최초 커밋 — 기존 코드 전체 + 문서 체계 신설
git 저장소가 없어 히스토리·협업 기반이 아예 없던 상태를 연다.
함께 문서를 재편했다. 그동안 문서가 있어도 "이 제품이 뭘 푸는가"와
"어떻게 도는가"를 담은 문서가 없어서, 목표 문장이 backend/frontend
README 두 곳에 복붙돼 있었다 — 상위 문서가 없어 아래로 샌 것이다.
신설
README.md 레포 진입점 + 문서 지도 + 문서 규칙 4가지
AGENTS.md 에이전트·신규 합류자용 함정 목록과 규약
(CLAUDE.md 는 여기로 걸린 심볼릭 링크)
docs/PRODUCT.md 제품 정의 — 문제·사용자·원칙·**non-goals**·성공 기준
docs/ARCHITECTURE.md payload 경계·발행 파이프라인·서빙 결정·앱 분리 설계
이동
backend/docs/DECISIONS.md → docs/DECISIONS.md
백엔드만의 결정이 아니다. 게다가 코드 주석 ~25곳이 이미
`docs/DECISIONS.md` 로 적고 있어 레포 루트 기준으로는 그게 맞다.
갱신
docs/DEPLOY.md 서빙 결정 반영 — nginx 정적 서빙이 지금 경로(3절),
Azure 는 나중에 켤 때(4절)로 분리
docs/ARCHITECTURE.md 사이트 = 한 장(2026-08-31) 구조 반영
docs/COLLECTION_SEO_AEO_FLOW.md
robots.txt·sitemap.xml 은 오리진 루트에만 굽는다는 점 명시
frontend/site/scripts/prerender.ts
헤더 주석의 렌더 보고서 경로가 실제(422줄)와 달라 수정
.gitignore
★ CLAUDE.md 를 더 이상 무시하지 않는다. 에이전트 지침은 팀과 모든
에이전트가 공유하는 규약이라 커밋해야 한다 — 무시하면 클론한 사람이
"배포 후 republish_all.py 필수" 같은 함정을 전달받지 못한다.
개인용 오버라이드는 ~/.claude/CLAUDE.md 에 둔다.
This commit is contained in:
commit
6784e59ca5
713 files changed
+68390
No files matched your search
@@ -0,0 +1,58 @@
|
||||
import {useSite} from '@/lib/site-context';
|
||||
import {galleryImages} from '@/lib/derive';
|
||||
|
||||
export function AboutSection() {
|
||||
const payload = useSite();
|
||||
const {narrative, place} = payload;
|
||||
if (narrative.about.length === 0) return null;
|
||||
|
||||
// 대표가 아닌 사진 중 첫 장. 히어로와 같은 사진이 두 번 나오지 않게.
|
||||
const image = galleryImages(payload).find((m) => !m.isPrimary);
|
||||
|
||||
return (
|
||||
<section
|
||||
id="about"
|
||||
aria-labelledby="about-heading"
|
||||
className="w-full border-b border-black/8 py-16 sm:py-24"
|
||||
>
|
||||
<div className="shell">
|
||||
<p className="mb-3 text-xs font-semibold uppercase tracking-wider opacity-50">About</p>
|
||||
|
||||
<div className="grid grid-cols-1 items-center gap-8 md:grid-cols-12 lg:gap-12">
|
||||
{image && (
|
||||
<figure className="md:col-span-6">
|
||||
<div className="relative aspect-4/3 overflow-hidden rounded-2xl md:aspect-5/4">
|
||||
<img
|
||||
src={image.url}
|
||||
alt={image.alt}
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
width={image.width}
|
||||
height={image.height}
|
||||
className="size-full object-cover"
|
||||
/>
|
||||
</div>
|
||||
{image.caption && (
|
||||
<figcaption className="mt-2 text-xs opacity-60">{image.caption}</figcaption>
|
||||
)}
|
||||
</figure>
|
||||
)}
|
||||
|
||||
<div className={image ? 'md:col-span-6' : 'md:col-span-12'}>
|
||||
{/* 제목은 사장님이 붙인 섹션 이름이 먼저다. 이름이 비어 있을 때만
|
||||
지금까지 쓰던 문구(한 줄 소개 → "○○ 소개")로 떨어진다. */}
|
||||
<h2 id="about-heading" className="serif mb-4 text-2xl font-bold leading-snug tracking-tight sm:text-3xl lg:text-4xl">
|
||||
{narrative.heroSubline ?? `${place.name} 소개`}
|
||||
</h2>
|
||||
|
||||
<div className="space-y-3 text-sm leading-relaxed opacity-80">
|
||||
{narrative.about.map((paragraph, index) => (
|
||||
<p key={index}>{paragraph}</p>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
import {useSite} from '@/lib/site-context';
|
||||
import {factualSummary} from '@/seo/meta';
|
||||
import {essentialRows} from '@/lib/derive';
|
||||
import {formatKoreanDate} from '@/lib/format';
|
||||
|
||||
/**
|
||||
* 핵심 정보 요약 — AEO 의 핵심 블록.
|
||||
*
|
||||
* AI 검색은 페이지 전체를 요약하지 않는다. "답이 될 만한 문장"을 찾아 그대로 인용한다.
|
||||
* 그래서 상단에 단정문을 둔다: "체크인은 16:00입니다." 형태.
|
||||
* 표(dl)로 두는 이유는 label-value 관계가 마크업으로 드러나야 기계가 짝을 짓기 때문이다.
|
||||
*
|
||||
* ★ 여기 나오는 값은 전부 확인된 fact 다. essentialRows() 가 걸러 준다.
|
||||
*/
|
||||
export function AnswerBlock() {
|
||||
const payload = useSite();
|
||||
const rows = essentialRows(payload).slice(0, 6);
|
||||
const summary = payload.narrative.summary ?? factualSummary(payload);
|
||||
|
||||
if (rows.length === 0 && !summary) return null;
|
||||
|
||||
return (
|
||||
<section
|
||||
id="summary"
|
||||
aria-labelledby="summary-heading"
|
||||
className="w-full border-b border-black/8 py-10 sm:py-12"
|
||||
style={{backgroundColor: 'var(--color-surface-alt)'}}
|
||||
>
|
||||
<div className="shell">
|
||||
<h2 id="summary-heading" className="serif mb-1 text-lg font-bold sm:text-xl">
|
||||
한눈에 보는 {payload.place.name}
|
||||
</h2>
|
||||
<p className="mb-5 text-xs opacity-60">
|
||||
{formatKoreanDate(payload.site.updatedAt)} 기준, 사업자가 확인한 정보입니다.
|
||||
</p>
|
||||
|
||||
{/* 단정문 한 덩어리 — 인용되기 좋은 형태. */}
|
||||
<p className="mb-5 max-w-3xl text-sm leading-relaxed sm:text-base">{summary}</p>
|
||||
|
||||
{rows.length > 0 && (
|
||||
<dl className="grid grid-cols-1 gap-x-8 gap-y-0 sm:grid-cols-2">
|
||||
{rows.map((row) => (
|
||||
<div
|
||||
key={row.label}
|
||||
className="flex items-start justify-between gap-4 border-b border-black/8 py-2.5 text-sm"
|
||||
>
|
||||
<dt className="shrink-0 font-medium opacity-60">{row.label}</dt>
|
||||
<dd className="text-right font-semibold">{row.value}</dd>
|
||||
</div>
|
||||
))}
|
||||
</dl>
|
||||
)}
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
import {ArrowUpRight, CalendarCheck, Phone} from 'lucide-react';
|
||||
import {useSite} from '@/lib/site-context';
|
||||
import {bookingLinks, bookingRows, channelLabel, sectionName} from '@/lib/derive';
|
||||
|
||||
/**
|
||||
* 예약 안내.
|
||||
*
|
||||
* ★ 무엇을 근거로 그리나
|
||||
* 1) `payload.links` 중 예약을 실제로 받는 확정 채널(야놀자·여기어때·네이버 플레이스).
|
||||
* 2) 예약 관련 확인 fact(예약 필수 / 예약 방법) — 음식점·관광체험 스키마에 있다.
|
||||
* 3) `place.phone` — 국내 소규모 사업장에서 전화는 여전히 1순위 예약 창구다.
|
||||
*
|
||||
* ★ 예약 링크를 지어내지 않는다
|
||||
* 관리자 캔버스는 채널 URL 이 안 흘러와서 상호 검색으로 떨어뜨리지만(`bookingHref`),
|
||||
* 발행본에는 확정된 채널 URL 이 실려 온다. 그러니 여기서는 검색으로 떨어뜨리지 않는다 —
|
||||
* "예약하기"를 눌렀는데 검색 결과가 뜨면 손님은 예약을 포기한다.
|
||||
* 근거가 하나도 없으면 섹션째 그리지 않는다.
|
||||
*/
|
||||
export function BookingSection() {
|
||||
const payload = useSite();
|
||||
const links = bookingLinks(payload);
|
||||
const rows = bookingRows(payload);
|
||||
const phone = payload.place.phone;
|
||||
|
||||
if (links.length === 0 && rows.length === 0 && !phone) return null;
|
||||
|
||||
return (
|
||||
<section
|
||||
id="booking"
|
||||
aria-labelledby="booking-heading"
|
||||
className="w-full border-b border-black/8 py-16 sm:py-24"
|
||||
style={{backgroundColor: 'var(--color-surface-alt)'}}
|
||||
>
|
||||
<div className="shell">
|
||||
<p className="mb-2 flex items-center gap-2 text-xs font-semibold uppercase tracking-wider opacity-50">
|
||||
<CalendarCheck className="size-4" />
|
||||
<span>Booking</span>
|
||||
</p>
|
||||
|
||||
<h2 id="booking-heading" className="serif mb-2 text-2xl font-bold tracking-tight sm:text-3xl lg:text-4xl">
|
||||
{sectionName(payload, 'booking', '예약 안내')}
|
||||
</h2>
|
||||
<p className="mb-8 max-w-xl text-xs opacity-60 sm:text-sm">
|
||||
{payload.place.name} 예약은 아래 경로로 받습니다.
|
||||
</p>
|
||||
|
||||
<div
|
||||
className="max-w-3xl overflow-hidden rounded-2xl border border-black/8"
|
||||
style={{backgroundColor: 'var(--color-surface)'}}
|
||||
>
|
||||
{rows.length > 0 && (
|
||||
<dl className="divide-y divide-black/5">
|
||||
{rows.map((row) => (
|
||||
<div
|
||||
key={row.label}
|
||||
className="flex flex-col justify-between gap-1 p-4 sm:flex-row sm:items-start sm:gap-4 sm:p-5"
|
||||
>
|
||||
<dt className="shrink-0 text-xs font-bold sm:w-32 sm:text-sm">{row.label}</dt>
|
||||
<dd className="flex-1 text-left text-xs sm:text-right sm:text-sm">{row.value}</dd>
|
||||
</div>
|
||||
))}
|
||||
</dl>
|
||||
)}
|
||||
|
||||
<div className="flex flex-wrap items-center gap-2 border-t border-black/8 p-4 sm:p-5">
|
||||
{phone && (
|
||||
<a
|
||||
href={`tel:${phone}`}
|
||||
className="inline-flex items-center gap-1.5 rounded-xl px-4 py-2.5 text-xs font-semibold text-white transition-opacity hover:opacity-90"
|
||||
style={{backgroundColor: 'var(--color-brand)'}}
|
||||
>
|
||||
<Phone className="size-3.5" />
|
||||
<span>전화 예약 {phone}</span>
|
||||
</a>
|
||||
)}
|
||||
|
||||
{/* 확정된 채널만 나간다 — 확정 전 URL 은 동명 업소의 예약 페이지일 수 있다. */}
|
||||
{links.map((link) => (
|
||||
<a
|
||||
key={link.url}
|
||||
href={link.url}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="inline-flex items-center gap-1.5 rounded-xl border border-black/10 px-4 py-2.5 text-xs font-semibold transition-colors hover:bg-black/5"
|
||||
style={{backgroundColor: 'var(--color-surface-alt)'}}
|
||||
>
|
||||
<span>{channelLabel(link)}</span>
|
||||
<ArrowUpRight className="size-3.5" />
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
import {Info} from 'lucide-react';
|
||||
import {useSite} from '@/lib/site-context';
|
||||
import {essentialRows} from '@/lib/derive';
|
||||
import {formatKoreanDate} from '@/lib/format';
|
||||
|
||||
/**
|
||||
* 이용 정보 표 전체.
|
||||
*
|
||||
* AnswerBlock 이 상위 6개만 보여준다면 여기는 확인된 것 전부를 낸다.
|
||||
* ★ "확인 안 된 항목이 N개 있다"를 숨기지 않는다 — 없는 척하면
|
||||
* 손님이 다른 데서 틀린 값을 찾아 온다. 있다고 말하고 문의로 보낸다.
|
||||
*/
|
||||
export function EssentialInfoSection() {
|
||||
const payload = useSite();
|
||||
const rows = essentialRows(payload);
|
||||
const hiddenCount = payload.facts.filter(
|
||||
(fact) => fact.scope === 'place' && !rows.some((row) => row.label === fact.label),
|
||||
).length;
|
||||
|
||||
if (rows.length === 0) return null;
|
||||
|
||||
const half = Math.ceil(rows.length / 2);
|
||||
|
||||
return (
|
||||
<section
|
||||
id="info"
|
||||
aria-labelledby="info-heading"
|
||||
className="w-full border-b border-black/8 py-16 sm:py-24"
|
||||
style={{backgroundColor: 'var(--color-surface-alt)'}}
|
||||
>
|
||||
<div className="shell">
|
||||
<p className="mb-2 flex items-center gap-2 text-xs font-semibold uppercase tracking-wider opacity-50">
|
||||
<Info className="size-4" />
|
||||
<span>Essential Information</span>
|
||||
</p>
|
||||
|
||||
<div className="mb-8 flex flex-col justify-between gap-4 md:flex-row md:items-end">
|
||||
<div>
|
||||
<h2 id="info-heading" className="serif text-2xl font-bold tracking-tight sm:text-3xl">
|
||||
{'이용 및 예약 안내'}
|
||||
</h2>
|
||||
<p className="mt-1 text-xs opacity-60 sm:text-sm">
|
||||
방문 전 확인이 필요한 운영 규정과 시설 안내입니다.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
className="overflow-hidden rounded-2xl border border-black/8"
|
||||
style={{backgroundColor: 'var(--color-surface)'}}
|
||||
>
|
||||
<div className="grid grid-cols-1 divide-y divide-black/8 md:grid-cols-2 md:divide-x md:divide-y-0">
|
||||
{[rows.slice(0, half), rows.slice(half)].map((column, columnIndex) => (
|
||||
<dl key={columnIndex} className="divide-y divide-black/5">
|
||||
{column.map((row) => (
|
||||
<div
|
||||
key={row.label}
|
||||
className="flex flex-col justify-between gap-1 p-4 sm:flex-row sm:items-start sm:gap-4 sm:p-5"
|
||||
>
|
||||
<dt className="shrink-0 text-xs font-bold sm:w-32 sm:text-sm">{row.label}</dt>
|
||||
<dd className="flex-1 text-left sm:text-right">
|
||||
<p className="text-xs font-medium sm:text-sm">{row.value}</p>
|
||||
{row.note && <p className="mt-0.5 text-[11px] opacity-50">{row.note}</p>}
|
||||
</dd>
|
||||
</div>
|
||||
))}
|
||||
</dl>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="flex flex-col items-center justify-between gap-2 border-t border-black/8 px-4 py-3.5 text-xs opacity-60 sm:flex-row sm:px-6">
|
||||
<span>
|
||||
{hiddenCount > 0
|
||||
? `확인 중인 항목 ${hiddenCount}개는 표시하지 않았습니다. 필요하시면 전화로 문의해 주세요.`
|
||||
: '모든 항목이 사업자 확인을 거쳤습니다.'}
|
||||
</span>
|
||||
<span className="font-medium">{formatKoreanDate(payload.site.updatedAt)} 기준</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
import {Ticket} from 'lucide-react';
|
||||
import {useSite} from '@/lib/site-context';
|
||||
import {exhibitionRows, sectionName} from '@/lib/derive';
|
||||
|
||||
/**
|
||||
* 전시 · 관람 안내.
|
||||
*
|
||||
* ★ payload 에 없는 것 — 전시 자체
|
||||
* 에디터의 `exhibition.gallery` 는 전시 사진 + 관람 시간 + 관람료를 그린다. 그런데
|
||||
* SitePayload 에도, 관광체험 업종 스키마(tour_activity.json)에도 전시 목록(작품·기획전),
|
||||
* 전시 기간, 관람료(admission) 필드가 없다. 그래서 "○○ 기획전 · 3월 1일까지 · 성인 5,000원"
|
||||
* 같은 화면은 근거 없이는 못 만든다 — 전시 기간과 관람료는 틀리면 그대로 헛걸음이다.
|
||||
* (요금은 프로그램 단위 fact(price_adult/price_child)로 들어와 프로그램 섹션이 낸다.)
|
||||
* 전시 모델이 스키마에 생기면 그때 사진·기간·관람료를 여기에 붙인다.
|
||||
*
|
||||
* ★ 지금 그릴 수 있는 것 — 관람 조건에 답하는 확인 fact
|
||||
* 운영시간 · 회차 시간 · 휴무일 · 연령 제한 · 안내 언어.
|
||||
* "언제 가면 볼 수 있나"에 답하는 값만 고른다. 한 줄도 없으면 섹션째 그리지 않는다.
|
||||
*/
|
||||
export function ExhibitionSection() {
|
||||
const payload = useSite();
|
||||
const rows = exhibitionRows(payload);
|
||||
|
||||
if (rows.length === 0) return null;
|
||||
|
||||
return (
|
||||
<section
|
||||
id="exhibition"
|
||||
aria-labelledby="exhibition-heading"
|
||||
className="w-full border-b border-black/8 py-16 sm:py-24"
|
||||
style={{backgroundColor: 'var(--color-surface-alt)'}}
|
||||
>
|
||||
<div className="shell">
|
||||
<p className="mb-2 flex items-center gap-2 text-xs font-semibold uppercase tracking-wider opacity-50">
|
||||
<Ticket className="size-4" />
|
||||
<span>Exhibition</span>
|
||||
</p>
|
||||
|
||||
<h2 id="exhibition-heading" className="serif mb-2 text-2xl font-bold tracking-tight sm:text-3xl lg:text-4xl">
|
||||
{sectionName(payload, 'exhibition', '관람 안내')}
|
||||
</h2>
|
||||
<p className="mb-8 max-w-xl text-xs opacity-60 sm:text-sm">
|
||||
방문 전 관람 조건을 확인해 주세요.
|
||||
</p>
|
||||
|
||||
<div
|
||||
className="max-w-3xl overflow-hidden rounded-2xl border border-black/8"
|
||||
style={{backgroundColor: 'var(--color-surface)'}}
|
||||
>
|
||||
<dl className="divide-y divide-black/5">
|
||||
{rows.map((row) => (
|
||||
<div
|
||||
key={row.label}
|
||||
className="flex flex-col justify-between gap-1 p-4 sm:flex-row sm:items-start sm:gap-4 sm:p-5"
|
||||
>
|
||||
<dt className="shrink-0 text-xs font-bold sm:w-32 sm:text-sm">{row.label}</dt>
|
||||
<dd className="flex-1 text-left text-xs sm:text-right sm:text-sm">{row.value}</dd>
|
||||
</div>
|
||||
))}
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
import {HelpCircle} from 'lucide-react';
|
||||
import {useSite} from '@/lib/site-context';
|
||||
import {faqList} from '@/lib/derive';
|
||||
|
||||
/**
|
||||
* FAQ.
|
||||
*
|
||||
* ★ <details>/<summary> 로 만든다. 리액트 상태로 접었다 폈다 하면
|
||||
* 닫힌 답변이 DOM 에 없거나 hidden 이라, 크롤러가 못 읽는 일이 생긴다.
|
||||
* 네이티브 details 는 닫혀 있어도 내용이 문서에 있고, 검색·AI 가 그대로 읽는다.
|
||||
* FAQPage 구조화 데이터와 화면 텍스트가 같아야 하는 규칙도 이 방식이라야 지켜진다.
|
||||
*/
|
||||
export function FaqSection() {
|
||||
const payload = useSite();
|
||||
const faqs = faqList(payload);
|
||||
|
||||
if (faqs.length === 0) return null;
|
||||
|
||||
return (
|
||||
<section
|
||||
id="faq"
|
||||
aria-labelledby="faq-heading"
|
||||
className="w-full border-b border-black/8 py-16 sm:py-24"
|
||||
style={{backgroundColor: 'var(--color-surface-alt)'}}
|
||||
>
|
||||
<div className="shell">
|
||||
<p className="mb-2 flex items-center gap-2 text-xs font-semibold uppercase tracking-wider opacity-50">
|
||||
<HelpCircle className="size-4" />
|
||||
<span>FAQ</span>
|
||||
</p>
|
||||
|
||||
<h2 id="faq-heading" className="serif mb-2 text-2xl font-bold tracking-tight sm:text-3xl lg:text-4xl">
|
||||
{'자주 묻는 질문'}
|
||||
</h2>
|
||||
<p className="mb-8 max-w-xl text-xs opacity-60 sm:text-sm">
|
||||
아래 답변은 모두 사업자가 확인한 내용입니다.
|
||||
</p>
|
||||
|
||||
<div className="max-w-3xl space-y-3">
|
||||
{faqs.map((faq, index) => (
|
||||
<details
|
||||
key={faq.faqId}
|
||||
// 첫 항목만 펼쳐 둔다 — 나머지도 DOM 에는 그대로 있다.
|
||||
open={index === 0}
|
||||
className="overflow-hidden rounded-2xl border border-black/8"
|
||||
style={{backgroundColor: 'var(--color-surface)'}}
|
||||
>
|
||||
<summary className="flex cursor-pointer items-center gap-2.5 p-4 text-xs font-bold marker:content-none sm:p-5 sm:text-sm [&::-webkit-details-marker]:hidden">
|
||||
<span className="serif shrink-0 opacity-50">Q.</span>
|
||||
<span>{faq.question}</span>
|
||||
</summary>
|
||||
<div className="border-t border-black/5 px-4 pb-4 pt-3 text-xs leading-relaxed opacity-80 sm:px-5 sm:pb-5 sm:text-sm">
|
||||
{faq.answer}
|
||||
</div>
|
||||
</details>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,234 @@
|
||||
import {useCallback, useEffect, useState} from 'react';
|
||||
import useEmblaCarousel from 'embla-carousel-react';
|
||||
import {ChevronLeft, ChevronRight, X} from 'lucide-react';
|
||||
import {useSite} from '@/lib/site-context';
|
||||
import {galleryImages} from '@/lib/derive';
|
||||
|
||||
export function GallerySection() {
|
||||
const payload = useSite();
|
||||
const images = galleryImages(payload);
|
||||
const setting = payload.theme.sections.find((section) => section.id === 'photos');
|
||||
const variantId = setting?.variantId ?? 'photos.grid';
|
||||
const [openIndex, setOpenIndex] = useState<number | null>(null);
|
||||
/**
|
||||
* ★ 슬라이드를 화면 폭보다 좁게 잡아 **양옆이 보이게** 한다.
|
||||
* 100% 폭이면 정지 화면에서 사진 한 장과 구분이 안 된다 — 손님은 옆으로 더 있다는 걸
|
||||
* 모르고 지나간다. 옆 사진이 살짝 걸쳐 보이는 것이 "밀어서 볼 수 있다"는 유일한 신호다.
|
||||
*/
|
||||
const [carouselRef, carouselApi] = useEmblaCarousel({loop: true, align: 'center', skipSnaps: false});
|
||||
const [selected, setSelected] = useState(0);
|
||||
|
||||
// 화살표·드래그·키보드 어느 쪽으로 움직여도 인디케이터가 따라오게 한다.
|
||||
useEffect(() => {
|
||||
if (!carouselApi) return;
|
||||
const sync = () => setSelected(carouselApi.selectedScrollSnap());
|
||||
sync();
|
||||
carouselApi.on('select', sync);
|
||||
return () => {
|
||||
carouselApi.off('select', sync);
|
||||
};
|
||||
}, [carouselApi]);
|
||||
|
||||
const scrollTo = useCallback((index: number) => carouselApi?.scrollTo(index), [carouselApi]);
|
||||
|
||||
if (images.length === 0) return null;
|
||||
|
||||
const step = (delta: number) => {
|
||||
setOpenIndex((current) =>
|
||||
current === null ? null : (current + delta + images.length) % images.length,
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<section
|
||||
id="gallery"
|
||||
aria-labelledby="gallery-heading"
|
||||
className="w-full border-b border-black/8 py-16 sm:py-24"
|
||||
>
|
||||
<div className="shell">
|
||||
<p className="mb-2 text-xs font-semibold uppercase tracking-wider opacity-50">Gallery</p>
|
||||
<h2 id="gallery-heading" className="serif mb-8 text-2xl font-bold tracking-tight sm:text-3xl lg:text-4xl">
|
||||
{setting?.name || '공간 갤러리'}
|
||||
</h2>
|
||||
|
||||
{/* 비전 분석 결과는 검색·접근성 메타데이터로만 사용하고 화면에는 사진만 보인다. */}
|
||||
{variantId === 'photos.carousel' ? (
|
||||
<div
|
||||
className="relative mx-auto max-w-5xl"
|
||||
role="group"
|
||||
aria-roledescription="캐러셀"
|
||||
aria-label={`사진 ${images.length}장`}
|
||||
// 좌우 키로도 넘길 수 있어야 한다 — 마우스가 없는 사람에게 화살표 버튼만 남기지 않는다.
|
||||
tabIndex={0}
|
||||
onKeyDown={(event) => {
|
||||
if (event.key === 'ArrowLeft') carouselApi?.scrollPrev();
|
||||
if (event.key === 'ArrowRight') carouselApi?.scrollNext();
|
||||
}}
|
||||
>
|
||||
{/* 양옆 사진이 걸쳐 보이도록 컨테이너 밖으로 넘치는 부분만 잘라낸다. */}
|
||||
<div ref={carouselRef} className="overflow-hidden">
|
||||
<ul className="-ml-3 flex touch-pan-y sm:-ml-4">
|
||||
{images.map((image, index) => (
|
||||
<li
|
||||
key={image.mediaId}
|
||||
className="min-w-0 flex-[0_0_88%] pl-3 sm:flex-[0_0_72%] sm:pl-4"
|
||||
aria-roledescription="슬라이드"
|
||||
aria-label={`${index + 1} / ${images.length}`}
|
||||
>
|
||||
<GalleryImage
|
||||
image={image}
|
||||
onOpen={() => setOpenIndex(index)}
|
||||
// 지금 보고 있지 않은 사진은 눌러서 흐리게 — 어느 것이 현재인지 눈에 바로 들어온다.
|
||||
className={`aspect-16/9 rounded-2xl transition-opacity duration-300 ${
|
||||
index === selected ? 'opacity-100' : 'opacity-45'
|
||||
}`}
|
||||
/>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{images.length > 1 && (
|
||||
<>
|
||||
<CarouselButton label="이전 사진" side="left" onClick={() => carouselApi?.scrollPrev()} />
|
||||
<CarouselButton label="다음 사진" side="right" onClick={() => carouselApi?.scrollNext()} />
|
||||
|
||||
{/* 몇 장 중 몇 번째인지. 점만 있으면 사진이 많을 때 셀 수 없다. */}
|
||||
<div className="mt-4 flex items-center justify-center gap-3">
|
||||
<ul className="flex items-center gap-1.5">
|
||||
{images.map((image, index) => (
|
||||
<li key={image.mediaId}>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => scrollTo(index)}
|
||||
aria-label={`${index + 1}번째 사진으로`}
|
||||
aria-current={index === selected}
|
||||
className={`h-1.5 rounded-full transition-all ${
|
||||
index === selected ? 'w-5 bg-black/70' : 'w-1.5 bg-black/20 hover:bg-black/40'
|
||||
}`}
|
||||
/>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
<span className="text-xs tabular-nums opacity-50">
|
||||
{selected + 1} / {images.length}
|
||||
</span>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
) : variantId === 'photos.masonry' ? (
|
||||
<ul className="columns-2 gap-2 sm:columns-3 sm:gap-4 [&>li]:mb-2 sm:[&>li]:mb-4">
|
||||
{images.map((image, index) => (
|
||||
<li key={image.mediaId} className="break-inside-avoid">
|
||||
<GalleryImage image={image} onOpen={() => setOpenIndex(index)} className="rounded-xl" free />
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
) : (
|
||||
<ul className="grid grid-cols-3 gap-2 sm:gap-4 md:grid-cols-4">
|
||||
{images.map((image, index) => (
|
||||
<li key={image.mediaId}>
|
||||
<GalleryImage image={image} onOpen={() => setOpenIndex(index)} className="aspect-square rounded-xl" />
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{openIndex !== null && (
|
||||
<div
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
aria-label="사진 크게 보기"
|
||||
className="fixed inset-0 z-50 flex items-center justify-center bg-black/90 p-4 backdrop-blur-md"
|
||||
onClick={() => setOpenIndex(null)}
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setOpenIndex(null)}
|
||||
aria-label="닫기"
|
||||
className="absolute right-4 top-4 z-10 rounded-full bg-white/10 p-2.5 text-white transition-colors hover:bg-white/20"
|
||||
>
|
||||
<X className="size-6" />
|
||||
</button>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
onClick={(event) => {
|
||||
event.stopPropagation();
|
||||
step(-1);
|
||||
}}
|
||||
aria-label="이전 사진"
|
||||
className="absolute left-3 z-10 rounded-full bg-white/10 p-2.5 text-white transition-colors hover:bg-white/20 sm:left-6"
|
||||
>
|
||||
<ChevronLeft className="size-6" />
|
||||
</button>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
onClick={(event) => {
|
||||
event.stopPropagation();
|
||||
step(1);
|
||||
}}
|
||||
aria-label="다음 사진"
|
||||
className="absolute right-3 z-10 rounded-full bg-white/10 p-2.5 text-white transition-colors hover:bg-white/20 sm:right-6"
|
||||
>
|
||||
<ChevronRight className="size-6" />
|
||||
</button>
|
||||
|
||||
<div
|
||||
className="flex max-h-[85vh] max-w-4xl items-center justify-center"
|
||||
onClick={(event) => event.stopPropagation()}
|
||||
>
|
||||
<img
|
||||
src={images[openIndex].url}
|
||||
alt={images[openIndex].alt}
|
||||
className="max-h-[72vh] max-w-full rounded-xl object-contain"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
function GalleryImage({image, onOpen, className, free = false}: {
|
||||
image: ReturnType<typeof galleryImages>[number];
|
||||
onOpen: () => void;
|
||||
className: string;
|
||||
free?: boolean;
|
||||
}) {
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
onClick={onOpen}
|
||||
className={`group relative block w-full cursor-pointer overflow-hidden border border-black/8 ${className}`}
|
||||
aria-label={`${image.alt} 크게 보기`}
|
||||
>
|
||||
<img
|
||||
src={image.url}
|
||||
alt={image.alt}
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
width={image.width}
|
||||
height={image.height}
|
||||
className={free ? 'h-auto w-full' : 'size-full object-cover transition-transform duration-500 group-hover:scale-105'}
|
||||
/>
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
||||
function CarouselButton({label, side, onClick}: {label: string; side: 'left' | 'right'; onClick: () => void}) {
|
||||
const Icon = side === 'left' ? ChevronLeft : ChevronRight;
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
onClick={onClick}
|
||||
aria-label={label}
|
||||
className={`absolute top-1/2 z-10 -translate-y-1/2 rounded-full bg-black/55 p-2.5 text-white backdrop-blur transition-colors hover:bg-black/75 ${side === 'left' ? 'left-3' : 'right-3'}`}
|
||||
>
|
||||
<Icon className="size-5" />
|
||||
</button>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
import {ArrowRight, MapPin} from 'lucide-react';
|
||||
import {useSite} from '@/lib/site-context';
|
||||
import {primaryImage} from '@/seo/meta';
|
||||
import {unitSpec} from '@/lib/derive';
|
||||
|
||||
export function HeroSection() {
|
||||
const payload = useSite();
|
||||
const {place, narrative} = payload;
|
||||
const image = primaryImage(payload);
|
||||
const spec = unitSpec(payload);
|
||||
|
||||
// id="top" — 상단 로고와 하단 탭의 '홈' 이 여기로 돌아온다.
|
||||
return (
|
||||
<section
|
||||
id="top"
|
||||
className="relative flex min-h-[420px] w-full items-center justify-center overflow-hidden bg-zinc-950 md:min-h-[580px] md:h-[78vh]"
|
||||
>
|
||||
{image && (
|
||||
<div className="absolute inset-0 z-0">
|
||||
<img
|
||||
src={image.url}
|
||||
alt={image.alt}
|
||||
// 첫 화면 이미지는 지연 로딩하지 않는다 — LCP 가 그만큼 늦어진다.
|
||||
fetchPriority="high"
|
||||
decoding="async"
|
||||
width={image.width}
|
||||
height={image.height}
|
||||
className="size-full object-cover object-center"
|
||||
/>
|
||||
<div className="absolute inset-0 bg-gradient-to-t from-zinc-950 via-zinc-950/60 to-zinc-950/30" />
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="shell relative z-10 flex flex-col items-center py-16 text-center text-white">
|
||||
{(place.addressLocality ?? place.addressRegion) && (
|
||||
<p className="mb-4 inline-flex items-center gap-1.5 rounded-full border border-white/20 bg-white/10 px-3 py-1 text-xs backdrop-blur-md sm:mb-6 sm:text-sm">
|
||||
<MapPin className="size-3.5" />
|
||||
<span>{place.addressLocality ?? place.addressRegion}</span>
|
||||
</p>
|
||||
)}
|
||||
|
||||
{/* h1 은 페이지에 하나. 가게 이름이 들어가야 "○○ 홈페이지" 질의에 잡힌다. */}
|
||||
<h1 className="serif mb-4 text-2xl font-medium leading-tight tracking-tight sm:text-4xl md:text-5xl lg:text-6xl">
|
||||
{narrative.heroHeadline ? (
|
||||
<>
|
||||
<span className="block">{narrative.heroHeadline}</span>
|
||||
<span className="mt-1 block font-semibold">{place.name}</span>
|
||||
</>
|
||||
) : (
|
||||
place.name
|
||||
)}
|
||||
</h1>
|
||||
|
||||
{(narrative.tagline ?? narrative.heroSubline) && (
|
||||
<p className="mb-8 max-w-2xl text-xs font-light leading-relaxed text-white/80 sm:text-base md:text-lg">
|
||||
{narrative.tagline ?? narrative.heroSubline}
|
||||
</p>
|
||||
)}
|
||||
|
||||
<div className="flex w-full flex-col items-center gap-3 sm:w-auto sm:flex-row">
|
||||
{payload.units.length > 0 && (
|
||||
<a
|
||||
href="#units"
|
||||
className="flex w-full items-center justify-center gap-2 rounded-xl bg-white px-6 py-3 text-xs font-medium text-zinc-950 transition-all hover:bg-white/90 sm:w-auto sm:text-sm"
|
||||
>
|
||||
<span>{spec.label} 둘러보기</span>
|
||||
<ArrowRight className="size-4" />
|
||||
</a>
|
||||
)}
|
||||
<a
|
||||
href="#info"
|
||||
className="flex w-full items-center justify-center gap-2 rounded-xl border border-white/30 bg-white/15 px-6 py-3 text-xs font-medium backdrop-blur-md transition-all hover:bg-white/25 sm:w-auto sm:text-sm"
|
||||
>
|
||||
<span>이용 정보 보기</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
import {ArrowUpRight, Mail, MessageCircle, Phone} from 'lucide-react';
|
||||
import {useSite} from '@/lib/site-context';
|
||||
import {channelLabel, contactLinks, sectionName} from '@/lib/derive';
|
||||
|
||||
/**
|
||||
* 문의 · 연락.
|
||||
*
|
||||
* ★ 무엇을 근거로 그리나
|
||||
* `place.phone` · `place.email` · 확정된 연락 채널(네이버 플레이스·인스타그램)뿐이다.
|
||||
* 하나도 없으면 섹션째 그리지 않는다.
|
||||
*
|
||||
* ★ 문의 양식(폼)은 만들지 않는다
|
||||
* 에디터에는 `inquiry.form` 배리에이션이 있지만, 발행 사이트는 정적 HTML 이라
|
||||
* 제출을 받을 곳이 없다. 눌러도 아무 데도 도착하지 않는 [문의 보내기] 버튼은
|
||||
* 연락처가 없는 것보다 나쁘다 — 손님은 문의를 남겼다고 믿고 답을 기다린다.
|
||||
* 접수 엔드포인트가 생기기 전까지는 "바로 연락되는 창구"만 낸다.
|
||||
*/
|
||||
export function InquirySection() {
|
||||
const payload = useSite();
|
||||
const {place} = payload;
|
||||
const links = contactLinks(payload);
|
||||
|
||||
if (!place.phone && !place.email && links.length === 0) return null;
|
||||
|
||||
return (
|
||||
<section
|
||||
id="inquiry"
|
||||
aria-labelledby="inquiry-heading"
|
||||
className="w-full border-b border-black/8 py-16 sm:py-24"
|
||||
>
|
||||
<div className="shell">
|
||||
<p className="mb-2 flex items-center gap-2 text-xs font-semibold uppercase tracking-wider opacity-50">
|
||||
<MessageCircle className="size-4" />
|
||||
<span>Contact</span>
|
||||
</p>
|
||||
|
||||
<h2 id="inquiry-heading" className="serif mb-2 text-2xl font-bold tracking-tight sm:text-3xl lg:text-4xl">
|
||||
{sectionName(payload, 'inquiry', '문의 안내')}
|
||||
</h2>
|
||||
<p className="mb-8 max-w-xl text-xs opacity-60 sm:text-sm">
|
||||
궁금한 점은 아래로 연락 주시면 {place.name}에서 직접 안내해 드립니다.
|
||||
</p>
|
||||
|
||||
<ul
|
||||
className="max-w-3xl divide-y divide-black/5 overflow-hidden rounded-2xl border border-black/8"
|
||||
style={{backgroundColor: 'var(--color-surface-alt)'}}
|
||||
>
|
||||
{place.phone && (
|
||||
<li>
|
||||
<a
|
||||
href={`tel:${place.phone}`}
|
||||
className="flex items-center justify-between gap-3 p-4 transition-colors hover:bg-black/[0.02] sm:p-5"
|
||||
>
|
||||
<span className="flex items-center gap-2.5">
|
||||
<Phone className="size-4 shrink-0 opacity-50" />
|
||||
<span className="text-xs font-bold sm:text-sm">전화</span>
|
||||
</span>
|
||||
<span className="text-xs font-semibold sm:text-sm">{place.phone}</span>
|
||||
</a>
|
||||
</li>
|
||||
)}
|
||||
|
||||
{place.email && (
|
||||
<li>
|
||||
<a
|
||||
href={`mailto:${place.email}`}
|
||||
className="flex items-center justify-between gap-3 p-4 transition-colors hover:bg-black/[0.02] sm:p-5"
|
||||
>
|
||||
<span className="flex items-center gap-2.5">
|
||||
<Mail className="size-4 shrink-0 opacity-50" />
|
||||
<span className="text-xs font-bold sm:text-sm">이메일</span>
|
||||
</span>
|
||||
<span className="break-all text-xs font-semibold sm:text-sm">{place.email}</span>
|
||||
</a>
|
||||
</li>
|
||||
)}
|
||||
|
||||
{links.map((link) => (
|
||||
<li key={link.url}>
|
||||
<a
|
||||
href={link.url}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="flex items-center justify-between gap-3 p-4 transition-colors hover:bg-black/[0.02] sm:p-5"
|
||||
>
|
||||
<span className="flex items-center gap-2.5">
|
||||
<MessageCircle className="size-4 shrink-0 opacity-50" />
|
||||
<span className="text-xs font-bold sm:text-sm">{channelLabel(link)}</span>
|
||||
</span>
|
||||
<ArrowUpRight className="size-4 shrink-0 opacity-40" />
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
import {ArrowUpRight, Calendar, MapPin, Utensils} from 'lucide-react';
|
||||
import type {LocalPlace} from '@o2o/shared';
|
||||
import {useSite} from '@/lib/site-context';
|
||||
import {formatKoreanDate, naverSearchUrl} from '@/lib/format';
|
||||
|
||||
/**
|
||||
* 주변 정보.
|
||||
*
|
||||
* "○○ 근처 숙소" 같은 지역 질의에 걸리려면 지역 고유명사가 본문에 있어야 한다.
|
||||
* ★ 우리가 남의 가게 URL 을 지어내지 않는다 — 검색 링크로만 보낸다.
|
||||
* 틀린 링크는 사용자를 엉뚱한 데로 보내고, 그 책임은 이 홈페이지가 진다.
|
||||
*/
|
||||
export function LocalGuideSection() {
|
||||
const payload = useSite();
|
||||
const {local} = payload;
|
||||
const hasAnything =
|
||||
local.restaurants.length > 0 || local.attractions.length > 0 || local.festivals.length > 0;
|
||||
if (!hasAnything) return null;
|
||||
|
||||
return (
|
||||
<section
|
||||
id="guide"
|
||||
aria-labelledby="guide-heading"
|
||||
className="w-full border-b border-black/8 py-12 sm:py-20"
|
||||
style={{backgroundColor: 'var(--color-surface-alt)'}}
|
||||
>
|
||||
<div className="shell max-w-[880px]">
|
||||
<div className="mb-8 flex flex-col justify-between gap-2 border-b border-black/8 pb-4 sm:flex-row sm:items-baseline">
|
||||
<div>
|
||||
<h2 id="guide-heading" className="serif text-2xl font-bold tracking-tight sm:text-3xl">
|
||||
{'주변 안내'}
|
||||
</h2>
|
||||
<p className="mt-1 text-xs opacity-60 sm:text-sm">
|
||||
{payload.place.addressLocality ?? '주변'} 지역의 맛집 · 명소 · 행사 안내입니다.
|
||||
</p>
|
||||
</div>
|
||||
{local.syncedAt && (
|
||||
<p className="self-start text-[11px] opacity-50 sm:self-auto">
|
||||
{formatKoreanDate(local.syncedAt)} 갱신
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{local.restaurants.length > 0 && (
|
||||
<PlaceList title="주변 맛집" icon={Utensils} places={local.restaurants} />
|
||||
)}
|
||||
{local.attractions.length > 0 && (
|
||||
<PlaceList title="주변 명소" icon={MapPin} places={local.attractions} />
|
||||
)}
|
||||
|
||||
{local.festivals.length > 0 && (
|
||||
<div className="space-y-4">
|
||||
<h3 className="serif flex items-center gap-2 text-base font-bold sm:text-lg">
|
||||
<Calendar className="size-4 opacity-50" />
|
||||
<span>지역 행사</span>
|
||||
</h3>
|
||||
|
||||
<ul
|
||||
className="divide-y divide-black/5 overflow-hidden rounded-xl border border-black/8"
|
||||
style={{backgroundColor: 'var(--color-surface)'}}
|
||||
>
|
||||
{local.festivals.map((festival) => (
|
||||
<li key={festival.name} className="flex items-center justify-between gap-3 p-4">
|
||||
<div className="min-w-0 space-y-0.5">
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="rounded bg-black/5 px-1.5 py-0.5 text-[11px] font-bold">
|
||||
{festival.month}
|
||||
</span>
|
||||
<h4 className="truncate text-xs font-bold sm:text-sm">{festival.name}</h4>
|
||||
</div>
|
||||
<p className="text-xs opacity-60">
|
||||
{festival.description ?? festival.period}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<a
|
||||
href={festival.officialUrl ?? naverSearchUrl(festival.searchQuery)}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer nofollow"
|
||||
className="shrink-0 rounded-lg border border-black/10 px-3 py-1.5 text-xs font-medium transition-colors hover:bg-black/5"
|
||||
>
|
||||
자세히
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
function PlaceList({
|
||||
title,
|
||||
icon: Icon,
|
||||
places,
|
||||
}: {
|
||||
title: string;
|
||||
icon: typeof MapPin;
|
||||
places: LocalPlace[];
|
||||
}) {
|
||||
return (
|
||||
<div className="mb-8 space-y-4">
|
||||
<h3 className="serif flex items-center gap-2 text-base font-bold sm:text-lg">
|
||||
<Icon className="size-4 opacity-50" />
|
||||
<span>{title}</span>
|
||||
</h3>
|
||||
|
||||
<ul
|
||||
className="divide-y divide-black/5 overflow-hidden rounded-xl border border-black/8"
|
||||
style={{backgroundColor: 'var(--color-surface)'}}
|
||||
>
|
||||
{places.map((place) => (
|
||||
<li key={place.name}>
|
||||
<a
|
||||
href={naverSearchUrl(place.searchQuery)}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer nofollow"
|
||||
className="group flex items-center justify-between gap-3 p-4 transition-colors hover:bg-black/[0.02]"
|
||||
>
|
||||
<div className="min-w-0 space-y-0.5 pr-3">
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="truncate text-xs font-bold sm:text-sm">{place.name}</span>
|
||||
{(place.distanceText ?? place.durationText) && (
|
||||
<span className="shrink-0 font-mono text-[10px] opacity-50">
|
||||
{place.distanceText ?? place.durationText}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
{place.description && (
|
||||
<p className="truncate text-xs opacity-60">{place.description}</p>
|
||||
)}
|
||||
</div>
|
||||
<span className="flex shrink-0 items-center gap-0.5 text-xs opacity-40 transition-opacity group-hover:opacity-80">
|
||||
<span>검색</span>
|
||||
<ArrowUpRight className="size-3.5" />
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,166 @@
|
||||
import {useState} from 'react';
|
||||
import {Car, Check, Copy, MapPin, Navigation} from 'lucide-react';
|
||||
import {useSite} from '@/lib/site-context';
|
||||
import {kakaoDirectionsUrl, naverDirectionsUrl, osmEmbedUrl} from '@/lib/format';
|
||||
|
||||
export function LocationSection() {
|
||||
const payload = useSite();
|
||||
const {place, routes} = payload;
|
||||
const [copied, setCopied] = useState(false);
|
||||
|
||||
const address = place.roadAddress ?? place.address;
|
||||
if (!address) return null;
|
||||
|
||||
// 좌표가 있어야 지도도 길찾기도 정확해진다. 없으면 지도를 그리지 않고,
|
||||
// 버튼은 검색으로 떨어진다(format.ts) — 틀린 핀을 찍느니 안 찍는다.
|
||||
const {latitude: lat, longitude: lng} = place;
|
||||
const hasGeo = lat != null && lng != null;
|
||||
|
||||
const handleCopy = async () => {
|
||||
try {
|
||||
await navigator.clipboard.writeText(address);
|
||||
setCopied(true);
|
||||
setTimeout(() => setCopied(false), 2000);
|
||||
} catch {
|
||||
// 클립보드 권한이 없으면 조용히 넘어간다 — 주소는 화면에 그대로 있다.
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<section
|
||||
id="location"
|
||||
aria-labelledby="location-heading"
|
||||
className="w-full border-b border-black/8 py-16 sm:py-24"
|
||||
>
|
||||
<div className="shell">
|
||||
<p className="mb-2 flex items-center gap-2 text-xs font-semibold uppercase tracking-wider opacity-50">
|
||||
<MapPin className="size-4" />
|
||||
<span>Location</span>
|
||||
</p>
|
||||
|
||||
<h2 id="location-heading" className="serif mb-2 text-2xl font-bold tracking-tight sm:text-3xl lg:text-4xl">
|
||||
{'오시는 길'}
|
||||
</h2>
|
||||
<p className="mb-8 max-w-xl text-xs opacity-60 sm:text-sm">
|
||||
주소와 주요 거점까지의 이동 시간을 안내합니다.
|
||||
</p>
|
||||
|
||||
{hasGeo && (
|
||||
<div className="mb-6 overflow-hidden rounded-2xl border border-black/8">
|
||||
{/* ★ loading="lazy" — 지도는 접힌 화면 아래에 있는 경우가 많고, 첫 화면 속도를
|
||||
남의 서버 응답에 맡기지 않는다. title 은 스크린리더가 읽을 유일한 설명이다. */}
|
||||
<iframe
|
||||
title={`${place.name} 위치 지도`}
|
||||
src={osmEmbedUrl(lat, lng)}
|
||||
loading="lazy"
|
||||
referrerPolicy="no-referrer-when-downgrade"
|
||||
className="block aspect-[16/9] w-full border-0"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div
|
||||
className="mb-8 rounded-2xl border border-black/8 p-5 sm:p-6"
|
||||
style={{backgroundColor: 'var(--color-surface-alt)'}}
|
||||
>
|
||||
<div className="flex flex-col justify-between gap-4 md:flex-row md:items-center">
|
||||
<div className="space-y-1">
|
||||
<p className="text-[11px] font-bold uppercase tracking-wide opacity-50">주소</p>
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
{/* address 태그로 감싼다 — 기계가 "이게 이 업소의 주소"임을 안다. */}
|
||||
<address className="text-base font-bold not-italic sm:text-lg">{address}</address>
|
||||
<button
|
||||
type="button"
|
||||
onClick={handleCopy}
|
||||
title="주소 복사"
|
||||
className="inline-flex items-center gap-1 rounded-lg border border-black/10 px-2.5 py-1 text-xs font-medium transition-colors hover:bg-black/5"
|
||||
style={{backgroundColor: 'var(--color-surface)'}}
|
||||
>
|
||||
{copied ? <Check className="size-3.5" /> : <Copy className="size-3.5" />}
|
||||
<span>{copied ? '복사완료' : '복사'}</span>
|
||||
</button>
|
||||
</div>
|
||||
{place.phone && (
|
||||
<p className="text-xs opacity-60">
|
||||
문의: <a href={`tel:${place.phone}`} className="underline-offset-2 hover:underline">{place.phone}</a>
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-2">
|
||||
<a
|
||||
href={naverDirectionsUrl(place.name, lat, lng)}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer nofollow"
|
||||
className="flex items-center gap-1.5 rounded-xl bg-emerald-600 px-4 py-2.5 text-xs font-semibold text-white transition-opacity hover:opacity-90"
|
||||
>
|
||||
<Navigation className="size-3.5" />
|
||||
<span>네이버 길찾기</span>
|
||||
</a>
|
||||
<a
|
||||
href={kakaoDirectionsUrl(place.name, lat, lng)}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer nofollow"
|
||||
className="flex items-center gap-1.5 rounded-xl bg-amber-400 px-4 py-2.5 text-xs font-semibold text-zinc-950 transition-opacity hover:opacity-90"
|
||||
>
|
||||
<Navigation className="size-3.5" />
|
||||
<span>카카오 길찾기</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{routes.length > 0 && (
|
||||
<div>
|
||||
<h3 className="mb-3 flex items-center gap-2 text-sm font-bold sm:text-base">
|
||||
<Car className="size-4 opacity-60" />
|
||||
<span>주요 거점 소요시간</span>
|
||||
</h3>
|
||||
|
||||
<div
|
||||
className="overflow-hidden rounded-2xl border border-black/8"
|
||||
style={{backgroundColor: 'var(--color-surface)'}}
|
||||
>
|
||||
<div className="overflow-x-auto">
|
||||
<table className="w-full text-left text-xs sm:text-sm">
|
||||
<caption className="sr-only">
|
||||
{payload.place.name}에서 주요 거점까지의 이동 시간
|
||||
</caption>
|
||||
<thead
|
||||
className="border-b border-black/8 font-semibold"
|
||||
style={{backgroundColor: 'var(--color-surface-alt)'}}
|
||||
>
|
||||
<tr>
|
||||
<th scope="col" className="p-3.5 sm:p-4">목적지</th>
|
||||
<th scope="col" className="p-3.5 sm:p-4">차량</th>
|
||||
<th scope="col" className="p-3.5 sm:p-4">도보 / 대중교통</th>
|
||||
<th scope="col" className="hidden p-3.5 sm:table-cell sm:p-4">거리</th>
|
||||
<th scope="col" className="hidden p-3.5 md:table-cell sm:p-4">비고</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody className="divide-y divide-black/5">
|
||||
{routes.map((route) => (
|
||||
<tr key={route.destination}>
|
||||
<th scope="row" className="p-3.5 text-left font-bold sm:p-4">
|
||||
{route.destination}
|
||||
</th>
|
||||
<td className="p-3.5 font-semibold sm:p-4">{route.byCar ?? '—'}</td>
|
||||
<td className="p-3.5 opacity-70 sm:p-4">{route.byTransit ?? '—'}</td>
|
||||
<td className="hidden p-3.5 font-mono opacity-50 sm:table-cell sm:p-4">
|
||||
{route.distanceText ?? '—'}
|
||||
</td>
|
||||
<td className="hidden p-3.5 text-xs opacity-50 md:table-cell sm:p-4">
|
||||
{route.note ?? ''}
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
import {Home, Image as ImageIcon, MapPin, Sparkles} from 'lucide-react';
|
||||
import {useSite} from '@/lib/site-context';
|
||||
import {isSectionEnabled, unitSpec} from '@/lib/derive';
|
||||
import {useActiveSection} from '@/lib/use-active-section';
|
||||
|
||||
/**
|
||||
* 모바일 하단 탭.
|
||||
*
|
||||
* ★ 사이트가 한 장이 되면서 이게 사실상 유일한 내비게이션이 됐다. 그래서 활성 표시를
|
||||
* 버리지 않고 스크롤 위치로 다시 계산한다(useActiveSection) — 예전에는 라우터의
|
||||
* 현재 경로로 알았다.
|
||||
*
|
||||
* ★ 없는 섹션으로는 보내지 않는다. 앵커는 대상이 없으면 아무 일도 일어나지 않는데,
|
||||
* 눌러도 반응이 없는 탭은 고장으로 읽힌다.
|
||||
*/
|
||||
export function MobileTabBar() {
|
||||
const payload = useSite();
|
||||
const spec = unitSpec(payload);
|
||||
|
||||
const tabs = [
|
||||
{id: 'top', label: '홈', icon: Home},
|
||||
...(payload.units.length > 0 ? [{id: 'units', label: spec.label, icon: ImageIcon}] : []),
|
||||
...(isSectionEnabled(payload, 'local') ? [{id: 'guide', label: '주변', icon: Sparkles}] : []),
|
||||
{id: 'location', label: '위치', icon: MapPin},
|
||||
];
|
||||
|
||||
const active = useActiveSection(tabs.map((tab) => tab.id));
|
||||
|
||||
return (
|
||||
<nav
|
||||
aria-label="하단 내비게이션"
|
||||
className="safe-b fixed inset-x-0 bottom-0 z-50 flex items-center justify-around border-t border-black/8 px-3 py-2 backdrop-blur-md md:hidden"
|
||||
style={{backgroundColor: 'color-mix(in srgb, var(--color-surface) 94%, transparent)'}}
|
||||
>
|
||||
{tabs.map(({id, label, icon: Icon}) => (
|
||||
<a
|
||||
key={id}
|
||||
href={`#${id}`}
|
||||
aria-current={active === id ? 'true' : undefined}
|
||||
className={`flex flex-1 flex-col items-center justify-center py-1 transition-opacity ${
|
||||
active === id ? 'font-bold opacity-100' : 'font-medium opacity-55'
|
||||
}`}
|
||||
>
|
||||
<Icon className="size-5" />
|
||||
<span className="mt-0.5 text-[10px] tracking-tight">{label}</span>
|
||||
</a>
|
||||
))}
|
||||
</nav>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
import {ShieldCheck} from 'lucide-react';
|
||||
import {useSite} from '@/lib/site-context';
|
||||
import {ruleRows, sectionName} from '@/lib/derive';
|
||||
import {formatKoreanDate} from '@/lib/format';
|
||||
|
||||
/**
|
||||
* 이용 규정.
|
||||
*
|
||||
* ★ 왜 별도 섹션인가
|
||||
* 이용 정보(info) 표에도 같은 fact 가 들어가지만, 거기서는 와이파이·주차와 같은 무게로
|
||||
* 섞인다. 취소·환불 규정과 입실 수칙은 "몰랐다"가 곧 클레임이 되는 항목이라
|
||||
* 사장님이 따로 세워 둘 수 있어야 한다. 실제로 이 섹션이 발행본에 없던 동안,
|
||||
* 에디터에서 켜 둔 환불 규정이 payload 까지 실려 오고도 화면에서 말없이 사라졌다.
|
||||
*
|
||||
* ★ 규정을 지어내지 않는다
|
||||
* 확인된 fact(RULE_FACT_KEYS)만 줄이 된다. 한 줄도 없으면 섹션째 그리지 않는다 —
|
||||
* "규정 없음"으로 읽히는 빈 껍데기가 가장 위험하다.
|
||||
*/
|
||||
export function RulesSection() {
|
||||
const payload = useSite();
|
||||
const rows = ruleRows(payload);
|
||||
|
||||
if (rows.length === 0) return null;
|
||||
|
||||
return (
|
||||
<section
|
||||
id="rules"
|
||||
aria-labelledby="rules-heading"
|
||||
className="w-full border-b border-black/8 py-16 sm:py-24"
|
||||
>
|
||||
<div className="shell">
|
||||
<p className="mb-2 flex items-center gap-2 text-xs font-semibold uppercase tracking-wider opacity-50">
|
||||
<ShieldCheck className="size-4" />
|
||||
<span>House Rules</span>
|
||||
</p>
|
||||
|
||||
<h2 id="rules-heading" className="serif mb-2 text-2xl font-bold tracking-tight sm:text-3xl lg:text-4xl">
|
||||
{sectionName(payload, 'rules', '이용 규정')}
|
||||
</h2>
|
||||
<p className="mb-8 max-w-xl text-xs opacity-60 sm:text-sm">
|
||||
예약 전에 꼭 확인해 주세요. 아래 내용은 모두 사업자가 확인한 규정입니다.
|
||||
</p>
|
||||
|
||||
{/* dl 로 둔다 — 규정 이름과 내용의 짝이 마크업에 드러나야 AI 검색이 그대로 인용한다. */}
|
||||
<dl className="grid max-w-4xl grid-cols-1 gap-3 sm:grid-cols-2">
|
||||
{rows.map((row) => (
|
||||
<div
|
||||
key={row.label}
|
||||
className="rounded-2xl border border-black/8 p-4 sm:p-5"
|
||||
style={{backgroundColor: 'var(--color-surface-alt)'}}
|
||||
>
|
||||
<dt className="mb-1 text-xs font-bold sm:text-sm">{row.label}</dt>
|
||||
<dd className="text-xs leading-relaxed opacity-80 sm:text-sm">{row.value}</dd>
|
||||
</div>
|
||||
))}
|
||||
</dl>
|
||||
|
||||
<p className="mt-4 text-xs opacity-50">
|
||||
{formatKoreanDate(payload.site.updatedAt)} 기준
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
import {ExternalLink, Mail, MapPin, Phone} from 'lucide-react';
|
||||
import {useSite} from '@/lib/site-context';
|
||||
import {formatKoreanDate} from '@/lib/format';
|
||||
// 채널 이름표는 예약·문의 섹션과 같은 표를 쓴다 — 같은 채널이 자리마다 다른 이름으로 뜨면 안 된다.
|
||||
import {channelLabel} from '@/lib/derive';
|
||||
|
||||
export function SiteFooter() {
|
||||
const payload = useSite();
|
||||
const {place, site} = payload;
|
||||
// 확정된 채널만 — 확정 전 URL 은 동명 업소일 수 있다.
|
||||
const links = payload.links.filter((link) => link.confirmed);
|
||||
const address = place.roadAddress ?? place.address;
|
||||
|
||||
return (
|
||||
<footer className="w-full bg-zinc-950 pb-24 pt-12 text-zinc-400 md:pb-14">
|
||||
<div className="shell">
|
||||
<div className="grid grid-cols-1 gap-8 border-b border-white/10 pb-10 md:grid-cols-12">
|
||||
<div className="space-y-3 md:col-span-6">
|
||||
<p className="serif text-lg font-bold tracking-tight text-white">{place.name}</p>
|
||||
|
||||
<div className="space-y-1.5 text-xs font-light">
|
||||
{address && (
|
||||
<p className="flex items-start gap-1.5">
|
||||
<MapPin className="mt-0.5 size-3.5 shrink-0 opacity-60" />
|
||||
<span>{address}</span>
|
||||
</p>
|
||||
)}
|
||||
{place.phone && (
|
||||
<p className="flex items-center gap-1.5">
|
||||
<Phone className="size-3.5 shrink-0 opacity-60" />
|
||||
<a href={`tel:${place.phone}`} className="hover:text-white">
|
||||
{place.phone}
|
||||
</a>
|
||||
</p>
|
||||
)}
|
||||
{place.email && (
|
||||
<p className="flex items-center gap-1.5">
|
||||
<Mail className="size-3.5 shrink-0 opacity-60" />
|
||||
<a href={`mailto:${place.email}`} className="hover:text-white">
|
||||
{place.email}
|
||||
</a>
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{links.length > 0 && (
|
||||
<nav aria-label="공식 채널" className="md:col-span-6 md:justify-self-end">
|
||||
<h2 className="mb-3 text-xs font-bold uppercase tracking-wider text-zinc-200">
|
||||
공식 채널
|
||||
</h2>
|
||||
<ul className="space-y-2 text-xs">
|
||||
{links.map((link) => (
|
||||
<li key={link.url}>
|
||||
<a
|
||||
href={link.url}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="inline-flex items-center gap-1 transition-colors hover:text-white"
|
||||
>
|
||||
<span>{channelLabel(link)}</span>
|
||||
<ExternalLink className="size-3" />
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</nav>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="flex flex-col items-center justify-between gap-3 pt-6 text-[11px] text-zinc-500 sm:flex-row">
|
||||
<div className="flex flex-wrap items-center gap-x-3 gap-y-1 text-center sm:text-left">
|
||||
<span>상호: {place.name}</span>
|
||||
{place.legal?.representative && <span>대표: {place.legal.representative}</span>}
|
||||
{place.legal?.businessRegistrationNumber && (
|
||||
<span>사업자등록번호: {place.legal.businessRegistrationNumber}</span>
|
||||
)}
|
||||
{place.legal?.mailOrderNumber && (
|
||||
<span>통신판매업신고: {place.legal.mailOrderNumber}</span>
|
||||
)}
|
||||
{place.legal?.licenseNumber && (
|
||||
<span>
|
||||
{place.legal.licenseLabel ?? '인허가번호'}: {place.legal.licenseNumber}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* 마지막 갱신을 화면에도 적는다 — 사람도 AI 도 신선도를 여기서 본다. */}
|
||||
<p>최종 갱신 {formatKoreanDate(site.updatedAt)}</p>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
import {Phone} from 'lucide-react';
|
||||
import {useSite} from '@/lib/site-context';
|
||||
import {isSectionEnabled, unitSpec} from '@/lib/derive';
|
||||
|
||||
/**
|
||||
* 상단 내비.
|
||||
*
|
||||
* ★ 메뉴를 <nav> + <a> 로 그대로 둔다. 자바스크립트로 만드는 메뉴는
|
||||
* 크롤러가 링크 그래프를 못 읽는다.
|
||||
*
|
||||
* ★ 사이트가 한 장이라 전부 앵커다. 예전에는 페이지 이동이 섞여 있어서
|
||||
* 라우터의 basename 을 타야 했는데(`<a href="/guide">` 는 호스트 루트로 가서 404),
|
||||
* 앵커만 남으니 그 문제가 없다.
|
||||
*/
|
||||
export function SiteHeader() {
|
||||
const payload = useSite();
|
||||
const spec = unitSpec(payload);
|
||||
|
||||
const items = [
|
||||
{label: '소개', href: '#about', show: isSectionEnabled(payload, 'intro')},
|
||||
{label: spec.label, href: '#units', show: payload.units.length > 0},
|
||||
{label: '주변 정보', href: '#guide', show: isSectionEnabled(payload, 'local')},
|
||||
{label: '오시는 길', href: '#location', show: true},
|
||||
{label: 'FAQ', href: '#faq', show: payload.faqs.length > 0},
|
||||
].filter((item) => item.show);
|
||||
|
||||
return (
|
||||
<header className="sticky top-0 z-40 w-full border-b border-black/8 bg-[color-mix(in_srgb,var(--color-surface)_92%,transparent)] backdrop-blur-md">
|
||||
<div className="shell flex h-16 items-center justify-between">
|
||||
<a href="#top" className="flex min-w-0 items-center gap-2">
|
||||
<span
|
||||
className="serif flex size-7 shrink-0 items-center justify-center rounded-lg text-sm font-semibold text-white"
|
||||
style={{backgroundColor: 'var(--color-brand)'}}
|
||||
aria-hidden
|
||||
>
|
||||
{payload.place.name.slice(0, 1)}
|
||||
</span>
|
||||
<span className="flex min-w-0 flex-col">
|
||||
<span className="serif truncate text-base font-bold leading-none tracking-tight sm:text-lg">
|
||||
{payload.place.name}
|
||||
</span>
|
||||
{payload.place.englishName && (
|
||||
<span className="mt-0.5 truncate text-[10px] uppercase leading-tight tracking-wider opacity-50">
|
||||
{payload.place.englishName}
|
||||
</span>
|
||||
)}
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<nav aria-label="주요 메뉴" className="hidden items-center gap-6 md:flex">
|
||||
{items.map((item) => (
|
||||
<a
|
||||
key={item.label}
|
||||
href={item.href}
|
||||
className="py-1 text-sm font-medium opacity-70 transition-opacity hover:opacity-100"
|
||||
>
|
||||
{item.label}
|
||||
</a>
|
||||
))}
|
||||
</nav>
|
||||
|
||||
{payload.place.phone && (
|
||||
<a
|
||||
href={`tel:${payload.place.phone}`}
|
||||
className="flex items-center gap-1.5 rounded-xl px-3 py-2 text-xs font-semibold text-white transition-opacity hover:opacity-90"
|
||||
style={{backgroundColor: 'var(--color-brand)'}}
|
||||
>
|
||||
<Phone className="size-3.5" />
|
||||
<span className="hidden sm:inline">{payload.place.phone}</span>
|
||||
<span className="sm:hidden">전화</span>
|
||||
</a>
|
||||
)}
|
||||
</div>
|
||||
</header>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
import {Armchair} from 'lucide-react';
|
||||
import {useSite} from '@/lib/site-context';
|
||||
import {sectionName, spaceRows} from '@/lib/derive';
|
||||
|
||||
/**
|
||||
* 공간 안내.
|
||||
*
|
||||
* ★ payload 에 없는 것 — 구역(zone) 모델
|
||||
* 에디터의 기본 배리에이션 `space.zones` 는 "1층 창가석 / 루프탑" 처럼 자리별 카드를
|
||||
* 그린다. 그러려면 구역 이름 · 구역 설명 · 구역별 사진이라는 데이터가 있어야 하는데,
|
||||
* SitePayload 에는 그런 필드가 없다. `media.category`("좌석", "테라스", "음료" …)가
|
||||
* 비슷해 보이지만 그건 사진 분류이지 좌석 구역이 아니다 — 그걸 구역 이름으로 쓰면
|
||||
* "음료"라는 이름의 자리가 생긴다. 그래서 사진 구역 카드는 그리지 않는다.
|
||||
* 백엔드에 구역 모델이 생기면 그때 여기에 붙인다.
|
||||
*
|
||||
* ★ 지금 그릴 수 있는 것 — 공간을 설명하는 확인 fact
|
||||
* 좌석 수 · 테라스 · 룸/별실 · 단체석 최대 인원 · 콘센트 · 장시간 이용 · 휠체어 접근.
|
||||
* "자리가 어떻게 생겼고 얼마나 앉을 수 있나"에 답하는 값만 고른다.
|
||||
* 한 줄도 없으면 섹션째 그리지 않는다.
|
||||
*/
|
||||
export function SpaceSection() {
|
||||
const payload = useSite();
|
||||
const rows = spaceRows(payload);
|
||||
|
||||
if (rows.length === 0) return null;
|
||||
|
||||
return (
|
||||
<section
|
||||
id="space"
|
||||
aria-labelledby="space-heading"
|
||||
className="w-full border-b border-black/8 py-16 sm:py-24"
|
||||
>
|
||||
<div className="shell">
|
||||
<p className="mb-2 flex items-center gap-2 text-xs font-semibold uppercase tracking-wider opacity-50">
|
||||
<Armchair className="size-4" />
|
||||
<span>Space</span>
|
||||
</p>
|
||||
|
||||
<h2 id="space-heading" className="serif mb-2 text-2xl font-bold tracking-tight sm:text-3xl lg:text-4xl">
|
||||
{sectionName(payload, 'space', '공간 안내')}
|
||||
</h2>
|
||||
<p className="mb-8 max-w-xl text-xs opacity-60 sm:text-sm">
|
||||
좌석과 이용 환경 안내입니다.
|
||||
</p>
|
||||
|
||||
<dl className="grid max-w-4xl grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3">
|
||||
{rows.map((row) => (
|
||||
<div
|
||||
key={row.label}
|
||||
className="rounded-2xl border border-black/8 p-4 sm:p-5"
|
||||
style={{backgroundColor: 'var(--color-surface-alt)'}}
|
||||
>
|
||||
<dt className="mb-1 text-xs font-medium opacity-60">{row.label}</dt>
|
||||
<dd className="text-sm font-bold sm:text-base">{row.value}</dd>
|
||||
</div>
|
||||
))}
|
||||
</dl>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,160 @@
|
||||
import {ChevronDown, Phone} from 'lucide-react';
|
||||
import {useSite} from '@/lib/site-context';
|
||||
import {sectionName, unitSpec, unitViews} from '@/lib/derive';
|
||||
|
||||
/**
|
||||
* 객실 · 메뉴 · 프로그램 — 업종에 따라 이름만 달라진다.
|
||||
*
|
||||
* ★ 예전에는 카드가 상세 **페이지**로 넘어갔다. 사이트를 한 장으로 합치면서
|
||||
* 그 페이지의 내용(이용 정보 표 · 사진 전체 · 전화 문의)을 카드 안으로 들여왔다.
|
||||
* 빼고 합쳤으면 확인된 fact 가 화면에서 사라지고, JSON-LD 에는 남아 있어
|
||||
* 발행 게이트(화면 ↔ 구조화 데이터 대조)에 걸린다.
|
||||
*
|
||||
* ★ 펼침은 <details> 다. 자바스크립트 없이 동작하고, 크롤러는 접힌 내용도 읽는다 —
|
||||
* 조건부 렌더로 감추면 HTML 에 아예 없어서 AI 가 못 본다.
|
||||
*/
|
||||
export function UnitsSection() {
|
||||
const payload = useSite();
|
||||
const spec = unitSpec(payload);
|
||||
const units = unitViews(payload);
|
||||
|
||||
if (units.length === 0) return null;
|
||||
|
||||
return (
|
||||
<section
|
||||
id="units"
|
||||
aria-labelledby="units-heading"
|
||||
className="w-full border-b border-black/8 py-16 sm:py-24"
|
||||
>
|
||||
<div className="shell">
|
||||
<div className="mb-10 flex flex-col justify-between gap-4 sm:flex-row sm:items-end">
|
||||
<div>
|
||||
<p className="mb-2 text-xs font-semibold uppercase tracking-wider opacity-50">
|
||||
{spec.label}
|
||||
</p>
|
||||
{/* 섹션 id 는 업종마다 다르다(rooms · menu · programs) — spec.path 가 그 id 다.
|
||||
사장님이 이름을 안 바꿨으면 지금까지 쓰던 "객실 3개 안내" 꼴로 떨어진다. */}
|
||||
<h2 id="units-heading" className="serif text-2xl font-bold tracking-tight sm:text-3xl lg:text-4xl">
|
||||
{sectionName(payload, spec.path, `${spec.label} ${units.length}개 안내`)}
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ul className="grid grid-cols-1 gap-4 sm:grid-cols-2 sm:gap-6 lg:gap-8">
|
||||
{units.map((unit) => (
|
||||
<li
|
||||
key={unit.unitId}
|
||||
className="flex flex-col justify-between overflow-hidden rounded-2xl border border-black/8"
|
||||
style={{backgroundColor: 'var(--color-surface-alt)'}}
|
||||
>
|
||||
<div>
|
||||
{unit.images[0] && (
|
||||
<div className="relative aspect-16/10 overflow-hidden sm:aspect-16/9">
|
||||
<img
|
||||
src={unit.images[0].url}
|
||||
alt={unit.images[0].alt}
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
className="size-full object-cover"
|
||||
/>
|
||||
{unit.priceText && (
|
||||
<span
|
||||
className="absolute bottom-3 right-3 rounded-lg px-2.5 py-1 text-xs font-bold"
|
||||
style={{
|
||||
backgroundColor: 'var(--color-surface)',
|
||||
color: 'var(--color-ink)',
|
||||
}}
|
||||
>
|
||||
{unit.priceText}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="space-y-3 p-4 sm:space-y-4 sm:p-6">
|
||||
<h3 className="serif text-base font-bold leading-snug sm:text-xl">
|
||||
{unit.name}
|
||||
</h3>
|
||||
|
||||
{unit.chips.length > 0 && (
|
||||
<ul className="flex flex-wrap items-center gap-1.5 sm:gap-2">
|
||||
{unit.chips.map((chip) => (
|
||||
<li
|
||||
key={chip.label}
|
||||
className="rounded-lg border border-black/8 px-2.5 py-1 text-xs"
|
||||
style={{backgroundColor: 'var(--color-surface)'}}
|
||||
>
|
||||
<span className="opacity-50">{chip.label} </span>
|
||||
<span className="font-medium">{chip.value}</span>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
|
||||
{unit.intro && (
|
||||
<p className="text-xs leading-relaxed opacity-70">{unit.intro}</p>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{(unit.rows.length > 0 || unit.images.length > 1) && (
|
||||
<details className="group border-t border-black/8">
|
||||
<summary className="flex cursor-pointer list-none items-center justify-between gap-2 p-4 text-xs font-semibold sm:p-6">
|
||||
<span>{unit.name} 자세히</span>
|
||||
<ChevronDown className="size-4 transition-transform group-open:rotate-180" />
|
||||
</summary>
|
||||
|
||||
<div className="space-y-5 px-4 pb-4 sm:px-6 sm:pb-6">
|
||||
{unit.rows.length > 0 && (
|
||||
<dl className="divide-y divide-black/5 border-t border-black/8">
|
||||
{unit.rows.map((row) => (
|
||||
<div
|
||||
key={row.label}
|
||||
className="flex items-start justify-between gap-4 py-2 text-xs"
|
||||
>
|
||||
<dt className="shrink-0 opacity-55">{row.label}</dt>
|
||||
<dd className="text-right font-semibold">{row.value}</dd>
|
||||
</div>
|
||||
))}
|
||||
</dl>
|
||||
)}
|
||||
|
||||
{unit.images.length > 1 && (
|
||||
<ul className="grid grid-cols-2 gap-2">
|
||||
{unit.images.slice(1).map((image) => (
|
||||
<li
|
||||
key={image.mediaId}
|
||||
className="relative aspect-16/10 overflow-hidden rounded-xl"
|
||||
>
|
||||
<img
|
||||
src={image.url}
|
||||
alt={image.alt}
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
className="size-full object-cover"
|
||||
/>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
|
||||
{payload.place.phone && (
|
||||
<a
|
||||
href={`tel:${payload.place.phone}`}
|
||||
className="flex w-full items-center justify-center gap-1.5 rounded-xl px-3 py-2.5 text-xs font-semibold text-white transition-opacity hover:opacity-90"
|
||||
style={{backgroundColor: 'var(--color-brand)'}}
|
||||
>
|
||||
<Phone className="size-3.5" />
|
||||
<span>{payload.place.phone} 문의</span>
|
||||
</a>
|
||||
)}
|
||||
</div>
|
||||
</details>
|
||||
)}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
import {Cloud} from 'lucide-react';
|
||||
import {useSite} from '@/lib/site-context';
|
||||
import {useLiveWeather} from '@/lib/use-live-weather';
|
||||
|
||||
/** 프리렌더 스냅샷으로 시작해 하이드레이션 후 최신 캐시로 갱신되는 독립 날씨 섹션. */
|
||||
export function WeatherSection() {
|
||||
const payload = useSite();
|
||||
const weather = useLiveWeather({
|
||||
initial: payload.local.weather,
|
||||
regionCode: payload.place.regionCode,
|
||||
latitude: payload.place.latitude,
|
||||
longitude: payload.place.longitude,
|
||||
});
|
||||
|
||||
if (!weather) return null;
|
||||
|
||||
return (
|
||||
<section
|
||||
id="weather"
|
||||
aria-labelledby="weather-heading"
|
||||
className="w-full border-b border-black/8 py-10 sm:py-14"
|
||||
style={{backgroundColor: 'var(--color-surface-alt)'}}
|
||||
>
|
||||
<div className="shell max-w-[880px]">
|
||||
<h2 id="weather-heading" className="serif mb-4 text-xl font-bold tracking-tight sm:text-2xl">
|
||||
오늘의 날씨
|
||||
</h2>
|
||||
<div
|
||||
className="rounded-xl border border-black/8 p-5 sm:p-6"
|
||||
style={{backgroundColor: 'var(--color-surface)'}}
|
||||
>
|
||||
<div className="flex items-center gap-3">
|
||||
<Cloud className="size-6 opacity-50" aria-hidden="true" />
|
||||
<div className="flex items-baseline gap-2">
|
||||
<span className="text-2xl font-extrabold sm:text-3xl">{weather.temperature}°C</span>
|
||||
<span className="text-xs font-semibold opacity-70">{weather.condition}</span>
|
||||
{weather.stale && <span className="text-[10px] text-amber-700">최근 관측값</span>}
|
||||
</div>
|
||||
</div>
|
||||
{weather.note && (
|
||||
<p className="mt-2 text-xs leading-relaxed opacity-70 sm:text-sm">{weather.note}</p>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
export {SiteHeader} from './SiteHeader';
|
||||
export {HeroSection} from './HeroSection';
|
||||
export {AnswerBlock} from './AnswerBlock';
|
||||
export {AboutSection} from './AboutSection';
|
||||
export {EssentialInfoSection} from './EssentialInfoSection';
|
||||
export {UnitsSection} from './UnitsSection';
|
||||
export {RulesSection} from './RulesSection';
|
||||
export {BookingSection} from './BookingSection';
|
||||
export {SpaceSection} from './SpaceSection';
|
||||
export {InquirySection} from './InquirySection';
|
||||
export {ExhibitionSection} from './ExhibitionSection';
|
||||
export {LocalGuideSection} from './LocalGuideSection';
|
||||
export {WeatherSection} from './WeatherSection';
|
||||
export {GallerySection} from './GallerySection';
|
||||
export {LocationSection} from './LocationSection';
|
||||
export {FaqSection} from './FaqSection';
|
||||
export {SiteFooter} from './SiteFooter';
|
||||
export {MobileTabBar} from './MobileTabBar';
|
||||
Reference in new issue
Block a user