kasaframe 0.0.0-stage → 0.1.3

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 (442) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE +148 -0
  3. package/README.md +92 -2
  4. package/app/package.json +12 -0
  5. package/app/server/engine.ts +533 -0
  6. package/app/server/main.ts +209 -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 +1195 -0
  11. package/app/web/style.css +463 -0
  12. package/bin/hooks.mjs +64 -0
  13. package/bin/kf.mjs +32 -0
  14. package/docs/AGENTS.md +286 -0
  15. package/music/README.md +37 -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 +280 -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 +45 -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 +136 -0
  43. package/packages/check/src/rules/layout.ts +281 -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 +30 -0
  52. package/packages/cli/src/blur.ts +80 -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/bench.ts +123 -0
  58. package/packages/cli/src/commands/blender.ts +293 -0
  59. package/packages/cli/src/commands/check.ts +25 -0
  60. package/packages/cli/src/commands/direct.ts +210 -0
  61. package/packages/cli/src/commands/doctor.ts +30 -0
  62. package/packages/cli/src/commands/gen.ts +173 -0
  63. package/packages/cli/src/commands/look.ts +46 -0
  64. package/packages/cli/src/commands/lyrics.ts +157 -0
  65. package/packages/cli/src/commands/make.ts +1121 -0
  66. package/packages/cli/src/commands/music.ts +78 -0
  67. package/packages/cli/src/commands/narrate.ts +238 -0
  68. package/packages/cli/src/commands/new.ts +185 -0
  69. package/packages/cli/src/commands/preview.ts +43 -0
  70. package/packages/cli/src/commands/render.ts +250 -0
  71. package/packages/cli/src/commands/series.ts +110 -0
  72. package/packages/cli/src/commands/setup.ts +102 -0
  73. package/packages/cli/src/commands/sheet.ts +114 -0
  74. package/packages/cli/src/commands/skill.ts +43 -0
  75. package/packages/cli/src/commands/still.ts +40 -0
  76. package/packages/cli/src/commands/theme.ts +172 -0
  77. package/packages/cli/src/commands/transitions.ts +40 -0
  78. package/packages/cli/src/deps.ts +122 -0
  79. package/packages/cli/src/ffmpeg.ts +81 -0
  80. package/packages/cli/src/index.ts +8 -0
  81. package/packages/cli/src/kf.ts +64 -0
  82. package/packages/cli/src/lock.ts +72 -0
  83. package/packages/cli/src/mix.ts +131 -0
  84. package/packages/cli/src/out.ts +13 -0
  85. package/packages/cli/src/pool.ts +34 -0
  86. package/packages/cli/src/segments.ts +402 -0
  87. package/packages/cli/src/serve.ts +124 -0
  88. package/packages/clock/package.json +14 -0
  89. package/packages/clock/src/index.ts +25 -0
  90. package/packages/clock/src/install.ts +351 -0
  91. package/packages/clock/src/types.ts +45 -0
  92. package/packages/core/package.json +9 -0
  93. package/packages/core/src/beats.ts +283 -0
  94. package/packages/core/src/ease.ts +87 -0
  95. package/packages/core/src/frame.ts +99 -0
  96. package/packages/core/src/index.ts +27 -0
  97. package/packages/core/src/project.ts +157 -0
  98. package/packages/core/src/rand.ts +56 -0
  99. package/packages/core/src/spring.ts +52 -0
  100. package/packages/core/src/style.ts +100 -0
  101. package/packages/core/src/time.ts +88 -0
  102. package/packages/director/package.json +23 -0
  103. package/packages/director/src/assemble.ts +361 -0
  104. package/packages/director/src/brief.ts +122 -0
  105. package/packages/director/src/catalog.ts +49 -0
  106. package/packages/director/src/content.ts +343 -0
  107. package/packages/director/src/fallback.ts +58 -0
  108. package/packages/director/src/index.ts +13 -0
  109. package/packages/director/src/pattern.ts +90 -0
  110. package/packages/director/src/patterns/fill/cells.ts +115 -0
  111. package/packages/director/src/patterns/formula/stack.ts +93 -0
  112. package/packages/director/src/patterns/util.ts +58 -0
  113. package/packages/director/src/scene.ts +62 -0
  114. package/packages/director/src/select.ts +163 -0
  115. package/packages/director/src/transitions.ts +115 -0
  116. package/packages/gen/PROVIDERS.md +90 -0
  117. package/packages/gen/package.json +9 -0
  118. package/packages/gen/src/ask.ts +132 -0
  119. package/packages/gen/src/audio.ts +91 -0
  120. package/packages/gen/src/blender.ts +54 -0
  121. package/packages/gen/src/capabilities.ts +151 -0
  122. package/packages/gen/src/generate.ts +206 -0
  123. package/packages/gen/src/image/codex.ts +117 -0
  124. package/packages/gen/src/image/og.ts +133 -0
  125. package/packages/gen/src/index.ts +26 -0
  126. package/packages/gen/src/keys.ts +86 -0
  127. package/packages/gen/src/media.ts +150 -0
  128. package/packages/gen/src/music/elevenlabs.ts +41 -0
  129. package/packages/gen/src/music/index.ts +120 -0
  130. package/packages/gen/src/music/library.ts +73 -0
  131. package/packages/gen/src/music/lyria.ts +52 -0
  132. package/packages/gen/src/music/types.ts +28 -0
  133. package/packages/gen/src/plan.ts +106 -0
  134. package/packages/gen/src/registry.ts +54 -0
  135. package/packages/gen/src/seam.ts +103 -0
  136. package/packages/gen/src/tts/dashscope.ts +64 -0
  137. package/packages/gen/src/tts/elevenlabs.ts +84 -0
  138. package/packages/gen/src/tts/gemini.ts +73 -0
  139. package/packages/gen/src/tts/index.ts +241 -0
  140. package/packages/gen/src/tts/local.ts +42 -0
  141. package/packages/gen/src/tts/types.ts +44 -0
  142. package/packages/gen/src/types.ts +90 -0
  143. package/packages/gen/src/video/fal.ts +140 -0
  144. package/packages/gen/src/video/h3.ts +112 -0
  145. package/packages/gen/src/video/http.ts +44 -0
  146. package/packages/gen/src/video/ltx.ts +60 -0
  147. package/packages/gen/src/video/minimax.ts +55 -0
  148. package/packages/gen/src/video/veo.ts +71 -0
  149. package/packages/jizura/package.json +16 -0
  150. package/packages/jizura/src/deny.ts +73 -0
  151. package/packages/jizura/src/index.ts +7 -0
  152. package/packages/jizura/src/install.ts +269 -0
  153. package/packages/jizura/src/layer.ts +325 -0
  154. package/packages/jizura/src/lyrics.ts +81 -0
  155. package/packages/jizura/src/pin.ts +8 -0
  156. package/packages/jizura/src/vendor.ts +140 -0
  157. package/packages/jizura/src/vite.ts +63 -0
  158. package/packages/jizura/vendor/JIZURA_LICENSE.txt +21 -0
  159. package/packages/jizura/vendor/NOTICE +43 -0
  160. package/packages/jizura/vendor/engine.json +47 -0
  161. package/packages/jizura/vendor/fonts/BlackHanSans-Regular.woff2 +0 -0
  162. package/packages/jizura/vendor/fonts/DotGothic16-Regular.woff2 +0 -0
  163. package/packages/jizura/vendor/fonts/GowunBatang-Bold.woff2 +0 -0
  164. package/packages/jizura/vendor/fonts/IBMPlexMono-Medium.ttf +0 -0
  165. package/packages/jizura/vendor/fonts/IBMPlexMono-SemiBold.ttf +0 -0
  166. package/packages/jizura/vendor/fonts/NotoSansKR-VF.woff2 +0 -0
  167. package/packages/jizura/vendor/fonts/NotoSerifKR-VF.woff2 +0 -0
  168. package/packages/jizura/vendor/fonts/OFL-blackhansans.txt +93 -0
  169. package/packages/jizura/vendor/fonts/OFL-dotgothic16.txt +93 -0
  170. package/packages/jizura/vendor/fonts/OFL-gowunbatang.txt +94 -0
  171. package/packages/jizura/vendor/fonts/OFL-ibmplexmono.txt +93 -0
  172. package/packages/jizura/vendor/fonts/OFL-notosanskr.txt +93 -0
  173. package/packages/jizura/vendor/fonts/OFL-notoserifkr.txt +94 -0
  174. package/packages/jizura/vendor/fonts/fonts.json +52 -0
  175. package/packages/jizura/vendor/jizura_engine.js +35024 -0
  176. package/packages/motion/README.md +153 -0
  177. package/packages/motion/package.json +30 -0
  178. package/packages/motion/src/camera.ts +97 -0
  179. package/packages/motion/src/captions.ts +487 -0
  180. package/packages/motion/src/enter.ts +128 -0
  181. package/packages/motion/src/hangul.ts +129 -0
  182. package/packages/motion/src/impact.ts +100 -0
  183. package/packages/motion/src/index.ts +17 -0
  184. package/packages/motion/src/moves/brushWipe.ts +103 -0
  185. package/packages/motion/src/moves/cloneArray.ts +111 -0
  186. package/packages/motion/src/moves/curtains.ts +81 -0
  187. package/packages/motion/src/moves/dress.ts +191 -0
  188. package/packages/motion/src/moves/echoStack.ts +70 -0
  189. package/packages/motion/src/moves/fit.ts +70 -0
  190. package/packages/motion/src/moves/flood.ts +61 -0
  191. package/packages/motion/src/moves/ghostStack.ts +88 -0
  192. package/packages/motion/src/moves/gridFloor.ts +100 -0
  193. package/packages/motion/src/moves/imageSwarm.ts +113 -0
  194. package/packages/motion/src/moves/index.ts +38 -0
  195. package/packages/motion/src/moves/irisBlades.ts +113 -0
  196. package/packages/motion/src/moves/karaokeLine.ts +108 -0
  197. package/packages/motion/src/moves/ledBoard.ts +94 -0
  198. package/packages/motion/src/moves/liquidTab.ts +72 -0
  199. package/packages/motion/src/moves/markerWrite.ts +63 -0
  200. package/packages/motion/src/moves/menu.ts +138 -0
  201. package/packages/motion/src/moves/morphBox.ts +96 -0
  202. package/packages/motion/src/moves/neonSign.ts +78 -0
  203. package/packages/motion/src/moves/panelPop.ts +78 -0
  204. package/packages/motion/src/moves/paperTear.ts +75 -0
  205. package/packages/motion/src/moves/path.ts +64 -0
  206. package/packages/motion/src/moves/pathText.ts +107 -0
  207. package/packages/motion/src/moves/pointSphere.ts +109 -0
  208. package/packages/motion/src/moves/ransomLetters.ts +73 -0
  209. package/packages/motion/src/moves/shapeMorph.ts +143 -0
  210. package/packages/motion/src/moves/slamWords.ts +96 -0
  211. package/packages/motion/src/moves/sparkTrail.ts +130 -0
  212. package/packages/motion/src/moves/speedLines.ts +91 -0
  213. package/packages/motion/src/moves/splitFlap.ts +149 -0
  214. package/packages/motion/src/moves/stepWords.ts +128 -0
  215. package/packages/motion/src/moves/strikeOut.ts +98 -0
  216. package/packages/motion/src/moves/sunburst.ts +58 -0
  217. package/packages/motion/src/moves/tickerRows.ts +91 -0
  218. package/packages/motion/src/moves/tokenPicker.ts +115 -0
  219. package/packages/motion/src/moves/truchet.ts +85 -0
  220. package/packages/motion/src/moves/wordWall.ts +78 -0
  221. package/packages/motion/src/moves/worldRoll.ts +32 -0
  222. package/packages/motion/src/particles.ts +102 -0
  223. package/packages/motion/src/react/index.tsx +21 -0
  224. package/packages/motion/src/react/parts.tsx +431 -0
  225. package/packages/motion/src/react/time.tsx +97 -0
  226. package/packages/motion/src/text.ts +103 -0
  227. package/packages/motion/src/transition.ts +82 -0
  228. package/packages/motion/src/transition3d/cards.ts +65 -0
  229. package/packages/motion/src/transition3d/chain.ts +84 -0
  230. package/packages/motion/src/transition3d/dive.ts +181 -0
  231. package/packages/motion/src/transition3d/fold.ts +110 -0
  232. package/packages/motion/src/transition3d/gl.ts +219 -0
  233. package/packages/motion/src/transition3d/index.ts +235 -0
  234. package/packages/motion/src/transition3d/live.ts +70 -0
  235. package/packages/motion/src/transition3d/portal.ts +115 -0
  236. package/packages/motion/src/transition3d/react.tsx +29 -0
  237. package/packages/motion/src/transition3d/rig.ts +600 -0
  238. package/packages/motion/src/transition3d/shatter.ts +104 -0
  239. package/packages/motion/src/transition3d/space.ts +173 -0
  240. package/packages/motion/src/transition3d/whip.ts +78 -0
  241. package/packages/motion/src/transition3d/world.ts +737 -0
  242. package/packages/motion/src/transition3d/zoomOut.ts +114 -0
  243. package/packages/motion/src/transitions2d/catalog.ts +127 -0
  244. package/packages/motion/src/transitions2d/css.d.ts +2 -0
  245. package/packages/motion/src/transitions2d/cult-ui/LICENSE.md +9 -0
  246. package/packages/motion/src/transitions2d/cult-ui/RollingNumber.tsx +43 -0
  247. package/packages/motion/src/transitions2d/gl-transitions/LICENSE +25 -0
  248. package/packages/motion/src/transitions2d/gl-transitions/shaders.ts +1931 -0
  249. package/packages/motion/src/transitions2d/index.ts +2 -0
  250. package/packages/motion/src/transitions2d/kokonutui/LICENSE +21 -0
  251. package/packages/motion/src/transitions2d/kokonutui/MatrixText.css +16 -0
  252. package/packages/motion/src/transitions2d/kokonutui/MatrixText.tsx +94 -0
  253. package/packages/motion/src/transitions2d/magicui/HyperText.css +15 -0
  254. package/packages/motion/src/transitions2d/magicui/HyperText.tsx +115 -0
  255. package/packages/motion/src/transitions2d/magicui/LICENSE.md +21 -0
  256. package/packages/motion/src/transitions2d/magicui/MorphingText.css +25 -0
  257. package/packages/motion/src/transitions2d/magicui/MorphingText.tsx +130 -0
  258. package/packages/motion/src/transitions2d/magicui/WordRotate.tsx +42 -0
  259. package/packages/motion/src/transitions2d/react.ts +13 -0
  260. package/packages/motion/src/transitions2d/skiper-ui/ClipDiv.css +39 -0
  261. package/packages/motion/src/transitions2d/skiper-ui/ClipDiv.tsx +32 -0
  262. package/packages/motion/src/transitions2d/smoothui/LICENSE +21 -0
  263. package/packages/motion/src/transitions2d/smoothui/SharedAxisY.tsx +50 -0
  264. package/packages/motion/src/transitions2d/smoothui/TextMorph.tsx +90 -0
  265. package/packages/motion/src/transitions2d/smoothui/shaders.ts +223 -0
  266. package/packages/motion/src/transitions2d/unlumen/LICENSE +21 -0
  267. package/packages/motion/src/transitions2d/unlumen/ScrambleText.tsx +114 -0
  268. package/packages/motion/src/transitions2d/vengeance-ui/LICENSE +21 -0
  269. package/packages/motion/src/transitions2d/vengeance-ui/MorphText.css +69 -0
  270. package/packages/motion/src/transitions2d/vengeance-ui/MorphText.tsx +45 -0
  271. package/packages/motion/src/type.ts +131 -0
  272. package/packages/motion/src/ui.ts +172 -0
  273. package/packages/patterns/package.json +15 -0
  274. package/packages/patterns/src/bars/rank.ts +119 -0
  275. package/packages/patterns/src/before-after/shrink.ts +127 -0
  276. package/packages/patterns/src/before-after/strike.ts +125 -0
  277. package/packages/patterns/src/code/terminal.ts +133 -0
  278. package/packages/patterns/src/compare/bars.ts +142 -0
  279. package/packages/patterns/src/compare/duel.ts +103 -0
  280. package/packages/patterns/src/end/lockup.ts +85 -0
  281. package/packages/patterns/src/end/slam.ts +91 -0
  282. package/packages/patterns/src/flow/graph.ts +250 -0
  283. package/packages/patterns/src/hook-number/counter.ts +101 -0
  284. package/packages/patterns/src/hook-number/roll.ts +179 -0
  285. package/packages/patterns/src/hook-number/slam.ts +91 -0
  286. package/packages/patterns/src/index.ts +38 -0
  287. package/packages/patterns/src/kit.ts +449 -0
  288. package/packages/patterns/src/limit/gauge.ts +117 -0
  289. package/packages/patterns/src/list/cards.ts +131 -0
  290. package/packages/patterns/src/list/cycle.ts +22 -0
  291. package/packages/patterns/src/media/panels.ts +100 -0
  292. package/packages/patterns/src/objects.ts +234 -0
  293. package/packages/patterns/src/quote/karaoke.ts +126 -0
  294. package/packages/patterns/src/quote/slam.ts +22 -0
  295. package/packages/patterns/src/screen/focus.ts +85 -0
  296. package/packages/patterns/src/steps/path.ts +137 -0
  297. package/packages/patterns/src/steps/stack.ts +111 -0
  298. package/packages/patterns/src/term-reveal/chips.ts +92 -0
  299. package/packages/patterns/src/term-reveal/expand.ts +127 -0
  300. package/packages/patterns/src/timeline/axis.ts +144 -0
  301. package/packages/patterns/src/title/mask.ts +85 -0
  302. package/packages/patterns/src/title/slam.ts +23 -0
  303. package/packages/patterns/src/toggle-sim/switch.ts +92 -0
  304. package/packages/patterns/src/trend/columns.ts +108 -0
  305. package/packages/patterns/src/trend/draw.ts +140 -0
  306. package/packages/patterns/src/types.ts +67 -0
  307. package/packages/patterns/src/words/moves.ts +42 -0
  308. package/packages/patterns/src/words/slam.ts +4 -0
  309. package/packages/plan/package.json +15 -0
  310. package/packages/plan/src/asks.ts +256 -0
  311. package/packages/plan/src/brief.ts +383 -0
  312. package/packages/plan/src/captions.ts +78 -0
  313. package/packages/plan/src/detect.ts +93 -0
  314. package/packages/plan/src/index.ts +27 -0
  315. package/packages/plan/src/layout.ts +176 -0
  316. package/packages/plan/src/llm.ts +172 -0
  317. package/packages/plan/src/look.ts +222 -0
  318. package/packages/plan/src/plan.ts +179 -0
  319. package/packages/plan/src/request.ts +55 -0
  320. package/packages/plan/src/series.ts +76 -0
  321. package/packages/plan/src/studio.ts +53 -0
  322. package/packages/plan/src/templates.ts +42 -0
  323. package/packages/plan/src/themes.ts +48 -0
  324. package/packages/plan/src/types.ts +157 -0
  325. package/packages/studio/package.json +12 -0
  326. package/packages/studio/src/index.ts +1 -0
  327. package/packages/studio/src/plugin.ts +236 -0
  328. package/packages/studio/src/ui/main.ts +503 -0
  329. package/packages/studio/src/ui/studio.css +165 -0
  330. package/packages/studio/src/ui/timeline.ts +317 -0
  331. package/packages/themes/kit/THEME-MAKE.md +68 -0
  332. package/packages/themes/kit/THEME.md +30 -0
  333. package/packages/themes/kit/briefs/og-intro-15s/brief.json +16 -0
  334. package/packages/themes/kit/briefs/og-intro-15s/facts.ts +29 -0
  335. package/packages/themes/kit/briefs/og-intro-15s/logo.svg +12 -0
  336. package/packages/themes/kit/effects.ts +5 -0
  337. package/packages/themes/kit/sample/index.html +11 -0
  338. package/packages/themes/kit/sample/main.ts +9 -0
  339. package/packages/themes/kit/sample/scenes/scene.ts +15 -0
  340. package/packages/themes/package.json +19 -0
  341. package/packages/themes/src/factory.ts +296 -0
  342. package/packages/themes/src/fx.ts +14 -0
  343. package/packages/themes/src/index.ts +114 -0
  344. package/packages/themes/src/slotkit.ts +79 -0
  345. package/packages/themes/src/slots.ts +46 -0
  346. package/packages/themes/src/stage3d.ts +197 -0
  347. package/packages/themes/src/types.ts +58 -0
  348. package/presets/kawaii-pastel.json +94 -0
  349. package/presets/neutral-dark.json +82 -0
  350. package/presets/og.json +98 -0
  351. package/series/og-shorts.json +14 -0
  352. package/skills/kasaframe/SKILL.md +33 -0
  353. package/templates/_shared/project/index.html +11 -0
  354. package/templates/_shared/project/lib/react.ts +22 -0
  355. package/templates/_shared/project/lib/stage.ts +292 -0
  356. package/templates/_shared/project/main.ts +9 -0
  357. package/templates/_shared/scenes/default.ts +21 -0
  358. package/templates/_shared/scenes/drop.ts +33 -0
  359. package/templates/_shared/scenes/end.ts +26 -0
  360. package/templates/_shared/scenes/hook.ts +18 -0
  361. package/templates/_shared/scenes/seam.ts +41 -0
  362. package/templates/_shared/scenes/step.ts +49 -0
  363. package/templates/ad/preview.png +0 -0
  364. package/templates/ad/template.json +151 -0
  365. package/templates/demo/preview.png +0 -0
  366. package/templates/demo/template.json +141 -0
  367. package/templates/explainer/preview.png +0 -0
  368. package/templates/explainer/template.json +193 -0
  369. package/templates/launch/preview.png +0 -0
  370. package/templates/launch/template.json +163 -0
  371. package/templates/mv/preview.png +0 -0
  372. package/templates/mv/scenes/default.ts +98 -0
  373. package/templates/mv/template.json +178 -0
  374. package/templates/promo/preview.png +0 -0
  375. package/templates/promo/template.json +185 -0
  376. package/templates/shorts/preview.png +0 -0
  377. package/templates/shorts/scenes/hook.ts +37 -0
  378. package/templates/shorts/template.json +196 -0
  379. package/templates/square/preview.png +0 -0
  380. package/templates/square/template.json +133 -0
  381. package/themes/debug-hud/THEME.md +39 -0
  382. package/themes/debug-hud/effects.ts +389 -0
  383. package/themes/debug-hud/sample/assets/og/logo.svg +12 -0
  384. package/themes/debug-hud/sample/beats.json +1 -0
  385. package/themes/debug-hud/sample/index.html +11 -0
  386. package/themes/debug-hud/sample/kf.json +59 -0
  387. package/themes/debug-hud/sample/lib/hudkit.ts +49 -0
  388. package/themes/debug-hud/sample/lib/og.ts +29 -0
  389. package/themes/debug-hud/sample/main.ts +9 -0
  390. package/themes/debug-hud/sample/scenes/end.ts +62 -0
  391. package/themes/debug-hud/sample/scenes/gather.ts +67 -0
  392. package/themes/debug-hud/sample/scenes/models.ts +70 -0
  393. package/themes/debug-hud/sample/scenes/price.ts +79 -0
  394. package/themes/debug-hud/sample/style.json +91 -0
  395. package/themes/debug-hud/slots.ts +99 -0
  396. package/themes/debug-hud/still.png +0 -0
  397. package/themes/debug-hud/style.json +91 -0
  398. package/themes/debug-hud/theme.json +68 -0
  399. package/themes/og-measure/THEME.md +47 -0
  400. package/themes/og-measure/effects.ts +432 -0
  401. package/themes/og-measure/sample/assets/brand/og-logo-full.svg +12 -0
  402. package/themes/og-measure/sample/assets/brand/og-logo.svg +12 -0
  403. package/themes/og-measure/sample/assets/data/measure.json +353 -0
  404. package/themes/og-measure/sample/beats.json +1 -0
  405. package/themes/og-measure/sample/index.html +11 -0
  406. package/themes/og-measure/sample/kf.json +66 -0
  407. package/themes/og-measure/sample/lib/data.ts +62 -0
  408. package/themes/og-measure/sample/main.ts +9 -0
  409. package/themes/og-measure/sample/measure.ts +78 -0
  410. package/themes/og-measure/sample/scenes/end.ts +47 -0
  411. package/themes/og-measure/sample/scenes/gather.ts +51 -0
  412. package/themes/og-measure/sample/scenes/models.ts +34 -0
  413. package/themes/og-measure/sample/scenes/one.ts +39 -0
  414. package/themes/og-measure/sample/scenes/price.ts +56 -0
  415. package/themes/og-measure/sample/style.json +97 -0
  416. package/themes/og-measure/slots.ts +88 -0
  417. package/themes/og-measure/still.png +0 -0
  418. package/themes/og-measure/style.json +97 -0
  419. package/themes/og-measure/theme.json +79 -0
  420. package/themes/riso-zine/THEME.md +43 -0
  421. package/themes/riso-zine/effects.ts +321 -0
  422. package/themes/riso-zine/sample/assets/og/logo.svg +12 -0
  423. package/themes/riso-zine/sample/beats.json +1 -0
  424. package/themes/riso-zine/sample/index.html +11 -0
  425. package/themes/riso-zine/sample/kf.json +59 -0
  426. package/themes/riso-zine/sample/lib/og.ts +29 -0
  427. package/themes/riso-zine/sample/lib/shot.ts +86 -0
  428. package/themes/riso-zine/sample/lib/zine.ts +42 -0
  429. package/themes/riso-zine/sample/main.ts +9 -0
  430. package/themes/riso-zine/sample/scenes/end.ts +61 -0
  431. package/themes/riso-zine/sample/scenes/gather.ts +62 -0
  432. package/themes/riso-zine/sample/scenes/models.ts +52 -0
  433. package/themes/riso-zine/sample/scenes/price.ts +82 -0
  434. package/themes/riso-zine/sample/style.json +99 -0
  435. package/themes/riso-zine/slots.ts +81 -0
  436. package/themes/riso-zine/still.png +0 -0
  437. package/themes/riso-zine/style.json +99 -0
  438. package/themes/riso-zine/theme.json +75 -0
  439. package/tools/beats/beats.py +372 -0
  440. package/tools/beats/requirements.txt +3 -0
  441. package/tools/lyrics/align.py +164 -0
  442. package/tools/lyrics/requirements.txt +9 -0
