kasaframe 0.0.0-stage → 0.1.1

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.
Files changed (338) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE +146 -0
  3. package/README.md +77 -2
  4. package/app/package.json +12 -0
  5. package/app/server/engine.ts +415 -0
  6. package/app/server/main.ts +205 -0
  7. package/app/web/env.d.ts +2 -0
  8. package/app/web/icons.ts +31 -0
  9. package/app/web/index.html +21 -0
  10. package/app/web/main.ts +1013 -0
  11. package/app/web/style.css +430 -0
  12. package/bin/hooks.mjs +51 -0
  13. package/bin/kf.mjs +14 -0
  14. package/docs/AGENTS.md +238 -0
  15. package/music/README.md +13 -0
  16. package/package.json +44 -4
  17. package/packages/adapters/package.json +36 -0
  18. package/packages/adapters/src/css.ts +11 -0
  19. package/packages/adapters/src/gsap.ts +26 -0
  20. package/packages/adapters/src/index.ts +9 -0
  21. package/packages/adapters/src/lottie.ts +22 -0
  22. package/packages/adapters/src/media.ts +59 -0
  23. package/packages/adapters/src/page.ts +229 -0
  24. package/packages/adapters/src/project.ts +214 -0
  25. package/packages/adapters/src/react.ts +36 -0
  26. package/packages/adapters/src/svelte.ts +22 -0
  27. package/packages/adapters/src/three.ts +18 -0
  28. package/packages/adapters/src/vue.ts +27 -0
  29. package/packages/check/package.json +19 -0
  30. package/packages/check/src/check.ts +273 -0
  31. package/packages/check/src/cli.ts +70 -0
  32. package/packages/check/src/image.ts +146 -0
  33. package/packages/check/src/index.ts +9 -0
  34. package/packages/check/src/ocr.swift +37 -0
  35. package/packages/check/src/probe.ts +328 -0
  36. package/packages/check/src/report.ts +44 -0
  37. package/packages/check/src/rules/assets.ts +42 -0
  38. package/packages/check/src/rules/beats.ts +212 -0
  39. package/packages/check/src/rules/camera.ts +217 -0
  40. package/packages/check/src/rules/captions.ts +49 -0
  41. package/packages/check/src/rules/flash.ts +235 -0
  42. package/packages/check/src/rules/frames.ts +135 -0
  43. package/packages/check/src/rules/layout.ts +257 -0
  44. package/packages/check/src/rules/page.ts +87 -0
  45. package/packages/check/src/rules/runs.ts +20 -0
  46. package/packages/check/src/rules/text.ts +326 -0
  47. package/packages/check/src/scan.ts +240 -0
  48. package/packages/check/src/serve.ts +67 -0
  49. package/packages/check/src/types.ts +80 -0
  50. package/packages/check/src/video.ts +137 -0
  51. package/packages/cli/package.json +29 -0
  52. package/packages/cli/src/blur.ts +68 -0
  53. package/packages/cli/src/browser.ts +203 -0
  54. package/packages/cli/src/command.ts +44 -0
  55. package/packages/cli/src/commands/app.ts +25 -0
  56. package/packages/cli/src/commands/beats.ts +36 -0
  57. package/packages/cli/src/commands/blender.ts +270 -0
  58. package/packages/cli/src/commands/check.ts +25 -0
  59. package/packages/cli/src/commands/doctor.ts +22 -0
  60. package/packages/cli/src/commands/gen.ts +173 -0
  61. package/packages/cli/src/commands/look.ts +39 -0
  62. package/packages/cli/src/commands/lyrics.ts +111 -0
  63. package/packages/cli/src/commands/make.ts +542 -0
  64. package/packages/cli/src/commands/new.ts +176 -0
  65. package/packages/cli/src/commands/preview.ts +43 -0
  66. package/packages/cli/src/commands/render.ts +216 -0
  67. package/packages/cli/src/commands/setup.ts +63 -0
  68. package/packages/cli/src/commands/sheet.ts +114 -0
  69. package/packages/cli/src/commands/skill.ts +43 -0
  70. package/packages/cli/src/commands/still.ts +40 -0
  71. package/packages/cli/src/commands/theme.ts +85 -0
  72. package/packages/cli/src/commands/transitions.ts +40 -0
  73. package/packages/cli/src/deps.ts +122 -0
  74. package/packages/cli/src/ffmpeg.ts +81 -0
  75. package/packages/cli/src/index.ts +8 -0
  76. package/packages/cli/src/kf.ts +53 -0
  77. package/packages/cli/src/lock.ts +72 -0
  78. package/packages/cli/src/out.ts +13 -0
  79. package/packages/cli/src/serve.ts +124 -0
  80. package/packages/clock/package.json +14 -0
  81. package/packages/clock/src/index.ts +25 -0
  82. package/packages/clock/src/install.ts +351 -0
  83. package/packages/clock/src/types.ts +45 -0
  84. package/packages/core/package.json +9 -0
  85. package/packages/core/src/beats.ts +283 -0
  86. package/packages/core/src/ease.ts +87 -0
  87. package/packages/core/src/frame.ts +99 -0
  88. package/packages/core/src/index.ts +27 -0
  89. package/packages/core/src/project.ts +146 -0
  90. package/packages/core/src/rand.ts +56 -0
  91. package/packages/core/src/spring.ts +52 -0
  92. package/packages/core/src/style.ts +100 -0
  93. package/packages/core/src/time.ts +88 -0
  94. package/packages/gen/PROVIDERS.md +55 -0
  95. package/packages/gen/package.json +9 -0
  96. package/packages/gen/src/generate.ts +204 -0
  97. package/packages/gen/src/image/og.ts +133 -0
  98. package/packages/gen/src/index.ts +18 -0
  99. package/packages/gen/src/keys.ts +60 -0
  100. package/packages/gen/src/media.ts +150 -0
  101. package/packages/gen/src/plan.ts +106 -0
  102. package/packages/gen/src/registry.ts +51 -0
  103. package/packages/gen/src/seam.ts +103 -0
  104. package/packages/gen/src/types.ts +86 -0
  105. package/packages/gen/src/video/fal.ts +140 -0
  106. package/packages/gen/src/video/h3.ts +107 -0
  107. package/packages/gen/src/video/http.ts +44 -0
  108. package/packages/gen/src/video/ltx.ts +60 -0
  109. package/packages/gen/src/video/minimax.ts +55 -0
  110. package/packages/gen/src/video/veo.ts +71 -0
  111. package/packages/jizura/package.json +16 -0
  112. package/packages/jizura/src/deny.ts +73 -0
  113. package/packages/jizura/src/index.ts +7 -0
  114. package/packages/jizura/src/install.ts +226 -0
  115. package/packages/jizura/src/layer.ts +282 -0
  116. package/packages/jizura/src/lyrics.ts +81 -0
  117. package/packages/jizura/src/pin.ts +5 -0
  118. package/packages/jizura/src/vite.ts +36 -0
  119. package/packages/motion/README.md +142 -0
  120. package/packages/motion/package.json +29 -0
  121. package/packages/motion/src/camera.ts +97 -0
  122. package/packages/motion/src/captions.ts +479 -0
  123. package/packages/motion/src/enter.ts +128 -0
  124. package/packages/motion/src/hangul.ts +129 -0
  125. package/packages/motion/src/impact.ts +100 -0
  126. package/packages/motion/src/index.ts +17 -0
  127. package/packages/motion/src/moves/brushWipe.ts +90 -0
  128. package/packages/motion/src/moves/cloneArray.ts +111 -0
  129. package/packages/motion/src/moves/curtains.ts +81 -0
  130. package/packages/motion/src/moves/echoStack.ts +70 -0
  131. package/packages/motion/src/moves/fit.ts +34 -0
  132. package/packages/motion/src/moves/flood.ts +61 -0
  133. package/packages/motion/src/moves/ghostStack.ts +79 -0
  134. package/packages/motion/src/moves/gridFloor.ts +100 -0
  135. package/packages/motion/src/moves/imageSwarm.ts +109 -0
  136. package/packages/motion/src/moves/index.ts +19 -0
  137. package/packages/motion/src/moves/irisBlades.ts +113 -0
  138. package/packages/motion/src/moves/karaokeLine.ts +94 -0
  139. package/packages/motion/src/moves/ledBoard.ts +94 -0
  140. package/packages/motion/src/moves/liquidTab.ts +72 -0
  141. package/packages/motion/src/moves/markerWrite.ts +63 -0
  142. package/packages/motion/src/moves/morphBox.ts +96 -0
  143. package/packages/motion/src/moves/neonSign.ts +77 -0
  144. package/packages/motion/src/moves/panelPop.ts +78 -0
  145. package/packages/motion/src/moves/paperTear.ts +75 -0
  146. package/packages/motion/src/moves/path.ts +64 -0
  147. package/packages/motion/src/moves/pathText.ts +107 -0
  148. package/packages/motion/src/moves/pointSphere.ts +109 -0
  149. package/packages/motion/src/moves/ransomLetters.ts +73 -0
  150. package/packages/motion/src/moves/shapeMorph.ts +143 -0
  151. package/packages/motion/src/moves/slamWords.ts +89 -0
  152. package/packages/motion/src/moves/sparkTrail.ts +114 -0
  153. package/packages/motion/src/moves/speedLines.ts +91 -0
  154. package/packages/motion/src/moves/splitFlap.ts +147 -0
  155. package/packages/motion/src/moves/stepWords.ts +117 -0
  156. package/packages/motion/src/moves/strikeOut.ts +98 -0
  157. package/packages/motion/src/moves/sunburst.ts +58 -0
  158. package/packages/motion/src/moves/tickerRows.ts +87 -0
  159. package/packages/motion/src/moves/tokenPicker.ts +114 -0
  160. package/packages/motion/src/moves/truchet.ts +85 -0
  161. package/packages/motion/src/moves/wordWall.ts +76 -0
  162. package/packages/motion/src/moves/worldRoll.ts +31 -0
  163. package/packages/motion/src/particles.ts +102 -0
  164. package/packages/motion/src/react/index.tsx +21 -0
  165. package/packages/motion/src/react/parts.tsx +431 -0
  166. package/packages/motion/src/react/time.tsx +97 -0
  167. package/packages/motion/src/text.ts +103 -0
  168. package/packages/motion/src/transition.ts +82 -0
  169. package/packages/motion/src/transition3d/cards.ts +65 -0
  170. package/packages/motion/src/transition3d/chain.ts +84 -0
  171. package/packages/motion/src/transition3d/dive.ts +181 -0
  172. package/packages/motion/src/transition3d/fold.ts +110 -0
  173. package/packages/motion/src/transition3d/gl.ts +219 -0
  174. package/packages/motion/src/transition3d/index.ts +228 -0
  175. package/packages/motion/src/transition3d/live.ts +70 -0
  176. package/packages/motion/src/transition3d/portal.ts +115 -0
  177. package/packages/motion/src/transition3d/react.tsx +29 -0
  178. package/packages/motion/src/transition3d/rig.ts +502 -0
  179. package/packages/motion/src/transition3d/shatter.ts +101 -0
  180. package/packages/motion/src/transition3d/whip.ts +65 -0
  181. package/packages/motion/src/transition3d/world.ts +683 -0
  182. package/packages/motion/src/transition3d/zoomOut.ts +114 -0
  183. package/packages/motion/src/transitions2d/catalog.ts +127 -0
  184. package/packages/motion/src/transitions2d/css.d.ts +2 -0
  185. package/packages/motion/src/transitions2d/cult-ui/LICENSE.md +9 -0
  186. package/packages/motion/src/transitions2d/cult-ui/RollingNumber.tsx +43 -0
  187. package/packages/motion/src/transitions2d/gl-transitions/LICENSE +25 -0
  188. package/packages/motion/src/transitions2d/gl-transitions/shaders.ts +1931 -0
  189. package/packages/motion/src/transitions2d/index.ts +2 -0
  190. package/packages/motion/src/transitions2d/kokonutui/LICENSE +21 -0
  191. package/packages/motion/src/transitions2d/kokonutui/MatrixText.css +16 -0
  192. package/packages/motion/src/transitions2d/kokonutui/MatrixText.tsx +94 -0
  193. package/packages/motion/src/transitions2d/magicui/HyperText.css +15 -0
  194. package/packages/motion/src/transitions2d/magicui/HyperText.tsx +115 -0
  195. package/packages/motion/src/transitions2d/magicui/LICENSE.md +21 -0
  196. package/packages/motion/src/transitions2d/magicui/MorphingText.css +25 -0
  197. package/packages/motion/src/transitions2d/magicui/MorphingText.tsx +130 -0
  198. package/packages/motion/src/transitions2d/magicui/WordRotate.tsx +42 -0
  199. package/packages/motion/src/transitions2d/react.ts +13 -0
  200. package/packages/motion/src/transitions2d/skiper-ui/ClipDiv.css +39 -0
  201. package/packages/motion/src/transitions2d/skiper-ui/ClipDiv.tsx +32 -0
  202. package/packages/motion/src/transitions2d/smoothui/LICENSE +21 -0
  203. package/packages/motion/src/transitions2d/smoothui/SharedAxisY.tsx +50 -0
  204. package/packages/motion/src/transitions2d/smoothui/TextMorph.tsx +90 -0
  205. package/packages/motion/src/transitions2d/smoothui/shaders.ts +223 -0
  206. package/packages/motion/src/transitions2d/unlumen/LICENSE +21 -0
  207. package/packages/motion/src/transitions2d/unlumen/ScrambleText.tsx +114 -0
  208. package/packages/motion/src/transitions2d/vengeance-ui/LICENSE +21 -0
  209. package/packages/motion/src/transitions2d/vengeance-ui/MorphText.css +69 -0
  210. package/packages/motion/src/transitions2d/vengeance-ui/MorphText.tsx +45 -0
  211. package/packages/motion/src/type.ts +131 -0
  212. package/packages/motion/src/ui.ts +172 -0
  213. package/packages/plan/package.json +15 -0
  214. package/packages/plan/src/brief.ts +254 -0
  215. package/packages/plan/src/captions.ts +75 -0
  216. package/packages/plan/src/detect.ts +93 -0
  217. package/packages/plan/src/index.ts +23 -0
  218. package/packages/plan/src/layout.ts +176 -0
  219. package/packages/plan/src/llm.ts +110 -0
  220. package/packages/plan/src/look.ts +220 -0
  221. package/packages/plan/src/plan.ts +125 -0
  222. package/packages/plan/src/request.ts +55 -0
  223. package/packages/plan/src/studio.ts +53 -0
  224. package/packages/plan/src/templates.ts +42 -0
  225. package/packages/plan/src/themes.ts +48 -0
  226. package/packages/plan/src/types.ts +106 -0
  227. package/packages/studio/package.json +12 -0
  228. package/packages/studio/src/index.ts +1 -0
  229. package/packages/studio/src/plugin.ts +236 -0
  230. package/packages/studio/src/ui/main.ts +503 -0
  231. package/packages/studio/src/ui/studio.css +165 -0
  232. package/packages/studio/src/ui/timeline.ts +317 -0
  233. package/packages/themes/kit/THEME-MAKE.md +68 -0
  234. package/packages/themes/kit/THEME.md +30 -0
  235. package/packages/themes/kit/briefs/og-intro-15s/brief.json +16 -0
  236. package/packages/themes/kit/briefs/og-intro-15s/facts.ts +29 -0
  237. package/packages/themes/kit/briefs/og-intro-15s/logo.svg +12 -0
  238. package/packages/themes/kit/effects.ts +5 -0
  239. package/packages/themes/kit/sample/index.html +11 -0
  240. package/packages/themes/kit/sample/main.ts +9 -0
  241. package/packages/themes/kit/sample/scenes/scene.ts +15 -0
  242. package/packages/themes/package.json +16 -0
  243. package/packages/themes/src/factory.ts +296 -0
  244. package/packages/themes/src/fx.ts +14 -0
  245. package/packages/themes/src/index.ts +105 -0
  246. package/packages/themes/src/stage3d.ts +177 -0
  247. package/packages/themes/src/types.ts +58 -0
  248. package/presets/kawaii-pastel.json +94 -0
  249. package/presets/neutral-dark.json +82 -0
  250. package/presets/og.json +98 -0
  251. package/skills/kasaframe/SKILL.md +32 -0
  252. package/templates/_shared/project/index.html +11 -0
  253. package/templates/_shared/project/lib/react.ts +22 -0
  254. package/templates/_shared/project/lib/stage.ts +272 -0
  255. package/templates/_shared/project/main.ts +9 -0
  256. package/templates/_shared/scenes/default.ts +18 -0
  257. package/templates/_shared/scenes/drop.ts +30 -0
  258. package/templates/_shared/scenes/end.ts +23 -0
  259. package/templates/_shared/scenes/hook.ts +16 -0
  260. package/templates/_shared/scenes/seam.ts +41 -0
  261. package/templates/_shared/scenes/step.ts +40 -0
  262. package/templates/ad/preview.png +0 -0
  263. package/templates/ad/template.json +132 -0
  264. package/templates/demo/preview.png +0 -0
  265. package/templates/demo/template.json +130 -0
  266. package/templates/explainer/preview.png +0 -0
  267. package/templates/explainer/template.json +142 -0
  268. package/templates/launch/preview.png +0 -0
  269. package/templates/launch/template.json +130 -0
  270. package/templates/mv/preview.png +0 -0
  271. package/templates/mv/scenes/default.ts +95 -0
  272. package/templates/mv/template.json +176 -0
  273. package/templates/promo/preview.png +0 -0
  274. package/templates/promo/template.json +144 -0
  275. package/templates/shorts/preview.png +0 -0
  276. package/templates/shorts/scenes/hook.ts +34 -0
  277. package/templates/shorts/template.json +127 -0
  278. package/templates/square/preview.png +0 -0
  279. package/templates/square/template.json +113 -0
  280. package/themes/debug-hud/THEME.md +39 -0
  281. package/themes/debug-hud/effects.ts +389 -0
  282. package/themes/debug-hud/sample/assets/og/logo.svg +12 -0
  283. package/themes/debug-hud/sample/beats.json +1 -0
  284. package/themes/debug-hud/sample/index.html +11 -0
  285. package/themes/debug-hud/sample/kf.json +59 -0
  286. package/themes/debug-hud/sample/lib/hudkit.ts +49 -0
  287. package/themes/debug-hud/sample/lib/og.ts +29 -0
  288. package/themes/debug-hud/sample/main.ts +9 -0
  289. package/themes/debug-hud/sample/scenes/end.ts +62 -0
  290. package/themes/debug-hud/sample/scenes/gather.ts +67 -0
  291. package/themes/debug-hud/sample/scenes/models.ts +70 -0
  292. package/themes/debug-hud/sample/scenes/price.ts +79 -0
  293. package/themes/debug-hud/sample/style.json +91 -0
  294. package/themes/debug-hud/still.png +0 -0
  295. package/themes/debug-hud/style.json +91 -0
  296. package/themes/debug-hud/theme.json +68 -0
  297. package/themes/og-measure/THEME.md +47 -0
  298. package/themes/og-measure/effects.ts +432 -0
  299. package/themes/og-measure/sample/assets/brand/og-logo-full.svg +12 -0
  300. package/themes/og-measure/sample/assets/brand/og-logo.svg +12 -0
  301. package/themes/og-measure/sample/assets/data/measure.json +353 -0
  302. package/themes/og-measure/sample/beats.json +1 -0
  303. package/themes/og-measure/sample/index.html +11 -0
  304. package/themes/og-measure/sample/kf.json +66 -0
  305. package/themes/og-measure/sample/lib/data.ts +62 -0
  306. package/themes/og-measure/sample/main.ts +9 -0
  307. package/themes/og-measure/sample/measure.ts +78 -0
  308. package/themes/og-measure/sample/scenes/end.ts +47 -0
  309. package/themes/og-measure/sample/scenes/gather.ts +51 -0
  310. package/themes/og-measure/sample/scenes/models.ts +34 -0
  311. package/themes/og-measure/sample/scenes/one.ts +39 -0
  312. package/themes/og-measure/sample/scenes/price.ts +56 -0
  313. package/themes/og-measure/sample/style.json +97 -0
  314. package/themes/og-measure/still.png +0 -0
  315. package/themes/og-measure/style.json +97 -0
  316. package/themes/og-measure/theme.json +79 -0
  317. package/themes/riso-zine/THEME.md +43 -0
  318. package/themes/riso-zine/effects.ts +321 -0
  319. package/themes/riso-zine/sample/assets/og/logo.svg +12 -0
  320. package/themes/riso-zine/sample/beats.json +1 -0
  321. package/themes/riso-zine/sample/index.html +11 -0
  322. package/themes/riso-zine/sample/kf.json +59 -0
  323. package/themes/riso-zine/sample/lib/og.ts +29 -0
  324. package/themes/riso-zine/sample/lib/shot.ts +86 -0
  325. package/themes/riso-zine/sample/lib/zine.ts +42 -0
  326. package/themes/riso-zine/sample/main.ts +9 -0
  327. package/themes/riso-zine/sample/scenes/end.ts +61 -0
  328. package/themes/riso-zine/sample/scenes/gather.ts +62 -0
  329. package/themes/riso-zine/sample/scenes/models.ts +52 -0
  330. package/themes/riso-zine/sample/scenes/price.ts +82 -0
  331. package/themes/riso-zine/sample/style.json +99 -0
  332. package/themes/riso-zine/still.png +0 -0
  333. package/themes/riso-zine/style.json +99 -0
  334. package/themes/riso-zine/theme.json +75 -0
  335. package/tools/beats/beats.py +372 -0
  336. package/tools/beats/requirements.txt +3 -0
  337. package/tools/lyrics/align.py +164 -0
  338. package/tools/lyrics/requirements.txt +9 -0
