[feat] solution/shared,frontend,site,backend: 붙여넣기 아이템 여섯 추가 · 발행본까지 내보내고 템플릿 토큰을 따르게 한다

아이템 넷(가요·일력·승차권·스케줄)만 있었고, 그마저 **발행본에는 하나도 안 나갔다.**
`SectionSetting` 계약에 data 가 없어 사장님이 채운 JSON 이 payload 경계에서 통째로 버려졌다 —
소개문 body 와 같은 사연이다. 빌더에서는 보이는데 발행하면 없는 섹션이었다.
그리고 아이템 전부가 갱지색·주(朱)잉크·간판체를 hex 로 박고 있어, 템플릿을 매거진으로 바꿔도
아이템 섹션만 레트로로 남았다. 발행본은 색만 템플릿을 따랐다(계약에 생김새가 없었다).

- shared/section-data: 읽는 쪽 계약을 계약 패키지로 — 항목 타입 · parseSectionData.
  같은 JSON 을 빌더와 발행본이 읽는다. 파서가 두 벌이면 슬러그 규칙처럼 조용히 어긋난다
- frontend/dataSpec: 아이템 6종 추가 — 인물 열전 · 시간의 골목 · 문학 서가 · 오늘의 엽서 ·
  뒤집어 보는 질문 · 계절별 추천 하루. [+ 섹션 추가] 목록은 dataSpec 에서 파생돼 손댈 곳이 없다
- shared/planDay: 계절별 추천 하루는 시각을 **계산한다**. schedule 과 축이 다르다 —
  저쪽은 사장님이 시각을 적고 여기는 출발 시각·소요 분에서 시각을 만든다.
  조립 규칙을 shared 에 둔 이유는 파서와 같다(빌더와 발행본이 같은 시각을 내야 한다).
  21시를 넘기는 칸은 넣지 않고 뺐다고 화면에 밝힌다 — 숨기면 왜 없는지 사장님이 모른다
- shared/site-payload: SectionSetting.data · SiteTheme.look 추가. backend/site_payload 는
  해석 없이 싣는다 — 모양을 검사하면 프론트가 필드를 늘린 날 조용히 떨어뜨린다
- site/sections/items: 발행본 아이템 10종. **인터랙션은 옮기지 않았다** — 캔버스의 턴테이블은
  '지금 한 곡'만 펴는데 그러면 나머지 곡의 문장이 HTML 에 없다. 인용이 이 사이트의 존재 이유다
- site/prerender: 아이템 항목을 고유 콘텐츠로 계수. 안 세면 "곡을 여덟 개 채웠는데 0건으로
  발행이 막힌다"가 된다(intro.body 와 같은 구멍). 백엔드 fake 도 같은 규칙으로 맞췄다
- 아이템 색·서체를 전부 --tpl-* 토큰으로. retro/common → items/common, RETRO_* → ITEM_*.
  글자 단계는 stone-400/500/600 대신 불투명도로 만든다 — 팔레트가 바뀌어도 위계가 남는다
- site/seo/head: look 을 --tpl-* 로 심고, 웹폰트는 템플릿이 쓰는 것만 내려보낸다.
  전부 항상 실으면 쓰지도 않는 서체가 모든 발행 사이트의 첫 렌더를 늦춘다
- shared/color: deriveSurfaces 를 계약 패키지로. 캔버스·쇼케이스·발행본이 같은 식을 써야
  미리보기가 거짓말을 하지 않는다. 프론트 lib/color 는 재수출만 남겼다

밟은 함정: 강조색을 그대로 쓰면 팔레트에 따라 큰 날짜 숫자와 순위 배지가 사라진다(연한 accent +
밝은 바탕). color-mix(accent 70%, currentColor) 로 색조는 남기고 대비만 확보했다.
'확인/확인필요' 배지는 디자인이 아니라 신호라 신호색을 지키되 둘레 글자색만 섞는다.

tsc·eslint·vite build 통과(frontend·admin·site), site 테스트 17 passed.
실물 프리렌더(레트로 look + 아이템): 열 섹션과 본문 문장 전부 포함, --tpl-font-heading 'Gugi' ·
border-width 2px, family=Gugi&Gowun+Batang 링크, 계절 묶음·순위·계산된 시각(09:30 출발 →
09:45 도착 → 11:15 → 11:25) 확인. 고유 콘텐츠 12건 ok=true.
옛 payload(look 없음)로 다시 구워 예전과 동일하게 나오는 것까지 확인.
백엔드는 이 환경에 PostgreSQL 이 없어 pytest 를 못 돌렸다 — _theme·_sections 는 함수 단위로 확인.
This commit is contained in:
minaChoi committed 2026-09-02 21:30:25 +09:00
1 parent 5ef3e5a7de
commit 71c0c1f6ab
47 files changed
+3579 -572

No files matched your search

