[feat] solution/site,shared: 발행본을 /s/stay 목업에 맞춘다 — 잃어버린 CSS 토큰 복원 + 섹션 마크업 이식

목업(/s/stay)이 참조하는 스타일시트가 서버에서 사라져(404) 그 화면을 기준으로 삼을 수
없었다. 브라우저 캐시에 남아 있던 규칙을 꺼내 레포에 되돌리고, 섹션 마크업을 목업 HTML
에서 그대로 옮겼다. Playwright 대조로 섹션 래퍼·제목 16/17, 안쪽 구조 14/17 일치.

- index.css: --fs-display~--fs-xs(유동 타이포 7) · --section-space · --color-line/muted ·
  .h2 .h3 .panel .paper .measure .border-line .text-muted .divide-line .slider-viewport/track
  ★ 이 토큰이 없던 동안 컴포넌트가 var(--fs-display)를 써도 브라우저가 조용히 무시했다 —
    히어로 제목이 본문 크기로 나오던 원인
- HeroSection: 가운데 → 좌하단. 사진 위에 글자를 한가운데 얹으면 피사체를 정확히 가린다
- AnswerBlock·EssentialInfo·Units·Gallery·Location·Faq·LocalGuide·Weather·About:
  목업 마크업 그대로. embla 를 scroll-snap 으로 바꿔 스크립트 없이도 레일이 밀린다
- FestivalSection(계절 탭) · StorySection(이야기 탭 래퍼) · items/TripMap(OSM 타일 지도) 신설
  ★ 지도는 iframe 이 아니라 타일을 직접 깐다 — iframe 은 핀을 하나밖에 못 찍어
    "어떤 순서로 도는가" 를 그릴 수 없다
- items: itinerary·event·video kind 추가(파서에 없어 payload 까지 실려 오고도 화면에서
  사라지던 것) · Rail 을 slider-viewport/track 으로 · SongsSection 을 턴테이블로
- color.ts: 선 색을 secondary → mix(bg, text, .2). secondary 는 '본문 다음으로 진한
  글자색' 이라 선으로 쓰면 표와 카드가 격자무늬처럼 새까맣게 그어진다
- seo/head.ts: --tpl-texture. 없으면 색만 갱지고 면은 매끈해서 인쇄물로 안 보인다
- seo/verify.ts: unitCode·numberOfRooms 를 화면 대조에서 뺀다
  ★ unitCode 는 ㎡의 ISO 코드로 priceCurrency 와 같은 성격인데 예외에 없었다. 그래서
    room_size 가 있는 사업장은 발행 게이트가 전부 막았다(실측: 가은채 객실 12개).
    stay 는 객실 2개 + room_size 없음이라 우연히 통과했다
- shared: LocalPlace.imageUrl/distanceMeters · FestivalEntry.imageUrl ·
  ItineraryStop 좌표 · TemplateLook.texture · people/chronicle/postcard imageUrl
  ★ 좌표·사진은 모델이 만드는 칸이 아니다. 공식 API 로 조회해 채운다

검증: tsc 통과 · Playwright 대조(목업 CSS 주입) 섹션 래퍼·제목 16/17, 안쪽 14/17.
남은 차이는 데이터 한계다 — people 사진은 위키에 원본이 없고(original:false),
weather.note 는 정적 페이지에 날씨 문장을 박는 문제라 보류.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KP1ykMnWZFtLFpm2mow1Sw
This commit is contained in:
minaChoiandClaude Opus 5 committed 2026-09-08 09:53:19 +09:00
1 parent 6df125d840
commit 00e13bca7f
38 files changed
+2085 -774

No files matched your search

