@su-record/vibe 2.8.36 → 2.8.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -8
- package/hooks/scripts/llm-orchestrate.js +4 -6
- package/package.json +2 -2
- package/skills/vibe.figma/SKILL.md +452 -56
- package/skills/vibe.figma/templates/figma-handoff.md +4 -4
- package/skills/vibe.figma.convert/SKILL.md +318 -134
- package/skills/vibe.figma.convert/rubrics/conversion-rules.md +71 -80
- package/skills/vibe.figma.convert/templates/component.md +90 -98
- package/skills/vibe.figma.extract/SKILL.md +136 -79
- package/skills/vibe.figma.extract/rubrics/image-rules.md +1 -1
|
@@ -1,54 +1,162 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: vibe.figma.convert
|
|
3
|
-
description:
|
|
3
|
+
description: Figma 트리 → 구조적 코드 생성 + 스크린샷 검증
|
|
4
4
|
triggers: []
|
|
5
5
|
tier: standard
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
# vibe.figma.convert —
|
|
8
|
+
# vibe.figma.convert — 트리 기반 구조적 코드 생성
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
**Figma 트리 데이터를 기계적으로 HTML+CSS에 매핑한다. 추정하지 않는다.**
|
|
11
|
+
**Claude는 시맨틱 판단(태그 선택, 컴포넌트 분리, 인터랙션)만 담당한다.**
|
|
11
12
|
|
|
12
13
|
```
|
|
13
|
-
❌
|
|
14
|
-
|
|
14
|
+
❌ 스크린샷을 보고 CSS 추정 (범용 LLM의 약점)
|
|
15
|
+
❌ Figma 레이어를 무분별하게 div soup로 변환
|
|
16
|
+
✅ Figma Auto Layout → CSS Flexbox 1:1 매핑 (기계적)
|
|
17
|
+
✅ Figma CSS 속성 → SCSS 직접 변환 (추정 없음)
|
|
18
|
+
✅ Claude → 시맨틱 태그 선택 + 컴포넌트 설계 + 인터랙션
|
|
19
|
+
✅ 스크린샷 → 생성이 아닌 검증용
|
|
15
20
|
```
|
|
16
21
|
|
|
17
22
|
---
|
|
18
23
|
|
|
19
|
-
##
|
|
24
|
+
## 0. 재사용 확인 (코드 작성 전)
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
component-index (/tmp/{feature}/component-index.json) 에서 매칭되는 컴포넌트가 있으면:
|
|
28
|
+
|
|
29
|
+
✅ import하여 사용 (새로 만들지 않음)
|
|
30
|
+
✅ props로 커스터마이즈 (variant, size 등)
|
|
31
|
+
✅ 래퍼 클래스로 위치/크기만 조정
|
|
32
|
+
❌ 기존 컴포넌트 내부 수정
|
|
33
|
+
❌ 90% 유사한데 새로 만들기
|
|
34
|
+
|
|
35
|
+
매칭 안 되면 → 섹션 1 프로세스로 새로 생성
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 1. 트리 기반 코드 생성 프로세스
|
|
20
41
|
|
|
21
42
|
```
|
|
22
43
|
입력:
|
|
23
|
-
-
|
|
24
|
-
-
|
|
44
|
+
- tree.json (노드 트리 + CSS 속성 — 코드 생성의 PRIMARY 소스)
|
|
45
|
+
- /tmp/{feature}/images/ (다운로드된 이미지 에셋)
|
|
46
|
+
- 섹션 스크린샷 (검증용 — 생성에 사용하지 않음)
|
|
47
|
+
- scaleFactor (모바일: 480/720=0.667, PC: 1920/2560=0.75)
|
|
25
48
|
|
|
26
49
|
출력:
|
|
27
50
|
- 컴포넌트 파일 (Vue SFC / React TSX)
|
|
28
51
|
- SCSS 파일 (layout/ + components/ + _tokens.scss)
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### 1-1. 노드 → HTML 매핑 규칙 (기계적)
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
각 노드에 대해 아래 규칙을 순서대로 적용:
|
|
58
|
+
|
|
59
|
+
1. 타입별 기본 매핑:
|
|
60
|
+
TEXT 노드 → <span> (Claude가 <h1>~<h6>, <p>, <button> 등으로 승격)
|
|
61
|
+
IMAGE fill → <img src="다운로드된 경로" />
|
|
62
|
+
VECTOR/GROUP → 크기가 작으면(≤64px) 아이콘 후보 → <img> (렌더링 이미지)
|
|
63
|
+
크기가 크면 장식 요소 → <div> + background
|
|
64
|
+
FRAME/INSTANCE:
|
|
65
|
+
Auto Layout 있음 → <div> + flex (direction/gap/padding 직접 매핑)
|
|
66
|
+
Auto Layout 없음 → <div> + position:relative (자식은 absolute)
|
|
67
|
+
children 없음 → 빈 div 또는 스킵
|
|
68
|
+
|
|
69
|
+
2. 배경 레이어 판별:
|
|
70
|
+
부모와 동일 크기(±5%) + imageRef 있음 + z-index 낮음
|
|
71
|
+
→ position:absolute + inset:0 + object-fit:cover
|
|
72
|
+
→ 부모에 position:relative + overflow:hidden 추가
|
|
73
|
+
|
|
74
|
+
3. 반복 패턴 감지:
|
|
75
|
+
같은 부모 아래 동일 타입 + 유사 구조(children 수 동일) 노드 3개 이상
|
|
76
|
+
→ v-for (Vue) 또는 .map() (React)
|
|
77
|
+
→ 첫 번째 노드를 기준으로 템플릿 생성
|
|
78
|
+
|
|
79
|
+
4. 스킵 대상:
|
|
80
|
+
크기 0px 노드
|
|
81
|
+
visible=false 노드 (트리에 포함되지 않으므로 해당 없음)
|
|
82
|
+
VECTOR 장식선 (width 또는 height ≤ 2px)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### 1-2. CSS 속성 직접 매핑 (추정 없음)
|
|
29
86
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
87
|
+
```
|
|
88
|
+
tree.json의 css 객체를 SCSS로 직접 변환한다. 추정하지 않는다.
|
|
89
|
+
|
|
90
|
+
레이아웃 (layout/ 파일):
|
|
91
|
+
node.css.display → display
|
|
92
|
+
node.css.flexDirection → flex-direction
|
|
93
|
+
node.css.justifyContent → justify-content
|
|
94
|
+
node.css.alignItems → align-items
|
|
95
|
+
node.css.gap → gap (× scaleFactor)
|
|
96
|
+
node.css.padding → padding (× scaleFactor)
|
|
97
|
+
node.css.width → width (× scaleFactor)
|
|
98
|
+
node.css.height → height (× scaleFactor)
|
|
99
|
+
node.css.overflow → overflow
|
|
100
|
+
node.css.position → position
|
|
101
|
+
|
|
102
|
+
비주얼 (components/ 파일):
|
|
103
|
+
node.css.backgroundColor → background-color
|
|
104
|
+
node.css.color → color
|
|
105
|
+
node.css.fontFamily → font-family
|
|
106
|
+
node.css.fontSize → font-size (× scaleFactor)
|
|
107
|
+
node.css.fontWeight → font-weight
|
|
108
|
+
node.css.lineHeight → line-height
|
|
109
|
+
node.css.letterSpacing → letter-spacing (× scaleFactor)
|
|
110
|
+
node.css.textAlign → text-align
|
|
111
|
+
node.css.borderRadius → border-radius (× scaleFactor)
|
|
112
|
+
node.css.border → border (width만 × scaleFactor)
|
|
113
|
+
node.css.boxShadow → box-shadow (px값만 × scaleFactor)
|
|
114
|
+
node.css.opacity → opacity
|
|
115
|
+
node.css.mixBlendMode → mix-blend-mode
|
|
116
|
+
node.css.filter → filter (px값만 × scaleFactor)
|
|
117
|
+
node.css.backdropFilter → backdrop-filter (px값만 × scaleFactor)
|
|
118
|
+
|
|
119
|
+
scaleFactor 적용:
|
|
120
|
+
✅ 적용: width, height, padding, gap, margin, font-size, letter-spacing,
|
|
121
|
+
border-radius, border-width, box-shadow px, filter px
|
|
122
|
+
❌ 미적용: color, opacity, font-weight, font-family, z-index,
|
|
123
|
+
line-height(단위 없을 때), text-align, mix-blend-mode
|
|
124
|
+
|
|
125
|
+
값이 없으면:
|
|
126
|
+
→ 해당 속성 생략 (추정 금지)
|
|
127
|
+
→ tree.json에 없는 속성은 CSS에 쓰지 않는다
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### 1-3. Claude의 시맨틱 판단 (유일한 추정 영역)
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
기계적 매핑 후 Claude가 판단하는 것:
|
|
134
|
+
|
|
135
|
+
1. HTML 태그 승격:
|
|
136
|
+
<span> "MISSION 02" → <span> (장식 배지)
|
|
137
|
+
<span> "플레이 타임 달성" → <h2> (섹션 제목)
|
|
138
|
+
<span> "참여 대상 : PC..." → <p> (설명 텍스트)
|
|
139
|
+
<span> "보상 받기" → <button> 내부 텍스트
|
|
140
|
+
|
|
141
|
+
2. 컴포넌트 분리:
|
|
142
|
+
tree.json 1depth 자식 = 섹션 컴포넌트 후보
|
|
143
|
+
INSTANCE 타입 반복 = 공유 컴포넌트 후보
|
|
144
|
+
→ 컴포넌트 경계, 파일명, props interface 설계
|
|
145
|
+
|
|
146
|
+
3. 인터랙션 판단:
|
|
147
|
+
name에 "btn", "CTA", "link" 포함 → 클릭 이벤트
|
|
148
|
+
name에 "tab", "toggle" 포함 → 상태 전환
|
|
149
|
+
→ @click 핸들러, 상태 변수, 조건부 렌더링
|
|
150
|
+
|
|
151
|
+
4. 접근성:
|
|
152
|
+
배경/장식 이미지 → alt="" aria-hidden="true"
|
|
153
|
+
콘텐츠 이미지 → TEXT 노드에서 가장 가까운 텍스트를 alt로
|
|
154
|
+
인터랙티브 요소 → role, aria-label
|
|
155
|
+
|
|
156
|
+
5. 노드 생략 판단:
|
|
157
|
+
BG 그룹 내 장식 요소가 너무 많으면 (10개+)
|
|
158
|
+
→ 배경 이미지 1장 + 핵심 장식 2~3개만 유지
|
|
159
|
+
→ 나머지는 성능상 생략 가능 (스크린샷으로 검증)
|
|
52
160
|
```
|
|
53
161
|
|
|
54
162
|
---
|
|
@@ -59,145 +167,186 @@ tier: standard
|
|
|
59
167
|
|
|
60
168
|
```
|
|
61
169
|
layout/ → position, display, flex/grid, width, height, padding, margin,
|
|
62
|
-
gap, overflow, z-index,
|
|
170
|
+
gap, overflow, z-index, inset
|
|
63
171
|
components/ → font-size, font-weight, color, line-height, letter-spacing,
|
|
64
|
-
text-align, border, border-radius, box-shadow, opacity
|
|
172
|
+
text-align, border, border-radius, box-shadow, opacity,
|
|
173
|
+
background-color, background-image, mix-blend-mode, filter
|
|
65
174
|
```
|
|
66
175
|
|
|
67
|
-
### layout 예시 (
|
|
176
|
+
### layout 예시 (트리 기반 — 추정 없음)
|
|
68
177
|
|
|
69
178
|
```scss
|
|
70
|
-
//
|
|
71
|
-
//
|
|
72
|
-
//
|
|
179
|
+
// tree.json 데이터:
|
|
180
|
+
// Hero: { width:720, height:1280 }
|
|
181
|
+
// Title: { display:flex, flexDirection:column, alignItems:center, gap:24px, width:620, height:230 }
|
|
182
|
+
// Period: { display:flex, flexDirection:column, gap:10px, padding:"22px 14px", width:600, height:220 }
|
|
183
|
+
// scaleFactor = 0.667
|
|
73
184
|
|
|
74
185
|
@use '../tokens' as t;
|
|
75
186
|
|
|
76
187
|
.heroSection {
|
|
77
188
|
position: relative;
|
|
78
|
-
height: 960px; // 재료: 1280 × 0.75
|
|
79
189
|
width: 100%;
|
|
80
|
-
|
|
190
|
+
height: 854px; // 1280 × 0.667
|
|
191
|
+
overflow: hidden; // tree: overflow:hidden
|
|
81
192
|
}
|
|
82
193
|
|
|
83
|
-
.
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
194
|
+
.heroTitle {
|
|
195
|
+
display: flex; // tree: display:flex
|
|
196
|
+
flex-direction: column; // tree: flexDirection:column
|
|
197
|
+
align-items: center; // tree: alignItems:center
|
|
198
|
+
gap: 16px; // tree: 24 × 0.667
|
|
199
|
+
width: 414px; // tree: 620 × 0.667
|
|
88
200
|
}
|
|
89
201
|
|
|
90
|
-
.
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
padding-top: 98px; // 재료: 130 × 0.75
|
|
202
|
+
.heroPeriod {
|
|
203
|
+
display: flex; // tree: display:flex
|
|
204
|
+
flex-direction: column; // tree: flexDirection:column
|
|
205
|
+
gap: 7px; // tree: 10 × 0.667
|
|
206
|
+
padding: 15px 9px; // tree: "22px 14px" × 0.667
|
|
207
|
+
width: 400px; // tree: 600 × 0.667
|
|
97
208
|
}
|
|
98
209
|
```
|
|
99
210
|
|
|
100
|
-
### components 예시
|
|
211
|
+
### components 예시 (트리 기반)
|
|
101
212
|
|
|
102
213
|
```scss
|
|
103
|
-
//
|
|
104
|
-
//
|
|
105
|
-
//
|
|
214
|
+
// tree.json 데이터:
|
|
215
|
+
// TEXT "참여 대상": { fontSize:24px, fontWeight:600, color:#ffffff, fontFamily:Pretendard }
|
|
216
|
+
// BTN_Share: { borderRadius:500px, backgroundColor:rgba(13,40,61,0.5), border:"1px solid #ffffff" }
|
|
106
217
|
|
|
107
218
|
@use '../tokens' as t;
|
|
108
219
|
|
|
109
|
-
.
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
220
|
+
.heroTarget {
|
|
221
|
+
font-size: 16px; // tree: 24 × 0.667
|
|
222
|
+
font-weight: 600; // tree: fontWeight:600
|
|
223
|
+
color: #ffffff; // tree: color:#ffffff
|
|
224
|
+
font-family: t.$font-pretendard;
|
|
225
|
+
text-align: center; // tree: textAlign:center
|
|
113
226
|
}
|
|
114
227
|
|
|
115
|
-
.
|
|
116
|
-
|
|
117
|
-
color:
|
|
118
|
-
|
|
119
|
-
|
|
228
|
+
.heroShareBtn {
|
|
229
|
+
border-radius: 500px; // tree: borderRadius:500px (비율이므로 scaleFactor 미적용)
|
|
230
|
+
background-color: rgba(13, 40, 61, 0.5); // tree 그대로
|
|
231
|
+
border: 1px solid #ffffff; // tree 그대로
|
|
232
|
+
width: 48px; // tree: 72 × 0.667
|
|
233
|
+
height: 48px; // tree: 72 × 0.667
|
|
234
|
+
display: flex; // tree: display:flex
|
|
235
|
+
justify-content: center; // tree: justifyContent:center
|
|
236
|
+
align-items: center; // tree: alignItems:center
|
|
120
237
|
}
|
|
121
238
|
```
|
|
122
239
|
|
|
123
|
-
### _tokens.scss
|
|
240
|
+
### _tokens.scss (기존 토큰 참조 + 트리에서 추출)
|
|
124
241
|
|
|
125
242
|
```scss
|
|
126
|
-
// ───
|
|
127
|
-
|
|
128
|
-
$color-black: #000000;
|
|
129
|
-
$color-navy-dark: #0a1628;
|
|
130
|
-
$color-navy-medium: #00264a;
|
|
243
|
+
// ─── 기존 토큰 참조 (프로젝트에 이미 있는 경우) ───
|
|
244
|
+
@use '../../styles/variables' as v;
|
|
131
245
|
|
|
246
|
+
// ─── 매핑 (기존 토큰 → 피처 시맨틱 별칭) ────────
|
|
247
|
+
$color-bg-primary: v.$color-navy;
|
|
248
|
+
$color-text-primary: v.$color-white;
|
|
249
|
+
|
|
250
|
+
// ─── 새 토큰 (tree.json에서 추출, 기존에 없는 값만) ───
|
|
251
|
+
$color-accent-gold: #ffd700;
|
|
252
|
+
|
|
253
|
+
// ─── 폰트 ─────────────────────────────────────
|
|
132
254
|
$font-pretendard: 'Pretendard', sans-serif;
|
|
133
255
|
|
|
134
|
-
|
|
135
|
-
$
|
|
136
|
-
$
|
|
137
|
-
$
|
|
138
|
-
|
|
139
|
-
$font-weight-regular: 400;
|
|
140
|
-
$font-weight-medium: 500;
|
|
141
|
-
$font-weight-bold: 700;
|
|
142
|
-
|
|
143
|
-
$space-xs: 5px;
|
|
144
|
-
$space-sm: 11px;
|
|
145
|
-
$space-md: 16px;
|
|
146
|
-
$space-lg: 21px;
|
|
147
|
-
|
|
148
|
-
// ─── Semantic (용도별) ────────────────────────
|
|
149
|
-
$color-text-primary: $color-white;
|
|
150
|
-
$color-text-secondary: #dadce3;
|
|
151
|
-
$color-bg-primary: $color-navy-dark;
|
|
152
|
-
$color-bg-section: $color-navy-medium;
|
|
153
|
-
$color-border-primary: #203f6c;
|
|
154
|
-
$bp-desktop: 1024px;
|
|
256
|
+
// ─── 간격 (tree.json의 빈번한 gap/padding 값) ──
|
|
257
|
+
$space-xs: 5px; // tree에서 빈도 높은 값
|
|
258
|
+
$space-sm: 7px;
|
|
259
|
+
$space-md: 11px;
|
|
260
|
+
$space-lg: 16px;
|
|
155
261
|
|
|
156
|
-
|
|
157
|
-
// - primitive: 재료함의 고유 값 (hex, 폰트명, px)
|
|
158
|
-
// - semantic: primitive 참조로 용도별 이름
|
|
159
|
-
// - 같은 값 중복 금지 — 기존 토큰 재사용
|
|
262
|
+
$bp-desktop: 1024px;
|
|
160
263
|
```
|
|
161
264
|
|
|
162
265
|
---
|
|
163
266
|
|
|
164
267
|
## 3. 컴포넌트 작성
|
|
165
268
|
|
|
166
|
-
### Vue / Nuxt 예시
|
|
269
|
+
### Vue / Nuxt 예시 (트리 기반)
|
|
167
270
|
|
|
168
271
|
```vue
|
|
169
|
-
<!--
|
|
272
|
+
<!--
|
|
273
|
+
tree.json 구조:
|
|
274
|
+
Hero (INSTANCE 720x1280)
|
|
275
|
+
├── BG (FRAME — 배경 레이어)
|
|
276
|
+
├── Title (FRAME — flex-column, gap:24px)
|
|
277
|
+
│ ├── Title (RECTANGLE — imageRef → title.png)
|
|
278
|
+
│ └── Sub Title (VECTOR — imageRef → subtitle.png)
|
|
279
|
+
├── Period (FRAME — flex-column, gap:10px, padding)
|
|
280
|
+
│ └── Period (FRAME — flex-column, gap:22px)
|
|
281
|
+
│ ├── Period_Left (FRAME — flex-column, gap:4px)
|
|
282
|
+
│ │ ├── TEXT "이벤트 기간 (이벤트 참여 및 미션 수행)"
|
|
283
|
+
│ │ └── TEXT "2025.12.22 11:00 ~ 2026.01.18 11:00 [KST]"
|
|
284
|
+
│ └── Period_Right (FRAME — flex-column, gap:4px)
|
|
285
|
+
│ ├── TEXT "교환/응모 종료일"
|
|
286
|
+
│ └── TEXT "2026.01.25. 11:00 [KST]"
|
|
287
|
+
└── BTN_Share (FRAME — flex, borderRadius:500px)
|
|
288
|
+
-->
|
|
170
289
|
<template>
|
|
171
290
|
<section class="heroSection">
|
|
291
|
+
<!-- BG: 부모와 동일 크기 + imageRef → 배경 레이어 -->
|
|
172
292
|
<div class="heroBg">
|
|
173
|
-
<img src="/images/{feature}/bg.
|
|
293
|
+
<img src="/images/{feature}/hero-bg.png" alt="" aria-hidden="true" />
|
|
174
294
|
</div>
|
|
175
295
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
296
|
+
<!-- Title: flex-column, gap:24px → 직접 매핑 -->
|
|
297
|
+
<div class="heroTitle">
|
|
298
|
+
<img src="/images/{feature}/title.png"
|
|
299
|
+
alt="추운 겨울, 따뜻한 보상이 펑펑"
|
|
300
|
+
class="heroTitleImg" />
|
|
301
|
+
<img src="/images/{feature}/subtitle.png"
|
|
302
|
+
alt="겨울을 녹일 보상, 지금 PC방에서 획득하세요!"
|
|
303
|
+
class="heroSubtitleImg" />
|
|
304
|
+
</div>
|
|
180
305
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
</
|
|
306
|
+
<!-- Period: flex-column, gap:10px, padding → 직접 매핑 -->
|
|
307
|
+
<div class="heroPeriod">
|
|
308
|
+
<div class="heroPeriodInner">
|
|
309
|
+
<!-- Period_Left: flex-column, gap:4px -->
|
|
310
|
+
<div class="heroPeriodGroup">
|
|
311
|
+
<!-- TEXT 노드에서 characters 직접 삽입 -->
|
|
312
|
+
<span class="heroPeriodLabel">이벤트 기간 (이벤트 참여 및 미션 수행)</span>
|
|
313
|
+
<span class="heroPeriodValue">{{ eventPeriod.start }} ~ {{ eventPeriod.end }} [{{ eventPeriod.timezone }}]</span>
|
|
314
|
+
</div>
|
|
315
|
+
<!-- Period_Right: 동일 구조 -->
|
|
316
|
+
<div class="heroPeriodGroup">
|
|
317
|
+
<span class="heroPeriodLabel">교환/응모 종료일</span>
|
|
318
|
+
<span class="heroPeriodValue">2026.01.25. 11:00 [KST]</span>
|
|
188
319
|
</div>
|
|
189
320
|
</div>
|
|
190
321
|
</div>
|
|
191
322
|
|
|
323
|
+
<!-- BTN_Share: flex, borderRadius:500px → 버튼으로 승격 -->
|
|
192
324
|
<button class="heroShareBtn" @click="handleShare">
|
|
193
|
-
<img src="/images/{feature}/share.
|
|
325
|
+
<img src="/images/{feature}/share-icon.png" alt="공유하기" class="heroShareIcon" />
|
|
194
326
|
</button>
|
|
195
327
|
</section>
|
|
196
328
|
</template>
|
|
197
329
|
|
|
198
330
|
<script setup lang="ts">
|
|
331
|
+
/**
|
|
332
|
+
* 히어로 섹션
|
|
333
|
+
* tree.json: Hero (INSTANCE 720x1280)
|
|
334
|
+
*
|
|
335
|
+
* [기능 정의]
|
|
336
|
+
* - 키비주얼 + 이벤트 기간 정보 + 공유 버튼
|
|
337
|
+
*
|
|
338
|
+
* [인터랙션]
|
|
339
|
+
* ① 공유 버튼 클릭 → 공유 다이얼로그
|
|
340
|
+
*/
|
|
341
|
+
|
|
342
|
+
interface EventPeriod {
|
|
343
|
+
start: string
|
|
344
|
+
end: string
|
|
345
|
+
timezone: string
|
|
346
|
+
}
|
|
347
|
+
|
|
199
348
|
defineProps<{
|
|
200
|
-
eventPeriod:
|
|
349
|
+
eventPeriod: EventPeriod
|
|
201
350
|
}>()
|
|
202
351
|
|
|
203
352
|
const emit = defineEmits<{ share: [] }>()
|
|
@@ -221,21 +370,30 @@ function handleShare(): void {
|
|
|
221
370
|
|
|
222
371
|
---
|
|
223
372
|
|
|
224
|
-
## 4. 이미지
|
|
373
|
+
## 4. 이미지 처리 (트리 기반 판별)
|
|
225
374
|
|
|
226
375
|
```
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
배경
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
376
|
+
트리 노드의 속성으로 이미지 유형을 판별한다:
|
|
377
|
+
|
|
378
|
+
배경 이미지:
|
|
379
|
+
조건: imageRef 있음 + 부모와 크기 동일(±5%) + 형제 중 가장 먼저 위치
|
|
380
|
+
매핑: position:absolute + inset:0 + z-index:0 + object-fit:cover
|
|
381
|
+
태그: <img alt="" aria-hidden="true" />
|
|
382
|
+
|
|
383
|
+
콘텐츠 이미지:
|
|
384
|
+
조건: imageRef 있음 + 독립적 크기 + TEXT 형제 없음
|
|
385
|
+
매핑: width/height tree 값 × scaleFactor
|
|
386
|
+
태그: <img alt="가장 가까운 TEXT 노드의 characters" />
|
|
387
|
+
|
|
388
|
+
장식 이미지:
|
|
389
|
+
조건: opacity < 1 또는 mixBlendMode 있음 또는 filter:blur 있음
|
|
390
|
+
매핑: tree의 opacity/mixBlendMode/filter 직접 적용
|
|
391
|
+
태그: <img alt="" aria-hidden="true" />
|
|
392
|
+
|
|
393
|
+
아이콘:
|
|
394
|
+
조건: VECTOR/GROUP + 크기 ≤ 64px
|
|
395
|
+
매핑: width/height × scaleFactor
|
|
396
|
+
태그: <img alt="기능 설명" /> 또는 인라인 SVG
|
|
239
397
|
```
|
|
240
398
|
|
|
241
399
|
---
|
|
@@ -243,16 +401,18 @@ function handleShare(): void {
|
|
|
243
401
|
## 5. 반응형 추가 (데스크탑 URL)
|
|
244
402
|
|
|
245
403
|
```
|
|
246
|
-
두 번째 URL의
|
|
404
|
+
두 번째 URL의 tree.json을 확보한 후:
|
|
247
405
|
|
|
248
|
-
|
|
406
|
+
모바일 tree vs 데스크탑 tree 비교:
|
|
407
|
+
동일한 name의 노드를 매칭
|
|
408
|
+
CSS 속성 차이만 @media 오버라이드로 추가
|
|
249
409
|
|
|
250
410
|
같은 값 → 유지
|
|
251
|
-
다른 px 값 → @include pc {
|
|
411
|
+
다른 px 값 → @include pc { width: {desktop값 × pcScaleFactor}px; }
|
|
252
412
|
다른 레이아웃 → @include pc { flex-direction: row; }
|
|
253
|
-
다른
|
|
413
|
+
다른 이미지 → @include pc { content: url(/images/{feature}/desktop-xxx.png); }
|
|
254
414
|
|
|
255
|
-
기존 코드 삭제 금지.
|
|
415
|
+
기존 모바일 코드 삭제 금지.
|
|
256
416
|
```
|
|
257
417
|
|
|
258
418
|
---
|
|
@@ -260,12 +420,36 @@ function handleShare(): void {
|
|
|
260
420
|
## 6. Semantic HTML 규칙
|
|
261
421
|
|
|
262
422
|
```
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
-
|
|
266
|
-
-
|
|
267
|
-
-
|
|
268
|
-
-
|
|
423
|
+
Claude가 태그를 승격할 때의 규칙:
|
|
424
|
+
|
|
425
|
+
- 최상위 래퍼: <section>
|
|
426
|
+
- 섹션 제목 (name에 "title", 가장 큰 fontSize): <h2>
|
|
427
|
+
- 설명 텍스트: <p>
|
|
428
|
+
- 클릭 가능 (name에 "btn", "CTA", "link"): <button> 또는 <a>
|
|
429
|
+
- 반복 리스트: <ul>/<ol> + <li>
|
|
430
|
+
- 네비게이션: <nav>
|
|
431
|
+
- 제목 순서: <h1>~<h6> (순차, 건너뛰기 금지)
|
|
269
432
|
- 장식 이미지: alt="" + aria-hidden="true"
|
|
270
433
|
- 콘텐츠 이미지: alt="설명적 텍스트"
|
|
271
434
|
```
|
|
435
|
+
|
|
436
|
+
---
|
|
437
|
+
|
|
438
|
+
## 7. 생성 후 자가 검증
|
|
439
|
+
|
|
440
|
+
```
|
|
441
|
+
코드 작성 완료 후, Phase 4 (브라우저 검증) 전에:
|
|
442
|
+
|
|
443
|
+
1. 클래스명 일관성:
|
|
444
|
+
template의 모든 class가 SCSS에 정의됨 → OK
|
|
445
|
+
SCSS에 정의된 클래스가 template에 없음 → 경고 (미사용)
|
|
446
|
+
template에 사용된 클래스가 SCSS에 없음 → P1 (스타일 미적용)
|
|
447
|
+
|
|
448
|
+
2. 이미지 경로:
|
|
449
|
+
모든 src="/images/..." 경로가 static/ 에 실제 존재 → OK
|
|
450
|
+
존재하지 않는 경로 → P1
|
|
451
|
+
|
|
452
|
+
3. 트리 매핑 완전성:
|
|
453
|
+
tree.json의 Auto Layout 노드 → SCSS에 flex 속성 존재 → OK
|
|
454
|
+
Auto Layout인데 SCSS에 flex 없음 → P1 (레이아웃 깨짐)
|
|
455
|
+
```
|