@su-record/vibe 2.8.37 → 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/package.json +1 -1
- package/skills/vibe.figma/SKILL.md +66 -46
- package/skills/vibe.figma/templates/figma-handoff.md +4 -4
- package/skills/vibe.figma.convert/SKILL.md +298 -141
- 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 +129 -79
- package/skills/vibe.figma.extract/rubrics/image-rules.md +1 -1
|
@@ -1,17 +1,22 @@
|
|
|
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
|
---
|
|
@@ -27,44 +32,131 @@ component-index (/tmp/{feature}/component-index.json) 에서 매칭되는 컴포
|
|
|
27
32
|
❌ 기존 컴포넌트 내부 수정
|
|
28
33
|
❌ 90% 유사한데 새로 만들기
|
|
29
34
|
|
|
30
|
-
매칭 안 되면 → 섹션 1 프로세스로 새로 생성
|
|
35
|
+
매칭 안 되면 → 섹션 1 프로세스로 새로 생성
|
|
31
36
|
```
|
|
32
37
|
|
|
33
38
|
---
|
|
34
39
|
|
|
35
|
-
## 1. 코드 생성 프로세스
|
|
40
|
+
## 1. 트리 기반 코드 생성 프로세스
|
|
36
41
|
|
|
37
42
|
```
|
|
38
43
|
입력:
|
|
39
|
-
-
|
|
40
|
-
-
|
|
44
|
+
- tree.json (노드 트리 + CSS 속성 — 코드 생성의 PRIMARY 소스)
|
|
45
|
+
- /tmp/{feature}/images/ (다운로드된 이미지 에셋)
|
|
46
|
+
- 섹션 스크린샷 (검증용 — 생성에 사용하지 않음)
|
|
47
|
+
- scaleFactor (모바일: 480/720=0.667, PC: 1920/2560=0.75)
|
|
41
48
|
|
|
42
49
|
출력:
|
|
43
50
|
- 컴포넌트 파일 (Vue SFC / React TSX)
|
|
44
51
|
- SCSS 파일 (layout/ + components/ + _tokens.scss)
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### 1-1. 노드 → HTML 매핑 규칙 (기계적)
|
|
45
55
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
-
|
|
67
|
-
|
|
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 속성 직접 매핑 (추정 없음)
|
|
86
|
+
|
|
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
|
+
→ 나머지는 성능상 생략 가능 (스크린샷으로 검증)
|
|
68
160
|
```
|
|
69
161
|
|
|
70
162
|
---
|
|
@@ -75,156 +167,186 @@ component-index (/tmp/{feature}/component-index.json) 에서 매칭되는 컴포
|
|
|
75
167
|
|
|
76
168
|
```
|
|
77
169
|
layout/ → position, display, flex/grid, width, height, padding, margin,
|
|
78
|
-
gap, overflow, z-index,
|
|
170
|
+
gap, overflow, z-index, inset
|
|
79
171
|
components/ → font-size, font-weight, color, line-height, letter-spacing,
|
|
80
|
-
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
|
|
81
174
|
```
|
|
82
175
|
|
|
83
|
-
### layout 예시 (
|
|
176
|
+
### layout 예시 (트리 기반 — 추정 없음)
|
|
84
177
|
|
|
85
178
|
```scss
|
|
86
|
-
//
|
|
87
|
-
//
|
|
88
|
-
//
|
|
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
|
|
89
184
|
|
|
90
185
|
@use '../tokens' as t;
|
|
91
186
|
|
|
92
187
|
.heroSection {
|
|
93
188
|
position: relative;
|
|
94
|
-
height: 960px; // 재료: 1280 × 0.75
|
|
95
189
|
width: 100%;
|
|
96
|
-
|
|
190
|
+
height: 854px; // 1280 × 0.667
|
|
191
|
+
overflow: hidden; // tree: overflow:hidden
|
|
97
192
|
}
|
|
98
193
|
|
|
99
|
-
.
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
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
|
|
104
200
|
}
|
|
105
201
|
|
|
106
|
-
.
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
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
|
|
113
208
|
}
|
|
114
209
|
```
|
|
115
210
|
|
|
116
|
-
### components 예시
|
|
211
|
+
### components 예시 (트리 기반)
|
|
117
212
|
|
|
118
213
|
```scss
|
|
119
|
-
//
|
|
120
|
-
//
|
|
121
|
-
//
|
|
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" }
|
|
122
217
|
|
|
123
218
|
@use '../tokens' as t;
|
|
124
219
|
|
|
125
|
-
.
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
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
|
|
129
226
|
}
|
|
130
227
|
|
|
131
|
-
.
|
|
132
|
-
|
|
133
|
-
color:
|
|
134
|
-
|
|
135
|
-
|
|
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
|
|
136
237
|
}
|
|
137
238
|
```
|
|
138
239
|
|
|
139
|
-
### _tokens.scss
|
|
240
|
+
### _tokens.scss (기존 토큰 참조 + 트리에서 추출)
|
|
140
241
|
|
|
141
242
|
```scss
|
|
142
243
|
// ─── 기존 토큰 참조 (프로젝트에 이미 있는 경우) ───
|
|
143
|
-
// project-tokens.json 매칭 결과에 따라 @use로 참조
|
|
144
244
|
@use '../../styles/variables' as v;
|
|
145
245
|
|
|
146
246
|
// ─── 매핑 (기존 토큰 → 피처 시맨틱 별칭) ────────
|
|
147
|
-
$color-bg-primary: v.$color-navy;
|
|
148
|
-
$color-text-primary: v.$color-white;
|
|
149
|
-
|
|
150
|
-
// ─── 새 토큰 (매칭 안 된 값만 생성) ─────────────
|
|
151
|
-
// 기존 토큰이 없는 프로젝트에서는 아래처럼 전체 생성 (기존 방식)
|
|
247
|
+
$color-bg-primary: v.$color-navy;
|
|
248
|
+
$color-text-primary: v.$color-white;
|
|
152
249
|
|
|
153
|
-
// ───
|
|
154
|
-
$color-
|
|
155
|
-
$color-black: #000000;
|
|
156
|
-
$color-navy-dark: #0a1628;
|
|
157
|
-
$color-navy-medium: #00264a;
|
|
250
|
+
// ─── 새 토큰 (tree.json에서 추출, 기존에 없는 값만) ───
|
|
251
|
+
$color-accent-gold: #ffd700;
|
|
158
252
|
|
|
253
|
+
// ─── 폰트 ─────────────────────────────────────
|
|
159
254
|
$font-pretendard: 'Pretendard', sans-serif;
|
|
160
255
|
|
|
161
|
-
|
|
162
|
-
$
|
|
163
|
-
$
|
|
164
|
-
$
|
|
165
|
-
|
|
166
|
-
$font-weight-regular: 400;
|
|
167
|
-
$font-weight-medium: 500;
|
|
168
|
-
$font-weight-bold: 700;
|
|
169
|
-
|
|
170
|
-
$space-xs: 5px;
|
|
171
|
-
$space-sm: 11px;
|
|
172
|
-
$space-md: 16px;
|
|
173
|
-
$space-lg: 21px;
|
|
174
|
-
|
|
175
|
-
// ─── Semantic (용도별) ────────────────────────
|
|
176
|
-
$color-text-primary: $color-white;
|
|
177
|
-
$color-text-secondary: #dadce3;
|
|
178
|
-
$color-bg-primary: $color-navy-dark;
|
|
179
|
-
$color-bg-section: $color-navy-medium;
|
|
180
|
-
$color-border-primary: #203f6c;
|
|
181
|
-
$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;
|
|
182
261
|
|
|
183
|
-
|
|
184
|
-
// - primitive: 재료함의 고유 값 (hex, 폰트명, px)
|
|
185
|
-
// - semantic: primitive 참조로 용도별 이름
|
|
186
|
-
// - 같은 값 중복 금지 — 기존 토큰 재사용
|
|
262
|
+
$bp-desktop: 1024px;
|
|
187
263
|
```
|
|
188
264
|
|
|
189
265
|
---
|
|
190
266
|
|
|
191
267
|
## 3. 컴포넌트 작성
|
|
192
268
|
|
|
193
|
-
### Vue / Nuxt 예시
|
|
269
|
+
### Vue / Nuxt 예시 (트리 기반)
|
|
194
270
|
|
|
195
271
|
```vue
|
|
196
|
-
<!--
|
|
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
|
+
-->
|
|
197
289
|
<template>
|
|
198
290
|
<section class="heroSection">
|
|
291
|
+
<!-- BG: 부모와 동일 크기 + imageRef → 배경 레이어 -->
|
|
199
292
|
<div class="heroBg">
|
|
200
|
-
<img src="/images/{feature}/bg.
|
|
293
|
+
<img src="/images/{feature}/hero-bg.png" alt="" aria-hidden="true" />
|
|
201
294
|
</div>
|
|
202
295
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
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>
|
|
207
305
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
</
|
|
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>
|
|
215
319
|
</div>
|
|
216
320
|
</div>
|
|
217
321
|
</div>
|
|
218
322
|
|
|
323
|
+
<!-- BTN_Share: flex, borderRadius:500px → 버튼으로 승격 -->
|
|
219
324
|
<button class="heroShareBtn" @click="handleShare">
|
|
220
|
-
<img src="/images/{feature}/share.
|
|
325
|
+
<img src="/images/{feature}/share-icon.png" alt="공유하기" class="heroShareIcon" />
|
|
221
326
|
</button>
|
|
222
327
|
</section>
|
|
223
328
|
</template>
|
|
224
329
|
|
|
225
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
|
+
|
|
226
348
|
defineProps<{
|
|
227
|
-
eventPeriod:
|
|
349
|
+
eventPeriod: EventPeriod
|
|
228
350
|
}>()
|
|
229
351
|
|
|
230
352
|
const emit = defineEmits<{ share: [] }>()
|
|
@@ -248,21 +370,30 @@ function handleShare(): void {
|
|
|
248
370
|
|
|
249
371
|
---
|
|
250
372
|
|
|
251
|
-
## 4. 이미지
|
|
373
|
+
## 4. 이미지 처리 (트리 기반 판별)
|
|
252
374
|
|
|
253
375
|
```
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
배경
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
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
|
|
266
397
|
```
|
|
267
398
|
|
|
268
399
|
---
|
|
@@ -270,16 +401,18 @@ function handleShare(): void {
|
|
|
270
401
|
## 5. 반응형 추가 (데스크탑 URL)
|
|
271
402
|
|
|
272
403
|
```
|
|
273
|
-
두 번째 URL의
|
|
404
|
+
두 번째 URL의 tree.json을 확보한 후:
|
|
274
405
|
|
|
275
|
-
|
|
406
|
+
모바일 tree vs 데스크탑 tree 비교:
|
|
407
|
+
동일한 name의 노드를 매칭
|
|
408
|
+
CSS 속성 차이만 @media 오버라이드로 추가
|
|
276
409
|
|
|
277
410
|
같은 값 → 유지
|
|
278
|
-
다른 px 값 → @include pc {
|
|
411
|
+
다른 px 값 → @include pc { width: {desktop값 × pcScaleFactor}px; }
|
|
279
412
|
다른 레이아웃 → @include pc { flex-direction: row; }
|
|
280
|
-
다른
|
|
413
|
+
다른 이미지 → @include pc { content: url(/images/{feature}/desktop-xxx.png); }
|
|
281
414
|
|
|
282
|
-
기존 코드 삭제 금지.
|
|
415
|
+
기존 모바일 코드 삭제 금지.
|
|
283
416
|
```
|
|
284
417
|
|
|
285
418
|
---
|
|
@@ -287,12 +420,36 @@ function handleShare(): void {
|
|
|
287
420
|
## 6. Semantic HTML 규칙
|
|
288
421
|
|
|
289
422
|
```
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
-
|
|
293
|
-
-
|
|
294
|
-
-
|
|
295
|
-
-
|
|
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> (순차, 건너뛰기 금지)
|
|
296
432
|
- 장식 이미지: alt="" + aria-hidden="true"
|
|
297
433
|
- 콘텐츠 이미지: alt="설명적 텍스트"
|
|
298
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
|
+
```
|