From 446af2e9b5791f827ca8a8f00f9eb429961ca5d0 Mon Sep 17 00:00:00 2001 From: Mina Choi Date: Fri, 23 Oct 2026 09:22:23 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=8B=A8=ED=92=8D=20=EC=A7=80=EB=8F=84?= =?UTF-8?q?=20=EC=A0=90=EC=9D=B4=20=EB=B9=BD=EB=B9=BD=ED=95=B4=20=EB=B3=B4?= =?UTF-8?q?=EC=9D=B4=EB=8D=98=20=EB=AC=B8=EC=A0=9C=20=E2=80=94=20=EC=A0=88?= =?UTF-8?q?=EC=A0=95=EB=A7=8C=20=ED=85=8C=EB=91=90=EB=A6=AC=20=EC=A0=90?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EB=9D=84=EC=9A=B0=EA=B3=A0=20=EB=82=98?= =?UTF-8?q?=EB=A8=B8=EC=A7=80=EB=8A=94=20=EC=9E=91=EC=9D=80=20=EC=A0=90?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C,=20=EC=A7=80=EB=8F=84=EB=A5=BC=20=EB=88=84?= =?UTF-8?q?=EB=A5=B4=EB=A9=B4=20=EA=B0=80=EC=9E=A5=20=EA=B0=80=EA=B9=8C?= =?UTF-8?q?=EC=9A=B4=20=EB=AA=85=EC=86=8C=EA=B0=80=20=EC=97=B4=EB=A6=AC?= =?UTF-8?q?=EA=B2=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/b/foliageMap.tsx | 57 +++++++++++++++++++++++++---------- 1 file changed, 41 insertions(+), 16 deletions(-) diff --git a/frontend/src/b/foliageMap.tsx b/frontend/src/b/foliageMap.tsx index 87bf8bf..050c902 100644 --- a/frontend/src/b/foliageMap.tsx +++ b/frontend/src/b/foliageMap.tsx @@ -14,23 +14,25 @@ const MAP = { lon0: 124.5, lat1: 38.75, k: 0.809017, s: 153.5327, ox: 40, oy: 62 const FIRST_DAYS = 14 const PEAK_DAYS = 3 const PEAK_AFTER = 7 -// 점 반지름(테두리 포함, px)과 점 사이 최소 틈 -const DOT_R: Record = { before: 5.5, first: 6.5, peak: 8, gone: 5.5 } +// 점 반지름(테두리 포함, px)과 점 사이 최소 틈, 지도를 눌렀을 때 가장 가까운 명소를 고르는 거리 +const DOT_R: Record = { before: 2.5, first: 3, peak: 7.5, gone: 2.5 } const GAP = 1.5 +const TAP_R = 22 const STAGE: Record = { before: '단풍 전', first: '첫 단풍', peak: '절정', gone: '' } const KIND: Record = { maple: '단풍', ginkgo: '은행' } +// 절정만 테두리·그림자로 띄우고, 나머지는 테두리 없는 작은 점으로 지도 결에 묻는다 const DOT: Record = { - before: 'size-2 bg-[#b9bcc6]', - first: 'size-2.5 bg-[#f39a3d]', - peak: 'size-[13px] bg-[#e0442e]', - gone: 'size-2 bg-[#b9bcc6]', + before: 'size-[5px] bg-[#8f8a80]/55', + first: 'size-[6px] bg-[#d9772e]/80', + peak: 'size-[13px] border-2 border-white bg-[#e0442e] shadow-[0_1px_3px_rgb(40_48_74/0.35)]', + gone: 'size-[5px] bg-[#8f8a80]/55', } const LEGEND = [ - { label: '단풍 전', color: 'bg-[#b9bcc6]' }, - { label: '첫 단풍', color: 'bg-[#f39a3d]' }, - { label: '절정 단풍', color: 'bg-[#e0442e]' }, - { label: '절정 은행', color: 'bg-[#f2c230]' }, + { label: '단풍 전', dot: DOT.before }, + { label: '첫 단풍', dot: DOT.first }, + { label: '절정 단풍', dot: DOT.peak }, + { label: '절정 은행', dot: cx(DOT.peak, 'bg-[#f2c230]') }, ] const xy = (m: Spot) => [(MAP.ox + (m.lon - MAP.lon0) * MAP.k * MAP.s) / MAP.size, (MAP.oy + (MAP.lat1 - m.lat) * MAP.s) / MAP.size] @@ -145,13 +147,28 @@ export function FoliageCard() { if (days(peaks[0], today) < -FIRST_DAYS || days(peaks[peaks.length - 1], today) > PEAK_AFTER) return null const peakNow = spots.filter((m) => m.stage === 'peak').map((m) => m.name) const sel = spots.find((m) => m.name === picked) + // 작은 점도 손가락으로 고를 수 있게 누른 자리에서 가장 가까운 명소를 연다 + const tapNearest = (e: React.MouseEvent) => { + const r = e.currentTarget.getBoundingClientRect() + const x = e.clientX - r.left + const y = e.clientY - r.top + let best: string | null = null + let bestD = TAP_R + for (const m of spots) { + const [nx, ny] = xy(m) + const p = at[m.name] ?? { x: nx * r.width, y: ny * r.width } + const d = Math.hypot(p.x - x, p.y - y) + if (d < bestD) [best, bestD] = [m.name, d] + } + setPicked(best === picked ? null : best) + } const order = [...spots].sort((a, b) => Number(a.stage === 'peak') - Number(b.stage === 'peak')) return ( 5 ? ' 외' : ''}` : undefined}>

단풍 지도 · {md(today)}

{headline(spots)}

-
+
단풍 지도 {order.map((m) => { const [x, y] = xy(m) @@ -160,13 +177,16 @@ export function FoliageCard() {