@@ -0,0 +1,317 @@
1
+ export interface TimelineData {
2
+ duration: number;
3
+ fps: number;
4
+ scenes: { id: string; from: number; end: number }[];
5
+ sections: { t: number; kind: string; strength?: number }[];
6
+ beats: number[];
7
+ downbeats: number[];
8
+ phrases: number[];
9
+ drops: { t: number; label: string }[];
10
+ energy?: { hz: number; low: number[]; mid: number[]; high: number[] };
11
+ }
12
+
13
+ export interface TimelineHooks {
14
+ /** snap 이면 가까운 박·마커에 붙인 시각이다 */
15
+ seek(t: number, snapped: boolean): void;
16
+ scrubStart(): void;
17
+ scrubEnd(): void;
18
+ }
19
+
20
+ const C = {
21
+ bg: "#14161b",
22
+ line: "#262a33",
23
+ ink: "#e9ebf0",
24
+ dim: "#8b91a0",
25
+ faint: "#5a606d",
26
+ sceneA: "#20252f",
27
+ sceneB: "#272d39",
28
+ accent: "#ff6b9a",
29
+ sky: "#7cc4ff",
30
+ energy: "rgba(124,196,255,0.16)",
31
+ };
32
+ const RULER = [0, 18];
33
+ const SCENES = [20, 46];
34
+ const SECTIONS = [48, 64];
35
+ const BEATS = [66, 152];
36
+ const SNAP_PX = 10;
37
+ const STEPS = [1 / 60, 0.05, 0.1, 0.25, 0.5, 1, 2, 5, 10, 15, 30, 60, 120];
38
+
39
+ export class Timeline {
40
+ private canvas: HTMLCanvasElement;
41
+ private ctx: CanvasRenderingContext2D;
42
+ private hooks: TimelineHooks;
43
+ private data: TimelineData = { duration: 1, fps: 60, scenes: [], sections: [], beats: [], downbeats: [], phrases: [], drops: [] };
44
+ private a = 0;
45
+ private b = 1;
46
+ private t = 0;
47
+ private hover: number | null = null;
48
+ private dragging = false;
49
+ private W = 0;
50
+ private H = 0;
51
+
52
+ constructor(host: HTMLElement, hooks: TimelineHooks) {
53
+ this.hooks = hooks;
54
+ this.canvas = document.createElement("canvas");
55
+ host.appendChild(this.canvas);
56
+ this.ctx = this.canvas.getContext("2d")!;
57
+ new ResizeObserver(() => this.resize()).observe(host);
58
+ this.bind();
59
+ }
60
+
61
+ setData(d: TimelineData) {
62
+ const fresh = d.duration !== this.data.duration;
63
+ this.data = d;
64
+ if (fresh) {
65
+ this.a = 0;
66
+ this.b = d.duration;
67
+ }
68
+ this.draw();
69
+ }
70
+
71
+ setTime(t: number, follow: boolean) {
72
+ this.t = t;
73
+ const span = this.b - this.a;
74
+ if (follow && (t > this.b - span * 0.02 || t < this.a)) {
75
+ this.a = Math.max(0, Math.min(t - span * 0.1, this.data.duration - span));
76
+ this.b = this.a + span;
77
+ }
78
+ this.draw();
79
+ }
80
+
81
+ private resize() {
82
+ const r = this.canvas.getBoundingClientRect();
83
+ const dpr = window.devicePixelRatio || 1;
84
+ this.W = r.width;
85
+ this.H = r.height;
86
+ this.canvas.width = Math.round(r.width * dpr);
87
+ this.canvas.height = Math.round(r.height * dpr);
88
+ this.ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
89
+ this.draw();
90
+ }
91
+
92
+ private x(t: number) {
93
+ return ((t - this.a) / (this.b - this.a)) * this.W;
94
+ }
95
+
96
+ private tAt(x: number) {
97
+ return this.a + (x / this.W) * (this.b - this.a);
98
+ }
99
+
100
+ private snapTargets(): number[] {
101
+ const d = this.data;
102
+ return [...d.beats, ...d.downbeats, ...d.phrases, ...d.drops.map((m) => m.t), ...d.scenes.map((s) => s.from), ...d.sections.map((s) => s.t), 0, d.duration];
103
+ }
104
+
105
+ private pick(x: number, snap: boolean): { t: number; snapped: boolean } {
106
+ const t = Math.max(0, Math.min(this.data.duration, this.tAt(x)));
107
+ if (!snap) return { t, snapped: false };
108
+ let best = t;
109
+ let bestPx = SNAP_PX;
110
+ for (const s of this.snapTargets()) {
111
+ const px = Math.abs(this.x(s) - x);
112
+ if (px < bestPx) {
113
+ bestPx = px;
114
+ best = s;
115
+ }
116
+ }
117
+ return { t: best, snapped: best !== t };
118
+ }
119
+
120
+ private bind() {
121
+ const c = this.canvas;
122
+ const local = (e: PointerEvent | WheelEvent | MouseEvent) => e.clientX - c.getBoundingClientRect().left;
123
+ c.addEventListener("pointerdown", (e) => {
124
+ if (e.button !== 0) return;
125
+ c.setPointerCapture(e.pointerId);
126
+ this.dragging = true;
127
+ this.hooks.scrubStart();
128
+ const p = this.pick(local(e), e.shiftKey);
129
+ this.hooks.seek(p.t, p.snapped);
130
+ });
131
+ c.addEventListener("pointermove", (e) => {
132
+ this.hover = local(e);
133
+ if (this.dragging) {
134
+ const p = this.pick(this.hover, e.shiftKey);
135
+ this.hooks.seek(p.t, p.snapped);
136
+ } else this.draw();
137
+ });
138
+ const end = (e: PointerEvent) => {
139
+ if (!this.dragging) return;
140
+ this.dragging = false;
141
+ if (c.hasPointerCapture(e.pointerId)) c.releasePointerCapture(e.pointerId);
142
+ this.hooks.scrubEnd();
143
+ };
144
+ c.addEventListener("pointerup", end);
145
+ c.addEventListener("pointercancel", end);
146
+ c.addEventListener("pointerleave", () => {
147
+ this.hover = null;
148
+ this.draw();
149
+ });
150
+ c.addEventListener(
151
+ "wheel",
152
+ (e) => {
153
+ e.preventDefault();
154
+ const span = this.b - this.a;
155
+ const D = this.data.duration;
156
+ if (Math.abs(e.deltaX) > Math.abs(e.deltaY) || e.shiftKey) {
157
+ const dt = ((e.shiftKey ? e.deltaY : e.deltaX) / this.W) * span;
158
+ this.a = Math.max(0, Math.min(D - span, this.a + dt));
159
+ this.b = this.a + span;
160
+ } else {
161
+ const at = this.tAt(local(e));
162
+ const next = Math.max(Math.min(1, D), Math.min(D, span * Math.exp(e.deltaY * 0.004)));
163
+ const k = (at - this.a) / span;
164
+ this.a = Math.max(0, Math.min(D - next, at - k * next));
165
+ this.b = this.a + next;
166
+ }
167
+ this.draw();
168
+ },
169
+ { passive: false },
170
+ );
171
+ c.addEventListener("dblclick", () => {
172
+ this.a = 0;
173
+ this.b = this.data.duration;
174
+ this.draw();
175
+ });
176
+ }
177
+
178
+ private label(text: string, x: number, y: number, color: string, maxW?: number) {
179
+ const g = this.ctx;
180
+ g.fillStyle = color;
181
+ if (maxW !== undefined && maxW < 14) return;
182
+ if (maxW !== undefined && g.measureText(text).width > maxW) {
183
+ let s = text;
184
+ while (s.length > 1 && g.measureText(`${s}…`).width > maxW) s = s.slice(0, -1);
185
+ text = `${s}…`;
186
+ }
187
+ g.fillText(text, x, y);
188
+ }
189
+
190
+ draw() {
191
+ const g = this.ctx;
192
+ const { W, H } = this;
193
+ if (!W || !H) return;
194
+ const d = this.data;
195
+ const pxPerSec = W / (this.b - this.a);
196
+ g.clearRect(0, 0, W, H);
197
+ g.fillStyle = C.bg;
198
+ g.fillRect(0, 0, W, H);
199
+ g.font = "11px ui-monospace, SFMono-Regular, Menlo, monospace";
200
+ g.textBaseline = "middle";
201
+
202
+ const step = STEPS.find((s) => s * pxPerSec >= 64) ?? 300;
203
+ g.strokeStyle = C.line;
204
+ g.lineWidth = 1;
205
+ for (let t = Math.ceil(this.a / step) * step; t <= this.b + 1e-9; t += step) {
206
+ const x = Math.round(this.x(t)) + 0.5;
207
+ g.beginPath();
208
+ g.moveTo(x, RULER[1] - 5);
209
+ g.lineTo(x, RULER[1]);
210
+ g.stroke();
211
+ const txt = step < 1 ? t.toFixed(step < 0.1 ? 3 : 2) : step < 60 ? `${Math.round(t)}s` : `${Math.floor(t / 60)}:${String(Math.round(t % 60)).padStart(2, "0")}`;
212
+ this.label(txt, x + 3, 8, C.faint);
213
+ }
214
+ g.fillStyle = C.line;
215
+ g.fillRect(0, RULER[1], W, 1);
216
+
217
+ d.scenes.forEach((s, i) => {
218
+ const x0 = this.x(s.from);
219
+ const x1 = this.x(s.end);
220
+ if (x1 < 0 || x0 > W) return;
221
+ g.fillStyle = i % 2 ? C.sceneB : C.sceneA;
222
+ g.fillRect(x0, SCENES[0], Math.max(1, x1 - x0 - 1), SCENES[1] - SCENES[0]);
223
+ const lx = Math.max(x0, 0) + 6;
224
+ this.label(s.id, lx, (SCENES[0] + SCENES[1]) / 2, C.ink, x1 - lx - 6);
225
+ });
226
+
227
+ d.sections.forEach((s, i) => {
228
+ const x0 = this.x(s.t);
229
+ const x1 = i + 1 < d.sections.length ? this.x(d.sections[i + 1].t) : this.x(d.duration);
230
+ if (x1 < 0 || x0 > W) return;
231
+ g.fillStyle = s.kind === "drop" ? C.accent : C.dim;
232
+ g.fillRect(Math.round(x0), SECTIONS[0] + 2, 2, SECTIONS[1] - SECTIONS[0] - 4);
233
+ const strength = s.strength !== undefined ? ` ${s.strength.toFixed(2)}` : "";
234
+ this.label(`${s.kind}${strength}`, Math.max(x0, 0) + 6, (SECTIONS[0] + SECTIONS[1]) / 2, s.kind === "drop" ? C.accent : C.dim, x1 - Math.max(x0, 0) - 10);
235
+ });
236
+
237
+ const laneTop = BEATS[0];
238
+ const laneBot = BEATS[1];
239
+ const laneH = laneBot - laneTop;
240
+ if (d.energy && d.energy.low.length) {
241
+ const { hz, low } = d.energy;
242
+ const curve = (vals: number[]) => {
243
+ const pts: [number, number][] = [];
244
+ for (let x = 0; x <= W; x += 2) {
245
+ const i = Math.floor(this.tAt(x) * hz);
246
+ const v = vals[Math.max(0, Math.min(vals.length - 1, i))] ?? 0;
247
+ pts.push([x, laneBot - v * laneH * 0.92]);
248
+ }
249
+ return pts;
250
+ };
251
+ g.beginPath();
252
+ g.moveTo(0, laneBot);
253
+ for (const [x, y] of curve(low)) g.lineTo(x, y);
254
+ g.lineTo(W, laneBot);
255
+ g.closePath();
256
+ g.fillStyle = C.energy;
257
+ g.fill();
258
+ }
259
+
260
+ const visible = (ts: number[]) => ts.filter((t) => t >= this.a - 1 && t <= this.b + 1);
261
+ const beatPx = d.beats.length > 1 ? (pxPerSec * d.duration) / d.beats.length : 99;
262
+ g.fillStyle = C.faint;
263
+ if (beatPx >= 3) for (const t of visible(d.beats)) g.fillRect(Math.round(this.x(t)), laneTop, 1, 7);
264
+ g.fillStyle = C.dim;
265
+ if (beatPx * 4 >= 3) for (const t of visible(d.downbeats)) g.fillRect(Math.round(this.x(t)), laneTop, 1, 15);
266
+ g.fillStyle = "rgba(233,235,240,0.35)";
267
+ for (const t of visible(d.phrases)) g.fillRect(Math.round(this.x(t)), laneTop, 1, laneH);
268
+
269
+ for (const m of d.drops) {
270
+ const x = Math.round(this.x(m.t));
271
+ if (x < -40 || x > W + 40) continue;
272
+ g.fillStyle = C.accent;
273
+ g.fillRect(x, SCENES[0], 2, laneBot - SCENES[0]);
274
+ g.beginPath();
275
+ g.moveTo(x + 1, laneTop - 1);
276
+ g.lineTo(x + 6, laneTop + 5);
277
+ g.lineTo(x + 1, laneTop + 11);
278
+ g.lineTo(x - 4, laneTop + 5);
279
+ g.closePath();
280
+ g.fill();
281
+ }
282
+
283
+ if (this.hover !== null && !this.dragging) {
284
+ const x = Math.round(this.hover) + 0.5;
285
+ g.strokeStyle = "rgba(233,235,240,0.25)";
286
+ g.beginPath();
287
+ g.moveTo(x, 0);
288
+ g.lineTo(x, H);
289
+ g.stroke();
290
+ const ht = this.tAt(this.hover);
291
+ const txt = ht.toFixed(3);
292
+ const w = g.measureText(txt).width + 8;
293
+ const bx = Math.min(W - w, x + 4);
294
+ g.fillStyle = "#0c0d10";
295
+ g.fillRect(bx, H - 18, w, 16);
296
+ this.label(txt, bx + 4, H - 10, C.dim);
297
+ }
298
+
299
+ const px = Math.round(this.x(this.t)) + 0.5;
300
+ if (px >= -1 && px <= W + 1) {
301
+ g.strokeStyle = C.ink;
302
+ g.lineWidth = 1.5;
303
+ g.beginPath();
304
+ g.moveTo(px, 0);
305
+ g.lineTo(px, H);
306
+ g.stroke();
307
+ g.lineWidth = 1;
308
+ g.fillStyle = C.ink;
309
+ g.beginPath();
310
+ g.moveTo(px - 5, 0);
311
+ g.lineTo(px + 5, 0);
312
+ g.lineTo(px, 7);
313
+ g.closePath();
314
+ g.fill();
315
+ }
316
+ }
317
+ }
@@ -0,0 +1,68 @@
1
+ # 테마 만들기 지시서 — `{{id}}`
2
+
3
+ 너는 kasaframe 테마 하나를 처음부터 끝까지 만든다: 참고 자료를 보고 → 비유를 정하고 → 스타일·효과를 짜고 → 공통 브리프로 견본을 만들어 → 검사를 통과시키고 → review 로 올린다. 사람은 견본 영상만 보고 OK 한다. **OK 전에 approved 로 바꾸지 않는다.**
4
+
5
+ - 테마 폴더: `themes/{{id}}/` — 이 폴더 밖은 고치지 않는다. 커밋은 `git commit -m "<명사형 제목>" -- themes/{{id}}`(남의 스테이징을 쓸어 가지 않게 경로를 꼭 준다). 커밋 제목·주석에 개인 호칭·페르소나 표현 금지.
6
+ - 이름: {{name}} · 브리프: {{brief}} · 결이 비슷한 기존 테마: {{like}}
7
+ - 명령은 레포 뿌리에서 `npx kf …`. `kf render`·`kf check`·`kf sheet` 는 스스로 렌더 잠금(`.render-lock`)을 잡고 기다린다 — **밖에서 잠금을 따로 잡고 그 안에서 kf 를 부르지 않는다**(교착). 탭은 `--tabs 2` 까지.
8
+ {{kindNote}}
9
+
10
+ ## 1. 읽기 (10분)
11
+
12
+ 1. `SPEC.md` 의 「계약 9 테마 팩」과 `docs/AGENTS.md`(장면 파일 쓰는 법).
13
+ 2. approved 테마 둘 이상을 통째로 — `themes/<id>/THEME.md`·`effects.ts`·`sample/scenes/*.ts`. `npx kf theme list` 로 목록을 본다. 비유·색이 이미 있는 테마와 겹치면 안 된다.
14
+ 3. 브리프 `{{briefDoc}}` — 화면에 쓰는 사실·숫자는 여기 적힌 것만. 숫자를 지어내지 않는다. 사실 모음은 `sample/lib/facts.ts` 에 이미 옮겨 두었다.
15
+
16
+ ## 2. 참고 자료 보기 → `refs/NOTES.md`
17
+
18
+ 참고 자료: {{refs}}
19
+
20
+ - 그림은 Read 로 직접 본다. 영상은 `refs/frames/` 에 뽑아 둔 장면을 본다. 주소는 `kc navigate <url>` 뒤 `kc screenshot --path <절대경로>` 로 찍어 Read 하거나 WebFetch.
21
+ - `refs/NOTES.md` 에 적는다: 색(실제 값 몇 개) · 질감 · 형태 언어 · 움직임 성격 · 공간감(평면/깊이/등각) · 빛 · 이 자료에서 **가져올 것 셋**과 **안 가져올 것**.
22
+
23
+ ## 3. 비유·스타일 — `THEME.md` 앞부분 · `style.json` · `theme.json`
24
+
25
+ - 비유 한 줄: 「무엇이 무엇처럼 되며 화면이 찍힌다/드러난다」. 내용(정보가 화면에 오르는 방식)에서 나온 개념이어야 한다 — 장식 이름이 아니라 동사가 있는 문장.
26
+ - `style.json`: 프리셋과 같은 KfStyle 꼴 통째, `name` = `{{id}}`. 잉크 2–3색 + 그 어두운 단(`colors`), 바탕 `bg`, 글 `ink`, 강조 `accent`. 글꼴 셋(`sans`·`display`·`mono`)은 **한글이 서는 글꼴로 끝나게**(Pretendard 를 마지막에), `faces` 는 **한 파일 주소**(jsdelivr `gh/google/fonts@main/ofl/<이름>/<파일>.ttf` 나 `npm/pretendard@1.3.9/.../PretendardVariable.woff2`). 구글 폰트 CSS(unicode-range 조각)는 글이 투명하게 찍히니 쓰지 않는다. `theme` 칸에 `inks`·`texture`·`movement` 를 글로.
27
+ - `theme.json`: `name`·`metaphor`·`purposes`·`aspect`. status 는 draft 그대로.
28
+ - 글자 대비는 찍힌 픽셀로 3:1 이상 — 옅은 잉크로 작은 글을 쓰지 않는다.
29
+
30
+ ## 4. 효과 — `effects.ts` (5–10개)
31
+
32
+ - `value` = `(t, opts) => Style | number | string | 객체` · `layer` = `(el, opts) => (t) => void`(장면 `build` 처럼 DOM·캔버스를 한 번 짓고 t 마다 칠한다). **같은 t 면 같은 화면** — 앞 프레임 상태를 쌓지 않는다, `Math.random`·`Date.now` 금지(`rand(seed, i)`·`noise1`).
33
+ - 비유 전용이어야 한다: 등장·전환·드롭·늘 흐르는 바탕·숫자/글 찍기·끝 카드 쪽이 하나씩은 있으면 견본이 테마 효과만으로 선다.
34
+ - 흔들림·섬광·박 펄스·카메라는 `@kasaframe/motion` 의 `dropBurst`·`shake`·`beatPulse`·`camera` 를 거쳐 검사가 셀 수 있게. 드롭 연출은 `ctx.beats.drop(0)` 으로 잰 시각에만.
35
+ - 캔버스는 **그리는 자리만큼만** 잡고 `translate(-x, -y)` 로 화면 좌표를 그대로 쓴다(화면 전체 캔버스 수십 장이면 탭 셋이 GB 를 먹는다).
36
+ - `theme.json` 의 `effects` 를 `{ name, kind, does, use }` 로 채운다 — 이름이 `effects.ts` 의 함수 내보내기와 정확히 같아야 한다(시험이 본다). `use` 는 모델이 그대로 베낄 한 줄.
37
+
38
+ ## 5. 견본 — `sample/` (브리프 그대로, 15초)
39
+
40
+ 뼈대는 이미 있다: `kf.json`(장면 넷 — 경계가 마디·드롭에 붙어 있다)·`beats.json`·곡·`lib/facts.ts`·`assets/`. `scenes/*.ts` 넷을 다시 쓴다.
41
+
42
+ 공통 규칙(검사가 오류로 잡는다):
43
+
44
+ - **0.1초도 서지 않는다** — 늘 흐르는 층 하나(바탕 흐름·눈금·드리프트·끓는 결)를 깔아 둔다. 깜빡이는 점 몇 개로는 모자란다(160×90 회색조 평균 차 0.35).
45
+ - **같은 구도 1.5초 안** — 마디(약 1.41초)마다 컷을 바꾼다. 컷은 `display: none` 으로 숨긴다 — `visibility: hidden` 은 안쪽 요소가 visible 을 주면 부모를 뚫고 보여서 지난 컷이 비치고 같은 t 의 그림이 달라진다(`frame.nondeterministic`).
46
+ - **박마다 눈에 보이는 큰 사건 하나** — 찍히고, 갈리고, 뛰고, 바뀐다. 미세한 떨림으로 때우지 않는다.
47
+ - **꽉 찬 화면** — 글·그림이 화면 가운데 작게 몰리지 않게. 안전 영역(가로 80px·세로 60px) 안에.
48
+ - **문구 금지** — 슬로건·감성 카피·말 거는 문장 없이 실제 주소·모델 ID·숫자·짧은 낱말·끝 카드만.
49
+ - 영상 생성 모델은 쓰지 않는다. 모자란 그림은 `npx kf gen img` 몇 장까지(돈 규칙은 `packages/gen/PROVIDERS.md`).
50
+ - 로고 SVG 는 `import svg from "../assets/og/logo.svg?raw"` 로 받아 `currentColor` 로 칠한다. 속성을 바꿀 때 `height="auto"` 는 SVG 오류다 — `width="100%"` 만 두고 높이는 viewBox 에 맡긴다.
51
+
52
+ ## 6. 검사 고리
53
+
54
+ 1. `npx kf theme check {{id}}` — 계약(파일·효과 이름·글꼴·남은 TODO) + `kf check sample`. 오류가 0 이 될 때까지.
55
+ 2. `npx kf sheet themes/{{id}}/sample --count 16` 을 **Read 로 직접 보고** 고친다: 빈 화면·겹친 글·잘린 글·지난 컷 비침·읽히지 않는 대비. 숫자 검사만 보고 넘기지 않는다.
56
+ 3. 렌더를 되풀이하기 전에 고칠 것을 모아서 한 번에(맥북 부하).
57
+
58
+ ## 7. review
59
+
60
+ `npx kf theme review {{id}}` — 굽기 → mp4 검사 → 장면 모음·대표 장면 → `sample.mp4`·`still.png` 갱신 → 공유 폴더(`kasaframe-테마-{{id}}`)에 `{{id}}-{{share}}.mp4`·장면 모음·대표 장면·THEME.md → status review. 끝나면 커밋하고 맡긴 사람에게 공유 폴더 경로와 비유 한 줄·흐름·검사 결과를 알린다.
61
+
62
+ ## 함정(앞 테마들이 밟은 것)
63
+
64
+ - 한글은 모노 글꼴 뒤 Pretendard 로 그려져 폭이 다르다 — 셀·고정 폭 배치면 한글 한 자를 두 칸으로.
65
+ - 캔버스에 글을 그리는 효과는 `document.fonts` 가 다 받은 뒤(장면 `build` 는 그 뒤에 불린다) 쓴다. 떨어져 있는 캔버스에 미리 그려 둔 글은 검사가 화면 글로 읽지 않는다.
66
+ - 장면 박자 `ctx.beats.beats` 는 곡 끝까지 들어 있다 — 「이 장면의 마지막 박」은 `ctx.dur` 로 거른다.
67
+ - 흔들림을 바탕째 걸면 가장자리에 페이지 검정이 비친다 — 내용 틀에만.
68
+ - 렌더가 무거우면(종이결·잡음) mp4 가 수십 MB — 레포의 `sample.mp4` 는 `kf theme review` 가 줄여 넣는다.
@@ -0,0 +1,30 @@
1
+ # {{name}} `{{id}}`
2
+
3
+ **비유: TODO 한 줄 — 내용에서 나온 개념(무엇이 무엇처럼 되며 화면이 찍힌다).** TODO 두세 줄로 풀어 쓴다.
4
+
5
+ ## 맞는 내용·용도
6
+
7
+ - TODO 어떤 내용에 맞나
8
+ - 용도: TODO(promo·shorts·explainer·launch·demo·ad·square·mv 중)
9
+ - 화면 글: TODO
10
+
11
+ ## 금지
12
+
13
+ - TODO 이 비유를 깨는 것(색·글꼴·움직임·질감)
14
+ - 슬로건·감성 문장.
15
+
16
+ ## 움직임
17
+
18
+ - 쉬지 않는다: TODO(0.1초도 서지 않게 늘 흐르는 것)
19
+ - 구도는 마디마다 바꾼다: TODO
20
+ - 박마다 큰 사건 하나: TODO
21
+
22
+ ## 효과
23
+
24
+ 같은 레포 안에서는 `effects.ts` 를 바로, 프로젝트에서는 `fx("{{id}}")`. layer 는 `build` 에서 만들고 `(t) => …` 에서 부른다.
25
+
26
+ | 효과 | 꼴 | 하는 일 |
27
+ |---|---|---|
28
+ | TODO | | |
29
+
30
+ 견본: `sample/` — {{brief}}.
@@ -0,0 +1,16 @@
1
+ {
2
+ "id": "og-intro-15s",
3
+ "doc": "docs/briefs/og-intro-15s.md",
4
+ "label": "OpenGateway 소개 15초",
5
+ "share": "OG견본",
6
+ "music": "kawaii-friends.mp3",
7
+ "from": 4.0,
8
+ "to": 19.0,
9
+ "assets": { "og/logo.svg": "logo.svg" },
10
+ "scenes": [
11
+ { "id": "gather", "role": "hook", "until": "bar:3.1", "idea": "여러 회사 모델이 흩어져 있다 → 회사별 모델 수" },
12
+ { "id": "models", "role": "explain", "until": "drop:0", "idea": "한 주소(https://apis.opengateway.ai/v1) → 박마다 바뀌는 모델 ID 가 같은 주소로 → 드롭 앞 모아 올리기" },
13
+ { "id": "price", "role": "drop", "until": "bar:11.5", "idea": "드롭에 가장 크게 102 · 한 주소 → 하루 시계에서 00–10시 창이 -90% → deepseek 가격" },
14
+ { "id": "end", "role": "end", "until": "end", "idea": "첫 토큰 실측 셋 → 끝 카드(OG 로고 · opengateway.ai)" }
15
+ ]
16
+ }
@@ -0,0 +1,29 @@
1
+ // OpenGateway 사실 — docs/briefs/og-intro-15s.md 에 적힌 것만. 숫자를 여기서 새로 만들지 않는다
2
+ export const OG = {
3
+ url: "https://apis.opengateway.ai/v1",
4
+ host: "apis.opengateway.ai/v1",
5
+ site: "opengateway.ai",
6
+ models: 102,
7
+ endpoints: ["/chat/completions", "/responses", "/messages", "/images/generations"],
8
+ providers: [
9
+ ["OpenAI", 41],
10
+ ["Anthropic", 15],
11
+ ["Google", 15],
12
+ ["Z.ai", 7],
13
+ ["xAI", 6],
14
+ ["Qwen", 5],
15
+ ["Moonshot", 4],
16
+ ["DeepSeek", 4],
17
+ ["MiniMax", 3],
18
+ ] as [string, number][],
19
+ ids: ["openai/gpt-6.1-sol", "anthropic/claude-opus-5-5", "google/gemini-3.5-flash-lite", "deepseek/deepseek-v4.1-flash-ultrafast", "z-ai/glm-5.3-flash-ultrafast"],
20
+ night: { from: 0, to: 10, tz: "KST" },
21
+ deepseek: { id: "deepseek-v4.1-flash-ultrafast", input: ["$0.30", "$0.03"], output: ["$1.20", "$0.12"], off: "-90%" },
22
+ glm: { id: "glm-5.3-flash-ultrafast", off: "-70%" },
23
+ ttft: [
24
+ ["gpt-5.4-nano", "612.5ms", 612.5],
25
+ ["gemini-3.5-flash-lite", "693.0ms", 693.0],
26
+ ["claude-haiku-5-5", "760.5ms", 760.5],
27
+ ] as [string, string, number][],
28
+ calls: "18번 합 $0.0004",
29
+ };
@@ -0,0 +1,12 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1140 650" width="1140" height="650" fill="none" role="img" aria-label="OpenGateway">
2
+ <title>OpenGateway</title>
3
+ <g id="logo" stroke="currentColor" fill="currentColor">
4
+ <rect id="node-in" x="36" y="36" width="420" height="578" rx="89" fill="none" stroke-width="72"/>
5
+ <rect id="bar-in" x="72" y="272" width="277" height="106" stroke="none"/>
6
+ <path id="node-out" d="M684 213 L684 125 A89 89 0 0 1 773 36 L1015 36 A89 89 0 0 1 1104 125 L1104 525 A89 89 0 0 1 1015 614 L773 614 A89 89 0 0 1 684 525 L684 436" fill="none" stroke-width="72" stroke-linecap="butt"/>
7
+ <g id="arrow">
8
+ <rect id="arrow-shaft" x="420" y="272" width="394" height="106" stroke="none"/>
9
+ <path id="arrow-head" d="M833 220 L970 325 L833 430 Z" stroke-width="38" stroke-linejoin="round"/>
10
+ </g>
11
+ </g>
12
+ </svg>
@@ -0,0 +1,5 @@
1
+ // 테마 {{id}} 전용 효과 — THEME-MAKE.md 4단계. 5–10개, 이름 있는 내보내기 = theme.json effects[].name
2
+ // value: (t, opts) => Style·수·글 · layer: (el, opts) => (t) => void. 같은 t 면 같은 화면, Math.random 금지(rand(seed, i))
3
+ import type { SceneCtx } from "@kasaframe/core";
4
+
5
+ export type { SceneCtx };
@@ -0,0 +1,11 @@
1
+ <!doctype html>
2
+ <html lang="ko">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <title>{{id}} 견본</title>
6
+ </head>
7
+ <body>
8
+ <div id="stage"></div>
9
+ <script type="module" src="./main.ts"></script>
10
+ </body>
11
+ </html>
@@ -0,0 +1,9 @@
1
+ import { mountProject } from "@kasaframe/adapters";
2
+ import kf from "./kf.json";
3
+ import style from "./style.json";
4
+
5
+ // 장면 파일을 늘리거나 빼도 이 파일은 그대로 — 시간표는 kf.json 한 곳. 글꼴·색 변수는 mountProject 가 건다
6
+ const scenes = import.meta.glob("./scenes/*.ts", { eager: true });
7
+ const beats = Object.values(import.meta.glob("./beats.json", { eager: true, import: "default" }))[0] ?? null;
8
+
9
+ mountProject({ kf, scenes, beats, style, stage: document.getElementById("stage")! });
@@ -0,0 +1,15 @@
1
+ import type { SceneCtx } from "@kasaframe/core";
2
+ // THEME-MAKE.md 5단계에서 이 파일을 통째로 다시 쓴다 — 할 일: {{idea}}
3
+ import * as fx from "../../effects.ts";
4
+
5
+ export default {
6
+ build(root: HTMLElement, ctx: SceneCtx) {
7
+ void fx;
8
+ const el = document.createElement("div");
9
+ el.style.cssText = `position:absolute;inset:0;display:grid;place-items:center;font:700 64px ${ctx.style.fonts.sans};color:${ctx.style.colors.dim};`;
10
+ root.append(el);
11
+ return (t: number) => {
12
+ el.textContent = `{{scene}} ${t.toFixed(2)}`;
13
+ };
14
+ },
15
+ };
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "@kasaframe/themes",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "exports": {
7
+ ".": "./src/index.ts",
8
+ "./fx": "./src/fx.ts",
9
+ "./factory": "./src/factory.ts",
10
+ "./stage3d": "./src/stage3d.ts"
11
+ },
12
+ "dependencies": {
13
+ "@kasaframe/core": "0.0.0",
14
+ "three": "^0.186.1"
15
+ }
16
+ }