@@ -24,7 +24,7 @@ export function ChronicleSection() {
<ItemSection
id="chronicle"
name={parsed.title || sectionName(payload, 'chronicle', '시간의 골목')}
subtitle={parsed.subtitle}
subtitle={parsed.subtitle ?? '이 도시를 만든 해들'}
count={`붉은 점은 도시의 성격이 바뀐 해입니다 · ${turning}개 / 전체 ${items.length}개`}
>
<Rail label="연표">
@@ -51,11 +51,23 @@ export function ChronicleSection() {
}}
/>
</div>
<div className="space-y-1.5 pr-5">
<h3 className="serif text-base font-bold">{item.title}</h3>
{item.summary && <p className="text-[13px] leading-relaxed opacity-80">{item.summary}</p>}
{item.place && <p className="text-[11px] opacity-60">지금 이 자리 · {item.place}</p>}
<SourceLine source={item.source} verified={item.verified} />
<div className="flex gap-2.5 pr-5">
{item.imageUrl && (
<img
src={item.imageUrl}
alt={`${item.title} 사진`}
loading="lazy"
decoding="async"
className="size-14 shrink-0 border object-cover"
style={{borderColor: ITEM_BORDER}}
/>
)}
<div className="min-w-0 flex-1 space-y-1.5">
<h3 className="serif text-base font-bold">{item.title}</h3>
{item.summary && <p className="text-[13px] leading-relaxed opacity-80">{item.summary}</p>}
{item.place && <p className="text-[11px] opacity-60">지금 이 자리 · {item.place}</p>}
<SourceLine source={item.source} verified={item.verified} />
</div>
</div>
</article>
);
@@ -0,0 +1,54 @@
/**
* 소식 — 사장님이 쓰는 공지·안내.
*
* ★ 지역 리서치 아이템과 성격이 다르다. 여기 글의 주인은 사장님이고 출처도 사장님이다 —
* 그래서 source 를 요구하지 않는다(SourceLine 대신 verified 배지만).
*/
import type {EventItem} from '@o2o/shared';
import {useSite} from '@/lib/site-context';
import {sectionItems, sectionName} from '@/lib/derive';
import {ITEM_ACCENT, ITEM_BORDER, ITEM_CARD, ItemSection, tally} from './common';
export function EventSection() {
const payload = useSite();
const parsed = sectionItems<EventItem>(payload, 'event');
if (parsed.items.length === 0) return null;
return (
<ItemSection
id="event"
name={parsed.title || sectionName(payload, 'event', '소식')}
subtitle={parsed.subtitle ?? '미리 알아 두시면 좋은 것들'}
count={tally(parsed.items.length, parsed.unverified, '건')}
>
<ul className="grid gap-5 sm:grid-cols-2 lg:grid-cols-3">
{parsed.items.map((notice, index) => (
<li
key={`${notice.title}-${index}`}
className="w4-paper flex flex-col border-2 p-5"
style={{backgroundColor: ITEM_CARD, borderColor: ITEM_BORDER}}
>
{notice.kind && (
<span
className="mb-2 self-start border px-2 py-0.5 text-[length:var(--fs-xs)] font-bold"
style={{borderColor: ITEM_ACCENT, color: ITEM_ACCENT}}
>
{notice.kind}
</span>
)}
<h3 className="serif text-[length:var(--fs-lead)] font-bold leading-snug">{notice.title}</h3>
{notice.summary && (
<p className="measure mt-2 text-[length:var(--fs-sm)] opacity-80">{notice.summary}</p>
)}
{notice.body && (
// 줄바꿈이 항목 구분이다. 사장님이 쓴 그대로 둔다.
<p className="mt-3 whitespace-pre-line text-[length:var(--fs-sm)] leading-relaxed opacity-75">
{notice.body}
</p>
)}
</li>
))}
</ul>
</ItemSection>
);
}
@@ -0,0 +1,210 @@
/**
* 추천 일정 — 며칠 묵느냐로 갈린다.
*
* ★ 마크업은 목업(/s/stay 의 `<section id="itinerary">`)에서 그대로 옮겼다.
* 기간 탭 → 일정마다 날짜 카드를 가로로 밀고, 카드 안에 지도와 타임라인이 함께 있다.
* ★ 시각은 **계산한다.** 출발 시각과 머무는 분을 더해 나가므로, 출발을 당기면 하루가
* 통째로 밀린다. 모델이 시각을 적어 내면 합이 안 맞는 표가 나온다.
* ★ 전 일정을 HTML 에 편다. 탭은 화면에서만 접는다 — 접힌 쪽이 HTML 에 없으면
* 검색·AI 가 나머지 일정을 못 읽는다.
*/
import {useState} from 'react';
import type {ItineraryDay, ItineraryItem, ItineraryStop} from '@o2o/shared';
import {useSite} from '@/lib/site-context';
import {sectionItems, sectionName} from '@/lib/derive';
import {ITEM_ACCENT, ITEM_BORDER, ITEM_CARD, ItemSection, SourceLine, tally} from './common';
import {TripMap, type TripPoint} from './TripMap';
/** 'HH:MM' → 분. 형식이 아니면 null(시각을 지어내지 않는다). */
function toMinutes(time?: string): number | null {
const m = /^(\d{1,2}):(\d{2})$/.exec((time ?? '').trim());
if (!m) return null;
return Number(m[1]) * 60 + Number(m[2]);
}
/** '3시간 40분' — 첫 칸 시작부터 마지막 칸 끝까지. */
function spanLabel(rows: {from?: string; to?: string}[]): string | null {
const from = toMinutes(rows[0]?.from);
const to = toMinutes(rows[rows.length - 1]?.to);
if (from === null || to === null || to <= from) return null;
const total = to - from;
const h = Math.floor(total / 60);
const m = total % 60;
return [h ? `${h}시간` : '', m ? `${m}분` : ''].filter(Boolean).join(' ');
}
function toClock(minutes: number): string {
const h = Math.floor(minutes / 60) % 24;
return `${String(h).padStart(2, '0')}:${String(minutes % 60).padStart(2, '0')}`;
}
/** 정거장마다 시작·끝 시각을 계산한다. 출발 시각이 없으면 시각을 아예 안 그린다. */
function schedule(day: ItineraryDay): {stop: ItineraryStop; from?: string; to?: string}[] {
let cursor = toMinutes(day.startTime);
return (day.stops ?? []).map((stop) => {
if (cursor === null) return {stop};
const from = cursor;
const to = from + (stop.minutes ?? 0);
cursor = to;
return {stop, from: toClock(from), to: toClock(to)};
});
}
export function ItinerarySection() {
const payload = useSite();
const parsed = sectionItems<ItineraryItem>(payload, 'itinerary');
const durations = Array.from(
new Set(parsed.items.map((item) => item.duration?.trim()).filter(Boolean) as string[]),
);
const [active, setActive] = useState(durations[0] ?? '');
if (parsed.items.length === 0) return null;
return (
<ItemSection
id="itinerary"
name={parsed.title || sectionName(payload, 'itinerary', '추천 일정')}
subtitle={parsed.subtitle ?? '며칠 묵느냐에 따라 다르게 돕니다'}
count={`${tally(parsed.items.length, parsed.unverified, '개')} · 시각은 출발 시각과 머무는 시간으로 계산한 것입니다`}
>
{durations.length > 1 && (
<div className="mb-6 flex flex-wrap gap-1.5" role="tablist" aria-label="묵는 기간">
{durations.map((duration) => (
<button
key={duration}
type="button"
role="tab"
aria-selected={duration === active}
onClick={() => setActive(duration)}
className="border-line rounded-full border px-4 py-1.5 text-[length:var(--fs-sm)] font-bold transition-opacity hover:opacity-80"
style={
duration === active
? {backgroundColor: 'var(--color-brand)', color: 'var(--tpl-bg, #fff)', borderColor: 'transparent'}
: undefined
}
>
{duration}
<span className="ml-1.5 font-normal opacity-60">
{parsed.items.filter((i) => i.duration === duration).length}
</span>
</button>
))}
</div>
)}
<div className="space-y-10">
{parsed.items.map((plan, planIndex) => (
<div
key={`${plan.name}-${planIndex}`}
hidden={durations.length > 1 && plan.duration !== active}
className="space-y-3"
>
<div className="space-y-1">
<h3 className="serif text-lg font-bold">{plan.name}</h3>
{plan.audience && <p className="text-[13px] opacity-60">{plan.audience}</p>}
</div>
<div className="w4-scroll flex snap-x snap-mandatory gap-4 overflow-x-auto pb-3">
{(plan.days ?? []).map((day, dayIndex) => {
const rows = schedule(day);
const last = rows[rows.length - 1];
const points: TripPoint[] = (day.stops ?? [])
.filter((s): s is ItineraryStop & {latitude: number; longitude: number} =>
typeof s.latitude === 'number' && typeof s.longitude === 'number')
.map((s) => ({name: s.name, latitude: s.latitude, longitude: s.longitude, searchQuery: s.searchQuery}));
return (
<article
key={`${day.label}-${dayIndex}`}
className="w4-paper w-[320px] shrink-0 snap-center border"
style={{backgroundColor: ITEM_CARD, borderColor: ITEM_BORDER}}
>
<div
className="flex items-center justify-between gap-2 border-b px-4 py-2.5"
style={{borderColor: ITEM_BORDER}}
>
<span
className="border px-2 py-0.5 text-[11px] font-bold"
style={{
backgroundColor: 'var(--tpl-text, #09090b)',
color: 'var(--tpl-bg, #ffffff)',
borderColor: 'var(--tpl-text, #09090b)',
}}
>
{day.label}
</span>
{rows[0]?.from && last?.to && (
<span className="text-[11px] opacity-60">
{rows[0].from}–{last.to}
{spanLabel(rows) && ` · ${spanLabel(rows)}`}
</span>
)}
</div>
<div className="space-y-1.5 px-4 pt-3.5">
<h4 className="serif text-lg font-bold">{plan.name}</h4>
{plan.why && (
<p className="text-[13px] leading-relaxed opacity-80">{plan.why}</p>
)}
</div>
{/* 지도는 카드 폭을 꽉 채운다 — 여백을 두면 접힌 카드에서 지도가 잘려 보인다. */}
{points.length > 0 && <TripMap points={points} />}
<ol className="mt-3 px-4 pb-3">
{rows.map(({stop, from, to}, stopIndex) => (
<li
key={`${stop.name}-${stopIndex}`}
className="grid grid-cols-[46px_minmax(0,1fr)] gap-2.5"
>
<span className="serif pt-2 text-[12px] tabular-nums opacity-75">{from ?? ''}</span>
<div className="border-l pb-2 pl-3" style={{borderColor: ITEM_BORDER}}>
<div className="flex items-start gap-2.5 pt-1">
{stop.imageUrl && (
<img
src={stop.imageUrl}
alt={`${stop.name} 사진`}
loading="lazy"
decoding="async"
className="size-12 shrink-0 object-cover"
style={{border: `1px solid ${ITEM_BORDER}`}}
/>
)}
<span className="min-w-0">
<span className="block text-sm font-bold">
<span
className="mr-1.5 inline-grid size-[17px] translate-y-px place-items-center rounded-full text-[10px] tabular-nums"
style={{backgroundColor: ITEM_ACCENT, color: 'var(--tpl-bg, #ffffff)'}}
>
{stopIndex + 1}
</span>
{stop.name}
</span>
{stop.note && (
<span className="mt-0.5 block text-[12px] leading-relaxed opacity-75">
{stop.note}
</span>
)}
</span>
</div>
<p className="mt-0.5 text-[10px] opacity-50">
{from && to ? `${from}–${to}` : ''}
{stop.searchQuery && ` · 지도 검색 ${stop.searchQuery}`}
</p>
</div>
</li>
))}
</ol>
<div className="border-t border-dashed px-4 py-2.5" style={{borderColor: ITEM_BORDER}}>
<SourceLine source={plan.source} verified={plan.verified} />
</div>
</article>
);
})}
</div>
</div>
))}
</div>
</ItemSection>
);
}
@@ -16,27 +16,45 @@ export function PeopleSection() {
<ItemSection
id="people"
name={parsed.title || sectionName(payload, 'people', '인물 열전')}
subtitle={parsed.subtitle}
subtitle={parsed.subtitle ?? '이 도시가 배출한 이름들'}
count={`${tally(parsed.items.length, parsed.unverified, '명')} · 사진이 없는 인물은 이름 활자로 대신합니다`}
dark
>
<div className="border border-white/10" style={{backgroundColor: ITEM_INVERSE}}>
<div
className="tpl-border border"
style={{
backgroundColor: ITEM_INVERSE,
borderColor: 'color-mix(in oklab, currentColor 22%, transparent)',
}}
>
<div className="w4-film-perf h-2.5 opacity-70" />
<div className="px-3 py-4">
<Rail label="인물 목록">
{parsed.items.map((person, index) => (
<article key={`${person.name}-${index}`} className="w-[210px] shrink-0 snap-center">
<span
className="serif grid aspect-3/4 w-full place-items-center border text-5xl"
// 프레임 안쪽은 필름보다 한 단 밝게 — 색을 박지 않고 글자색을 섞어 만든다.
style={{
backgroundColor: 'color-mix(in oklab, currentColor 14%, transparent)',
borderColor: 'color-mix(in oklab, currentColor 28%, transparent)',
}}
aria-hidden
>
{person.name.trim().charAt(0)}
</span>
{person.imageUrl ? (
<img
src={person.imageUrl}
alt={`${person.name} 사진`}
loading="lazy"
decoding="async"
className="aspect-3/4 w-full border object-cover"
style={{borderColor: 'color-mix(in oklab, currentColor 28%, transparent)'}}
/>
) : (
<span
className="serif grid aspect-3/4 w-full place-items-center border text-5xl"
// 사진이 없으면 빈 상자 대신 활판 이니셜. 프레임 안쪽은 필름보다 한 단 밝게 —
// 색을 박지 않고 글자색을 섞어 만든다.
style={{
backgroundColor: 'color-mix(in oklab, currentColor 14%, transparent)',
borderColor: 'color-mix(in oklab, currentColor 28%, transparent)',
}}
aria-hidden
>
{person.name.trim().charAt(0)}
</span>
)}
<h3 className="serif mt-3 text-base font-bold">
{person.name}
{person.aka && <span className="ml-1.5 text-xs opacity-60">호 {person.aka}</span>}
@@ -17,7 +17,7 @@ export function PostcardSection() {
<ItemSection
id="postcard"
name={parsed.title || sectionName(payload, 'postcard', '오늘의 엽서')}
subtitle={parsed.subtitle}
subtitle={parsed.subtitle ?? '그대로 붙여 쓰는 한 문장'}
count={tally(parsed.items.length, parsed.unverified, '장')}
>
<Rail label="엽서 목록">
@@ -27,6 +27,16 @@ export function PostcardSection() {
className="w4-paper w-[304px] shrink-0 snap-center border p-4"
style={{backgroundColor: ITEM_CARD, borderColor: ITEM_INK}}
>
{card.imageUrl && (
<img
src={card.imageUrl}
alt={`${card.place ?? card.postmark ?? ''} 사진`}
loading="lazy"
decoding="async"
className="mb-3.5 block aspect-3/2 w-full border object-cover"
style={{borderColor: ITEM_BORDER}}
/>
)}
<div className="grid grid-cols-[minmax(0,1fr)_auto] gap-3">
{/* 가운데 괘선 — 엽서 뒷면을 반으로 가르는 그 선 */}
<div className="min-w-0 border-r pr-3" style={{borderColor: ITEM_BORDER}}>
+122 -49
View File
@@ -1,78 +1,151 @@
/**
* 가요 다방 — 발행본.
*
* 캔버스는 턴테이블에 한 장만 얹지만 발행본은 곡마다 판을 하나씩 놓는다.
* 인용될 문장(story·connection)이 전부 HTML 에 있어야 하기 때문이다.
* ★ 마크업은 목업(/s/stay 의 `<section id="songs">`)에서 그대로 옮겼다.
* 턴테이블 하나에 판을 갈아 끼우고, 아래 미니 판으로 곡을 고른다.
* ★ **전 곡을 HTML 에 굽고 화면에서만 접는다**(`hidden`). 접힌 곡이 HTML 에 없으면
* 이 섹션을 둔 이유(인용)가 사라진다.
* ★ 가사는 어디에도 없다 — 스키마에 lyrics 칸 자체가 없다(원문 전재 금지).
* 그 사실을 화면에도 적는다. 손님이 "왜 가사가 없나" 를 묻지 않게.
*/
import {useState} from 'react';
import {Youtube} from 'lucide-react';
import type {SongItem} from '@o2o/shared';
import {useSite} from '@/lib/site-context';
import {sectionItems, sectionName} from '@/lib/derive';
import {ITEM_ACCENT, ITEM_BORDER, ITEM_CARD, ITEM_INVERSE, ItemSection, Rail, SourceLine, tally} from './common';
import {ITEM_ACCENT, ITEM_INVERSE, ItemSection, SourceLine, tally} from './common';
/** 곡이 라벨 색을 안 주면 템플릿 강조색이 라벨이 된다. */
const FALLBACK_LABEL = ITEM_ACCENT;
/** 라벨 색을 안 주는 곡이 대부분이다. 순환시키면 미니 판이 서로 구별된다. */
const LABEL_COLORS = ['#d4551f', '#1d3c74', '#2a6053', '#7a3b6b', '#8a6d1f'];
export function SongsSection() {
const payload = useSite();
const parsed = sectionItems<SongItem>(payload, 'songs');
const [active, setActive] = useState(0);
if (parsed.items.length === 0) return null;
const labelOf = (song: SongItem, index: number) =>
song.labelColor || LABEL_COLORS[index % LABEL_COLORS.length];
return (
<ItemSection
id="songs"
name={parsed.title || sectionName(payload, 'songs', '가요 다방')}
subtitle={parsed.subtitle}
subtitle={parsed.subtitle ?? '이 도시를 노래한 곡들'}
count={tally(parsed.items.length, parsed.unverified, '곡')}
>
<Rail label="곡 목록">
{parsed.items.map((song, index) => (
<article
key={`${song.title}-${index}`}
className="w4-paper w-[280px] shrink-0 snap-center border p-5"
style={{backgroundColor: ITEM_CARD, borderColor: ITEM_BORDER}}
<div
className="tpl-border grid items-center gap-8 border p-6 sm:p-8 md:grid-cols-[240px_minmax(0,1fr)]"
style={{
backgroundColor: ITEM_INVERSE,
color: 'var(--tpl-bg, #ffffff)',
borderColor: 'color-mix(in oklab, currentColor 22%, transparent)',
}}
>
<div className="relative mx-auto size-[220px]">
<div
className="absolute inset-0 rounded-full"
style={{backgroundColor: 'color-mix(in oklab, currentColor 16%, transparent)'}}
/>
<div
className="w4-disc w4-spin absolute inset-2 rounded-full"
style={{
['--lbl' as string]: labelOf(parsed.items[active], active),
['--w4-vinyl' as string]: ITEM_INVERSE,
}}
>
<div
className="w4-disc mx-auto size-[132px] rounded-full"
style={{
['--lbl' as string]: song.labelColor || FALLBACK_LABEL,
['--w4-vinyl' as string]: ITEM_INVERSE,
}}
>
<span
className="block size-full rounded-full"
style={{boxShadow: 'inset 0 0 0 1px rgba(255,255,255,.06)'}}
/>
</div>
<span
className="absolute left-1/2 top-1/2 size-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full"
style={{backgroundColor: 'color-mix(in oklab, currentColor 30%, transparent)'}}
/>
</div>
{/* 톤암 — 판 위에 얹힌 바늘. 이게 없으면 그냥 검은 원이다. */}
<div aria-hidden="true" className="absolute -right-1 top-3 h-2 w-[110px] origin-right rotate-6">
<span
className="absolute inset-y-[3px] left-0 right-4 rounded-sm"
style={{backgroundColor: 'color-mix(in oklab, currentColor 65%, transparent)'}}
/>
<span
className="absolute -top-2 right-0 size-6 rounded-full"
style={{backgroundColor: 'color-mix(in oklab, currentColor 55%, transparent)'}}
/>
</div>
</div>
<h3 className="serif mt-4 text-lg font-bold">{song.title}</h3>
<p className="mt-1 text-xs opacity-65">
{[
song.artist,
song.year ? String(song.year) : undefined,
song.lyricist || song.composer
? `작사 ${song.lyricist ?? '미상'} / 작곡 ${song.composer ?? '미상'}`
: undefined,
song.label,
]
.filter(Boolean)
.join(' · ')}
</p>
{song.story && <p className="mt-3 text-sm leading-relaxed opacity-85">{song.story}</p>}
{song.connection && (
<p className="mt-2 text-sm leading-relaxed" style={{color: ITEM_ACCENT}}>
{song.connection}
<div className="min-w-0">
{parsed.items.map((song, index) => (
<div key={`${song.title}-${index}`} hidden={index !== active} className="space-y-3">
<p className="text-[10px] tracking-[0.24em]" style={{color: ITEM_ACCENT}}>
A면 · {index + 1} / {parsed.items.length}
</p>
)}
<p className="mt-3 border border-dashed px-2 py-1 text-[10px] opacity-60" style={{borderColor: ITEM_BORDER}}>
◎ 가사 대신 이야기 — 원문은 싣지 않습니다
</p>
<div className="mt-2">
<h3 className="serif text-[length:var(--fs-h2)] leading-tight">{song.title}</h3>
<p className="text-[length:var(--fs-xs)] opacity-60">
{[
song.artist,
song.year ? String(song.year) : undefined,
song.lyricist || song.composer
? `작사 ${song.lyricist ?? '미상'} / 작곡 ${song.composer ?? '미상'}`
: undefined,
song.label,
]
.filter(Boolean)
.join(' · ')}
</p>
{song.story && (
<p className="measure text-[length:var(--fs-sm)] leading-relaxed opacity-85">{song.story}</p>
)}
{song.connection && (
<p className="measure text-[length:var(--fs-sm)] leading-relaxed" style={{color: ITEM_ACCENT}}>
{song.connection}
</p>
)}
<a
href={`https://www.youtube.com/results?search_query=${encodeURIComponent(
`${song.title} ${song.artist ?? ''}`.trim(),
)}`}
target="_blank"
rel="noopener noreferrer nofollow"
className="inline-flex items-center gap-1.5 text-[length:var(--fs-sm)] font-bold underline-offset-4 hover:underline"
style={{color: ITEM_ACCENT}}
>
<Youtube className="size-4" aria-hidden="true" />
<span>유튜브에서 듣기</span>
</a>
<span
className="block w-fit border border-dashed px-2 py-1 text-[10px] tracking-[0.1em] opacity-60"
style={{borderColor: 'color-mix(in oklab, currentColor 35%, transparent)'}}
>
◎ 가사 대신 이야기 — 원문은 싣지 않습니다
</span>
<SourceLine source={song.source} verified={song.verified} />
</div>
</article>
))}
</Rail>
))}
</div>
</div>
{parsed.items.length > 1 && (
<div className="mt-4 flex flex-wrap justify-center gap-4">
{parsed.items.map((song, index) => (
<button
key={`${song.title}-pick-${index}`}
type="button"
aria-pressed={index === active}
onClick={() => setActive(index)}
className="w-24 text-center"
>
<span
className="w4-disc-mini mx-auto block size-[76px] rounded-full transition-transform hover:scale-105"
style={{
['--lbl' as string]: labelOf(song, index),
['--w4-vinyl' as string]: ITEM_INVERSE,
boxShadow: index === active ? `0 0 0 2px ${ITEM_ACCENT}` : undefined,
}}
/>
<span className="mt-2 block truncate text-[10px] leading-tight opacity-70">{song.title}</span>
</button>
))}
</div>
)}
</ItemSection>
);
}
@@ -0,0 +1,128 @@
/**
* 일정 지도 — OpenStreetMap 타일을 직접 깔고 그 위에 번호 핀을 찍는다.
*
* ★ 왜 iframe 이 아닌가
* iframe 임베드는 핀을 하나밖에 못 찍고, 순서(1→2→3)를 그릴 수 없다. 일정에서 중요한 건
* "어디"가 아니라 "어떤 순서로 도는가"라 경로가 보여야 한다.
* ★ 타일은 회색으로 눌러 깐다(`grayscale opacity .55`). 지도가 선명하면 핀과 경로가 묻힌다.
* ★ 핀을 누르면 네이버 길찾기로 간다 — 앞 정거장에서 이 정거장까지. 우리가 경로를
* 계산해 그리지 않는다(지어낸 시간을 그릴 수 없다).
*/
const TILE = 256;
/** 경위도 → Web Mercator 픽셀(줌 z 기준). */
function project(lat: number, lng: number, z: number) {
const n = 2 ** z;
const x = ((lng + 180) / 360) * n * TILE;
const s = Math.sin((lat * Math.PI) / 180);
const y = ((0.5 - Math.log((1 + s) / (1 - s)) / (4 * Math.PI)) * n) * TILE;
return {x, y};
}
export interface TripPoint {
name: string;
latitude: number;
longitude: number;
searchQuery?: string;
}
export function TripMap({points, width = 320, height = 168}: {
points: TripPoint[];
width?: number;
height?: number;
}) {
if (points.length === 0) return null;
const lats = points.map((p) => p.latitude);
const lngs = points.map((p) => p.longitude);
const center = {lat: (Math.min(...lats) + Math.max(...lats)) / 2, lng: (Math.min(...lngs) + Math.max(...lngs)) / 2};
// 모든 점이 상자 안에 들어오는 가장 큰 줌. 한 점뿐이면 동네가 보이는 15로 둔다.
let zoom = 15;
for (let z = 16; z >= 10; z -= 1) {
const xs = points.map((p) => project(p.latitude, p.longitude, z).x);
const ys = points.map((p) => project(p.latitude, p.longitude, z).y);
const w = Math.max(...xs) - Math.min(...xs);
const h = Math.max(...ys) - Math.min(...ys);
if (w <= width - 56 && h <= height - 56) {
zoom = z;
break;
}
}
const c = project(center.lat, center.lng, zoom);
const originX = c.x - width / 2;
const originY = c.y - height / 2;
// 화면을 덮는 타일만 깐다.
const tiles: {x: number; y: number; left: number; top: number}[] = [];
const tx0 = Math.floor(originX / TILE);
const ty0 = Math.floor(originY / TILE);
const tx1 = Math.floor((originX + width) / TILE);
const ty1 = Math.floor((originY + height) / TILE);
for (let tx = tx0; tx <= tx1; tx += 1) {
for (let ty = ty0; ty <= ty1; ty += 1) {
tiles.push({x: tx, y: ty, left: tx * TILE - originX, top: ty * TILE - originY});
}
}
const naverTo = (from: TripPoint | undefined, to: TripPoint) => {
const dest = `${to.longitude},${to.latitude},${encodeURIComponent(to.name)}`;
const start = from ? `${from.longitude},${from.latitude},${encodeURIComponent(from.name)}` : '-';
return `https://map.naver.com/p/directions/${start}/${dest}/-/transit`;
};
return (
<div
className="relative mt-3.5 overflow-hidden border-y"
style={{
height,
borderColor: 'var(--tpl-border, #d6d3d1)',
// ★ 타일이 로드되기 전에도 지도 자리가 비어 보이지 않게 — OSM 육지 색이다.
backgroundColor: '#e8e5df',
}}
aria-label="일정 지도"
>
{tiles.map((tile) => (
<img
key={`${tile.x}-${tile.y}`}
src={`https://tile.openstreetmap.org/${zoom}/${tile.x}/${tile.y}.png`}
alt=""
width={TILE}
height={TILE}
loading="lazy"
decoding="async"
className="pointer-events-none absolute max-w-none"
style={{left: tile.left, top: tile.top, filter: 'grayscale(1) contrast(0.95) opacity(0.55)'}}
/>
))}
{points.map((point, index) => {
const p = project(point.latitude, point.longitude, zoom);
return (
<a
key={`${point.name}-${index}`}
href={naverTo(points[index - 1], point)}
target="_blank"
rel="noopener noreferrer"
title={`${point.name} — 네이버 지도`}
className="absolute grid h-[22px] min-w-[22px] -translate-x-1/2 -translate-y-1/2 place-items-center whitespace-nowrap rounded-full px-1.5 text-[11px] font-bold shadow-sm transition-transform hover:scale-110"
style={{
left: p.x - originX,
top: p.y - originY,
backgroundColor: 'color-mix(in oklab, var(--tpl-accent, #2563eb) 70%, currentColor)',
color: 'var(--tpl-bg, #ffffff)',
border: '1.5px solid var(--tpl-bg, #ffffff)',
}}
>
{index + 1}
</a>
);
})}
<span className="absolute bottom-0.5 right-1 bg-white/70 px-1 text-[9px] leading-tight text-stone-600">
© OpenStreetMap
</span>
</div>
);
}
@@ -0,0 +1,50 @@
/**
* 영상.
*
* ★ 자동 재생하지 않고 iframe 도 심지 않는다 — 외부 스크립트를 끌어오면 첫 화면이 늦어지고
* 추적 쿠키가 따라 들어온다. 썸네일과 링크만 둔다.
*/
import {Play} from 'lucide-react';
import type {VideoItem} from '@o2o/shared';
import {useSite} from '@/lib/site-context';
import {sectionItems, sectionName} from '@/lib/derive';
import {ITEM_BORDER, ITEM_INVERSE, ITEM_INVERSE_INK, ItemSection, tally} from './common';
export function VideoSection() {
const payload = useSite();
const parsed = sectionItems<VideoItem>(payload, 'video');
if (parsed.items.length === 0) return null;
return (
<ItemSection
id="video"
name={parsed.title || sectionName(payload, 'video', '영상')}
subtitle={parsed.subtitle}
count={tally(parsed.items.length, parsed.unverified, '편')}
>
<ul className="grid gap-5 sm:grid-cols-2 lg:grid-cols-3">
{parsed.items.map((video, index) => (
<li key={`${video.url}-${index}`}>
<a
href={video.url}
target="_blank"
rel="noopener noreferrer"
className="group block border-2"
style={{borderColor: ITEM_BORDER}}
>
<div
className="flex aspect-video items-center justify-center"
style={{backgroundColor: ITEM_INVERSE, color: ITEM_INVERSE_INK}}
>
<Play className="size-10 opacity-70 transition-opacity group-hover:opacity-100" aria-hidden="true" />
</div>
{video.caption && (
<p className="px-3 py-2 text-[length:var(--fs-sm)] leading-snug">{video.caption}</p>
)}
</a>
</li>
))}
</ul>
</ItemSection>
);
}
+28 -16
View File
@@ -56,35 +56,47 @@ export function ItemSection({
<section
id={id}
aria-labelledby={`${id}-heading`}
className="w-full border-b"
className="border-line paper w-full border-b"
style={{
backgroundColor: dark ? ITEM_INVERSE : 'var(--tpl-surface, #fafafa)',
color: dark ? ITEM_INVERSE_INK : ITEM_INK,
borderColor: 'color-mix(in oklab, currentColor 12%, transparent)',
paddingBlock: 'var(--tpl-section-space, 4rem)',
paddingBlock: 'var(--section-space)',
}}
>
<div className="shell">
<h2 id={`${id}-heading`} className="serif text-2xl tracking-tight sm:text-3xl lg:text-4xl">
{name}
</h2>
{subtitle && <p className="mt-2 text-sm opacity-70">{subtitle}</p>}
<div className="mt-8">{children}</div>
{count && <p className="mt-4 text-xs opacity-55">{count}</p>}
{/* ★ 머리말은 목업(/s/stay 의 아이템 섹션)과 같은 모양이다 — 다른 섹션과 달리
세로 막대를 달지 않는다. 이야기 섹션은 그 자체가 한 덩어리라 구분선이 필요 없다. */}
<header className="mb-8 sm:mb-10">
<div className="flex flex-wrap items-baseline justify-between gap-x-4 gap-y-2">
<h2 id={`${id}-heading`} className="h2">
{name}
</h2>
</div>
{subtitle && (
<p className="measure mt-3 text-[length:var(--fs-sm)] opacity-70">{subtitle}</p>
)}
</header>
{children}
{count && <p className="mt-5 text-[length:var(--fs-xs)] opacity-55">{count}</p>}
</div>
</section>
);
}
/** 가로로 미는 레일. 화살표 버튼은 두지 않는다 — 스크립트 없이도 손가락·트랙패드로 민다. */
/**
* 가로로 미는 레일. 화살표 버튼은 두지 않는다 — 스크립트 없이도 손가락·트랙패드로 민다.
*
* ★ 클래스 이름(`slider-viewport`/`slider-track`)은 목업과 같게 둔다. 스크롤 스냅만으로
* 같은 동작이 나오므로 캐러셀 라이브러리는 쓰지 않는다.
*/
export function Rail({children, label}: {children: ReactNode; label: string}) {
return (
<div
role="group"
aria-label={label}
className="w4-scroll flex snap-x snap-mandatory gap-4 overflow-x-auto pb-3"
>
{children}
<div className="relative">
<div className="slider-viewport" role="group" aria-roledescription="캐러셀" aria-label={label} tabIndex={0}>
<div className="slider-track" style={{gap: '1rem'}}>
{children}
</div>
</div>
</div>
);
}
@@ -5,6 +5,9 @@
* 한쪽에만 있으면 사장님이 켜 둔 섹션이 발행본에서 말없이 사라진다(HomePage 주석과 같은 함정).
*/
import {SongsSection} from './SongsSection';
import {ItinerarySection} from './ItinerarySection';
import {EventSection} from './EventSection';
import {VideoSection} from './VideoSection';
import {DailySection} from './DailySection';
import {CourseSection} from './CourseSection';
import {ScheduleSection} from './ScheduleSection';
@@ -26,4 +29,7 @@ export const ITEM_SECTIONS: Record<string, () => React.ReactElement | null> = {
postcard: PostcardSection,
quiz: QuizSection,
planner: PlannerSection,
itinerary: ItinerarySection,
event: EventSection,
video: VideoSection,
};
@@ -107,3 +107,27 @@
transition: none;
}
}
/*
* 날씨 카드의 하늘.
*
* ★ 색을 박지 않는다 — 템플릿이 갱지든 흰 바탕이든 그 위에 얹히는 결이라
* 글자색을 섞어 만든다. data-mood 로 결의 방향과 세기만 바꾼다.
*/
.w4-sky {
position: absolute;
inset: 0;
pointer-events: none;
background-image:
radial-gradient(120% 80% at 80% 0%, color-mix(in oklab, currentColor 7%, transparent) 0%, transparent 60%),
linear-gradient(180deg, color-mix(in oklab, currentColor 4%, transparent) 0%, transparent 55%);
}
.w4-sky[data-mood*="비"],
.w4-sky[data-mood*="눈"] {
background-image:
repeating-linear-gradient(105deg, color-mix(in oklab, currentColor 8%, transparent) 0 1px, transparent 1px 9px),
linear-gradient(180deg, color-mix(in oklab, currentColor 6%, transparent) 0%, transparent 60%);
}
.w4-sky[data-mood*="맑"] {
background-image: radial-gradient(60% 60% at 82% 12%, color-mix(in oklab, currentColor 12%, transparent) 0%, transparent 70%);
}