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 @@
1
+ {"source": "assets/music/kawaii-friends-0400.mp3", "from": 0, "duration": 15.0, "bpm": 170.0, "beats": [0.2899, 0.6382, 0.9923, 1.3464, 1.6947, 2.0546, 2.4029, 2.757, 3.1169, 3.4652, 3.8251, 4.1734, 4.5275, 4.8758, 5.2299, 5.584, 5.9381, 6.2922, 6.6463, 6.9946, 7.336, 7.6971, 8.0628, 8.4053, 8.7478, 9.1135, 9.4676, 9.8159, 10.1816, 10.5241, 10.8782, 11.2265, 11.5748, 11.9405, 12.3004, 12.6487, 12.997, 13.3453, 13.7052, 14.0477, 14.396, 14.7617], "downbeats": [0.2899, 1.6947, 3.1169, 4.5275, 5.9381, 7.336, 8.7478, 10.1816, 11.5748, 12.997, 14.396], "bars": [0.2899, 1.6947, 3.1169, 4.5275, 5.9381, 7.336, 8.7478, 10.1816, 11.5748, 12.997, 14.396], "phrases": [0.0, 1.6947, 7.336, 12.997], "sections": [{"t": 0.0, "kind": "intro"}, {"t": 7.336, "kind": "drop", "strength": 0.99}], "drops": [7.336], "energy": {"hz": 20, "low": [0.0, 0.144, 0.183, 0.0, 0.0, 0.001, 0.0, 0.0, 0.208, 0.21, 0.0, 0.0, 0.0, 0.0, 0.0, 0.226, 0.241, 0.0, 0.0, 0.394, 0.25, 0.0, 0.131, 0.19, 0.033, 0.024, 0.245, 0.101, 0.009, 0.0, 0.0, 0.016, 0.134, 0.285, 0.097, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.371, 0.335, 0.0, 0.0, 0.148, 0.0, 0.0, 0.265, 0.171, 0.0, 0.0, 0.184, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.249, 0.015, 0.0, 0.0, 0.0, 0.0, 0.072, 0.297, 0.092, 0.009, 0.312, 0.389, 0.096, 0.031, 0.133, 0.021, 0.112, 0.0, 0.0, 0.074, 0.0, 0.227, 0.089, 0.018, 0.0, 0.091, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.022, 0.0, 0.0, 0.026, 0.02, 0.006, 0.184, 0.411, 0.068, 0.0, 0.156, 0.083, 0.0, 0.055, 0.182, 0.074, 0.0, 0.288, 0.232, 0.072, 0.022, 0.0, 0.0, 0.0, 0.0, 0.0, 0.015, 0.018, 0.053, 0.0, 0.03, 0.0, 0.0, 0.004, 0.094, 0.461, 0.453, 0.505, 0.55, 0.588, 0.627, 0.672, 0.72, 0.752, 0.759, 0.767, 0.772, 0.761, 0.724, 0.896, 0.998, 0.973, 0.838, 0.624, 0.667, 0.733, 0.796, 0.819, 0.8, 0.747, 0.833, 0.811, 0.816, 0.733, 0.507, 0.341, 0.066, 0.062, 0.0, 0.0, 0.798, 0.981, 1.0, 0.943, 0.813, 0.803, 0.799, 0.747, 0.606, 0.6, 0.606, 0.622, 0.649, 0.684, 0.812, 0.992, 0.986, 0.92, 0.668, 0.628, 0.572, 0.479, 0.365, 0.0, 0.0, 0.075, 0.0, 0.0, 0.758, 1.0, 1.0, 0.979, 0.876, 0.899, 0.9, 0.844, 0.772, 0.805, 0.811, 0.83, 0.858, 0.897, 0.945, 1.0, 0.961, 0.898, 0.862, 0.911, 0.902, 0.822, 0.611, 0.352, 0.0, 0.083, 0.0, 0.0, 0.682, 0.999, 0.985, 0.983, 0.897, 0.871, 0.869, 0.855, 0.74, 0.678, 0.686, 0.705, 0.733, 0.771, 0.793, 0.956, 0.999, 0.955, 0.815, 0.738, 0.75, 0.757, 0.672, 0.597, 0.618, 0.761, 0.977, 0.994, 0.935, 0.8, 0.8, 0.792, 0.782, 0.743, 0.643, 0.522, 0.898, 0.996, 0.975, 0.829, 0.577, 0.615, 0.683, 0.739, 0.765, 0.748, 0.703, 0.763, 0.752, 0.757, 0.68, 0.478, 0.287, 0.03, 0.055, 0.0, 0.022, 0.832, 0.99, 0.967, 0.886, 0.739, 0.749, 0.76, 0.719, 0.607, 0.613, 0.628, 0.645, 0.669, 0.713, 0.823, 1.0, 0.989, 0.916, 0.754, 0.736], "mid": [0.625, 0.806, 0.843, 0.738, 0.642, 0.71, 0.726, 0.582, 0.708, 0.759, 0.668, 0.544, 0.611, 0.572, 0.451, 0.785, 0.835, 0.629, 0.607, 0.911, 0.834, 0.737, 0.856, 0.806, 0.755, 0.566, 0.739, 0.759, 0.685, 0.742, 0.708, 0.66, 0.649, 0.834, 0.819, 0.654, 0.626, 0.747, 0.713, 0.526, 0.65, 0.711, 0.616, 0.518, 0.679, 0.644, 0.437, 0.861, 0.792, 0.499, 0.6, 0.773, 0.665, 0.541, 0.865, 0.918, 0.817, 0.666, 0.852, 0.772, 0.629, 0.697, 0.756, 0.683, 0.585, 0.767, 0.706, 0.55, 0.633, 0.706, 0.632, 0.595, 0.805, 0.726, 0.689, 0.822, 0.841, 0.661, 0.738, 0.746, 0.585, 0.553, 0.588, 0.601, 0.599, 0.566, 0.831, 0.755, 0.6, 0.698, 0.863, 0.782, 0.543, 0.66, 0.617, 0.593, 0.647, 0.707, 0.746, 0.728, 0.746, 0.741, 0.665, 0.748, 0.881, 0.656, 0.472, 0.682, 0.66, 0.618, 0.719, 0.915, 0.852, 0.797, 0.899, 0.862, 0.789, 0.769, 0.7, 0.637, 0.575, 0.608, 0.638, 0.653, 0.664, 0.714, 0.763, 0.732, 0.705, 0.722, 0.722, 0.794, 0.908, 0.714, 0.575, 0.602, 0.584, 0.615, 0.628, 0.732, 0.814, 0.826, 0.779, 0.756, 0.718, 0.641, 0.947, 0.785, 0.711, 0.7, 0.742, 0.817, 0.844, 0.879, 0.896, 0.888, 0.878, 0.878, 0.864, 0.82, 0.876, 0.775, 0.496, 0.503, 0.591, 0.607, 0.65, 0.945, 0.901, 0.821, 0.799, 0.845, 0.875, 0.891, 0.863, 0.757, 0.747, 0.77, 0.796, 0.821, 0.837, 0.935, 0.898, 0.746, 0.732, 0.823, 0.791, 0.805, 0.854, 0.843, 0.515, 0.434, 0.63, 0.711, 0.701, 0.893, 0.92, 0.775, 0.78, 0.834, 0.793, 0.723, 0.708, 0.777, 0.773, 0.82, 0.845, 0.876, 0.918, 0.993, 1.0, 1.0, 0.9, 0.954, 0.887, 0.84, 0.841, 0.888, 0.601, 0.394, 0.659, 0.815, 0.862, 0.939, 1.0, 0.974, 0.953, 0.891, 0.902, 0.903, 0.91, 0.818, 0.778, 0.724, 0.712, 0.78, 0.789, 0.831, 0.966, 0.839, 0.816, 0.822, 0.822, 0.823, 0.843, 0.891, 0.736, 0.674, 0.871, 0.882, 0.8, 0.831, 0.886, 0.902, 0.898, 0.884, 0.909, 0.859, 0.787, 0.949, 0.796, 0.732, 0.753, 0.82, 0.825, 0.862, 0.904, 0.887, 0.883, 0.891, 0.89, 0.876, 0.789, 0.877, 0.733, 0.36, 0.504, 0.736, 0.773, 0.788, 0.977, 0.945, 0.924, 0.905, 0.866, 0.864, 0.867, 0.828, 0.737, 0.731, 0.776, 0.775, 0.75, 0.804, 0.959, 0.923, 0.796, 0.789, 0.85, 0.849], "high": [0.498, 0.853, 0.762, 0.559, 0.557, 0.552, 0.53, 0.517, 0.82, 0.775, 0.541, 0.543, 0.521, 0.483, 0.506, 0.845, 0.835, 0.601, 0.653, 0.952, 0.836, 0.629, 0.85, 0.779, 0.549, 0.583, 0.814, 0.62, 0.566, 0.76, 0.644, 0.544, 0.692, 0.884, 0.66, 0.547, 0.555, 0.615, 0.504, 0.5, 0.528, 0.522, 0.522, 0.513, 0.482, 0.507, 0.549, 0.923, 0.885, 0.563, 0.615, 0.731, 0.497, 0.47, 0.745, 0.681, 0.508, 0.594, 0.784, 0.576, 0.546, 0.547, 0.52, 0.543, 0.638, 0.806, 0.585, 0.587, 0.633, 0.633, 0.643, 0.713, 0.881, 0.809, 0.828, 0.905, 0.936, 0.696, 0.726, 0.85, 0.646, 0.663, 0.682, 0.705, 0.706, 0.728, 0.892, 0.764, 0.738, 0.731, 0.693, 0.645, 0.625, 0.653, 0.654, 0.695, 0.751, 0.773, 0.773, 0.782, 0.837, 0.836, 0.832, 0.884, 0.96, 0.761, 0.678, 0.85, 0.793, 0.786, 0.871, 0.962, 0.906, 0.882, 0.903, 0.888, 0.891, 0.864, 0.758, 0.674, 0.697, 0.712, 0.726, 0.752, 0.807, 0.838, 0.836, 0.848, 0.85, 0.868, 0.897, 0.907, 0.977, 0.839, 0.709, 0.726, 0.751, 0.78, 0.825, 0.863, 0.856, 0.857, 0.864, 0.875, 0.874, 1.0, 1.0, 0.811, 0.806, 0.793, 0.789, 0.826, 0.86, 0.895, 0.892, 0.888, 0.883, 0.879, 0.87, 0.847, 0.948, 0.885, 0.649, 0.574, 0.654, 0.671, 0.696, 0.831, 0.804, 0.843, 0.812, 0.839, 0.899, 0.906, 0.845, 0.707, 0.727, 0.774, 0.771, 0.783, 0.813, 0.877, 0.77, 0.659, 0.672, 0.81, 0.843, 0.864, 0.932, 0.928, 0.637, 0.439, 0.61, 0.671, 0.644, 0.802, 0.77, 0.736, 0.728, 0.714, 0.616, 0.503, 0.548, 0.683, 0.71, 0.714, 0.705, 0.758, 0.831, 0.872, 0.872, 0.875, 0.885, 0.89, 0.854, 0.82, 0.892, 0.961, 0.726, 0.496, 0.603, 0.74, 0.744, 0.828, 0.847, 0.846, 0.831, 0.786, 0.846, 0.859, 0.837, 0.747, 0.713, 0.673, 0.715, 0.84, 0.868, 0.829, 0.848, 0.796, 0.803, 0.838, 0.921, 0.944, 0.927, 0.968, 0.831, 0.699, 0.812, 0.798, 0.799, 0.863, 0.888, 0.847, 0.839, 0.861, 0.884, 0.834, 0.78, 0.832, 0.689, 0.707, 0.686, 0.702, 0.801, 0.858, 0.88, 0.871, 0.862, 0.852, 0.882, 0.867, 0.806, 0.946, 0.851, 0.52, 0.458, 0.679, 0.739, 0.75, 0.862, 0.857, 0.873, 0.821, 0.899, 0.924, 0.921, 0.846, 0.77, 0.781, 0.774, 0.783, 0.81, 0.867, 0.948, 0.824, 0.734, 0.722, 0.894, 0.935]}}
@@ -0,0 +1,11 @@
1
+ <!doctype html>
2
+ <html lang="ko">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <title>debug-hud 견본</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,59 @@
1
+ {
2
+ "template": "promo",
3
+ "title": "debug-hud · OpenGateway 15초",
4
+ "theme": "debug-hud",
5
+ "fps": 60,
6
+ "width": 1920,
7
+ "height": 1080,
8
+ "duration": 15.0,
9
+ "mode": "seek",
10
+ "style": "style.json",
11
+ "music": "assets/music/kawaii-friends-0400.mp3",
12
+ "beats": "beats.json",
13
+ "captions": "none",
14
+ "safeArea": {
15
+ "top": 60,
16
+ "bottom": 60,
17
+ "left": 80,
18
+ "right": 80
19
+ },
20
+ "text": {
21
+ "policy": "terms-only",
22
+ "maxOnScreen": 0,
23
+ "minPx": 0
24
+ },
25
+ "scenes": [
26
+ {
27
+ "id": "gather",
28
+ "from": 0,
29
+ "dur": 3.1169,
30
+ "file": "scenes/gather.ts",
31
+ "role": "hook",
32
+ "idea": "회사 아홉을 흩어진 상자로 박마다 재고, 회사별 모델 수를 막대 상자로 잰다"
33
+ },
34
+ {
35
+ "id": "models",
36
+ "from": 3.1169,
37
+ "dur": 4.2191,
38
+ "file": "scenes/models.ts",
39
+ "role": "explain",
40
+ "idea": "한 주소를 재고 엔드포인트가 로그로, 같은 주소에 모델 ID 만 바뀌는 요청이 박마다 로그로, 모델 수가 102 로 굴러 오른다"
41
+ },
42
+ {
43
+ "id": "price",
44
+ "from": 7.336,
45
+ "dur": 4.2388,
46
+ "file": "scenes/price.ts",
47
+ "role": "drop",
48
+ "idea": "드롭 트리거 102, 하루 가격선이 흐르며 00–10시 창을 재고 -90%, deepseek 가격 숫자가 굴러 내려간다"
49
+ },
50
+ {
51
+ "id": "end",
52
+ "from": 11.5748,
53
+ "dur": 3.4252,
54
+ "file": "scenes/end.ts",
55
+ "role": "end",
56
+ "idea": "첫 토큰 실측 ms 셋을 굴려 재고, OG 로고를 상자로 재는 끝 카드"
57
+ }
58
+ ]
59
+ }
@@ -0,0 +1,49 @@
1
+ import type { SceneCtx } from "@kasaframe/core";
2
+ import { hudFrame } from "../../effects.ts";
3
+
4
+ export const barsFrom0 = (ctx: SceneCtx): number[] => ctx.beats.bars.filter((b) => b >= -1e-6 && b < ctx.dur - 1e-6);
5
+ export const beatsFrom0 = (ctx: SceneCtx): number[] => ctx.beats.beats.filter((b) => b >= -1e-6 && b < ctx.dur - 1e-6);
6
+
7
+ export function layer(parent: HTMLElement): HTMLElement {
8
+ const el = document.createElement("div");
9
+ el.style.cssText = "position:absolute;inset:0;";
10
+ parent.append(el);
11
+ return el;
12
+ }
13
+
14
+ /** from 부터 to 까지만 보이는 컷 — 숨은 컷은 그리지 않는다 */
15
+ export function cut(parent: HTMLElement, from: number, to: number) {
16
+ const el = layer(parent);
17
+ return {
18
+ el,
19
+ on(t: number): boolean {
20
+ const v = t >= from && t < to;
21
+ // visibility 로 숨기면 안쪽 요소가 visible 을 주는 순간 부모를 뚫고 보인다 — display 로 통째로 뺀다
22
+ el.style.display = v ? "" : "none";
23
+ return v;
24
+ },
25
+ };
26
+ }
27
+
28
+ /** 모노 글 한 덩어리. at 전엔 숨는다 — 계기판 글은 잰 순간에 뜬다 */
29
+ export function mono(parent: HTMLElement, ctx: SceneCtx, o: { x: number; y: number; size: number; text?: string; color?: string; weight?: number; align?: "left" | "center" | "right"; w?: number }) {
30
+ const el = document.createElement("div");
31
+ const align = o.align ?? "left";
32
+ const box = align === "left" ? `left:${o.x}px;` : `left:${o.x}px;width:${o.w ?? 0}px;text-align:${align};`;
33
+ el.style.cssText = `position:absolute;${box}top:${o.y}px;font:${o.weight ?? 600} ${o.size}px ${ctx.style.fonts.mono};line-height:1;white-space:pre;color:${ctx.style.colors[o.color ?? "ink"] ?? o.color};`;
34
+ el.textContent = o.text ?? "";
35
+ parent.append(el);
36
+ return el;
37
+ }
38
+
39
+ /** 이 견본은 곡 4.0초부터 — 마디는 그 앞에 셋이 있었다 */
40
+ export const frameOf = (root: HTMLElement, ctx: SceneCtx) => hudFrame(layer(root), { ctx, title: "OpenGateway · apis.opengateway.ai/v1", songFrom: 4.0, barFrom: 3, grid: {} });
41
+
42
+ /** OG 로고(currentColor SVG) — 계기판 잉크로 */
43
+ export function logo(parent: HTMLElement, svg: string, x: number, y: number, w: number, color: string) {
44
+ const el = document.createElement("div");
45
+ el.style.cssText = `position:absolute;left:${x}px;top:${y}px;width:${w}px;color:${color};`;
46
+ el.innerHTML = svg.replace(/ width="\d+" height="\d+"/, ' width="100%" style="display:block"');
47
+ parent.append(el);
48
+ return el;
49
+ }
@@ -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,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,62 @@
1
+ import type { SceneCtx } from "@kasaframe/core";
2
+ import { crosshair, readout, wireBox } from "../../effects.ts";
3
+ import svg from "../assets/og/logo.svg?raw";
4
+ import { barsFrom0, beatsFrom0, cut, frameOf, layer, logo, mono } from "../lib/hudkit.ts";
5
+ import { OG } from "../lib/og.ts";
6
+
7
+ export default {
8
+ build(root: HTMLElement, ctx: SceneCtx) {
9
+ const B = barsFrom0(ctx);
10
+ const b = beatsFrom0(ctx);
11
+ const frame = frameOf(root, ctx);
12
+ const content = layer(root);
13
+ const ink = ctx.style.colors.ink;
14
+
15
+ // 첫 마디 — 첫 토큰 가운데값 셋을 박마다 굴려 재고, ms 만큼 막대 상자
16
+ const ttft = cut(content, 0, B[1]);
17
+ const max = Math.max(...OG.ttft.map(([, , ms]) => ms));
18
+ const rows = OG.ttft.map(([id, , ms], i) => ({
19
+ at: b[i] ?? i * 0.35,
20
+ ms,
21
+ id: mono(ttft.el, ctx, { x: 140, y: 110 + i * 270, size: 44, text: id, color: "dim" }),
22
+ value: mono(ttft.el, ctx, { x: 140, y: 170 + i * 270, size: 140, weight: 800 }),
23
+ }));
24
+ const bars = wireBox(ttft.el, { ctx, boxes: rows.map((r, i) => ({ x: 900, y: 175 + i * 270, w: (900 * r.ms) / max, h: 120, at: r.at + 0.05, label: "ttft p50", dims: true })) });
25
+ const sum = mono(ttft.el, ctx, { x: 900, y: 930, size: 56, text: OG.calls, weight: 700 });
26
+
27
+ // 둘째 마디 — 로고를 재는 끝 카드
28
+ const card = cut(content, B[1], B[2]);
29
+ logo(card.el, svg, 600, 150, 720, ink);
30
+ const site = mono(card.el, ctx, { x: 160, y: 640, size: 120, text: OG.site, align: "center", w: 1600, weight: 800 });
31
+ const url = mono(card.el, ctx, { x: 160, y: 820, size: 44, text: OG.url, align: "center", w: 1600, color: "dim" });
32
+ const cardBox = wireBox(card.el, { ctx, boxes: [{ x: 580, y: 130, w: 760, h: 450, at: B[1], label: "logo.svg", dims: true }, { x: 460, y: 615, w: 1000, h: 170, at: b[5] ?? B[1] + 0.35, label: "site" }] });
33
+ const aim = crosshair(card.el, { ctx, keys: [5, 6, 7].map((k, i) => ({ t: b[k] ?? B[1] + (i + 1) * 0.35, x: [960, 600, 1320][i], y: [330, 140, 520][i] })), size: 40, coords: true });
34
+
35
+ // 끝 반 마디 — 로고를 왼쪽으로 당기고 주소를 더해 박마다 다시 잰다
36
+ const last = cut(content, B[2], ctx.dur + 1);
37
+ logo(last.el, svg, 140, 300, 460, ink);
38
+ mono(last.el, ctx, { x: 680, y: 340, size: 128, text: OG.site, weight: 800 });
39
+ mono(last.el, ctx, { x: 690, y: 520, size: 46, text: OG.url, color: "dim" });
40
+ const again = b.filter((x) => x >= B[2] - 1e-6);
41
+ const lastBox = wireBox(last.el, { ctx, boxes: again.map((x, i) => ({ x: i % 2 ? 660 : 120, y: i % 2 ? 300 : 280, w: i % 2 ? 1180 : 500, h: i % 2 ? 300 : 300, at: x + 0.01, label: i % 2 ? "opengateway.ai" : "logo.svg", dims: true })) });
42
+ return (t: number) => {
43
+ frame(t);
44
+ if (ttft.on(t)) {
45
+ for (const r of rows) {
46
+ const on = t >= r.at;
47
+ r.id.style.visibility = on ? "visible" : "hidden";
48
+ r.value.textContent = on ? readout(t, { from: 0, to: r.ms, at: r.at, dur: 0.28, width: 5, decimals: 1, unit: "ms" }) : "";
49
+ }
50
+ bars(t);
51
+ sum.style.visibility = t >= (b[3] ?? 1.06) ? "visible" : "hidden";
52
+ }
53
+ if (card.on(t)) {
54
+ cardBox(t);
55
+ site.style.visibility = t >= (b[5] ?? B[1] + 0.35) ? "visible" : "hidden";
56
+ url.style.visibility = t >= (b[7] ?? B[1] + 1.06) ? "visible" : "hidden";
57
+ aim(t);
58
+ }
59
+ if (last.on(t)) lastBox(t);
60
+ };
61
+ },
62
+ };
@@ -0,0 +1,67 @@
1
+ import { applyStyle, type SceneCtx } from "@kasaframe/core";
2
+ import { crosshair, scanLine, wireBox, type Box } from "../../effects.ts";
3
+ import { barsFrom0, beatsFrom0, cut, frameOf, layer, mono } from "../lib/hudkit.ts";
4
+ import { OG } from "../lib/og.ts";
5
+
6
+ // 회사 아홉이 흩어진 자리 — 상자 [x, y]
7
+ const SPOT: [number, number][] = [
8
+ [140, 150], [760, 120], [1380, 190],
9
+ [260, 450], [880, 420], [1440, 500],
10
+ [120, 760], [700, 740], [1300, 800],
11
+ ];
12
+ const WAVE = [0, 1, 2, 0, 1, 2, 0, 1, 2];
13
+
14
+ export default {
15
+ build(root: HTMLElement, ctx: SceneCtx) {
16
+ const B = barsFrom0(ctx);
17
+ const b = beatsFrom0(ctx);
18
+ const frame = frameOf(root, ctx);
19
+ const content = layer(root);
20
+ const scan = scanLine(root, { ctx, at: 0, dur: 0.3 });
21
+
22
+ // 첫 마디 — 흩어진 회사 아홉을 박마다 셋씩 잰다
23
+ const spread = cut(content, 0, B[1]);
24
+ const at = (i: number) => b[WAVE[i]] ?? WAVE[i] * 0.35;
25
+ const boxes: Box[] = OG.providers.map(([name], i) => ({ x: SPOT[i][0], y: SPOT[i][1], w: 400, h: 150, at: at(i), label: name.toLowerCase(), dims: true }));
26
+ const measure = wireBox(spread.el, { ctx, boxes });
27
+ const names = OG.providers.map(([name, n], i) => [
28
+ mono(spread.el, ctx, { x: SPOT[i][0] + 24, y: SPOT[i][1] + 30, size: 64, text: name, weight: 800 }),
29
+ mono(spread.el, ctx, { x: SPOT[i][0] + 24, y: SPOT[i][1] + 104, size: 28, text: `${n} models`, color: "dim" }),
30
+ ]);
31
+ const aim = crosshair(spread.el, { ctx, keys: [0, 1, 2, 3].map((k) => ({ t: b[k] ?? k * 0.35, x: SPOT[k * 2][0] + 200, y: SPOT[k * 2][1] + 75 })), size: 34 });
32
+
33
+ // 둘째 마디 — 회사별 모델 수를 막대 상자로 잰다(박마다 셋)
34
+ const chart = cut(content, B[1], ctx.dur + 1);
35
+ const base = 900;
36
+ const colW = 168;
37
+ const bars: Box[] = OG.providers.map(([, n], i) => ({ x: 130 + i * 186, y: base - (620 * n) / 41, w: colW, h: (620 * n) / 41, at: b[4 + Math.floor(i / 3)] ?? B[1] + Math.floor(i / 3) * 0.35, dims: false }));
38
+ const measureBars = wireBox(chart.el, { ctx, boxes: bars });
39
+ const labels = OG.providers.map(([name, n], i) => [
40
+ mono(chart.el, ctx, { x: bars[i].x, y: base + 16, size: 26, text: name, align: "center", w: colW, color: "dim" }),
41
+ mono(chart.el, ctx, { x: bars[i].x, y: bars[i].y - 70, size: 56, text: String(n), align: "center", w: colW, weight: 800 }),
42
+ ]);
43
+ const aim2 = crosshair(chart.el, { ctx, keys: [0, 1, 2, 3].map((k) => ({ t: b[4 + k] ?? B[1] + k * 0.35, x: bars[[0, 3, 6, 0][k]].x + colW / 2, y: bars[[0, 3, 6, 0][k]].y })), size: 30 });
44
+ return (t: number) => {
45
+ frame(t);
46
+ applyStyle(content, scan(t));
47
+ if (spread.on(t)) {
48
+ measure(t);
49
+ names.forEach(([a, c], i) => {
50
+ const v = t >= at(i) + 0.12 ? "visible" : "hidden";
51
+ a.style.visibility = v;
52
+ c.style.visibility = v;
53
+ });
54
+ aim(t);
55
+ }
56
+ if (chart.on(t)) {
57
+ measureBars(t);
58
+ labels.forEach(([a, c], i) => {
59
+ const v = t >= bars[i].at + 0.15 ? "visible" : "hidden";
60
+ a.style.visibility = v;
61
+ c.style.visibility = v;
62
+ });
63
+ aim2(t);
64
+ }
65
+ };
66
+ },
67
+ };
@@ -0,0 +1,70 @@
1
+ import { clamp, type SceneCtx } from "@kasaframe/core";
2
+ import { crosshair, logTail, readout, scanLine, wireBox } from "../../effects.ts";
3
+ import { barsFrom0, beatsFrom0, cut, frameOf, layer, mono } from "../lib/hudkit.ts";
4
+ import { OG } from "../lib/og.ts";
5
+
6
+ export default {
7
+ build(root: HTMLElement, ctx: SceneCtx) {
8
+ const B = barsFrom0(ctx);
9
+ const b = beatsFrom0(ctx);
10
+ const drop = ctx.beats.drop(0);
11
+ const frame = frameOf(root, ctx);
12
+ const content = layer(root);
13
+
14
+ // 첫 마디 — 한 주소를 재고, 엔드포인트가 박마다 로그로
15
+ const addr = cut(content, 0, B[1]);
16
+ const urlBox = wireBox(addr.el, { ctx, boxes: [{ x: 160, y: 220, w: 1600, h: 200, at: 0.02, label: "endpoint", dims: true }, { x: 160, y: 520, w: 1600, h: 380, at: b[1] ?? 0.35, label: "routes" }] });
17
+ const url = mono(addr.el, ctx, { x: 160, y: 280, size: 84, text: OG.url, align: "center", w: 1600, weight: 700 });
18
+ const eps = logTail(addr.el, { ctx, x: 220, y: 560, w: 1500, h: 320, size: 52, lines: OG.endpoints.map((e, i) => ({ t: (b[Math.min(3, i + 1)] ?? 0.35 * (i + 1)) + (i === 3 ? 0.17 : 0), text: `POST /v1${e}` })) });
19
+ const reveal = scanLine(addr.el, { ctx, at: 0, dur: 0.25 });
20
+
21
+ // 둘째 마디 — 같은 주소, 모델 ID 만 박마다 바뀐다. 위엔 지금 회사, 아래엔 요청 로그
22
+ const call = cut(content, B[1], B[2]);
23
+ const who = mono(call.el, ctx, { x: 120, y: 170, size: 200, weight: 800 });
24
+ const whoBox = wireBox(call.el, { ctx, boxes: [0, 1, 2, 3].map((k) => ({ x: 100, y: 140, w: 1720, h: 260, at: (b[4 + k] ?? B[1] + k * 0.35) + 0.01, label: "model", dims: k === 3 })) });
25
+ const reqs = logTail(call.el, {
26
+ ctx,
27
+ x: 140,
28
+ y: 470,
29
+ w: 1660,
30
+ h: 480,
31
+ size: 34,
32
+ lines: OG.ids.slice(0, 4).flatMap((id, k) => {
33
+ const at = b[4 + k] ?? B[1] + k * 0.35;
34
+ return [
35
+ { t: at, text: `POST /v1/chat/completions model=${id}` },
36
+ { t: at + 0.12, text: " 200 OK", dim: true },
37
+ ];
38
+ }),
39
+ cps: 400,
40
+ });
41
+
42
+ // 셋째 마디 — 모델 수가 102 로 굴러 오르고, 박마다 상자를 다시 잰다
43
+ const many = cut(content, B[2], ctx.dur + 1);
44
+ const cnt = mono(many.el, ctx, { x: 160, y: 250, size: 420, align: "center", w: 1600, weight: 800 });
45
+ const cntBox = wireBox(many.el, { ctx, boxes: [0, 1, 2, 3].map((k) => ({ x: 560 - k * 30, y: 220 - k * 10, w: 800 + k * 60, h: 460 + k * 20, at: (b[8 + k] ?? B[2] + k * 0.35) + 0.01, label: "models", dims: true })) });
46
+ const ids = logTail(many.el, { ctx, x: 160, y: 760, w: 1600, h: 200, size: 32, lines: OG.ids.map((id, k) => ({ t: (b[8] ?? B[2]) + k * 0.25, text: `${id} 200` })), cps: 500 });
47
+ const aim = crosshair(many.el, { ctx, keys: [0, 1, 2, 3].map((k) => ({ t: b[8 + k] ?? B[2] + k * 0.35, x: [560, 1360, 960, 960][k], y: [220, 680, 450, 450][k] })), size: 30, coords: true });
48
+ return (t: number) => {
49
+ frame(t);
50
+ if (addr.on(t)) {
51
+ urlBox(t);
52
+ url.style.visibility = t >= 0.05 ? "visible" : "hidden";
53
+ eps(t);
54
+ reveal(t);
55
+ }
56
+ if (call.on(t)) {
57
+ const k = Math.max(0, b.slice(4, 8).filter((x) => x <= t).length - 1);
58
+ who.textContent = OG.ids[k].split("/")[0];
59
+ whoBox(t);
60
+ reqs(t);
61
+ }
62
+ if (many.on(t)) {
63
+ cnt.textContent = readout(t, { from: 0, to: OG.models, at: B[2], dur: clamp(drop - B[2] - 0.06, 0.1, 9), width: 3 });
64
+ cntBox(t);
65
+ ids(t);
66
+ aim(t);
67
+ }
68
+ };
69
+ },
70
+ };
@@ -0,0 +1,79 @@
1
+ import { applyStyle, type SceneCtx } from "@kasaframe/core";
2
+ import { crosshair, dropTrigger, plotTrace, readout, wireBox } from "../../effects.ts";
3
+ import { barsFrom0, beatsFrom0, cut, frameOf, layer, mono } from "../lib/hudkit.ts";
4
+ import { OG } from "../lib/og.ts";
5
+
6
+ export default {
7
+ build(root: HTMLElement, ctx: SceneCtx) {
8
+ const B = barsFrom0(ctx);
9
+ const b = beatsFrom0(ctx);
10
+ const frame = frameOf(root, ctx);
11
+ const content = layer(root);
12
+
13
+ // 드롭 마디 — 102 를 잰다
14
+ const hit = cut(content, 0, B[1]);
15
+ const big = mono(hit.el, ctx, { x: 160, y: 170, size: 480, text: String(OG.models), align: "center", w: 1600, weight: 800 });
16
+ const bigBox = wireBox(hit.el, { ctx, boxes: [{ x: 620, y: 150, w: 680, h: 440, at: b[1] ?? 0.35, label: "models", dims: true }, { x: 360, y: 700, w: 1200, h: 130, at: b[2] ?? 0.7, label: "endpoint" }] });
17
+ const host = mono(hit.el, ctx, { x: 360, y: 730, size: 72, text: OG.host, align: "center", w: 1200, weight: 700 });
18
+ const aim = crosshair(hit.el, { ctx, keys: [1, 2, 3].map((k) => ({ t: b[k] ?? k * 0.35, x: [960, 960, 1310][k - 1], y: [335, 765, 120][k - 1] })), size: 36 });
19
+
20
+ // 둘째 마디 — 하루가 한 마디에 흐르는 가격선. 00–10시 창에서 값이 -90% 로 떨어진다
21
+ const day = cut(content, B[1], B[2]);
22
+ const span = (B[2] ?? ctx.dur) - B[1];
23
+ const hourAt = (t: number) => ((((t - B[1]) / span) * 24) % 24 + 24) % 24;
24
+ const night = (h: number) => h >= OG.night.from && h < OG.night.to;
25
+ const price = plotTrace(day.el, { ctx, x: 120, y: 170, w: 1480, h: 420, at: B[1], since: B[1], window: span / 2, series: [{ label: "PRICE", value: (t) => (night(hourAt(t)) ? 0.08 : 0.8) }] });
26
+ const strip = wireBox(day.el, { ctx, boxes: [{ x: 120, y: 690, w: (1680 * 10) / 24, h: 90, at: b[5] ?? B[1] + 0.35, label: `00:00-10:00 ${OG.night.tz}`, dims: true }, { x: 120 + (1680 * 10) / 24 + 8, y: 690, w: (1680 * 14) / 24 - 8, h: 90, at: b[5] ?? B[1] + 0.35, label: "10:00-24:00" }] });
27
+ const clock = mono(day.el, ctx, { x: 160, y: 712, size: 48, color: "dim" });
28
+ const off = mono(day.el, ctx, { x: 1000, y: 820, size: 180, text: OG.deepseek.off, weight: 800, align: "right", w: 820 });
29
+
30
+ // 셋째 마디 — deepseek 정가에서 밤값으로 숫자가 굴러 내려간다
31
+ const table = cut(content, B[2], ctx.dur + 1);
32
+ const ds = OG.deepseek;
33
+ const idLine = mono(table.el, ctx, { x: 140, y: 100, size: 60, text: ds.id, weight: 700 });
34
+ const rows = [ds.input, ds.output].map(([from, to], i) => {
35
+ const at = b[9 + i] ?? B[2] + (i + 1) * 0.35;
36
+ return {
37
+ at,
38
+ from: Number(from.slice(1)),
39
+ to: Number(to.slice(1)),
40
+ label: mono(table.el, ctx, { x: 140, y: 290 + i * 260, size: 64, text: i ? "출력" : "입력", color: "dim" }),
41
+ value: mono(table.el, ctx, { x: 400, y: 250 + i * 260, size: 170, weight: 800 }),
42
+ was: mono(table.el, ctx, { x: 1060, y: 300 + i * 260, size: 56, text: `정가 ${from}`, color: "dim" }),
43
+ };
44
+ });
45
+ const rowBox = wireBox(table.el, { ctx, boxes: rows.map((r, i) => ({ x: 380, y: 230 + i * 260, w: 640, h: 210, at: r.at, label: i ? "output /M" : "input /M", dims: true })) });
46
+ const pct = mono(table.el, ctx, { x: 1060, y: 460, size: 150, text: ds.off, weight: 800 });
47
+ const glm = mono(table.el, ctx, { x: 140, y: 920, size: 48, text: `${OG.glm.id} ${OG.glm.off}`, color: "ink" });
48
+ const trig = dropTrigger(root, { ctx, drop: 0, label: String(OG.models) });
49
+ return (t: number) => {
50
+ frame(t);
51
+ if (hit.on(t)) {
52
+ big.style.visibility = t >= 0.03 ? "visible" : "hidden";
53
+ bigBox(t);
54
+ host.style.visibility = t >= (b[2] ?? 0.7) + 0.1 ? "visible" : "hidden";
55
+ aim(t);
56
+ }
57
+ if (day.on(t)) {
58
+ price(t);
59
+ strip(t);
60
+ const h = Math.floor(hourAt(t));
61
+ clock.textContent = t >= (b[5] ?? B[1]) ? `${String(h).padStart(2, "0")}:00 ${night(h) ? ds.input[1] : ds.input[0]}` : "";
62
+ clock.style.left = `${Math.min(1480, 120 + (1680 * h) / 24 + 16)}px`;
63
+ off.style.visibility = t >= (b[7] ?? B[1] + 1.06) ? "visible" : "hidden";
64
+ }
65
+ if (table.on(t)) {
66
+ idLine.style.visibility = "visible";
67
+ for (const r of rows) {
68
+ const on = t >= r.at;
69
+ r.label.style.visibility = r.was.style.visibility = on ? "visible" : "hidden";
70
+ r.value.textContent = on ? `$${readout(t, { from: r.from, to: r.to, at: r.at + 0.05, dur: 0.3, width: 4, decimals: 2 })}` : "";
71
+ }
72
+ rowBox(t);
73
+ pct.style.visibility = glm.style.visibility = t >= (b[11] ?? B[2] + 1.06) ? "visible" : "hidden";
74
+ }
75
+ const s = trig(t);
76
+ applyStyle(content, s.shake);
77
+ };
78
+ },
79
+ };
@@ -0,0 +1,91 @@
1
+ {
2
+ "name": "debug-hud",
3
+ "label": "디버그 HUD — 검정 위 형광 한 색으로 화면을 잰다",
4
+ "scheme": "dark",
5
+ "colors": {
6
+ "bg": "#050605",
7
+ "surface": "#0B0E08",
8
+ "raised": "#121709",
9
+ "line": "#2E3A12",
10
+ "ink": "#C8FF2E",
11
+ "inkSoft": "#A9D827",
12
+ "dim": "#7E9E22",
13
+ "accent": "#C8FF2E",
14
+ "accentSoft": "#3F5212",
15
+ "accentText": "#C8FF2E",
16
+ "onAccent": "#050605",
17
+ "success": "#C8FF2E",
18
+ "danger": "#C8FF2E",
19
+ "warning": "#C8FF2E"
20
+ },
21
+ "fonts": {
22
+ "sans": "\"JetBrains Mono\", ui-monospace, \"SF Mono\", \"Pretendard Variable\", Pretendard, \"Noto Sans KR\", \"Apple SD Gothic Neo\", monospace",
23
+ "display": "\"JetBrains Mono\", ui-monospace, \"SF Mono\", \"Pretendard Variable\", Pretendard, \"Noto Sans KR\", \"Apple SD Gothic Neo\", monospace",
24
+ "mono": "\"JetBrains Mono\", ui-monospace, \"SF Mono\", \"Pretendard Variable\", Pretendard, \"Noto Sans KR\", \"Apple SD Gothic Neo\", monospace",
25
+ "faces": [
26
+ {
27
+ "family": "JetBrains Mono",
28
+ "src": "https://cdn.jsdelivr.net/npm/@fontsource-variable/jetbrains-mono@5/files/jetbrains-mono-latin-wght-normal.woff2",
29
+ "weight": "100 800"
30
+ },
31
+ {
32
+ "family": "Pretendard Variable",
33
+ "src": "https://cdn.jsdelivr.net/npm/pretendard@1.3.9/dist/web/variable/woff2/PretendardVariable.woff2",
34
+ "weight": "45 920"
35
+ }
36
+ ]
37
+ },
38
+ "type": {
39
+ "hero": 180,
40
+ "title": 72,
41
+ "body": 34,
42
+ "caption": 26,
43
+ "weightDisplay": 700,
44
+ "weightBody": 500,
45
+ "tracking": "0em"
46
+ },
47
+ "radius": {
48
+ "sm": 0,
49
+ "md": 0,
50
+ "lg": 0,
51
+ "pill": 0
52
+ },
53
+ "shadow": {
54
+ "soft": "none",
55
+ "lift": "none"
56
+ },
57
+ "motion": {
58
+ "beatPulse": "drops-only",
59
+ "shake": {
60
+ "on": [
61
+ "drop"
62
+ ],
63
+ "maxPerPhrase": 1,
64
+ "maxPx": 8
65
+ },
66
+ "cameraMove": "off",
67
+ "repeatSameMove": false,
68
+ "maxFreezeSec": 0.5,
69
+ "enter": "fade",
70
+ "ease": "outExpo",
71
+ "durations": {
72
+ "fast": 0.08,
73
+ "base": 0.18,
74
+ "slow": 0.4
75
+ }
76
+ },
77
+ "theme": {
78
+ "inks": [
79
+ "#050605 검정",
80
+ "#C8FF2E 형광 라임 — 글·선·점 전부 이 한 색",
81
+ "#7E9E22 같은 색의 어두운 단(보조 글·눈금)"
82
+ ],
83
+ "texture": "1–2px 선만. 면 채우기는 드롭 섬광 한 번뿐. 상자는 모서리 꺾쇠부터 그려진다",
84
+ "movement": "재빠르게 잡고 멈춘다(outExpo 0.18초). 스캔선이 지나간 자리부터 드러나고, 숫자는 고정 폭으로 굴러간다"
85
+ },
86
+ "notes": [
87
+ "글은 전부 모노. 한글은 모노 뒤 Pretendard 로 선다.",
88
+ "형광 한 색과 그 어두운 단 말고 다른 색을 쓰지 않는다.",
89
+ "화면의 숫자는 지어내지 않는다 — 시각·박·마디·에너지처럼 그 순간 잰 값만."
90
+ ]
91
+ }
Binary file
@@ -0,0 +1,91 @@
1
+ {
2
+ "name": "debug-hud",
3
+ "label": "디버그 HUD — 검정 위 형광 한 색으로 화면을 잰다",
4
+ "scheme": "dark",
5
+ "colors": {
6
+ "bg": "#050605",
7
+ "surface": "#0B0E08",
8
+ "raised": "#121709",
9
+ "line": "#2E3A12",
10
+ "ink": "#C8FF2E",
11
+ "inkSoft": "#A9D827",
12
+ "dim": "#7E9E22",
13
+ "accent": "#C8FF2E",
14
+ "accentSoft": "#3F5212",
15
+ "accentText": "#C8FF2E",
16
+ "onAccent": "#050605",
17
+ "success": "#C8FF2E",
18
+ "danger": "#C8FF2E",
19
+ "warning": "#C8FF2E"
20
+ },
21
+ "fonts": {
22
+ "sans": "\"JetBrains Mono\", ui-monospace, \"SF Mono\", \"Pretendard Variable\", Pretendard, \"Noto Sans KR\", \"Apple SD Gothic Neo\", monospace",
23
+ "display": "\"JetBrains Mono\", ui-monospace, \"SF Mono\", \"Pretendard Variable\", Pretendard, \"Noto Sans KR\", \"Apple SD Gothic Neo\", monospace",
24
+ "mono": "\"JetBrains Mono\", ui-monospace, \"SF Mono\", \"Pretendard Variable\", Pretendard, \"Noto Sans KR\", \"Apple SD Gothic Neo\", monospace",
25
+ "faces": [
26
+ {
27
+ "family": "JetBrains Mono",
28
+ "src": "https://cdn.jsdelivr.net/npm/@fontsource-variable/jetbrains-mono@5/files/jetbrains-mono-latin-wght-normal.woff2",
29
+ "weight": "100 800"
30
+ },
31
+ {
32
+ "family": "Pretendard Variable",
33
+ "src": "https://cdn.jsdelivr.net/npm/pretendard@1.3.9/dist/web/variable/woff2/PretendardVariable.woff2",
34
+ "weight": "45 920"
35
+ }
36
+ ]
37
+ },
38
+ "type": {
39
+ "hero": 180,
40
+ "title": 72,
41
+ "body": 34,
42
+ "caption": 26,
43
+ "weightDisplay": 700,
44
+ "weightBody": 500,
45
+ "tracking": "0em"
46
+ },
47
+ "radius": {
48
+ "sm": 0,
49
+ "md": 0,
50
+ "lg": 0,
51
+ "pill": 0
52
+ },
53
+ "shadow": {
54
+ "soft": "none",
55
+ "lift": "none"
56
+ },
57
+ "motion": {
58
+ "beatPulse": "drops-only",
59
+ "shake": {
60
+ "on": [
61
+ "drop"
62
+ ],
63
+ "maxPerPhrase": 1,
64
+ "maxPx": 8
65
+ },
66
+ "cameraMove": "off",
67
+ "repeatSameMove": false,
68
+ "maxFreezeSec": 0.5,
69
+ "enter": "fade",
70
+ "ease": "outExpo",
71
+ "durations": {
72
+ "fast": 0.08,
73
+ "base": 0.18,
74
+ "slow": 0.4
75
+ }
76
+ },
77
+ "theme": {
78
+ "inks": [
79
+ "#050605 검정",
80
+ "#C8FF2E 형광 라임 — 글·선·점 전부 이 한 색",
81
+ "#7E9E22 같은 색의 어두운 단(보조 글·눈금)"
82
+ ],
83
+ "texture": "1–2px 선만. 면 채우기는 드롭 섬광 한 번뿐. 상자는 모서리 꺾쇠부터 그려진다",
84
+ "movement": "재빠르게 잡고 멈춘다(outExpo 0.18초). 스캔선이 지나간 자리부터 드러나고, 숫자는 고정 폭으로 굴러간다"
85
+ },
86
+ "notes": [
87
+ "글은 전부 모노. 한글은 모노 뒤 Pretendard 로 선다.",
88
+ "형광 한 색과 그 어두운 단 말고 다른 색을 쓰지 않는다.",
89
+ "화면의 숫자는 지어내지 않는다 — 시각·박·마디·에너지처럼 그 순간 잰 값만."
90
+ ]
91
+ }