+2
View File
@@ -16,3 +16,5 @@ export {LocationSection} from './LocationSection';
export {FaqSection} from './FaqSection';
export {SiteFooter} from './SiteFooter';
export {MobileTabBar} from './MobileTabBar';
// 붙여넣기 아이템 — 데이터가 fact 가 아니라 사장님이 넣은 JSON 에서 온다(theme.sections[].data).
export {ITEM_SECTIONS} from './items';
@@ -0,0 +1,66 @@
/**
* 시간의 골목 — 발행본. 연도가 큰 활자로 서고 사건이 붙는다.
* ★ 붉은 점은 도시의 성격이 바뀐 해다. 점의 색이 장식이 아니라 정보라 범례를 함께 낸다.
*/
import type {ChronicleItem} from '@o2o/shared';
import {useSite} from '@/lib/site-context';
import {sectionItems, sectionName} from '@/lib/derive';
import {ITEM_ACCENT, ITEM_BORDER, ITEM_CARD, ItemSection, Rail, SourceLine} from './common';
export function ChronicleSection() {
const payload = useSite();
const parsed = sectionItems<ChronicleItem>(payload, 'chronicle');
if (parsed.items.length === 0) return null;
// 연도가 있는 것부터 오름차순, 없는 것은 뒤로. 붙여넣은 순서를 믿지 않는다.
const items = [...parsed.items].sort((a, b) => {
if (a.year == null) return b.year == null ? 0 : 1;
if (b.year == null) return -1;
return a.year - b.year;
});
const turning = items.filter((item) => item.turning === true).length;
return (
<ItemSection
id="chronicle"
name={parsed.title || sectionName(payload, 'chronicle', '시간의 골목')}
subtitle={parsed.subtitle}
count={`붉은 점은 도시의 성격이 바뀐 해입니다 · ${turning}개 / 전체 ${items.length}개`}
>
<Rail label="연표">
{items.map((item, index) => {
const isTurning = item.turning === true;
return (
<article key={`${item.year ?? 'x'}-${item.title}-${index}`} className="w-[228px] shrink-0 snap-center">
<p className="serif text-3xl font-bold leading-none" style={{color: isTurning ? ITEM_ACCENT : undefined}}>
{item.year ?? '연도 미상'}
</p>
<div className="relative my-3 h-3">
<i
aria-hidden
className="absolute top-1/2 left-0 border-t"
// 마지막 해에서 선이 끊긴다 — 이어 두면 뒤가 더 있는 줄 안다.
style={{borderColor: ITEM_BORDER, right: index === items.length - 1 ? 'calc(100% - 12px)' : 0}}
/>
<i
aria-hidden
className="absolute top-1/2 left-0 size-3 -translate-y-1/2 rounded-full border-2"
style={{
backgroundColor: isTurning ? ITEM_ACCENT : ITEM_CARD,
borderColor: isTurning ? ITEM_ACCENT : ITEM_BORDER,
}}
/>
</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>
</article>
);
})}
</Rail>
</ItemSection>
);
}
@@ -0,0 +1,88 @@
/**
* 반나절 산책 — 발행본. 표 한 장이 정거장 하나다.
* ★ 링크를 만들지 않는다. 지도 검색어만 적는다 — 지어낸 주소를 링크하지 않는 이 레포의 규약.
*/
import type {CourseItem} from '@o2o/shared';
import {useSite} from '@/lib/site-context';
import {sectionItems, sectionName} from '@/lib/derive';
import {ITEM_ACCENT, ITEM_BORDER, ITEM_CARD, ITEM_INK, ItemSection, Rail, SourceLine} from './common';
export function CourseSection() {
const payload = useSite();
const parsed = sectionItems<CourseItem>(payload, 'course');
if (parsed.items.length === 0) return null;
return (
<ItemSection
id="course"
name={parsed.title || sectionName(payload, 'course', '반나절 산책')}
subtitle={parsed.subtitle}
>
<div className="space-y-10">
{parsed.items.map((course, courseIndex) => {
const stops = course.stops ?? [];
return (
<div key={`${course.name}-${courseIndex}`} className="space-y-3">
<div className="flex flex-wrap items-baseline gap-2.5">
<h3 className="serif text-lg font-bold">{course.name}</h3>
<span className="text-[11px] opacity-60">
{[course.duration, course.startsFrom ? `${course.startsFrom} 출발` : undefined, `${stops.length}곳`]
.filter(Boolean)
.join(' · ')}
</span>
</div>
<Rail label={`${course.name} 정거장`}>
{stops.map((stop, index) => {
const no = String(stop.order ?? index + 1).padStart(2, '0');
return (
<article
key={`${stop.name}-${index}`}
className="relative w-[236px] shrink-0 snap-center border"
style={{backgroundColor: ITEM_CARD, borderColor: ITEM_INK}}
>
<div
className="flex justify-between border-b border-dashed px-4 py-2.5 text-[10px] tracking-[0.12em] opacity-70"
style={{borderColor: ITEM_INK}}
>
<span className="truncate">{course.name}</span>
<span className="shrink-0">NO.{no}</span>
</div>
<p className="serif px-4 pt-4 text-3xl font-bold leading-none" style={{color: ITEM_ACCENT}}>
{no}
</p>
<h4 className="serif px-4 pt-1.5 text-base font-bold">{stop.name}</h4>
{stop.note && <p className="px-4 pt-2 text-[13px] leading-relaxed opacity-80">{stop.note}</p>}
<div
className="mt-3 flex justify-between gap-2 border-t border-dashed px-4 py-2.5 text-[10px] opacity-60"
style={{borderColor: ITEM_BORDER}}
>
<span>{stop.minutes ? `도보 ${stop.minutes}분` : '이동 시간 미정'}</span>
{stop.searchQuery && <span className="truncate">지도 검색 · {stop.searchQuery}</span>}
</div>
{/* 펀치 구멍 — 표를 표로 만드는 자리 */}
<i className="absolute -left-[7px] top-1/2 size-3 rounded-full border" style={{backgroundColor: ITEM_CARD, borderColor: ITEM_INK}} />
<i className="absolute -right-[7px] top-1/2 size-3 rounded-full border" style={{backgroundColor: ITEM_CARD, borderColor: ITEM_INK}} />
{index === stops.length - 1 && (
<span
className="serif absolute bottom-3 right-3 grid size-14 -rotate-12 place-items-center rounded-full border-2 text-center text-[11px] leading-tight opacity-75"
style={{borderColor: ITEM_ACCENT, color: ITEM_ACCENT}}
>
완주
<br />
도장
</span>
)}
</article>
);
})}
</Rail>
<SourceLine source={course.source} verified={course.verified} />
</div>
);
})}
</div>
</ItemSection>
);
}
@@ -0,0 +1,76 @@
/**
* 오늘의 한 장 — 발행본.
*
* ★ '오늘'을 서버에서 고르지 않는다. 프리렌더는 굽는 날짜로만 알고, 그 HTML 은 며칠씩 산다 —
* 구울 때의 '오늘'을 박으면 내일 틀린 날짜가 오늘로 걸린다.
* 그래서 전부 펴서 굽고, 브라우저에서 오늘 자리에만 표시를 얹는다(useEffect: SSR 과 안 어긋난다).
*/
import {useEffect, useState} from 'react';
import type {DailyItem} from '@o2o/shared';
import {useSite} from '@/lib/site-context';
import {sectionItems, sectionName} from '@/lib/derive';
import {ITEM_ACCENT, ITEM_BORDER, ITEM_CARD, ItemSection, Rail, SourceLine, tally} from './common';
export function DailySection() {
const payload = useSite();
const parsed = sectionItems<DailyItem>(payload, 'daily');
const [today, setToday] = useState<string>();
useEffect(() => {
const now = new Date();
setToday(`${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')}`);
}, []);
if (parsed.items.length === 0) return null;
const pages = [...parsed.items].sort((a, b) => a.monthDay.localeCompare(b.monthDay));
return (
<ItemSection
id="daily"
name={parsed.title || sectionName(payload, 'daily', '오늘의 한 장')}
subtitle={parsed.subtitle}
count={tally(pages.length, parsed.unverified, '장')}
>
<Rail label="날짜별 이야기">
{pages.map((page, index) => {
const [month, day] = page.monthDay.split('-');
const isToday = today === page.monthDay;
return (
<article
key={`${page.monthDay}-${index}`}
className="w4-paper relative w-[254px] shrink-0 snap-center border"
style={{
backgroundColor: ITEM_CARD,
borderColor: isToday ? ITEM_ACCENT : ITEM_BORDER,
boxShadow: isToday ? '5px 6px 0 rgba(191,47,27,.18)' : '5px 6px 0 rgba(27,26,21,.13)',
}}
>
<div
className="w4-perf h-3.5 border-b border-dashed"
style={{['--tear' as string]: ITEM_CARD, borderColor: ITEM_BORDER}}
/>
<div className="border-b px-5 pb-3 pt-5 text-center" style={{borderColor: ITEM_BORDER}}>
<p className="text-[11px] tracking-[0.2em] opacity-60">{month}月</p>
<p className="serif mt-1 text-6xl font-bold leading-none" style={{color: ITEM_ACCENT}}>
{String(Number(day) || day)}
</p>
{isToday && <p className="mt-1.5 text-[10px] tracking-[0.3em]" style={{color: ITEM_ACCENT}}>오늘</p>}
</div>
<div className="space-y-2 px-5 pb-5 pt-4">
{page.category && <p className="text-[10px] tracking-[0.16em] opacity-60">{page.category}</p>}
<h3 className="serif text-base font-bold leading-snug">{page.title}</h3>
{page.body && <p className="text-[13px] leading-relaxed opacity-80">{page.body}</p>}
{page.tags && page.tags.length > 0 && (
<p className="text-[10px] opacity-55">{page.tags.join(' ')}</p>
)}
<div className="border-t border-dashed pt-2.5" style={{borderColor: ITEM_BORDER}}>
<SourceLine source={page.source} verified={page.verified} />
</div>
</div>
</article>
);
})}
</Rail>
</ItemSection>
);
}
@@ -0,0 +1,70 @@
/**
* 문학 서가 — 발행본.
*
* 캔버스는 책등을 눌러 한 권만 펴지만, 발행본은 책등과 펼친 면을 함께 낸다 —
* 줄거리·배경 문장이 전부 HTML 에 있어야 인용된다.
* ★ 작품 원문은 한 줄도 없다. 배경과 "왜 여기냐"만 싣는다(원문 전재 금지).
*/
import type {LiteratureItem} from '@o2o/shared';
import {useSite} from '@/lib/site-context';
import {sectionItems, sectionName} from '@/lib/derive';
import {ITEM_ACCENT, ITEM_BORDER, ITEM_CARD, ITEM_INVERSE_INK, ItemSection, Rail, SourceLine, tally} from './common';
/** 책등 색을 안 줬을 때. 템플릿 강조색으로 떨어뜨린다. */
const FALLBACK_SPINE = ITEM_ACCENT;
export function LiteratureSection() {
const payload = useSite();
const parsed = sectionItems<LiteratureItem>(payload, 'literature');
if (parsed.items.length === 0) return null;
return (
<ItemSection
id="literature"
name={parsed.title || sectionName(payload, 'literature', '문학 서가')}
subtitle={parsed.subtitle}
count={tally(parsed.items.length, parsed.unverified, '권')}
>
<Rail label="작품 목록">
{parsed.items.map((book, index) => (
<article
key={`${book.workTitle}-${index}`}
className="w4-paper flex w-[320px] shrink-0 snap-center border"
style={{backgroundColor: ITEM_CARD, borderColor: ITEM_BORDER}}
>
{/* 책등 — 세로쓰기가 이 아이템의 인상이다 */}
<p
className="serif shrink-0 px-2 py-4 text-sm font-bold"
style={{
backgroundColor: book.spineColor || FALLBACK_SPINE,
// 책등 색은 사장님이 정하므로 그 위 글자는 밝은 면 색으로 고정한다.
color: ITEM_INVERSE_INK,
writingMode: 'vertical-rl',
}}
>
{book.workTitle}
{book.author ? ` · ${book.author}` : ''}
</p>
<div className="min-w-0 space-y-2.5 p-4">
<h3 className="serif text-lg font-bold">{book.workTitle}</h3>
<p className="text-xs opacity-60">
{[book.author, book.year, book.genre].filter(Boolean).join(' · ')}
</p>
{book.background && <p className="text-sm leading-relaxed opacity-85">{book.background}</p>}
{book.whyHere && (
<p className="border-l-2 pl-3 text-sm leading-relaxed opacity-75" style={{borderColor: ITEM_BORDER}}>
{book.whyHere}
</p>
)}
<p className="border border-dashed px-2 py-1 text-[10px] opacity-60" style={{borderColor: ITEM_BORDER}}>
◎ 원문 대신 배경 — 작품 문장은 싣지 않습니다
</p>
<SourceLine source={book.source} verified={book.verified} />
</div>
</article>
))}
</Rail>
</ItemSection>
);
}
@@ -0,0 +1,59 @@
/**
* 인물 열전 — 발행본. 필름 한 롤에 프레임이 이어진다.
* ★ 사진 자리는 활판 이니셜이다. 이미지 URL 을 받지 않기 때문에(imageQuery 만) 빈 상자 대신 활자를 둔다.
*/
import type {PeopleItem} from '@o2o/shared';
import {useSite} from '@/lib/site-context';
import {sectionItems, sectionName} from '@/lib/derive';
import {ITEM_INVERSE, ItemSection, Rail, SourceLine, tally} from './common';
export function PeopleSection() {
const payload = useSite();
const parsed = sectionItems<PeopleItem>(payload, 'people');
if (parsed.items.length === 0) return null;
return (
<ItemSection
id="people"
name={parsed.title || sectionName(payload, 'people', '인물 열전')}
subtitle={parsed.subtitle}
count={`${tally(parsed.items.length, parsed.unverified, '명')} · 사진이 없는 인물은 이름 활자로 대신합니다`}
dark
>
<div className="border border-white/10" style={{backgroundColor: ITEM_INVERSE}}>
<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>
<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>}
</h3>
<p className="mt-0.5 text-[11px] opacity-60">
{[person.role, person.years].filter(Boolean).join(' · ')}
</p>
{person.oneLine && <p className="mt-2 text-[13px] leading-relaxed opacity-85">{person.oneLine}</p>}
<div className="mt-2">
<SourceLine source={person.source} verified={person.verified} />
</div>
</article>
))}
</Rail>
</div>
<div className="w4-film-perf h-2.5 opacity-70" />
</div>
</ItemSection>
);
}
@@ -0,0 +1,119 @@
/**
* 계절별 추천 하루 — 발행본.
*
* ★ 캔버스는 계절 탭으로 하나씩 보여주지만, 발행본은 **계절 전부를 편다.**
* 탭 뒤에 숨은 계절은 HTML 에 없는 것과 같고, 이 사이트의 존재 이유가 인용이다.
* ★ 시각은 화면이 계산한다(shared planDay) — 사장님은 머무는 시간만 적는다.
* 조립 규칙이 빌더와 한 벌이라 사장님이 본 일정과 손님이 보는 일정이 같다.
*/
import {planDay, plannerSeasons, plannerTop, type PlannerItem} from '@o2o/shared';
import {useSite} from '@/lib/site-context';
import {sectionItems, sectionName} from '@/lib/derive';
import {ITEM_BORDER, ITEM_CARD, ITEM_INK, ITEM_INVERSE_INK, ItemSection, Rail, SourceLine} from './common';
const RANK_LABEL = ['1위', '2위', '3위'];
/** 총 소요를 "7시간 10분"으로. 분만 쓰면 430분이 얼마인지 아무도 모른다. */
function spanText(minutes: number): string {
const hour = Math.floor(minutes / 60);
const rest = minutes % 60;
return [hour > 0 ? `${hour}시간` : '', rest > 0 ? `${rest}분` : ''].filter(Boolean).join(' ') || '0분';
}
function PlanCard({item, rank}: {item: PlannerItem; rank: number}) {
const day = planDay(item);
return (
<article
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}}
>
{/* ★ 1위만 채운다. 셋 다 채우면 순위가 안 읽히고, 채움색을 강조색으로 두면
팔레트에 따라 글자가 안 보인다(연한 accent 위의 밝은 글자) — 글자색으로 채운다. */}
<span
className="border px-2 py-0.5 text-[11px] font-bold"
style={
rank === 0
? {backgroundColor: ITEM_INK, color: ITEM_INVERSE_INK, borderColor: ITEM_INK}
: {borderColor: ITEM_BORDER}
}
>
{RANK_LABEL[rank] ?? `${rank + 1}위`}
</span>
<span className="text-[11px] opacity-60">
{day.from}–{day.to} · {spanText(day.totalMinutes)}
</span>
</div>
<div className="space-y-1.5 px-4 pt-3.5">
<h4 className="serif text-lg font-bold">{item.name}</h4>
{item.audience && <p className="text-[11px] opacity-60">{item.audience}</p>}
{item.why && <p className="text-[13px] leading-relaxed opacity-80">{item.why}</p>}
</div>
<ol className="mt-3 px-4 pb-3">
{day.stops.map((planned, index) => (
<li key={`${planned.stop.name}-${index}`} className="grid grid-cols-[46px_minmax(0,1fr)] gap-2.5">
{/* 시각 열 — 왼쪽에 붙어 정렬돼야 '시간표'로 읽힌다 */}
<span className="serif pt-2 text-[12px] tabular-nums opacity-75">{planned.time}</span>
<div className="border-l pb-2 pl-3" style={{borderColor: ITEM_BORDER}}>
{planned.move > 0 && <p className="pt-1 text-[10px] opacity-50">↓ {planned.move}분 이동</p>}
<p className="pt-1 text-sm font-bold">{planned.stop.name}</p>
{planned.stop.note && (
<p className="mt-0.5 text-[12px] leading-relaxed opacity-75">{planned.stop.note}</p>
)}
<p className="mt-0.5 text-[10px] opacity-50">
{planned.time}–{planned.until}
{planned.stop.searchQuery && ` · 지도 검색 ${planned.stop.searchQuery}`}
</p>
</div>
</li>
))}
</ol>
<div className="border-t border-dashed px-4 py-2.5" style={{borderColor: ITEM_BORDER}}>
<SourceLine source={item.source} verified={item.verified} />
</div>
</article>
);
}
export function PlannerSection() {
const payload = useSite();
const parsed = sectionItems<PlannerItem>(payload, 'planner');
if (parsed.items.length === 0) return null;
const seasons = plannerSeasons(parsed.items);
// 계절을 안 적었으면 계절 묶음 없이 전체에서 top3 를 뽑는다 — 빈 소제목을 만들지 않는다.
const groups = seasons.length > 0 ? seasons : [undefined];
return (
<ItemSection
id="planner"
name={parsed.title || sectionName(payload, 'planner', '계절별 추천 하루')}
subtitle={parsed.subtitle}
count="시각은 출발 시각과 머무는 시간으로 계산한 것입니다"
>
<div className="space-y-10">
{groups.map((season) => {
const top = plannerTop(parsed.items, season);
if (top.length === 0) return null;
return (
<div key={season ?? 'all'} className="space-y-3">
{season && <h3 className="serif text-lg font-bold">{season}</h3>}
<Rail label={`${season ?? '추천'} 코스`}>
{top.map((item, index) => (
<PlanCard key={`${item.name}-${index}`} item={item} rank={index} />
))}
</Rail>
</div>
);
})}
</div>
</ItemSection>
);
}
@@ -0,0 +1,63 @@
/**
* 오늘의 엽서 — 발행본. 우표 자리·소인·가운데 괘선이 있는 뒷면 한 장.
* ★ 손님이 자기 계정에 붙여넣는 것이 목적이라, 문장을 그대로 긁을 수 있게 평문으로 둔다
* ([복사] 버튼은 두지 않는다 — 스크립트가 없어도 되는 화면을 스크립트로 만들 이유가 없다).
*/
import type {PostcardItem} from '@o2o/shared';
import {useSite} from '@/lib/site-context';
import {sectionItems, sectionName} from '@/lib/derive';
import {ITEM_ACCENT, ITEM_BORDER, ITEM_CARD, ITEM_INK, ItemSection, Rail, SourceLine, tally} from './common';
export function PostcardSection() {
const payload = useSite();
const parsed = sectionItems<PostcardItem>(payload, 'postcard');
if (parsed.items.length === 0) return null;
return (
<ItemSection
id="postcard"
name={parsed.title || sectionName(payload, 'postcard', '오늘의 엽서')}
subtitle={parsed.subtitle}
count={tally(parsed.items.length, parsed.unverified, '장')}
>
<Rail label="엽서 목록">
{parsed.items.map((card, index) => (
<article
key={`${card.line}-${index}`}
className="w4-paper w-[304px] shrink-0 snap-center border p-4"
style={{backgroundColor: ITEM_CARD, borderColor: ITEM_INK}}
>
<div className="grid grid-cols-[minmax(0,1fr)_auto] gap-3">
{/* 가운데 괘선 — 엽서 뒷면을 반으로 가르는 그 선 */}
<div className="min-w-0 border-r pr-3" style={{borderColor: ITEM_BORDER}}>
<p className="serif text-[17px] leading-snug">“{card.line}”</p>
{card.hashtags && card.hashtags.length > 0 && (
<p className="mt-2 text-[11px] opacity-60">{card.hashtags.join(' ')}</p>
)}
</div>
<div className="flex w-[62px] flex-col items-center gap-3">
<span
className="grid h-[56px] w-[44px] place-items-center border border-dashed text-center text-[9px] leading-tight opacity-60"
style={{borderColor: ITEM_BORDER}}
>
郵票
<br />
10원
</span>
<span
className="serif grid size-[54px] -rotate-6 place-items-center rounded-full border-2 px-1 text-center text-[9px] leading-tight"
style={{borderColor: ITEM_ACCENT, color: ITEM_ACCENT}}
>
{card.postmark || card.place || '소인'}
</span>
</div>
</div>
<div className="mt-3 border-t border-dashed pt-2.5" style={{borderColor: ITEM_BORDER}}>
<SourceLine source={card.source} verified={card.verified} />
</div>
</article>
))}
</Rail>
</ItemSection>
);
}
@@ -0,0 +1,54 @@
/**
* 뒤집어 보는 질문 — 발행본.
*
* ★ 캔버스처럼 뒤집지 않는다. 뒤집으면 힌트 문장이 HTML 에 있어도 화면에 없는 것처럼 읽히고,
* 무엇보다 종이로 뽑아 로비에 두는 쓰임이 이 아이템의 절반이다 — 앞뒤를 함께 인쇄한다.
* ★ 정답 칸은 없다. 이 데이터는 검증되지 않은 줄이 더 많아 단정하면 틀린 걸 단정한다.
*/
import type {QuizItem} from '@o2o/shared';
import {useSite} from '@/lib/site-context';
import {sectionItems, sectionName} from '@/lib/derive';
import {ITEM_ACCENT, ITEM_BORDER, ITEM_CARD, ITEM_INK, ItemSection, Rail, SourceLine} from './common';
export function QuizSection() {
const payload = useSite();
const parsed = sectionItems<QuizItem>(payload, 'quiz');
if (parsed.items.length === 0) return null;
return (
<ItemSection
id="quiz"
name={parsed.title || sectionName(payload, 'quiz', '뒤집어 보는 질문')}
subtitle={parsed.subtitle}
count={`정답은 두지 않습니다 — 힌트와 출처까지만 · 총 ${parsed.items.length}문항`}
>
<Rail label="질문 목록">
{parsed.items.map((item, index) => (
<article
key={`${item.question}-${index}`}
className="w4-paper flex w-[262px] shrink-0 snap-center flex-col gap-3 border p-4"
style={{backgroundColor: ITEM_CARD, borderColor: ITEM_INK}}
>
<p className="text-[10px] tracking-[0.16em] opacity-60">
문제 {index + 1}
{item.level ? ` · ${item.level}` : ''}
</p>
<h3 className="serif text-[17px] font-bold leading-snug">{item.question}</h3>
{item.hint && (
<p className="border-t border-dashed pt-2.5 text-[13px] leading-relaxed opacity-80" style={{borderColor: ITEM_BORDER}}>
<span className="mr-1.5 text-[10px] tracking-[0.16em]" style={{color: ITEM_ACCENT}}>
힌트
</span>
{item.hint}
</p>
)}
<div className="mt-auto space-y-1">
{item.topic && <p className="text-[10px] opacity-55">{item.topic}</p>}
<SourceLine source={item.source} verified={item.verified} />
</div>
</article>
))}
</Rail>
</ItemSection>
);
}
@@ -0,0 +1,95 @@
/**
* 여행 스케줄 — 발행본. 칸 하나가 시간대 하나다.
* ★ 승차권(course)과 축이 다르다 — 저쪽은 '어디를 도는가'(순번), 여기는 '몇 시에 무엇을'(시각).
*/
import type {ScheduleItem} from '@o2o/shared';
import {useSite} from '@/lib/site-context';
import {sectionItems, sectionName} from '@/lib/derive';
import {ITEM_ACCENT, ITEM_BORDER, ITEM_CARD, ITEM_INK, ITEM_INVERSE, ITEM_INVERSE_INK, ItemSection, Rail, SourceLine} from './common';
/** "09:30" → 9시 30분. 형식이 어긋나면 원문 그대로 — 지어내지 않는다. */
function splitTime(time: string): {head: string; tail?: string} {
const match = /^(\d{1,2}):(\d{2})$/.exec(time.trim());
if (!match) return {head: time.trim()};
return {head: match[1].padStart(2, '0'), tail: match[2]};
}
export function ScheduleSection() {
const payload = useSite();
const parsed = sectionItems<ScheduleItem>(payload, 'schedule');
if (parsed.items.length === 0) return null;
return (
<ItemSection
id="schedule"
name={parsed.title || sectionName(payload, 'schedule', '여행 스케줄')}
subtitle={parsed.subtitle}
>
<div className="space-y-10">
{parsed.items.map((schedule, scheduleIndex) => {
const slots = schedule.slots ?? [];
const span =
slots.length > 1 ? `${slots[0]?.time ?? ''}–${slots[slots.length - 1]?.time ?? ''}` : undefined;
return (
<div key={`${schedule.name}-${scheduleIndex}`} className="space-y-3">
<div className="flex flex-wrap items-baseline gap-2.5">
<h3 className="serif text-lg font-bold">{schedule.name}</h3>
<span className="text-[11px] opacity-60">
{[schedule.audience, schedule.season, span, `${slots.length}칸`].filter(Boolean).join(' · ')}
</span>
</div>
<Rail label={`${schedule.name} 시간표`}>
{slots.map((slot, index) => {
const {head, tail} = splitTime(slot.time ?? '');
return (
<article
key={`${slot.time}-${slot.title}-${index}`}
className="w-[228px] shrink-0 snap-center border"
style={{backgroundColor: ITEM_CARD, borderColor: ITEM_INK}}
>
{/* 플립보드 — 가운데 접힘선이 이 판을 시계로 만든다 */}
{/* 플립보드는 템플릿의 어두운 면이다. 위의 글자는 밝은 면 색을 그대로 쓴다. */}
<div
className="relative px-4 py-3 text-center"
style={{backgroundColor: ITEM_INVERSE, color: ITEM_INVERSE_INK}}
>
<span className="serif text-3xl font-bold leading-none">
{head}
{tail && <span className="opacity-60">:{tail}</span>}
</span>
<i
aria-hidden
className="pointer-events-none absolute inset-x-0 top-1/2 border-t"
style={{borderColor: 'color-mix(in oklab, currentColor 25%, transparent)'}}
/>
</div>
<div className="space-y-2 px-4 pb-3 pt-3.5">
<h4 className="serif text-base font-bold">{slot.title}</h4>
{slot.place && (
<p className="text-[12px] font-semibold" style={{color: ITEM_ACCENT}}>
{slot.place}
</p>
)}
{slot.note && <p className="text-[13px] leading-relaxed opacity-80">{slot.note}</p>}
</div>
<div
className="flex justify-between gap-2 border-t border-dashed px-4 py-2 text-[10px] opacity-60"
style={{borderColor: ITEM_BORDER}}
>
<span>{slot.minutes ? `${slot.minutes}분 머묾` : '머무는 시간 미정'}</span>
{slot.searchQuery && <span className="truncate">지도 검색 · {slot.searchQuery}</span>}
</div>
</article>
);
})}
</Rail>
<SourceLine source={schedule.source} verified={schedule.verified} />
</div>
);
})}
</div>
</ItemSection>
);
}
@@ -0,0 +1,78 @@
/**
* 가요 다방 — 발행본.
*
* 캔버스는 턴테이블에 한 장만 얹지만 발행본은 곡마다 판을 하나씩 놓는다.
* 인용될 문장(story·connection)이 전부 HTML 에 있어야 하기 때문이다.
* ★ 가사는 어디에도 없다 — 스키마에 lyrics 칸 자체가 없다(원문 전재 금지).
*/
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';
/** 곡이 라벨 색을 안 주면 템플릿 강조색이 라벨이 된다. */
const FALLBACK_LABEL = ITEM_ACCENT;
export function SongsSection() {
const payload = useSite();
const parsed = sectionItems<SongItem>(payload, 'songs');
if (parsed.items.length === 0) return null;
return (
<ItemSection
id="songs"
name={parsed.title || sectionName(payload, 'songs', '가요 다방')}
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="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>
<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}
</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">
<SourceLine source={song.source} verified={song.verified} />
</div>
</article>
))}
</Rail>
</ItemSection>
);
}
+140
View File
@@ -0,0 +1,140 @@
/**
* 붙여넣기 아이템의 발행본 공통 조각.
*
* ★ 색과 서체를 박지 않는다. 전부 템플릿 토큰(`--tpl-*`, `seo/head.ts` 가 심는다)을 읽는다 —
* 한때 이 파일이 갱지색·주(朱)잉크·간판체를 hex 와 폰트명으로 들고 있었고, 그 바람에
* 사장님이 템플릿을 바꿔도 아이템 섹션만 레트로로 남았다. 아이템은 레트로 전용 부품이 아니다.
* ★ 인상은 빌더 캔버스와 같게 그린다. 다만 **인터랙션은 옮기지 않는다** —
* 캔버스의 턴테이블은 '지금 한 곡'만 펴는데 그러면 나머지 곡의 문장이 HTML 에 없다.
* 이 사이트의 존재 이유가 AI·검색의 인용이라, 발행본은 전 항목을 펴고 가로로만 민다.
*/
import type {ReactNode} from 'react';
import type {DataSource, DataVerified} from '@o2o/shared';
import './items.css';
/** 카드·종이 면. 섹션 바탕보다 한 단계 앞이다. */
export const ITEM_CARD = 'var(--tpl-card, #fafafa)';
/** 선·테두리. */
export const ITEM_BORDER = 'var(--tpl-border, #d6d3d1)';
/**
* 강조 — 연표의 전환점, 일력의 날짜, 소인 도장.
*
* ★ 강조색을 그대로 쓰지 않고 둘레 글자색을 섞는다(빌더 캔버스와 같은 규칙). 팔레트에 따라
* accent 가 바탕과 같은 밝기면 큰 숫자와 배지가 화면에서 사라진다.
*/
export const ITEM_ACCENT = 'color-mix(in oklab, var(--tpl-accent, #2563eb) 70%, currentColor)';
/** 어두운 면(필름·플립보드). */
export const ITEM_INVERSE = 'var(--tpl-inverse, #1c1917)';
/** 어두운 면 위의 글자색 — 흰색을 박지 않고 템플릿의 밝은 면 색을 쓴다. */
export const ITEM_INVERSE_INK = 'var(--tpl-bg, #ffffff)';
/** 글자색. */
export const ITEM_INK = 'var(--tpl-text, #09090b)';
/**
* 아이템 섹션 껍데기.
*
* 바탕은 `--tpl-surface`(섹션 바탕) 또는 `--tpl-inverse`(어두운 아이템)다.
* 다른 섹션들이 쓰는 `border-black/8` 대신 토큰 테두리를 쓴다 — 어두운 면에서 검은 선은 안 보인다.
*/
export function ItemSection({
id,
name,
subtitle,
count,
children,
dark,
}: {
id: string;
name: string;
subtitle?: string;
/** 각주 한 줄("총 8곡 · 확인 필요 2"). 없으면 각주를 그리지 않는다. */
count?: string;
children: ReactNode;
dark?: boolean;
}) {
return (
<section
id={id}
aria-labelledby={`${id}-heading`}
className="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)',
}}
>
<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>}
</div>
</section>
);
}
/** 가로로 미는 레일. 화살표 버튼은 두지 않는다 — 스크립트 없이도 손가락·트랙패드로 민다. */
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>
);
}
/**
* 출처 한 줄 + 확신 배지.
*
* ★ 확인되지 않은 값을 숨기지 않고 드러낸다 — 발행본에서도 같다. 손님이 그 문장을
* 그대로 옮겨 적을 수 있어서, 어디까지가 확인된 것인지 화면이 말해야 한다.
* ★ 배지 색만은 토큰이 아니다. '확인/확인필요'는 디자인이 아니라 신호라, 팔레트를 따라가다
* 경고가 안 보이는 색이 되면 안 된다.
*/
export function SourceLine({source, verified}: {source?: DataSource; verified?: DataVerified}) {
if (!source && !verified) return null;
return (
<p className="flex flex-wrap items-center gap-x-2 gap-y-1 text-[10px] opacity-70">
{verified && (
<span
className="border px-1.5 py-px"
// ★ 신호색에 둘레 글자색을 섞어 어두운 면에서도 읽히게 한다(빌더 캔버스와 같은 규칙).
style={{
color: `color-mix(in oklab, ${verified === '확인' ? '#2a6053' : '#b07d10'} 62%, currentColor)`,
borderColor: 'currentColor',
}}
>
{verified}
</span>
)}
{source?.name && (
<span>
출처 ·{' '}
{source.url ? (
<a
href={source.url}
target="_blank"
rel="noopener noreferrer nofollow"
className="underline underline-offset-2"
>
{source.name}
</a>
) : (
source.name
)}
</span>
)}
</p>
);
}
/** "총 N개 · 확인 필요 M" 각주. 단위(곡·장·명)는 아이템마다 다르다. */
export function tally(total: number, unverified: number, unit: string): string {
return `총 ${total}${unit}${unverified > 0 ? ` · 확인 필요 ${unverified}${unit}` : ''}`;
}
+29
View File
@@ -0,0 +1,29 @@
/**
* 붙여넣기 아이템 섹션 — 섹션 id → 발행본 컴포넌트.
*
* ★ 이 표의 키는 `shared/lib/section-data.ts` 의 SECTION_ITEM_REQUIRED_KEY 와 같아야 한다.
* 한쪽에만 있으면 사장님이 켜 둔 섹션이 발행본에서 말없이 사라진다(HomePage 주석과 같은 함정).
*/
import {SongsSection} from './SongsSection';
import {DailySection} from './DailySection';
import {CourseSection} from './CourseSection';
import {ScheduleSection} from './ScheduleSection';
import {PeopleSection} from './PeopleSection';
import {ChronicleSection} from './ChronicleSection';
import {LiteratureSection} from './LiteratureSection';
import {PostcardSection} from './PostcardSection';
import {QuizSection} from './QuizSection';
import {PlannerSection} from './PlannerSection';
export const ITEM_SECTIONS: Record<string, () => React.ReactElement | null> = {
songs: SongsSection,
daily: DailySection,
course: CourseSection,
schedule: ScheduleSection,
people: PeopleSection,
chronicle: ChronicleSection,
literature: LiteratureSection,
postcard: PostcardSection,
quiz: QuizSection,
planner: PlannerSection,
};
+109
View File
@@ -0,0 +1,109 @@
/**
* 붙여넣기 아이템의 질감 — Tailwind 로는 못 그리는 것만 여기 둔다.
*
* ★ 빌더 캔버스의 `canvas/variants/items/items.css` 와 **같은 내용**이다. 한쪽만 고치면
* 사장님이 빌더에서 본 것과 발행본이 갈린다.
* ★ 색은 전부 템플릿 토큰(--tpl-*)에서 받는다.
*/
/* 종이 결 — 두 방향이 겹쳐야 종이로 읽힌다. 글자색을 옅게 깔아 어떤 팔레트에서도 결이 보인다. */
.w4-paper {
background-image:
repeating-linear-gradient(0deg, color-mix(in oklab, currentcolor 4%, transparent) 0 1px, transparent 1px 3px),
repeating-linear-gradient(90deg, color-mix(in oklab, currentcolor 3%, transparent) 0 1px, transparent 1px 4px);
}
/* 도넛판. --lbl 이 라벨 색이다. */
.w4-disc {
/* 판의 검정은 템플릿의 어두운 면(--tpl-inverse)이다. 홈은 그 위에 밝기 차로만 판다. */
background:
radial-gradient(circle at 50% 50%, transparent 0 15.5%, var(--lbl) 15.5% 33%, transparent 33%),
repeating-radial-gradient(
circle at 50% 50%,
color-mix(in oklab, var(--w4-vinyl) 88%, white) 0 1.4px,
var(--w4-vinyl) 1.4px 3px
),
var(--w4-vinyl);
box-shadow: inset 0 0 40px rgb(0 0 0 / 55%);
}
.w4-disc-sheen {
background: conic-gradient(
from 210deg,
rgb(255 255 255 / 12%),
transparent 22%,
transparent 70%,
rgb(255 255 255 / 7%)
);
}
.w4-spin {
animation: w4-rev 2.2s linear infinite;
}
@keyframes w4-rev {
to {
transform: rotate(360deg);
}
}
/* 미니 판 — 캐러셀에 늘어서는 작은 것. */
.w4-disc-mini {
background:
radial-gradient(circle at 50% 50%, transparent 0 14%, var(--lbl) 14% 34%, transparent 34%),
repeating-radial-gradient(
circle at 50% 50%,
color-mix(in oklab, var(--w4-vinyl) 88%, white) 0 1.2px,
var(--w4-vinyl) 1.2px 2.6px
),
var(--w4-vinyl);
box-shadow: 0 3px 10px rgb(0 0 0 / 35%);
}
/* 일력 톱니 — 뜯어낸 자국. --tear 는 섹션 바탕색이 들어온다(뜯긴 자리로 바탕이 비쳐야 한다). */
.w4-perf {
background: repeating-linear-gradient(90deg, transparent 0 8px, var(--tear) 8px 9px);
}
/* 승차권 절취선 */
.w4-dash {
border-top: 1px dashed currentcolor;
}
/* 필름 퍼포레이션 — 위아래 구멍이 있어야 한 장면이 아니라 '롤'로 읽힌다.
구멍은 currentColor(어두운 면 위의 글자색)로 뚫어 팔레트를 따른다. */
.w4-film-perf {
background: repeating-linear-gradient(90deg, currentcolor 0 9px, transparent 9px 21px);
}
/* 시험지 뒤집기. 카드가 얇아 보이지 않게 두 면을 같은 자리에 겹쳐 둔다. */
.w4-flip {
perspective: 900px;
}
.w4-flip-inner {
transform-style: preserve-3d;
transition: transform 0.5s;
}
.w4-flip-on .w4-flip-inner {
transform: rotateY(180deg);
}
.w4-flip-face {
backface-visibility: hidden;
}
.w4-flip-back {
transform: rotateY(180deg);
}
.w4-scroll {
scrollbar-width: none;
}
.w4-scroll::-webkit-scrollbar {
display: none;
}
@media (prefers-reduced-motion: reduce) {
.w4-spin {
animation: none;
}
.w4-flip-inner {
transition: none;
}
}