feat: 카드뉴스 포스트(관리자 admin/, /v1/card API, 피드 이미지 슬라이드), 인스타 홍보 기획 문서
This commit is contained in:
1 parent
96cbd19c61
commit
739a8c59eb
107 files changed
+17684
-19
No files matched your search
@@ -0,0 +1,28 @@
|
||||
import type { CardData } from './data'
|
||||
import { gakArt } from './gaks'
|
||||
import { hasTarotBg } from './templates'
|
||||
import { ootdBand, ootdOutfits } from './ootd'
|
||||
import type { Copy } from './templates'
|
||||
|
||||
export type ImageNeed = { kind: string; ids: string[] }
|
||||
|
||||
/** 이 카드에 필요한 그림 중 아직 없는 것 (all 이면 전부). kind 는 image-prompts/<kind>.json, 그날 필요한 것만 Codex로 만든다. 타로는 그날 뽑힌 각 카드 그림 */
|
||||
export function neededImages(templateId: string, d: CardData, copy: Copy, all = false): ImageNeed[] {
|
||||
if (templateId === 'ootd') {
|
||||
const style = copy.style || 'casual'
|
||||
const band = ootdBand(d.maxC).id
|
||||
const ids = ootdOutfits(d.maxC, style)
|
||||
.filter((o) => all || !o.image)
|
||||
.map((o) => `${band}-${o.persona}-${style}`)
|
||||
return ids.length ? [{ kind: 'ootd', ids }] : []
|
||||
}
|
||||
if (templateId === 'tarot') {
|
||||
const out: ImageNeed[] = []
|
||||
const ids = ['c1', 'c2', 'c3'].map((k) => copy[k]).filter((id) => id && (all || !gakArt(id)))
|
||||
if (ids.length) out.push({ kind: 'gak-card', ids })
|
||||
// 대주제 배경은 한 번만 만들고 다시 쓴다
|
||||
if (copy.skin && (all || !hasTarotBg(copy.skin))) out.push({ kind: 'tarot-bg', ids: [copy.skin] })
|
||||
return out
|
||||
}
|
||||
return []
|
||||
}
|
||||
Reference in new issue
Block a user