[feat] solution/site,shared: 발행본을 /s/stay 목업에 맞춘다 — 잃어버린 CSS 토큰 복원 + 섹션 마크업 이식
목업(/s/stay)이 참조하는 스타일시트가 서버에서 사라져(404) 그 화면을 기준으로 삼을 수
없었다. 브라우저 캐시에 남아 있던 규칙을 꺼내 레포에 되돌리고, 섹션 마크업을 목업 HTML
에서 그대로 옮겼다. Playwright 대조로 섹션 래퍼·제목 16/17, 안쪽 구조 14/17 일치.
- index.css: --fs-display~--fs-xs(유동 타이포 7) · --section-space · --color-line/muted ·
.h2 .h3 .panel .paper .measure .border-line .text-muted .divide-line .slider-viewport/track
★ 이 토큰이 없던 동안 컴포넌트가 var(--fs-display)를 써도 브라우저가 조용히 무시했다 —
히어로 제목이 본문 크기로 나오던 원인
- HeroSection: 가운데 → 좌하단. 사진 위에 글자를 한가운데 얹으면 피사체를 정확히 가린다
- AnswerBlock·EssentialInfo·Units·Gallery·Location·Faq·LocalGuide·Weather·About:
목업 마크업 그대로. embla 를 scroll-snap 으로 바꿔 스크립트 없이도 레일이 밀린다
- FestivalSection(계절 탭) · StorySection(이야기 탭 래퍼) · items/TripMap(OSM 타일 지도) 신설
★ 지도는 iframe 이 아니라 타일을 직접 깐다 — iframe 은 핀을 하나밖에 못 찍어
"어떤 순서로 도는가" 를 그릴 수 없다
- items: itinerary·event·video kind 추가(파서에 없어 payload 까지 실려 오고도 화면에서
사라지던 것) · Rail 을 slider-viewport/track 으로 · SongsSection 을 턴테이블로
- color.ts: 선 색을 secondary → mix(bg, text, .2). secondary 는 '본문 다음으로 진한
글자색' 이라 선으로 쓰면 표와 카드가 격자무늬처럼 새까맣게 그어진다
- seo/head.ts: --tpl-texture. 없으면 색만 갱지고 면은 매끈해서 인쇄물로 안 보인다
- seo/verify.ts: unitCode·numberOfRooms 를 화면 대조에서 뺀다
★ unitCode 는 ㎡의 ISO 코드로 priceCurrency 와 같은 성격인데 예외에 없었다. 그래서
room_size 가 있는 사업장은 발행 게이트가 전부 막았다(실측: 가은채 객실 12개).
stay 는 객실 2개 + room_size 없음이라 우연히 통과했다
- shared: LocalPlace.imageUrl/distanceMeters · FestivalEntry.imageUrl ·
ItineraryStop 좌표 · TemplateLook.texture · people/chronicle/postcard imageUrl
★ 좌표·사진은 모델이 만드는 칸이 아니다. 공식 API 로 조회해 채운다
검증: tsc 통과 · Playwright 대조(목업 CSS 주입) 섹션 래퍼·제목 16/17, 안쪽 14/17.
남은 차이는 데이터 한계다 — people 사진은 위키에 원본이 없고(original:false),
weather.note 는 정적 페이지에 날씨 문장을 박는 문제라 보류.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KP1ykMnWZFtLFpm2mow1Sw
This commit is contained in:
1 parent
6df125d840
commit
00e13bca7f
38 files changed
+2085
-774
No files matched your search
@@ -1,78 +1,102 @@
|
||||
import {ArrowRight, MapPin} from 'lucide-react';
|
||||
import {ChevronDown, MapPin} from 'lucide-react';
|
||||
import {useSite} from '@/lib/site-context';
|
||||
import {primaryImage} from '@/seo/meta';
|
||||
import {unitSpec} from '@/lib/derive';
|
||||
|
||||
/**
|
||||
* 첫 화면.
|
||||
*
|
||||
* ★ 가운데 정렬이 아니라 **좌하단**이다. 사진이 주인공인 화면에서 글자를 한가운데 얹으면
|
||||
* 사진의 피사체를 정확히 가린다 — 실제로 그 이유로 좌하단으로 내렸다(/s/stay).
|
||||
* ★ 색은 전부 템플릿 토큰이다. 여기에 zinc-950 같은 고정색을 쓰면 레트로(갱지)를 골라도
|
||||
* 첫 화면만 검게 남는다.
|
||||
* ★ 버튼을 두 개 세우지 않는다. 첫 화면에서 물어볼 것은 "방을 보겠는가" 하나다.
|
||||
*/
|
||||
export function HeroSection() {
|
||||
const payload = useSite();
|
||||
const {place, narrative} = payload;
|
||||
const image = primaryImage(payload);
|
||||
const spec = unitSpec(payload);
|
||||
const region = place.addressLocality ?? place.addressRegion;
|
||||
const subline = narrative.tagline ?? narrative.heroSubline;
|
||||
|
||||
// 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>
|
||||
<section id="top" className="w-full">
|
||||
<div
|
||||
className="relative flex w-full items-end overflow-hidden"
|
||||
style={{
|
||||
backgroundColor: 'var(--tpl-inverse, #1c1917)',
|
||||
color: 'var(--tpl-bg, #ffffff)',
|
||||
minHeight: 'clamp(24rem, 62vh, 36rem)',
|
||||
}}
|
||||
>
|
||||
{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"
|
||||
style={{
|
||||
background:
|
||||
'linear-gradient(to top, color-mix(in srgb, var(--tpl-inverse, #1c1917) 88%, transparent) 0%,' +
|
||||
' color-mix(in srgb, var(--tpl-inverse, #1c1917) 45%, transparent) 34%, transparent 66%)',
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* 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
|
||||
<div className="shell relative z-10 pb-10 pt-24 sm:pb-12">
|
||||
{region && (
|
||||
<p className="mb-3 inline-flex items-center gap-1 text-[length:var(--fs-xs)] opacity-80">
|
||||
<MapPin className="size-3.5" aria-hidden="true" />
|
||||
<span>{region}</span>
|
||||
</p>
|
||||
)}
|
||||
</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>
|
||||
)}
|
||||
{/* h1 은 페이지에 하나. 가게 이름이 들어가야 "○○ 홈페이지" 질의에 잡힌다. */}
|
||||
<h1
|
||||
className="serif"
|
||||
style={{
|
||||
fontSize: 'var(--fs-display)',
|
||||
fontWeight: 'var(--tpl-heading-weight, 700)',
|
||||
lineHeight: 1.15,
|
||||
}}
|
||||
>
|
||||
{narrative.heroHeadline ? (
|
||||
<>
|
||||
<span className="block">{narrative.heroHeadline}</span>
|
||||
<span className="mt-1 block">{place.name}</span>
|
||||
</>
|
||||
) : (
|
||||
place.name
|
||||
)}
|
||||
</h1>
|
||||
|
||||
{subline && (
|
||||
<p className="measure mt-3 text-[length:var(--fs-lead)] leading-relaxed opacity-85">
|
||||
{subline}
|
||||
</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"
|
||||
className="mt-6 inline-flex items-center gap-1 text-[length:var(--fs-sm)] font-medium underline-offset-4 opacity-80 transition-opacity hover:opacity-100"
|
||||
>
|
||||
<span>{spec.label} 둘러보기</span>
|
||||
<ArrowRight className="size-4" />
|
||||
<span>{spec.label} 보기</span>
|
||||
<ChevronDown className="size-4" aria-hidden="true" />
|
||||
</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>
|
||||
|
||||
Reference in new issue
Block a user