@@ -0,0 +1,292 @@
1
+ import { applyStyle, combine, ease, emit, lerp, progress, type SceneCtx, type Style } from "@kasaframe/core";
2
+ import { enter, type MoveName } from "@kasaframe/motion";
3
+ import { dressBg, dressText, dressWipe, type Dress } from "@kasaframe/motion/moves";
4
+
5
+ // 장면 뼈대가 같이 쓰는 무대. 카메라는 가만히 있고 주인공은 안전 영역 가운데에 선다 — 이유 없이 화면 전체를 흔들면
6
+ // 보는 사람이 주인공을 놓친다(카메라 드리프트·박마다 자세를 겹친 판이 쇼츠마다 기울고 가장자리로 밀렸다).
7
+ // 「단 0.1초도 쉬지 않는다」는 내용의 움직임이 맡는다 — 글·숫자 수(dress.text)가 박마다 바뀌고, 글 뒤 강조 띠가 박마다 차오른다.
8
+ // 바탕은 정지(still) — 뜻 없이 떠도는 빛 방울·옮겨 가는 판은 보는 사람이 무엇인지 묻게 만들어 걷었다.
9
+ // 카메라는 장면이 이유를 댈 때만 움직인다: stage.camera.pushIn·pullOut·follow·impact. 움직이는 동안만 __kf.events 에 남아
10
+ // kf check 의 camera.wander 가 「이유 없는 이동」과 가른다. 장면을 채울 때 그대로 써도, 지워도 된다.
11
+ // 연출 수(dress)를 주면 바탕·글·경계 덮기를 수 메뉴(@kasaframe/motion/moves menu)에서 건다 — kf new 가 장면마다 시드로 골라 넣는다.
12
+
13
+ export interface Stage {
14
+ box: HTMLDivElement; // 바탕 층(장면 전체) — 늘 흐르는 것은 여기에만
15
+ cam: HTMLDivElement; // 카메라 층 — 주 요소는 여기에. 가만히 있다가 camera 가 시킬 때만 움직인다
16
+ camera: Camera;
17
+ safeW: number;
18
+ safeH: number;
19
+ vertical: boolean;
20
+ /** 주인공 표시 — kf check 의 layout.edge 가 이 상자가 안전 영역 가장자리에 붙는지 본다(bigWord 는 스스로 단다) */
21
+ hero(el: HTMLElement): HTMLElement;
22
+ /**
23
+ * 낱말을 고른 글 수(dress.text)로 띄운다 — bigWord 면 큰 낱말 + 등장 움직임. paint 를 매 프레임 부른다(extra 는 그 위에 얹을 흔들림·펀치).
24
+ * ready 면 첫 프레임부터 글이 서 있다(훅·썸네일)
25
+ */
26
+ say(words: readonly string[], o?: { enter?: MoveName; color?: string; weight?: number; ready?: boolean }): { el: HTMLElement; paint: (t: number, extra?: Style) => void };
27
+ /** 경계 덮기 + 카메라(+ 이름으로 부른 움직이는 바탕). 카메라가 요소를 겨누면(to·follow) 내용을 칠한 뒤 맨 끝에 부른다 — 그 프레임의 자리를 잰다 */
28
+ tick(t: number): void;
29
+ }
30
+
31
+ /** 카메라 층 안 좌표(px, 변환 전) — w·h 를 주면 그 상자가 화면에 들어오게 배율을 줄인다 */
32
+ export interface Spot {
33
+ x: number;
34
+ y: number;
35
+ w?: number;
36
+ h?: number;
37
+ }
38
+ export type Target = HTMLElement | Spot | ((t: number) => Spot);
39
+
40
+ export interface Camera {
41
+ /** 드러냄에 다가가기 — to 가 없으면 화면 가운데로 */
42
+ pushIn(at: number, o?: { to?: Target; scale?: number; dur?: number }): Camera;
43
+ /** 비교 전체를 보이게 물러나기 — 기본은 처음 구도(배율 1)로 돌아온다. 더 넓게는 scale: 0.9 */
44
+ pullOut(at: number, o?: { to?: Target; scale?: number; dur?: number }): Camera;
45
+ /** from–to 동안 주인공 상자를 가운데에 두고 따라간다. 끝나면 앞 구도로 돌아와 선다 */
46
+ follow(target: Target, from: number, to: number, o?: { scale?: number }): Camera;
47
+ /** 한 번 툭 — 드롭·결과가 서는 순간에. 배율만 잠깐 키웠다 돌아온다 */
48
+ impact(at: number, o?: { amount?: number; dur?: number }): Camera;
49
+ /** 그 시각 카메라 층 Style — 다른 움직임과 combine 해서 쓸 때 */
50
+ pose(t: number): Style;
51
+ apply(t: number): void;
52
+ }
53
+
54
+ interface Pose {
55
+ s: number;
56
+ fx: number;
57
+ fy: number;
58
+ }
59
+
60
+ type Move =
61
+ | { kind: "push" | "pull"; at: number; dur: number; to?: Target; scale?: number }
62
+ | { kind: "follow"; at: number; end: number; to: Target; scale?: number }
63
+ | { kind: "impact"; at: number; dur: number; amount: number };
64
+
65
+ const FOLLOW_IN = 0.5;
66
+ const FOLLOW_OUT = 0.6;
67
+
68
+ /**
69
+ * 층 하나에 거는 카메라. frame 은 층 안 좌표로 본 「화면에 보일 자리」(보통 안전 영역) — 기본은 층 전체.
70
+ * 주인공을 frame 가운데로 데려오고, 배율은 상자가 frame 의 86% 안에 들어오게 누른다. 회전·원근은 쓰지 않는다.
71
+ */
72
+ export function makeCamera(layer: HTMLElement, ctx: SceneCtx, o: { frame?: { x: number; y: number; w: number; h: number } } = {}): Camera {
73
+ const frame = o.frame;
74
+ const cx = () => (frame ? frame.x + frame.w / 2 : layer.offsetWidth / 2);
75
+ const cy = () => (frame ? frame.y + frame.h / 2 : layer.offsetHeight / 2);
76
+ const fw = () => frame?.w ?? layer.offsetWidth;
77
+ const fh = () => frame?.h ?? layer.offsetHeight;
78
+ const moves: Move[] = [];
79
+ const add = (m: Move) => {
80
+ moves.push(m);
81
+ moves.sort((a, b) => a.at - b.at);
82
+ };
83
+
84
+ // 변환을 걷어 낸 층 안 좌표 — 층 상자와 요소 상자를 같은 화면에서 재고 층 배율로 나눈다(조상 배율까지 함께 나뉜다)
85
+ function spotOf(target: Target, t: number): Spot | null {
86
+ if (typeof target === "function") return target(t);
87
+ if (!(target instanceof HTMLElement)) return target;
88
+ const r = target.getBoundingClientRect();
89
+ if (r.width < 1 || r.height < 1) return null;
90
+ const lr = layer.getBoundingClientRect();
91
+ const k = lr.width / (layer.offsetWidth || 1) || 1;
92
+ return { x: (r.left + r.width / 2 - lr.left) / k, y: (r.top + r.height / 2 - lr.top) / k, w: r.width / k, h: r.height / k };
93
+ }
94
+
95
+ function goal(to: Target | undefined, scale: number | undefined, fallback: number, t: number): Pose {
96
+ const s = to ? spotOf(to, t) : null;
97
+ if (!s) return { s: scale ?? fallback, fx: cx(), fy: cy() };
98
+ const fit = Math.min(s.w ? (fw() * 0.86) / s.w : Infinity, s.h ? (fh() * 0.86) / s.h : Infinity);
99
+ return { s: Math.min(scale ?? fallback, fit), fx: s.x, fy: s.y };
100
+ }
101
+
102
+ const mix = (a: Pose, b: Pose, p: number): Pose => ({ s: lerp(a.s, b.s, p), fx: lerp(a.fx, b.fx, p), fy: lerp(a.fy, b.fy, p) });
103
+
104
+ // 앞 움직임이 다 끝났으면 그 끝 구도에서, 겹치면 지금 구도에서 이어 간다 — 늘 t 하나로 정해진다
105
+ function at(t: number): { p: Pose; kick: number } {
106
+ let p: Pose = { s: 1, fx: cx(), fy: cy() };
107
+ let kick = 0;
108
+ for (const m of moves) {
109
+ if (t < m.at) break;
110
+ if (m.kind === "impact") {
111
+ const e = t - m.at;
112
+ if (e < m.dur) {
113
+ kick += m.amount * Math.exp(-e / (m.dur * 0.3)) * (1 - e / m.dur);
114
+ emit({ kind: "camera", source: "stage:impact", scene: ctx.id, value: kick * 1000 });
115
+ }
116
+ continue;
117
+ }
118
+ if (m.kind === "follow") {
119
+ const w = ease.inOutCubic(progress(t, m.at, FOLLOW_IN)) * (1 - ease.inOutCubic(progress(t, m.end, FOLLOW_OUT)));
120
+ if (w > 0) {
121
+ p = mix(p, goal(m.to, m.scale, p.s, t), w);
122
+ emit({ kind: "camera", source: "stage:follow", scene: ctx.id, value: 1 });
123
+ }
124
+ continue;
125
+ }
126
+ const raw = progress(t, m.at, m.dur);
127
+ const target = goal(m.to, m.scale, m.kind === "push" ? 1.15 : 1, t);
128
+ p = mix(p, target, ease.inOutCubic(raw));
129
+ if (raw > 0 && raw < 1) emit({ kind: "camera", source: `stage:${m.kind}`, scene: ctx.id, value: Math.abs(target.s - p.s) * 1000 + Math.hypot(target.fx - p.fx, target.fy - p.fy) });
130
+ }
131
+ return { p, kick };
132
+ }
133
+
134
+ const cam: Camera = {
135
+ pushIn(t, x = {}) {
136
+ add({ kind: "push", at: t, dur: x.dur ?? 1, to: x.to, scale: x.scale });
137
+ return cam;
138
+ },
139
+ pullOut(t, x = {}) {
140
+ add({ kind: "pull", at: t, dur: x.dur ?? 0.9, to: x.to, scale: x.scale });
141
+ return cam;
142
+ },
143
+ follow(target, from, to, x = {}) {
144
+ add({ kind: "follow", at: from, end: to, to: target, scale: x.scale });
145
+ return cam;
146
+ },
147
+ impact(t, x = {}) {
148
+ add({ kind: "impact", at: t, dur: x.dur ?? 0.35, amount: x.amount ?? 0.04 });
149
+ return cam;
150
+ },
151
+ pose(t) {
152
+ if (!moves.length) return {};
153
+ const { p, kick } = at(t);
154
+ const s = p.s * (1 + kick);
155
+ return { x: -s * (p.fx - cx()), y: -s * (p.fy - cy()), scale: s };
156
+ },
157
+ apply(t) {
158
+ layer.style.transformOrigin = `${cx()}px ${cy()}px`;
159
+ applyStyle(layer, cam.pose(t));
160
+ },
161
+ };
162
+ return cam;
163
+ }
164
+
165
+ // 컷 시각 — 잰 박 목록을 그대로 쓴다(BPM 을 곱하지 않는다). 빠른 곡은 박 몇 개를 묶어 0.6초 넘는 간격으로.
166
+ // 박이 끊긴 곳(곡 앞뒤·잘라 쓴 끝)은 1.2초 간격으로 메워 장면 처음부터 끝까지 컷이 이어진다.
167
+ // 화면 안 내용을 바꾸는 시각이다(새 요소·숫자·칸 채우기) — 카메라를 여기마다 옮기지 않는다
168
+ export function cutTimes(ctx: SceneCtx): number[] {
169
+ const b = ctx.beats.beats.filter((x) => x >= 0 && x < ctx.dur);
170
+ let picked: number[] = [];
171
+ if (b.length >= 2) {
172
+ const gap = (b[b.length - 1] - b[0]) / (b.length - 1);
173
+ const every = Math.max(1, Math.round(0.6 / gap));
174
+ picked = b.filter((_, i) => i % every === 0);
175
+ }
176
+ const anchors = [0];
177
+ for (const t of picked) if (t - anchors[anchors.length - 1] >= 0.3) anchors.push(t);
178
+ anchors.push(ctx.dur);
179
+ const out: number[] = [];
180
+ for (let i = 0; i < anchors.length - 1; i++) {
181
+ const n = Math.max(1, Math.ceil((anchors[i + 1] - anchors[i]) / 1.2));
182
+ for (let k = 0; k < n; k++) out.push(anchors[i] + ((anchors[i + 1] - anchors[i]) * k) / n);
183
+ }
184
+ return out;
185
+ }
186
+
187
+ export function makeStage(root: HTMLElement, ctx: SceneCtx, o: { panel?: boolean; dress?: Dress } = {}): Stage {
188
+ const { top, right, bottom, left } = ctx.safe;
189
+ const { width, height } = ctx.meta;
190
+ // root 의 display 는 mountProject 가 장면을 켜고 끌 때 쓴다 — 배치는 안쪽 상자에
191
+ const box = document.createElement("div");
192
+ box.style.cssText = "position:absolute;inset:0;overflow:hidden;background:var(--kf-bg)";
193
+ const safeW = width - left - right;
194
+ const safeH = height - top - bottom;
195
+ // 바탕은 정지(still) — 패턴이 제 바탕을 그리면(panel: false) 바탕색만
196
+ const bgLayer = document.createElement("div");
197
+ bgLayer.style.cssText = "position:absolute;inset:0";
198
+ const bg = o.panel === false ? null : dressBg(o.dress?.bg ?? "still", bgLayer, ctx);
199
+ if (o.panel !== false) box.append(bgLayer);
200
+ const cam = document.createElement("div");
201
+ cam.style.cssText = `position:absolute;left:${left}px;top:${top}px;right:${right}px;bottom:${bottom}px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:28px`;
202
+ box.append(cam);
203
+ // 경계 덮기는 맨 위 층 — 앞 장면 끝을 덮은 덮개가 다음 장면 첫 프레임에서 그대로 걷힌다
204
+ const wipes = (["in", "out"] as const)
205
+ .map((side) => {
206
+ const name = side === "in" ? o.dress?.wipeIn : o.dress?.wipeOut;
207
+ if (!name || name === "none") return null;
208
+ const layer = document.createElement("div");
209
+ layer.style.cssText = "position:absolute;inset:0;pointer-events:none;z-index:60";
210
+ const paint = dressWipe(name, layer, ctx, side);
211
+ if (paint) box.append(layer);
212
+ return paint;
213
+ })
214
+ .filter((p): p is (t: number) => void => !!p);
215
+ root.append(box);
216
+ const camera = makeCamera(cam, ctx, { frame: { x: 0, y: 0, w: safeW, h: safeH } });
217
+ const cuts = cutTimes(ctx);
218
+ const stage: Stage = {
219
+ box,
220
+ cam,
221
+ camera,
222
+ safeW,
223
+ safeH,
224
+ vertical: height > width,
225
+ hero(el) {
226
+ el.dataset.kfHero = "";
227
+ return el;
228
+ },
229
+ say(words, x = {}) {
230
+ // 글 뒤 강조 띠 — 컷(박)마다 글 폭만큼 왼쪽부터 차오른다(형광펜으로 지금 읽힐 자리를 칠하는 강조).
231
+ // 글 수가 박에 바뀐 뒤 다음 박까지 서 있는 사이에도 내용이 움직인다 — 0.1초 멈춤 규칙을 이 띠가 넘긴다
232
+ const mark = document.createElement("div");
233
+ mark.style.cssText = `position:absolute;left:${Math.round(safeW * 0.1)}px;top:${Math.round(safeH * 0.37)}px;width:${Math.round(safeW * 0.8)}px;height:${Math.round(safeH * 0.26)}px;border-radius:${Math.round(safeH * 0.03)}px;background:color-mix(in srgb, var(--kf-accent) 50%, transparent);transform-origin:0 50%`;
234
+ stage.cam.append(mark);
235
+ const sweep = (t: number) => {
236
+ let k = 0;
237
+ while (k + 1 < cuts.length && cuts[k + 1] <= t) k++;
238
+ const a = cuts[k] ?? 0;
239
+ const b = cuts[k + 1] ?? ctx.dur;
240
+ mark.style.transform = `scaleX(${progress(t, a, Math.max(0.05, b - a)).toFixed(4)})`;
241
+ };
242
+ const host = document.createElement("div");
243
+ host.style.cssText = "position:absolute;inset:0";
244
+ const move = o.dress ? dressText(o.dress.text, host, ctx, { words, w: safeW, h: safeH, ready: x.ready }) : null;
245
+ if (move) {
246
+ // 수가 안전 영역 전체를 쓰니 그 상자를 주인공으로 짚으면 늘 가장자리에 붙은 것으로 잡힌다 — 글은 수가 가운데에 세운다
247
+ stage.cam.append(host);
248
+ return {
249
+ el: host,
250
+ paint(t, extra) {
251
+ sweep(t);
252
+ move(t);
253
+ if (extra) applyStyle(host, extra);
254
+ },
255
+ };
256
+ }
257
+ const word = bigWord(words[0] ?? "", stage, { color: x.color, weight: x.weight });
258
+ return {
259
+ el: word,
260
+ paint(t, extra) {
261
+ sweep(t);
262
+ applyStyle(word, combine(x.enter ? enter(x.enter, t, { at: 0, scene: ctx.id }) : {}, extra));
263
+ },
264
+ };
265
+ },
266
+ tick(t: number) {
267
+ bg?.(t);
268
+ for (const w of wipes) w(t);
269
+ camera.apply(t);
270
+ },
271
+ };
272
+ return stage;
273
+ }
274
+
275
+ // 렌더가 마지막으로 찍는 장면 안 시각 — 되돌이(끝 화면이 첫 화면으로 이어지는 쇼츠·피드)는 ctx.dur 이 아니라 여기서 움직임을 끝낸다
276
+ export const lastT = (ctx: SceneCtx): number => ctx.dur - 1 / ctx.meta.fps;
277
+
278
+ // 글자 수로 크기를 정한다(렌더 전엔 잴 수 없다) — 한글·한자는 1em, 라틴은 0.62em 으로 어림해 안전 영역 폭의 몫에 맞춘다
279
+ export function fitPx(text: string, width: number, o: { share?: number; max?: number; min?: number } = {}): number {
280
+ const em = [...text].reduce((a, c) => a + (/[ᄀ-ᇿ㄰-㆏가-힯一-鿿]/.test(c) ? 1 : c === " " ? 0.3 : 0.62), 0) || 1;
281
+ return Math.round(Math.max(o.min ?? 48, Math.min(o.max ?? 420, (width * (o.share ?? 0.7)) / em)));
282
+ }
283
+
284
+ // 큰 낱말 하나 — 화면 채움 규칙에 맞는 크기로, 주인공 표시를 달아 카메라 층 가운데에
285
+ export function bigWord(text: string, stage: Stage, o: { color?: string; weight?: number; share?: number } = {}): HTMLDivElement {
286
+ const el = document.createElement("div");
287
+ el.textContent = text;
288
+ const px = fitPx(text, stage.safeW, { share: o.share ?? (stage.vertical ? 0.72 : 0.62), max: stage.vertical ? 360 : 420 });
289
+ el.style.cssText = `position:relative;font-family:var(--kf-font-display);font-size:${px}px;font-weight:${o.weight ?? 800};line-height:1.02;color:${o.color ?? "var(--kf-ink)"};letter-spacing:var(--kf-tracking);text-align:center;word-break:keep-all;white-space:nowrap`;
290
+ stage.cam.append(stage.hero(el));
291
+ return el;
292
+ }
@@ -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,21 @@
1
+ import type { SceneCtx } from "@kasaframe/core";
2
+ import type { MoveName } from "@kasaframe/motion";
3
+ import type { Dress } from "@kasaframe/motion/moves";
4
+ import { makeStage } from "../lib/stage.ts";
5
+
6
+ const WORDS = ["{{word}}", "{{title}}"];
7
+ // 이어지는 두 장면이 같은 등장을 쓰면 검사가 잡는다(repeatSameMove) — kf new 가 장면 순번으로 돌려 넣는다
8
+ const MOVE: MoveName = "{{move}}";
9
+ // 연출 수 — kf new 가 용도·테마 묶음에서 시드로 골랐다(같은 요청이면 같은 수). 바꾸려면 MAKE.md 「연출 수」 메뉴의 이름으로
10
+ const DRESS: Dress = { bg: "{{bg}}", text: "{{text}}", wipeIn: "{{wipeIn}}", wipeOut: "{{wipeOut}}" };
11
+
12
+ export default {
13
+ build(root: HTMLElement, ctx: SceneCtx) {
14
+ const stage = makeStage(root, ctx, { dress: DRESS });
15
+ const words = stage.say(WORDS, { enter: MOVE });
16
+ return (t: number) => {
17
+ words.paint(t);
18
+ stage.tick(t);
19
+ };
20
+ },
21
+ };
@@ -0,0 +1,33 @@
1
+ import { applyStyle, combine, type SceneCtx } from "@kasaframe/core";
2
+ import { beatPulse, dropBurst, type MoveName } from "@kasaframe/motion";
3
+ import type { Dress } from "@kasaframe/motion/moves";
4
+ import { makeStage } from "../lib/stage.ts";
5
+
6
+ const WORDS = ["{{word}}", "{{title}}"];
7
+ const MOVE: MoveName = "{{move}}";
8
+ const DRESS: Dress = { bg: "{{bg}}", text: "{{text}}", wipeIn: "{{wipeIn}}", wipeOut: "{{wipeOut}}" };
9
+
10
+ // 장면 시작이 드롭에 붙어 있다(template anchor drop:k). 섬광·충격파·흔들림은 dropBurst 가 style.json 규칙(드롭 전용·maxPx)대로 내고
11
+ // window.__kf.events 에 남겨 검사가 센다 — 손으로 짜면 규칙 위반을 못 잡는다
12
+ export default {
13
+ build(root: HTMLElement, ctx: SceneCtx) {
14
+ const stage = makeStage(root, ctx, { dress: DRESS });
15
+ const ring = document.createElement("div");
16
+ ring.style.cssText = "position:absolute;left:50%;top:50%;width:600px;height:600px;margin:-300px 0 0 -300px;border-radius:50%;border:12px solid var(--kf-accent)";
17
+ stage.box.insertBefore(ring, stage.cam);
18
+ const words = stage.say(WORDS, { enter: MOVE, weight: 900, ready: true });
19
+ const flash = document.createElement("div");
20
+ flash.style.cssText = "position:absolute;inset:0;background:var(--kf-accent)";
21
+ stage.box.append(flash);
22
+ const drop = ctx.beats.drops.findIndex((d) => d >= -0.05 && d < ctx.dur);
23
+ return (t: number) => {
24
+ const b = drop >= 0 ? dropBurst(t, { beats: ctx.beats, drop, rules: ctx.style.motion, scene: ctx.id }) : null;
25
+ flash.style.opacity = String((b?.flash ?? 0) * 0.85);
26
+ applyStyle(ring, b ? { scale: b.ring.scale, opacity: b.ring.opacity } : { opacity: 0 });
27
+ // 박 펄스는 큰 낱말에만 — 글 수는 스스로 박에 터지고, 수가 깐 판 전체를 박마다 키우면 가장자리가 깜빡여 섬광 검사에 걸린다
28
+ const pulse = DRESS.text === "bigWord" ? beatPulse(t, { beats: ctx.beats, rules: ctx.style.motion, scene: ctx.id, source: "drop-word" }) : undefined;
29
+ words.paint(t, combine(b?.shake, b?.punch, pulse));
30
+ stage.tick(t);
31
+ };
32
+ },
33
+ };
@@ -0,0 +1,26 @@
1
+ import { applyStyle, type SceneCtx } from "@kasaframe/core";
2
+ import { enter, type MoveName } from "@kasaframe/motion";
3
+ import type { Dress } from "@kasaframe/motion/moves";
4
+ import { fitPx, makeStage } from "../lib/stage.ts";
5
+
6
+ const NAME = "{{title}}";
7
+ const LINE = "{{line}}";
8
+ const MOVE: MoveName = "{{move}}";
9
+ const DRESS: Dress = { bg: "{{bg}}", text: "{{text}}", wipeIn: "{{wipeIn}}", wipeOut: "{{wipeOut}}" };
10
+
11
+ export default {
12
+ build(root: HTMLElement, ctx: SceneCtx) {
13
+ const stage = makeStage(root, ctx, { dress: DRESS });
14
+ const name = stage.say([NAME], { enter: MOVE });
15
+ const line = document.createElement("div");
16
+ line.textContent = LINE;
17
+ // 이름 수가 안전 영역을 다 쓰니 한 줄은 아래 띠에 — 이름과 겹치지 않는다
18
+ line.style.cssText = `position:absolute;left:0;right:0;bottom:4%;z-index:5;font-family:var(--kf-font-sans);font-size:${fitPx(LINE, stage.safeW, { share: 0.6, max: 64, min: 40 })}px;color:var(--kf-dim);word-break:keep-all;text-align:center`;
19
+ if (LINE) stage.cam.append(line);
20
+ return (t: number) => {
21
+ name.paint(t);
22
+ applyStyle(line, enter("fade", t, { at: 0.25, scene: ctx.id }));
23
+ stage.tick(t);
24
+ };
25
+ },
26
+ };
@@ -0,0 +1,18 @@
1
+ import { clip, ease, type SceneCtx } from "@kasaframe/core";
2
+ import type { Dress } from "@kasaframe/motion/moves";
3
+ import { makeStage } from "../lib/stage.ts";
4
+
5
+ const WORDS = ["{{word}}", "{{title}}"];
6
+ const DRESS: Dress = { bg: "{{bg}}", text: "{{text}}", wipeIn: "{{wipeIn}}", wipeOut: "{{wipeOut}}" };
7
+
8
+ // 훅은 첫 프레임부터 내용이 있어야 한다 — 페이드로 시작하면 썸네일·첫 화면이 빈다
9
+ export default {
10
+ build(root: HTMLElement, ctx: SceneCtx) {
11
+ const stage = makeStage(root, ctx, { dress: DRESS });
12
+ const words = stage.say(WORDS, { color: "var(--kf-accent)", weight: 900, ready: true });
13
+ return (t: number) => {
14
+ words.paint(t, { scale: 1.12 - 0.12 * ease.outBack(clip(t, 0, 0.5).p) });
15
+ stage.tick(t);
16
+ };
17
+ },
18
+ };
@@ -0,0 +1,41 @@
1
+ import type { SceneCtx } from "@kasaframe/core";
2
+ import { transition3d, type Transition3dName } from "@kasaframe/motion/transition3d";
3
+ import kf from "../kf.json";
4
+
5
+ // 앞·뒤 장면을 살아 있는 화면으로 넘긴다(전환 중에도 앞 장면이 계속 돈다). 그걸 못 하는 브라우저면 assets/seam 정지 그림
6
+ const scenes = import.meta.glob("./*.ts", { eager: true });
7
+
8
+ // 이음매 — 앞 장면 마지막 화면에서 뒤 장면 첫 화면으로 잇는 모션그래픽 전환. 앞뒤 화면 두 장(assets/seam/<id>-from·to.png)은
9
+ // kf make 가 장면을 다 쓴 뒤 찍어 넣고, 없으면 style 색 대체 화면으로 돈다. 종류: dive·portal·cards·shatter·zoomOut·fold
10
+ const KIND = "{{transition}}" as Transition3dName;
11
+
12
+ // 요청에 「영상 생성」을 적어 생성 영상(assets/gen/<id>.mp4)이 만들어졌으면 그걸 깐다 —
13
+ // 없는 <video> 를 넣으면 페이지 ready 가 loadeddata 를 끝없이 기다려서 먼저 있는지 본다
14
+ function exists(url: string): boolean {
15
+ const x = new XMLHttpRequest();
16
+ x.open("HEAD", url, false);
17
+ try {
18
+ x.send();
19
+ } catch {
20
+ return false;
21
+ }
22
+ return x.status === 200 && (x.getResponseHeader("content-type") ?? "").startsWith("video/");
23
+ }
24
+
25
+ export default {
26
+ build(root: HTMLElement, ctx: SceneCtx) {
27
+ const url = ctx.asset(`gen/${ctx.id}.mp4`);
28
+ if (exists(url)) {
29
+ const video = document.createElement("video");
30
+ video.src = url;
31
+ video.muted = true;
32
+ video.playsInline = true;
33
+ video.preload = "auto";
34
+ video.dataset.kfFrom = String(ctx.from);
35
+ video.style.cssText = "position:absolute;inset:0;width:100%;height:100%;object-fit:cover";
36
+ root.append(video);
37
+ return () => {};
38
+ }
39
+ return transition3d(root, ctx, { kind: KIND, live: { kf, scenes } });
40
+ },
41
+ };
@@ -0,0 +1,49 @@
1
+ import { applyStyle, type SceneCtx } from "@kasaframe/core";
2
+ import { cursor, enter, terminal, type MoveName } from "@kasaframe/motion";
3
+ import type { Dress } from "@kasaframe/motion/moves";
4
+ import { makeStage } from "../lib/stage.ts";
5
+
6
+ const STEP = "{{word}}";
7
+ const MOVE: MoveName = "{{move}}";
8
+ const COMMANDS = [{ cmd: "kf new demo --template demo", out: ["장면 6개 · 60초"] }];
9
+ // 창이 주인공이라 글 수는 안 쓰고 바탕·경계 덮기만 건다
10
+ const DRESS: Dress = { bg: "{{bg}}", text: "bigWord", wipeIn: "{{wipeIn}}", wipeOut: "{{wipeOut}}" };
11
+
12
+ // 시연 한 단계 — 창(터미널) 하나 + 누를 자리로 다가가는 카메라 + 커서 + 단계 번호. 화면 녹화가 있으면 창 안을 <video data-kf-from> 로 바꾼다
13
+ export default {
14
+ build(root: HTMLElement, ctx: SceneCtx) {
15
+ // 흐르는 바탕·컷마다 바뀌는 판이 「쉬지 않기」를 진다 — 창은 가만히 서고, 카메라는 누른 뒤 한 번만 다가간다
16
+ const stage = makeStage(root, ctx, { dress: DRESS });
17
+ const cam = document.createElement("div");
18
+ // 창이 바탕을 다 덮으면 흐르는 바탕이 안 보여 멈춘 화면이 된다 — 둘레를 남긴다
19
+ cam.style.cssText = "position:relative;width:min(1100px, 70%)";
20
+ const win = document.createElement("div");
21
+ win.style.cssText = "background:var(--kf-surface);border:1px solid var(--kf-line);border-radius:var(--kf-radius-lg);box-shadow:var(--kf-shadow-lift);padding:40px 48px;min-height:520px;font-family:var(--kf-font-mono);font-size:46px;line-height:1.6;color:var(--kf-ink)";
22
+ const badge = document.createElement("div");
23
+ badge.textContent = STEP;
24
+ badge.style.cssText = "position:absolute;left:-24px;top:-36px;background:var(--kf-accent);color:var(--kf-on-accent);font-family:var(--kf-font-display);font-weight:800;font-size:max(44px, var(--kf-size-body));padding:10px 22px;border-radius:var(--kf-radius-pill)";
25
+ const pointer = document.createElement("div");
26
+ pointer.innerHTML = '<svg width="44" height="44" viewBox="0 0 24 24"><path d="M4 2 L4 20 L9 15 L12.5 22 L15.5 20.5 L12 13.8 L19 13.8 Z" fill="currentColor" stroke="white" stroke-width="1.4" stroke-linejoin="round"/></svg>';
27
+ pointer.style.cssText = "position:absolute;left:0;top:0;color:var(--kf-ink);filter:drop-shadow(0 2px 4px rgba(0,0,0,.25))";
28
+ cam.append(win, badge, pointer);
29
+ stage.cam.append(cam);
30
+ const click = Math.min(1.2, ctx.dur * 0.3);
31
+ const typed = 0.5 + COMMANDS[0].cmd.length / 16 + 0.3;
32
+ const FRAMES = Math.round(ctx.dur * ctx.meta.fps);
33
+ stage.camera.pushIn(click, { to: () => ({ x: cam.offsetLeft + 0.42 * cam.offsetWidth, y: cam.offsetTop + 0.45 * cam.offsetHeight }), scale: 1.12, dur: 1.2 });
34
+ return (t: number) => {
35
+ const st = terminal(t, COMMANDS, { at: 0.5, cps: 16 });
36
+ // 명령을 친 뒤에는 그 일의 진행이 구른다 — 프레임 수가 장면 끝까지 차오른다(쉬지 않기를 뜻 있는 숫자가 진다)
37
+ const done = Math.round(FRAMES * Math.min(1, Math.max(0, (t - typed) / Math.max(0.5, ctx.dur - typed))));
38
+ const run = t > typed ? `<div style="color:var(--kf-dim)">프레임 ${String(done).padStart(4, " ")} / ${FRAMES}</div>` : "";
39
+ win.innerHTML =
40
+ st.lines
41
+ .map((l) => `<div>${l.kind === "cmd" ? `<span style="color:var(--kf-accent)">${l.prompt} </span>` : ""}${l.text.replace(/</g, "&lt;")}${l.caret ? '<span style="display:inline-block;width:.55em;height:1.1em;vertical-align:-.2em;background:var(--kf-accent)"></span>' : ""}</div>`)
42
+ .join("") + run;
43
+ const c = cursor(t, [{ t: 0, x: 900, y: 520 }, { t: click, x: 300, y: 120, click: true }, { t: ctx.dur, x: 360, y: 160 }]);
44
+ applyStyle(pointer, { x: c.x, y: c.y, scale: c.pressed ? 0.9 : 1 });
45
+ applyStyle(cam, enter(MOVE, t, { at: 0, scene: ctx.id }));
46
+ stage.tick(t);
47
+ };
48
+ },
49
+ };
Binary file
@@ -0,0 +1,151 @@
1
+ {
2
+ "id": "ad",
3
+ "label": "광고",
4
+ "summary": "광고 — 6·15·30초 고정, 브랜드는 첫 2초 안",
5
+ "aspect": "16:9",
6
+ "width": 1920,
7
+ "height": 1080,
8
+ "fps": 60,
9
+ "variants": {
10
+ "9:16": {
11
+ "width": 1080,
12
+ "height": 1920,
13
+ "safeArea": {
14
+ "top": 230,
15
+ "bottom": 460,
16
+ "left": 40,
17
+ "right": 40
18
+ }
19
+ },
20
+ "1:1": {
21
+ "width": 1080,
22
+ "height": 1080,
23
+ "safeArea": {
24
+ "top": 60,
25
+ "bottom": 60,
26
+ "left": 60,
27
+ "right": 60
28
+ }
29
+ }
30
+ },
31
+ "duration": {
32
+ "min": 6,
33
+ "max": 30,
34
+ "default": 15,
35
+ "allowed": [
36
+ 6,
37
+ 15,
38
+ 30
39
+ ]
40
+ },
41
+ "music": "optional",
42
+ "captions": "on",
43
+ "loop": false,
44
+ "style": "kasaterm",
45
+ "safeArea": {
46
+ "top": 60,
47
+ "bottom": 60,
48
+ "left": 80,
49
+ "right": 80
50
+ },
51
+ "text": {
52
+ "policy": "captions",
53
+ "maxOnScreen": 6,
54
+ "minPx": 56
55
+ },
56
+ "motion": {
57
+ "beatPulse": "drops-only",
58
+ "shake": {
59
+ "on": [],
60
+ "maxPerPhrase": 0,
61
+ "maxPx": 0
62
+ },
63
+ "cameraMove": "once-per-phrase",
64
+ "repeatSameMove": false,
65
+ "maxFreezeSec": 0.1,
66
+ "staticSec": {
67
+ "warn": 1.5,
68
+ "error": 3
69
+ },
70
+ "beatMove": "every-beat"
71
+ },
72
+ "moves": {
73
+ "text": [
74
+ "slamWords",
75
+ "splitFlap",
76
+ "ransomLetters"
77
+ ],
78
+ "wipe": [
79
+ "brushWipe",
80
+ "flood"
81
+ ],
82
+ "roles": {
83
+ "brand": {
84
+ "text": [
85
+ "slamWords"
86
+ ]
87
+ }
88
+ }
89
+ },
90
+ "scenes": [
91
+ {
92
+ "id": "brand",
93
+ "role": "brand",
94
+ "sec": 2,
95
+ "anchor": "start",
96
+ "idea": "브랜드 — 로고나 이름이 첫 2초 안에 또렷하게"
97
+ },
98
+ {
99
+ "id": "message",
100
+ "role": "message",
101
+ "weight": 1,
102
+ "snap": "beat",
103
+ "idea": "한 가지 약속 — 문장 하나, 그걸 보여 주는 그림 하나"
104
+ },
105
+ {
106
+ "id": "cta",
107
+ "role": "end",
108
+ "sec": 2,
109
+ "anchor": "end",
110
+ "idea": "행동 한 줄 — 주소·버튼·날짜. 로고 다시"
111
+ }
112
+ ],
113
+ "assets": {
114
+ "need": [
115
+ "logo"
116
+ ],
117
+ "want": [
118
+ "product-shots"
119
+ ],
120
+ "gen": [
121
+ "img:message-hero"
122
+ ],
123
+ "act": "message"
124
+ },
125
+ "deliverables": [
126
+ "mp4",
127
+ "cover"
128
+ ],
129
+ "detect": {
130
+ "words": [
131
+ "광고",
132
+ "범퍼",
133
+ "범퍼 광고",
134
+ "CF",
135
+ "광고 영상",
136
+ "ad",
137
+ "advert",
138
+ "commercial",
139
+ "bumper"
140
+ ],
141
+ "hints": [
142
+ "6초",
143
+ "15초",
144
+ "30초",
145
+ "캠페인",
146
+ "campaign",
147
+ "cta"
148
+ ],
149
+ "aspect": "16:9"
150
+ }
151
+ }
Binary file