Compare commits

..
21 changed files with 79 additions and 24 deletions

No files matched your search

+4
View File
@@ -292,6 +292,10 @@
| [x] | 코디 카드 매일 다르게 — 고정 옷 데이터 대신 무신사 스냅 공개 API에서 오늘 구간 인기 코디를 사람별(40대~ 단정 태그 우선)로 골라 Claude가 옷 목록 추출, Codex가 참고 사진 첨부로 플랫레이 생성(`npm run card -- ootd --daily`, `/daily-cards`). 10/26 4장 검수 통과. 에이블리는 공개 API 없음(앱 전용)이라 미사용 | 사용자 요청 (10/26) | `admin/scripts/daily-ootd.mjs`, `snap.mjs`, `outfit.mjs`, `codex-image.mjs` |
| [x] | 10/26 세미정장 코디(그날 코디 첫 게시) — 킹서버 카드 12→포스트 4275, 인스타 https://www.instagram.com/p/De8O2kqATrl/. 무신사 스냅 4개 참고, 4장 1:1 검수 | 사용자 요청 (10/26) | `admin/scripts/daily-ootd.mjs` |
| [x] | 10/26 몸 컨디션 타로(건강: 등산각·자전거각·산책각) — 킹서버 카드 13→포스트 4276, 인스타 https://www.instagram.com/p/De8Zw7MIEVW/. 기획에서 3번 산책각 비 시점 틀린 것 피드백으로 고침. card.mjs --post-wait 가 ECONNRESET 으로 두 번 실패해 post-king.py 로 저장 | 사용자 요청 (10/26) | `admin/scripts/card.mjs` |
| [x] | 10/27 계좌 타로(철회: 경제와 무관한 각이라는 피드백, 포스트 4587 숨김 필요·인스타 앱에서 삭제 필요 / 경제 주식: 멍뭉산책각·꽃구경각·사진산책각) — 킹서버 카드 14→포스트 4587, 인스타 https://www.instagram.com/p/De-eiqPgZ7K/. 검수에서 2번 예보에 없는 바람 문구 빼고, 3번 '해 질 녘 8도'를 '저녁 6시 10도'로 고침, 5번 장식 점이 아래 문구를 가려 위로 옮김. card.mjs --post-wait 는 또 ECONNRESET 이라 post-king.py 로 저장 | 사용자 요청 (10/27) | `admin/scripts/card.mjs` |
| [x] | 10/27 계좌 타로 다시(경제 전용 카드: 분할매수각·적금각·배당각) — 킹서버 카드 20→포스트 4590, 인스타 https://www.instagram.com/p/De-p3dygf1K/. 경제 전용 카드 10장(`admin/money-deck.json`, 그림 `gak-card/money_*.webp`) 새로 만듦, 경제 주제는 이 카드에서 오늘 날씨에 맞는 3장을 고름 | 사용자 요청 (10/27) | `admin/money-deck.json`, `admin/scripts/plan.mjs` |
| [x] | 10/27 스트릿 코디(철회: 겉옷 없는 사람 2명·남성적이라는 피드백, 포스트 4588 숨김 필요·인스타 앱에서 삭제 필요) — 킹서버 카드 16→포스트 4588, 인스타 https://www.instagram.com/p/De-hDoVge1N/. 참고 스냅 f20 https://www.musinsa.com/snap/1554718501896708736 · m20 https://www.musinsa.com/snap/1561558258020785611 · f40 https://www.musinsa.com/snap/1552178778683619999 · m40 https://www.musinsa.com/snap/1549383828670555308. 사용자 요청으로 옷은 스냅에 태그된 무신사 상품만(사진에만 보이는 f20 레드 니트집업·m40 백팩 뺌). 에이블리는 공개 API 없음. 카드 15(고치기 전)는 승인 대기로 남음. 인스타 게시 API가 'Application request limit reached'를 돌려줬지만 실제 게시는 됨 | 사용자 요청 (10/27) | `admin/scripts/outfit.mjs`, `snap.mjs` |
| [x] | 10/27 캐주얼 코디(스트릿 대체) — 킹서버 카드 19→포스트 4589, 인스타 https://www.instagram.com/p/De-oLGagZRB/. 참고 스냅 f20 https://www.musinsa.com/snap/1555508873710779888 · m20 https://www.musinsa.com/snap/1555156725005269012 · f40 https://www.musinsa.com/snap/1555157672544679299 · m40 https://www.musinsa.com/snap/1552193811640384198. 구간을 아침 체감·낮 최고 평균으로 정해 chilly, 쌀쌀한 날 겉옷 필수·미니·뮬/슬링백 제외, 여자 코디는 고프코어 감점. 카드 15·16·17·18은 버린 판 | 사용자 요청 (10/27) | `admin/scripts/snap.mjs`, `daily-ootd.mjs` |
| [x] | 각 카드 그림 미리 생성 — 가을에 나올 만한 28장(피크닉·캠핑·놀이공원·빨래·단풍·억새·테니스·골프·군고구마·붕어빵·군밤·사진산책·별보기·환기·세차·이불빨래·데이트·치맥·막걸리·파전·우산·넷플릭스·집콕·한강밤바람·멍뭉산책·센치·감성노래·낚시) + 기존 8 = 36/68. 여름·한겨울 전용 32장은 철 되면 생성 | 사용자 요청 (10/26) | `admin/src/assets/gak-card/` |
| [ ] | 카드 자동화 다음 단계 — ① 생성 직후 자동 검사(Claude 비전: 옷 개수·사람·글자·추가 옷, 불합격 1회 재생성) ② 승인 대기 카드 메일/Teams 알림 + 서명 토큰 승인 링크(`GET /v1/card/{id}/approve`) ③ 맥 launchd 매일 06:30 `claude -p "/daily-cards"` ④ 그림 세트가 차면 킹서버로 이전 | 사용자 요청 (10/26) | `backend/router/v1/card/card.py`, `admin/scripts/` |
| [ ] | 앱 헤더가 400~448px 폭에서 컨테이너를 넘쳐 로그인 버튼이 잘림(`frontend/src/b/BLayout.tsx` TopBar). 캡처는 456px로 찍어 피했지만 실제 폰(430·440px)에서도 잘릴 수 있음 | 10/24 캡처 중 발견 | `frontend/src/b/BLayout.tsx` |
+15
View File
@@ -0,0 +1,15 @@
{
"about": "경제(주식·재테크) 타로 전용 카드. topics.json 에서 deck 이 money 인 대주제는 날씨각 각 대신 이 카드에서 오늘 날씨(when)에 맞는 3장을 고른다. 그림은 src/assets/gak-card/<code>.webp (npm run gen-image -- gak-card <code>).",
"cards": [
{ "code": "money_bull", "name": "불장각", "icon": "sun", "description": "맑고 따뜻해 마음이 들뜨는 날, 덩달아 사고 싶어지는 정도", "when": "하루 종일 맑고 낮이 따뜻한 날(낮 최고 20도 안팎 이상)", "scene": "the rabbit and bear cheering on top of a big glossy RED upward arrow shaped like a hill, bright sunny sky, a few gold coins bouncing around" },
{ "code": "money_hold", "name": "존버각", "icon": "umbrella", "description": "흐리거나 비 오는 날, 팔지 않고 버티기 좋은 정도", "when": "흐리거나 비 소식이 있는 날", "scene": "the bear sitting firmly on a small pile of gold coins holding an umbrella in gentle rain, calm and determined, the rabbit hugging the bear's arm" },
{ "code": "money_split", "name": "분할매수각", "icon": "sun_cloud", "description": "아침저녁과 낮 기온 차가 큰 날, 한 번에 말고 나눠 사기 좋은 정도", "when": "아침·저녁과 낮의 기온 차가 큰 날(7도 이상)", "scene": "the rabbit carefully dropping one gold coin at a time into three small glass jars lined up in a row, morning light on one side and noon light on the other" },
{ "code": "money_takeprofit", "name": "익절각", "icon": "gold", "description": "맑은 낮, 오른 만큼 챙겨 두기 좋은 정도", "when": "낮이 맑은 날(가장 따뜻한 시간대)", "scene": "the rabbit picking shiny golden coin-fruits from a small tree at bright noon and handing them to the bear who holds a basket" },
{ "code": "money_stoploss", "name": "손절각", "icon": "coldwind", "description": "기온이 뚝 떨어지거나 바람이 찬 날, 미련을 끊기 좋은 정도", "when": "어제보다 기온이 크게 떨어지거나 바람이 차가운 날", "scene": "the bear calmly snipping the string of a drooping balloon with small scissors while the rabbit waves goodbye, cool wind with a few falling leaves" },
{ "code": "money_watch", "name": "관망각", "icon": "jipkok", "description": "나가기 싫은 날, 사고팔기보다 지켜보기 좋은 정도", "when": "춥거나 흐려서 집에 있고 싶은 날", "scene": "the rabbit and bear wrapped in a blanket on a sofa, looking out the window through a toy binocular at rolling hills shaped like a gentle zigzag line" },
{ "code": "money_avgdown", "name": "물타기각", "icon": "rain", "description": "비 오는 날, 평단 낮추기를 신중히 따져 볼 정도", "when": "비가 오는 날", "scene": "the bear carefully watering a small potted plant whose leaves are gold coins with a little watering can while light rain falls outside, the rabbit holding a tiny umbrella over the pot" },
{ "code": "money_dividend", "name": "배당각", "icon": "sunset", "description": "해가 일찍 지는 가을·겨울 저녁, 따박따박 쌓이는 돈이 반가운 정도", "when": "가을·겨울의 맑은 저녁(해 질 녘)", "scene": "at sunset the rabbit and bear holding a basket under a tree that gently drops gold coins like acorns, warm orange sky" },
{ "code": "money_savings", "name": "적금각", "icon": "bronze", "description": "쌀쌀하고 맑은 아침, 꾸준히 넣기 좋은 정도", "when": "아침이 쌀쌀하고(체감 10도 안팎 이하) 맑은 날", "scene": "in a crisp clear morning the rabbit wearing a small scarf dropping a plain gold coin (no symbols or marks) into a cute pastel piggy bank while the bear watches with a mug" },
{ "code": "money_broke", "name": "텅장각", "icon": "delivery", "description": "비나 추위에 배달이 몰리는 날, 지출을 조심할 정도", "when": "비가 오거나 아주 추워 배달 주문이 몰리는 날", "scene": "the bear sitting among a stack of delivery food boxes holding an empty open wallet upside down, the rabbit peeking in surprised" }
]
}
+6 -3
View File
@@ -22,8 +22,11 @@ export async function weatherToday() {
const day = withTemp.filter((s) => hour(s) >= 6 && hour(s) <= 21)
const t = day.length ? day : withTemp
const maxC = Math.round(Math.max(...t.map((s) => s.temp_c)))
const morningC = Math.round((t.find((s) => hour(s) === 6) ?? t[0]).temp_c)
const band = spec.bands.find((b) => maxC >= b.from) ?? spec.bands[spec.bands.length - 1]
const morning = t.find((s) => hour(s) === 6) ?? t[0]
const morningC = Math.round(morning.temp_c)
// 낮 최고만 보면 아침·저녁 추위를 놓친다: 아침 체감과 낮 최고의 평균으로 구간을 정한다
const feelC = ((morning.feels_c ?? morning.temp_c) + maxC) / 2
const band = spec.bands.find((b) => feelC >= b.from) ?? spec.bands[spec.bands.length - 1]
return { day: d.day, morningC, maxC, band: band.id, layering: band.layering ?? '' }
}
@@ -38,7 +41,7 @@ function layoutFor(slots) {
return `top row: ${topRow}; bottom row: ${bottomRow}. Clearly separate spots, nothing else in between.`
}
function buildPrompt(persona, outfit, weather) {
export function buildPrompt(persona, outfit, weather) {
const by = Object.fromEntries(outfit.items.map((it) => [it.slot, it]))
const drawn = DRAW_ORDER.filter((s) => by[s])
const items = drawn.map((s, i) => `(${i + 1}) ${by[s].prompt}${s === 'outer' ? ' as the outer layer' : ''}`).join(', ')
+2 -1
View File
@@ -21,7 +21,8 @@ const spec = JSON.parse(readFileSync(promptFile, 'utf8'))
// 각 카드는 그림 목록을 따로 적지 않고 서비스의 각 목록에서 만든다
if (spec.deck === 'gak') {
const defs = JSON.parse(readFileSync(resolve('../backend/seed/index_definition.json'), 'utf8'))
spec.items = defs.map((g) => ({ id: g.code, motif: spec.scene.replaceAll('{name}', g.name).replaceAll('{meaning}', g.description), name: g.name, meaning: g.description }))
const money = JSON.parse(readFileSync(resolve('money-deck.json'), 'utf8')).cards
spec.items = [...defs, ...money].map((g) => ({ id: g.code, motif: (g.scene ?? spec.scene).replaceAll('{name}', g.name).replaceAll('{meaning}', g.description), name: g.name, meaning: g.description }))
}
const outDir = resolve(`src/assets/${kind}`)
mkdirSync(outDir, { recursive: true })
+3 -2
View File
@@ -43,9 +43,10 @@ function buildPrompt(pick, persona, weather) {
goods,
'',
'규칙:',
'- 자리(slot)는 top·bottom·shoes 는 반드시, 사진에서 겉옷(outer)을 입거나 걸쳤으면 outer 도, 가방이 있으면 bag 도 넣는다. 최대 5개, 자리마다 하나.',
'- 태그된 상품에 있는 옷만 넣는다. 사진에 보여도 상품 목록에 없는 옷·가방은 넣지 않는다.',
'- 자리(slot)는 top·bottom·shoes 는 반드시, 상품 목록에 겉옷이 있으면 outer 도, 가방이 있으면 bag 도 넣는다. 최대 5개, 자리마다 하나.',
'- 원피스면 top 으로 넣고 bottom 은 생략하지 말고 같은 원피스를 bottom 에 다시 넣지 않는다 → 원피스는 top, bottom 자리에는 사진의 다른 하의가 없으면 shoes·bag 으로 4개를 채운다.',
'- 상품 목록에 있는 옷은 그 상품명 기준으로, 없는 옷은 사진에서 보이는 대로. 색은 사진 기준.',
'- 옷 이름은 상품명 기준, 색은 사진 기준.',
'- label 은 카드 이름표라 짧고 쉬운 한글(브랜드·영어 금지). prompt 는 영어 한 구절, 색은 대문자.',
'- style 은 코디 분위기 한 단어.',
'JSON 으로만 답한다.',
+29 -9
View File
@@ -20,6 +20,10 @@ const questionOf = (topic) => {
}
// 날씨 타로 카드 = 날씨각 각 카드 (서비스와 같은 각 목록)
const DECK = JSON.parse(readFileSync(resolve(import.meta.dirname, '../../backend/seed/index_definition.json'), 'utf8')).map((g) => ({ id: g.code, name: g.name, icon: g.icon, meaning: g.description }))
// 경제 전용 카드: topics.json 에서 deck 이 money 인 대주제는 이 카드에서만 고른다
const MONEY_DECK = JSON.parse(readFileSync(resolve(import.meta.dirname, '../money-deck.json'), 'utf8')).cards.map((g) => ({ id: g.code, name: g.name, icon: g.icon, meaning: g.description, when: g.when }))
const ALL_CARDS = [...DECK, ...MONEY_DECK]
const deckOf = (topic) => (categoryOf(topic ?? '')?.deck === 'money' ? MONEY_DECK : DECK)
// 최근에 쓴 각은 빼서 매일 같은 카드가 나오지 않게 한다 (card.mjs 가 기획할 때마다 적는다)
const HISTORY_FILE = resolve(import.meta.dirname, '../out/tarot-history.json')
const HISTORY_DAYS = 7
@@ -43,7 +47,7 @@ const RULES = [
'카드에 들어가야 하니 칸마다 지금 문구와 비슷한 길이(최대 1.3배)로 쓴다(날씨 타로 리딩은 아래 길이 규칙을 따른다). 줄바꿈은 " ⏎ "로 표시하고, 개수를 지금 문구와 맞춘다.',
'강조할 말은 *별표*로 감싼다. 지금 문구에 별표가 있으면 같은 자리에 둔다.',
`아이콘 칸(i1·i2·i3)은 다음 중 하나의 파일 이름만 쓴다: ${ICONS.join(', ')}`,
'쓰지 않는 것: 투자 권유(종목, 매수·매도, 수익·손실 단정), 건강·의료 단정, 사고·재난·정치, 특정 집단 비하, 욕설.',
'쓰지 않는 것: 투자 권유(종목 추천, 수익·손실 단정), 건강·의료 단정, 사고·재난·정치, 특정 집단 비하, 욕설.',
'"재미로"라는 말이 지금 문구에 있으면 남긴다.',
'주제가 있으면 제목·카드 이름·문장을 모두 그 주제의 말로 바꾼다. 오늘 날씨 사실은 주제에 빗대는 근거로만 쓴다.',
'날씨각의 각 요약 문장("오전 10시 14°, 바람 조금")을 그대로 옮기지 않는다. 날씨 사실은 쉬운 말로 다시 쓴다.',
@@ -69,15 +73,18 @@ const TAROT_TONE = [
'키워드(k)는 4~8자 명사구("같이 걷는 시간", "먼저 보내는 한 줄"). 행운 포인트(l)는 시간·날씨·행동 한 줄 22자 이내("저녁 8시, 17도로 걷기 딱 좋아요").',
]
/** 오늘 고를 수 있는 각: 최근 7일에 쓴 각은 뺀다 (관리자가 고정한 카드는 남긴다) */
function availableDeck(fixed = {}) {
/** 오늘 고를 수 있는 각: 최근 7일에 쓴 각은 뺀다 (관리자가 고정한 카드는 남긴다). 경제 카드는 10장뿐이라 날씨로만 고른다 */
function availableDeck(fixed = {}, topic = '') {
const deck = deckOf(topic)
if (deck === MONEY_DECK) return deck
const recent = new Set(recentCodes())
const keep = new Set(fixed.cards ?? [])
return DECK.filter((c) => !recent.has(c.id) || keep.has(c.id))
return deck.filter((c) => !recent.has(c.id) || keep.has(c.id))
}
function tarotSection(topic, fixed = {}) {
const deck = availableDeck(fixed)
const deck = availableDeck(fixed, topic)
if (deck === MONEY_DECK) return moneySection(topic)
const excluded = DECK.filter((c) => !deck.includes(c)).map((c) => c.name)
return [
'',
@@ -91,6 +98,19 @@ function tarotSection(topic, fixed = {}) {
]
}
function moneySection(topic) {
return [
'',
'## 경제 카드 (이 목록에서만 고른다. card1·card2·card3에 서로 다른 code)',
`표지 질문(question)은 이것을 쓴다(피드백이 바꾸라고 하면 바꾼다): ${questionOf(topic)}`,
'각 카드의 "어울리는 날씨"가 오늘 날씨 데이터와 맞는 카드만 고른다. 맞는 카드가 많으면 더 잘 맞는 것, 아침·낮·저녁으로 이어지는 것을 고른다. 날씨와 안 맞는 카드는 고르지 않는다.',
'리딩은 카드 이름(불장·존버·분할매수·익절·손절·관망·물타기·배당·적금·텅장)의 뜻을 주식·돈 관리 이야기로 직접 풀고, 오늘 날씨를 그 근거로 든다. 산책·꽃구경 같은 날씨 활동 이야기로 새지 않는다. 종목 추천·수익 단정은 하지 않는다.',
...TAROT_TONE,
'',
...MONEY_DECK.map((c) => `- ${c.id}: ${c.name} — ${c.meaning} / 어울리는 날씨: ${c.when}`),
]
}
function buildPrompt(ctx, { topic, feedback, fixed = {} }) {
// 줄바꿈은 ⏎ 로 보여 주고 받을 때 되돌린다 (JSON 안의 \\n 을 글자로 따라 쓰는 일을 막는다)
const fields = ctx.fields.map((f) => `- ${f.key} (${f.label}): ${String(ctx.current[f.key] ?? '').replaceAll('\n', ' ⏎ ')}`).join('\n')
@@ -116,16 +136,16 @@ function buildPrompt(ctx, { topic, feedback, fixed = {} }) {
].join('\n')
}
function schema(ctx, fixed = {}) {
function schema(ctx, fixed = {}, topic = '') {
const properties = { topic: { type: 'string' } }
for (const f of ctx.fields) if (!(isTarot(ctx) && DECK_KEY.test(f.key))) properties[f.key] = { type: 'string' }
if (isTarot(ctx)) for (const k of ['card1', 'card2', 'card3']) properties[k] = { type: 'string', enum: availableDeck(fixed).map((c) => c.id) }
if (isTarot(ctx)) for (const k of ['card1', 'card2', 'card3']) properties[k] = { type: 'string', enum: availableDeck(fixed, topic).map((c) => c.id) }
return { type: 'object', properties, required: Object.keys(properties), additionalProperties: false }
}
/** @returns {Promise<{ topic: string, copy: Record<string, string> }>} */
export function runPlan(ctx, { topic = '', feedback = '', fixed = {} } = {}) {
const args = ['-p', buildPrompt(ctx, { topic, feedback, fixed }), '--output-format', 'json', '--json-schema', JSON.stringify(schema(ctx, fixed)), '--tools', '', '--no-session-persistence', '--model', 'sonnet']
const args = ['-p', buildPrompt(ctx, { topic, feedback, fixed }), '--output-format', 'json', '--json-schema', JSON.stringify(schema(ctx, fixed, topic)), '--tools', '', '--no-session-persistence', '--model', 'sonnet']
return new Promise((done, fail) => {
execFile('claude', args, { cwd: tmpdir(), timeout: 180_000, maxBuffer: 10 * 1024 * 1024 }, (err, stdout) => {
if (err) return fail(new Error(`Claude CLI 실행 실패: ${err.message}. 터미널에서 claude 로그인 상태를 확인하세요.`))
@@ -142,7 +162,7 @@ export function runPlan(ctx, { topic = '', feedback = '', fixed = {} } = {}) {
if (fixed.question) result.question = fixed.question
fixed.cards?.forEach((code, i) => (result[`card${i + 1}`] = code))
;['card1', 'card2', 'card3'].forEach((k, i) => {
const card = DECK.find((c) => c.id === result[k])
const card = ALL_CARDS.find((c) => c.id === result[k])
if (card) Object.assign(result, { [`c${i + 1}`]: card.id, [`n${i + 1}`]: card.name, [`i${i + 1}`]: card.icon })
})
}
+15 -6
View File
@@ -36,15 +36,17 @@ export const PERSONAS = {
const HEAVY = /패딩|푸퍼|다운|롱코트|울코트|무스탕|플리스|기모|헤비|퍼 /i
const MID = /코트|자켓|재킷|점퍼|블루종|집업/i
const SHORTS = /쇼츠|반바지|shorts|숏팬츠|버뮤다/i
const OPEN_SHOES = /뮬|슬링백|샌들|슬리퍼|mule|slingback|sandal/i
const MINI = /미니 ?(스커트|드레스|원피스)|mini (skirt|dress)/i
const SHORT_SLEEVE = /반팔|하프 슬리브|half sleeve|슬리브리스|민소매|sleeveless/i
const BAND = {
hot: { tags: ['여름코디', '간절기코디'], rejectGoods: [HEAVY, MID], rejectTags: [/겨울|패딩|코트/] },
warm: { tags: ['간절기코디', '가을코디'], rejectGoods: [HEAVY, MID], rejectTags: [/겨울|패딩|코트/] },
mild: { tags: ['가을코디', '간절기코디'], rejectGoods: [HEAVY, SHORTS], rejectTags: [/겨울|패딩/] },
cool: { tags: ['가을코디', '가을아우터'], rejectGoods: [HEAVY, SHORTS, SHORT_SLEEVE], rejectTags: [/겨울/] },
chilly: { tags: ['가을코디', '겨울코디'], rejectGoods: [/롱패딩|헤비/, SHORTS, SHORT_SLEEVE], rejectTags: [] },
cold: { tags: ['겨울코디'], rejectGoods: [SHORTS, SHORT_SLEEVE], rejectTags: [/여름|반팔/] },
freezing: { tags: ['겨울코디', '롱패딩'], rejectGoods: [SHORTS, SHORT_SLEEVE], rejectTags: [/여름|반팔|가을/] },
cool: { needOuter: true, tags: ['가을코디', '가을아우터'], rejectGoods: [HEAVY, SHORTS, SHORT_SLEEVE], rejectTags: [/겨울/] },
chilly: { needOuter: true, tags: ['가을코디', '겨울코디'], rejectGoods: [MINI, OPEN_SHOES, /롱패딩|헤비/, SHORTS, SHORT_SLEEVE], rejectTags: [] },
cold: { needOuter: true, tags: ['겨울코디'], rejectGoods: [MINI, OPEN_SHOES, SHORTS, SHORT_SLEEVE], rejectTags: [/여름|반팔/] },
freezing: { needOuter: true, tags: ['겨울코디', '롱패딩'], rejectGoods: [MINI, OPEN_SHOES, SHORTS, SHORT_SLEEVE], rejectTags: [/여름|반팔|가을/] },
}
// 철 지난 스냅은 뺀다
const MAX_AGE_DAYS = 45
@@ -141,6 +143,7 @@ function fits(snap, band) {
const slots = new Set(snap.goods.map((g) => g.slot))
const hasTop = slots.has('top') || slots.has('onepiece')
const hasBottom = slots.has('bottom') || slots.has('onepiece')
if (rule.needOuter && !slots.has('outer')) return false
return hasTop && hasBottom && slots.has('shoes') && !!snap.image
}
@@ -154,6 +157,12 @@ function score(snap, persona) {
if (goods.some((g) => /슬랙스|로퍼|니트|블라우스|코트|자켓|재킷|셔츠/.test(g.name + g.category2))) s += 0.5
if (goods.some((g) => /카고|후드|조거|스웨트/.test(g.name + g.category2))) s -= 1
} else if (MATURE_TAG.test(tagBlob) && !/꾸안꾸|데일리/.test(tagBlob)) s -= 0.3
// 여자 코디는 남성적인 고프코어보다 여성스러운 쪽을 고른다
if (PERSONAS[persona].gender === 'WOMEN') {
if (/페미닌|러블리|걸리시|여리여리|하객룩|오피스룩/.test(tagBlob)) s += 1
if (goods.some((g) => /블라우스|가디건|스커트|원피스|로퍼|플랫|메리제인|니트/.test(g.name + g.category2))) s += 0.7
if (goods.some((g) => /카고|백팩|트레일|고프코어|바람막이/.test(g.name + g.category2)) || /고프코어/.test(tagBlob)) s -= 1.5
}
return s
}
@@ -170,7 +179,7 @@ export async function pickSnaps({ band, style, outDir, pages = 2, log = console.
const styleTags = STYLE_TAGS[style] ?? []
const pool = new Map()
const add = (list) => list.forEach((s) => s.goodsNos.length >= 3 && !pool.has(s.id) && pool.set(s.id, s))
for (const tag of styleTags) add(await listSnaps({ tags: tag }, pages))
for (const tag of styleTags) add(await listSnaps({ tags: tag }, pages * 3))
for (const tag of rule.tags) add(await listSnaps({ tags: tag }, pages))
for (const gender of ['WOMEN', 'MEN']) for (const kw of MATURE_KEYWORDS[gender]) add(await listSnaps({ keyword: kw }, 1))
const hasStyle = (s) => styleTags.length === 0 || s.tags.some((t) => styleTags.some((st) => t.includes(st)))
@@ -186,7 +195,7 @@ export async function pickSnaps({ band, style, outDir, pages = 2, log = console.
const candidates = [...pool.values()]
.filter((s) => s.gender === gender && !used.has(s.id))
.sort((a, b) => Number(hasStyle(b)) - Number(hasStyle(a)) || score(b, persona) - score(a, persona))
.slice(0, 25)
.slice(0, 60)
let best = null
for (const c of candidates) {
const full = c.goods ? c : await withGoods(c)
Binary file not shown.

After

Width:  |  Height:  |  Size: 313 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 KiB

+1 -1
View File
@@ -334,7 +334,7 @@
.slide .deco.d3 { left: 58px; top: 905px; width: 26px; height: 26px; background: var(--blue); }
.slide .deco.d4 { right: 64px; top: 880px; width: 32px; height: 32px; }
.slide .deco.d5 { left: 330px; top: 1160px; width: 24px; height: 24px; background: var(--blue); }
.slide .deco.d6 { right: 330px; top: 1175px; width: 28px; height: 28px; }
.slide .deco.d6 { right: 330px; top: 1148px; width: 28px; height: 28px; }
.slide[data-skin='heart'] :is(.sparkle, .deco) {
clip-path: none;
+3 -2
View File
@@ -1,8 +1,9 @@
import defs from '../../../backend/seed/index_definition.json'
import money from '../../money-deck.json'
/** 날씨 타로 카드 덱 = 날씨각 각 카드 (서비스와 같은 목록) */
/** 날씨 타로 카드 덱 = 날씨각 각 카드 (서비스와 같은 목록) + 경제 전용 카드(money-deck.json) */
export type GakCard = { code: string; name: string; icon: string; meaning: string }
export const GAK_DECK: GakCard[] = defs.map((g) => ({ code: g.code, name: g.name, icon: g.icon, meaning: g.description }))
export const GAK_DECK: GakCard[] = [...defs, ...money.cards].map((g) => ({ code: g.code, name: g.name, icon: g.icon, meaning: g.description }))
export const gakByCode = (code?: string) => GAK_DECK.find((g) => g.code === code)
// 각 카드 앞면 그림 (Codex, npm run gen-image -- gak-card <code>). 없으면 각 아이콘
+1
View File
@@ -25,6 +25,7 @@
"id": "money",
"name": "경제",
"skin": "coin",
"deck": "money",
"subtopics": [
"주식",
"재테크",