[feat] solution/frontend: 템플릿이 색만 바꾸던 걸 끝낸다 — 업종당 5개에서 3개로
업종마다 템플릿이 다섯인데 넷이 "흰 바탕 + 고딕 + 둥근 모서리"에 색조만 달랐다. 고르는 화면의 미리보기도 회색 막대 세 줄 + 색 동그라미라 다섯 장이 전부 같은 그림이었다 — 뭐가 다른지 알 수 없으니 아무거나 골랐다. - shared/TemplateItem.look: 제목·본문 서체, 모서리, 테두리 두께, 그림자, 제목 자간·굵기, 섹션 여백. CSS 에 그대로 들어가는 문자열로 들고 있다 — 숫자로 두면 쓰는 쪽에서 단위를 빠뜨린 곳이 조용히 0 이 된다 - CanvasView: Tailwind v4 의 --radius-* · --shadow-* 를 캔버스 안에서만 덮는다. 변이 파일 40여 개에 흩어진 rounded-* · shadow-* 를 한 줄도 안 고치고 전부 템플릿을 따르게 된다. 배수는 Tailwind 기본 비율 그대로라 기준값 0.75rem 이면 지금까지와 픽셀 단위로 같다 - index.css: .site-canvas 는 --tpl-font-heading/body 를 이미 읽고 있었는데 아무도 넣지 않았다. 서체가 안 갈리던 진짜 이유가 이 빠진 고리다. 제목 굵기도 토큰으로 뺐다 — 간판체(Gugi)는 굵기가 한 벌뿐이라 700 을 주면 브라우저가 가짜 볼드를 씌워 획이 뭉갠다 - industryData: templatesFor() 팩토리 하나로 심플·매거진·레트로 셋. 업종은 accent 하나만 바꾼다 — 생김새는 업종이 아니라 취향의 문제다. 537줄 → 237줄 - Step4Template: 미리보기를 그 템플릿의 서체·모서리·테두리·그림자로 실제로 그린다 - index.html: Noto Serif KR 추가. 매거진 제목이 Batang 으로 떨어지는데 맥에는 그 서체가 없다 - SectionFrame: 세로 여백을 --tpl-section-space 로. 이 값 하나로 페이지의 호흡이 바뀐다 옛 템플릿 id 가 DB 에 남아 있어도 resolveTemplate 이 첫 템플릿으로 떨어뜨린다. tsc·eslint·vite build 통과(frontend·admin·site), 템플릿 12벌 look 전량 대조 + 폴백 확인
This commit is contained in:
1 parent
e6ffdad888
commit
4debeaed3a
9 files changed
+315
-407
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import {Check} from 'lucide-react';
|
||||
import type {TemplateItem} from '@o2o/shared';
|
||||
import {INDUSTRY_CONFIGS} from '@/data/industryData';
|
||||
import {queueSiteTemplateSave} from '@/features/publish/siteTemplate';
|
||||
import {cn} from '@/lib/utils';
|
||||
@@ -6,6 +7,79 @@ import {useBuilderStore} from '@/stores/builder';
|
||||
import {WizardFooter} from './WizardFooter';
|
||||
import {WizardSteps} from './WizardSteps';
|
||||
|
||||
|
||||
/**
|
||||
* 템플릿 미리보기 — 그 템플릿의 서체·모서리·테두리·그림자로 **실제로** 그린다.
|
||||
*
|
||||
* ★ 예전에는 회색 막대 세 줄과 색 동그라미였다. 다섯 템플릿이 전부 같은 그림이라
|
||||
* 무엇을 고르는지 알 수 없었고, 그래서 아무거나 골랐다.
|
||||
*/
|
||||
function TemplatePreview({template}: {template: TemplateItem}) {
|
||||
const {look, colors} = template;
|
||||
|
||||
return (
|
||||
<div
|
||||
className="my-3 overflow-hidden p-3.5"
|
||||
style={{
|
||||
backgroundColor: colors.bg,
|
||||
color: colors.text,
|
||||
borderRadius: look.radius,
|
||||
border: `${look.borderWidth} solid ${colors.secondary}22`,
|
||||
}}
|
||||
>
|
||||
<p
|
||||
className="text-[9px] uppercase"
|
||||
style={{color: colors.accent, letterSpacing: '0.22em', fontFamily: look.fontBody}}
|
||||
>
|
||||
Section
|
||||
</p>
|
||||
<p
|
||||
className="mt-1.5 text-base leading-tight"
|
||||
style={{
|
||||
fontFamily: look.fontHeading,
|
||||
fontWeight: look.headingWeight,
|
||||
letterSpacing: look.headingTracking,
|
||||
}}
|
||||
>
|
||||
오래 머무는 자리
|
||||
</p>
|
||||
<p
|
||||
className="mt-1.5 text-[10px] leading-relaxed"
|
||||
style={{fontFamily: look.fontBody, color: colors.secondary}}
|
||||
>
|
||||
제목은 {template.fontStyle}, 본문은 이 서체로 나갑니다.
|
||||
</p>
|
||||
|
||||
<div
|
||||
className="mt-3 p-2"
|
||||
style={{
|
||||
backgroundColor: colors.card,
|
||||
borderRadius: `calc(${look.radius} * 0.67)`,
|
||||
border: `${look.borderWidth} solid ${colors.secondary}22`,
|
||||
boxShadow: look.shadow,
|
||||
}}
|
||||
>
|
||||
<span className="text-[9px]" style={{fontFamily: look.fontBody, color: colors.secondary}}>
|
||||
카드 · 모서리 {look.radius === '0px' ? '각짐' : '둥금'} · 그림자{' '}
|
||||
{look.shadow === 'none' ? '없음' : '있음'}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<span
|
||||
className="mt-2.5 inline-block px-2.5 py-1 text-[9px] font-semibold"
|
||||
style={{
|
||||
backgroundColor: colors.accent,
|
||||
color: colors.bg,
|
||||
borderRadius: `calc(${look.radius} * 0.5)`,
|
||||
fontFamily: look.fontBody,
|
||||
}}
|
||||
>
|
||||
예약 문의
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function Step4Template() {
|
||||
const industry = useBuilderStore((s) => s.industry);
|
||||
const templateId = useBuilderStore((s) => s.templateId);
|
||||
@@ -79,31 +153,7 @@ export function Step4Template() {
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{/* 색·레이아웃 미리보기 와이어프레임 */}
|
||||
<div className="my-3 space-y-2.5 rounded-xl border border-border bg-muted/50 p-3.5">
|
||||
<div className="flex items-center gap-1.5">
|
||||
{(['primary', 'secondary', 'card'] as const).map((key) => (
|
||||
<span
|
||||
key={key}
|
||||
className="size-3.5 rounded-full border border-black/10"
|
||||
style={{backgroundColor: template.colors[key]}}
|
||||
title={key}
|
||||
/>
|
||||
))}
|
||||
<span className="ml-1 font-mono text-[10px] text-muted-foreground">
|
||||
{template.colors.primary}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div className="space-y-1.5 pt-1">
|
||||
<div
|
||||
className="h-2.5 w-2/3 rounded"
|
||||
style={{backgroundColor: template.colors.primary, opacity: 0.85}}
|
||||
/>
|
||||
<div className="h-1.5 w-full rounded bg-border" />
|
||||
<div className="h-1.5 w-4/5 rounded bg-border" />
|
||||
</div>
|
||||
</div>
|
||||
<TemplatePreview template={template} />
|
||||
|
||||
<p className="text-xs leading-relaxed text-muted-foreground">
|
||||
{template.description}
|
||||
|
||||
Reference in new issue
Block a user