@amg555/frameforge-mcp 2.7.3 → 2.7.7
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.
- package/.claude-plugin/marketplace.json +3 -3
- package/AGENTS.md +33 -0
- package/CHANGELOG.md +49 -0
- package/CLAUDE.md +17 -6
- package/GEMINI.md +63 -0
- package/README.md +216 -426
- package/START_HERE.md +4 -2
- package/package.json +5 -3
- package/plugins/ai-video-editor/README.md +32 -0
- package/plugins/ai-video-editor/SKILL.md +152 -0
- package/plugins/ai-video-editor/assets/fonts/fonts.css +2409 -0
- package/plugins/ai-video-editor/assets/fonts/ttf/anton-400.ttf +0 -0
- package/plugins/ai-video-editor/assets/fonts/ttf/archivo-800.ttf +0 -0
- package/plugins/ai-video-editor/assets/fonts/ttf/cabin-sketch-700.ttf +0 -0
- package/plugins/ai-video-editor/assets/fonts/ttf/dm-sans-700.ttf +0 -0
- package/plugins/ai-video-editor/assets/fonts/ttf/fraunces-600.ttf +0 -0
- package/plugins/ai-video-editor/assets/fonts/ttf/fraunces-700.ttf +0 -0
- package/plugins/ai-video-editor/assets/fonts/ttf/fredoka-700.ttf +0 -0
- package/plugins/ai-video-editor/assets/fonts/ttf/inter-700.ttf +0 -0
- package/plugins/ai-video-editor/assets/fonts/ttf/inter-800.ttf +0 -0
- package/plugins/ai-video-editor/assets/fonts/ttf/inter-tight-800.ttf +0 -0
- package/plugins/ai-video-editor/assets/fonts/ttf/kalam-700.ttf +0 -0
- package/plugins/ai-video-editor/assets/fonts/ttf/noto-sans-devanagari-700.ttf +0 -0
- package/plugins/ai-video-editor/assets/fonts/web/noto-sans-devanagari-devanagari-400-normal.woff2 +0 -0
- package/plugins/ai-video-editor/assets/fonts/web/noto-sans-devanagari-devanagari-500-normal.woff2 +0 -0
- package/plugins/ai-video-editor/assets/fonts/web/noto-sans-devanagari-devanagari-600-normal.woff2 +0 -0
- package/plugins/ai-video-editor/assets/fonts/web/noto-sans-devanagari-devanagari-700-normal.woff2 +0 -0
- package/plugins/ai-video-editor/assets/fonts/web/noto-sans-devanagari-devanagari-800-normal.woff2 +0 -0
- package/plugins/ai-video-editor/engine/hidpi.js +117 -0
- package/plugins/ai-video-editor/engine/page.html +43 -0
- package/plugins/ai-video-editor/engine/player.js +145 -0
- package/plugins/ai-video-editor/references/example-story-warm-canvas.js +95 -0
- package/plugins/ai-video-editor/references/story-guide.md +112 -0
- package/plugins/ai-video-editor/requirements.txt +4 -0
- package/plugins/ai-video-editor/styles/chalk-talk/base.js +490 -0
- package/plugins/ai-video-editor/styles/chalk-talk/style.json +14 -0
- package/plugins/ai-video-editor/styles/chalk-talk/style.md +41 -0
- package/plugins/ai-video-editor/styles/clean-tech/base.js +447 -0
- package/plugins/ai-video-editor/styles/clean-tech/style.json +15 -0
- package/plugins/ai-video-editor/styles/clean-tech/style.md +38 -0
- package/plugins/ai-video-editor/styles/creator-motion-graphics/base.js +698 -0
- package/plugins/ai-video-editor/styles/creator-motion-graphics/style.json +16 -0
- package/plugins/ai-video-editor/styles/creator-motion-graphics/style.md +39 -0
- package/plugins/ai-video-editor/styles/data-story/base.js +432 -0
- package/plugins/ai-video-editor/styles/data-story/style.json +14 -0
- package/plugins/ai-video-editor/styles/data-story/style.md +38 -0
- package/plugins/ai-video-editor/styles/index.json +103 -0
- package/plugins/ai-video-editor/styles/pop-info/base.js +570 -0
- package/plugins/ai-video-editor/styles/pop-info/style.json +13 -0
- package/plugins/ai-video-editor/styles/pop-info/style.md +37 -0
- package/plugins/ai-video-editor/styles/software-walkthrough/base.js +544 -0
- package/plugins/ai-video-editor/styles/software-walkthrough/style.json +15 -0
- package/plugins/ai-video-editor/styles/software-walkthrough/style.md +38 -0
- package/plugins/ai-video-editor/styles/warm-canvas/base.js +610 -0
- package/plugins/ai-video-editor/styles/warm-canvas/style.json +14 -0
- package/plugins/ai-video-editor/styles/warm-canvas/style.md +37 -0
- package/plugins/aiinsight-shorts/CHANGELOG.md +6 -0
- package/plugins/aiinsight-shorts/README.md +43 -0
- package/plugins/aiinsight-shorts/SKILL.md +138 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/STYLE.md +58 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/data/cues.json +140 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/data/lines.json +67 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/data/words.json +614 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/data/words.txt +102 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/fonts/Inter-Black.otf +0 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/fonts/Inter-ExtraBold.otf +0 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/index.html +17 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/script.json +27 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/sheet.html +11 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/src/core/board.js +62 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/src/core/captions.js +68 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/src/core/engine.js +65 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/src/core/human.js +128 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/src/core/lib.js +44 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/src/core/look2d.js +33 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/src/core/sdf.js +79 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/src/core/sets.js +107 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/src/core/timing.js +23 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/src/main.js +56 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/src/sheet.js +79 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/src/shots.js +136 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/tools/capture.mjs +122 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/tools/mix.py +172 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/vendor/LICENSE-three.txt +21 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/vendor/addons/environments/RoomEnvironment.js +144 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/vendor/addons/postprocessing/BokehPass.js +141 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/vendor/addons/postprocessing/EffectComposer.js +231 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/vendor/addons/postprocessing/MaskPass.js +104 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/vendor/addons/postprocessing/OutputPass.js +97 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/vendor/addons/postprocessing/Pass.js +95 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/vendor/addons/postprocessing/RenderPass.js +99 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/vendor/addons/postprocessing/ShaderPass.js +77 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/vendor/addons/postprocessing/UnrealBloomPass.js +415 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/vendor/addons/shaders/BokehShader.js +145 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/vendor/addons/shaders/CopyShader.js +45 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/vendor/addons/shaders/LuminosityHighPassShader.js +64 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/vendor/addons/shaders/OutputShader.js +85 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/example/vendor/three.module.js +6 -0
- package/plugins/aiinsight-shorts/styles/deep-dive/style-sheet.png +0 -0
- package/plugins/aiinsight-shorts/styles/inside-out/STYLE.md +97 -0
- package/plugins/aiinsight-shorts/styles/inside-out/example/data/cues.json +178 -0
- package/plugins/aiinsight-shorts/styles/inside-out/example/data/lines.json +73 -0
- package/plugins/aiinsight-shorts/styles/inside-out/example/data/words.json +662 -0
- package/plugins/aiinsight-shorts/styles/inside-out/example/fonts/Inter-Black.otf +0 -0
- package/plugins/aiinsight-shorts/styles/inside-out/example/index.html +17 -0
- package/plugins/aiinsight-shorts/styles/inside-out/example/script.json +26 -0
- package/plugins/aiinsight-shorts/styles/inside-out/example/src/core/captions.js +68 -0
- package/plugins/aiinsight-shorts/styles/inside-out/example/src/core/kit.js +345 -0
- package/plugins/aiinsight-shorts/styles/inside-out/example/src/core/lib.js +44 -0
- package/plugins/aiinsight-shorts/styles/inside-out/example/src/core/timing.js +23 -0
- package/plugins/aiinsight-shorts/styles/inside-out/example/src/main.js +62 -0
- package/plugins/aiinsight-shorts/styles/inside-out/example/src/shots.js +195 -0
- package/plugins/aiinsight-shorts/styles/inside-out/example/tools/capture.mjs +122 -0
- package/plugins/aiinsight-shorts/styles/inside-out/example/tools/mix.py +172 -0
- package/plugins/aiinsight-shorts/styles/inside-out/style-sheet.png +0 -0
- package/plugins/aiinsight-shorts/styles/night-file/STYLE.md +36 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/data/cues.json +146 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/data/lines.json +73 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/data/words.json +572 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/data/words.txt +95 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/fonts/FreeMonoBold.ttf +0 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/fonts/Inter-Black.otf +0 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/index.html +18 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/script.json +26 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/sheet.html +13 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/src/core/board.js +62 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/src/core/captions.js +49 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/src/core/engine.js +65 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/src/core/human.js +128 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/src/core/kit.js +151 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/src/core/lib.js +44 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/src/core/sdf.js +79 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/src/core/sets3d.js +106 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/src/core/timing.js +23 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/src/main.js +56 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/src/sheet.js +86 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/src/shots.js +130 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/tools/capture.mjs +122 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/tools/mix.py +172 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/vendor/LICENSE-three.txt +21 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/vendor/addons/environments/RoomEnvironment.js +144 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/vendor/addons/postprocessing/BokehPass.js +141 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/vendor/addons/postprocessing/EffectComposer.js +231 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/vendor/addons/postprocessing/MaskPass.js +104 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/vendor/addons/postprocessing/OutputPass.js +97 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/vendor/addons/postprocessing/Pass.js +95 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/vendor/addons/postprocessing/RenderPass.js +99 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/vendor/addons/postprocessing/ShaderPass.js +77 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/vendor/addons/postprocessing/UnrealBloomPass.js +415 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/vendor/addons/shaders/BokehShader.js +145 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/vendor/addons/shaders/CopyShader.js +45 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/vendor/addons/shaders/LuminosityHighPassShader.js +64 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/vendor/addons/shaders/OutputShader.js +85 -0
- package/plugins/aiinsight-shorts/styles/night-file/example/vendor/three.module.js +6 -0
- package/plugins/aiinsight-shorts/styles/night-file/style-sheet.png +0 -0
- package/plugins/aiinsight-shorts/styles/paper-atlas/STYLE.md +30 -0
- package/plugins/aiinsight-shorts/styles/paper-atlas/example/data/cues.json +167 -0
- package/plugins/aiinsight-shorts/styles/paper-atlas/example/data/lines.json +67 -0
- package/plugins/aiinsight-shorts/styles/paper-atlas/example/data/words.json +614 -0
- package/plugins/aiinsight-shorts/styles/paper-atlas/example/data/words.txt +102 -0
- package/plugins/aiinsight-shorts/styles/paper-atlas/example/fonts/Caladea-Bold.ttf +0 -0
- package/plugins/aiinsight-shorts/styles/paper-atlas/example/fonts/Inter-Black.otf +0 -0
- package/plugins/aiinsight-shorts/styles/paper-atlas/example/index.html +15 -0
- package/plugins/aiinsight-shorts/styles/paper-atlas/example/script.json +26 -0
- package/plugins/aiinsight-shorts/styles/paper-atlas/example/sheet.html +12 -0
- package/plugins/aiinsight-shorts/styles/paper-atlas/example/src/core/board.js +62 -0
- package/plugins/aiinsight-shorts/styles/paper-atlas/example/src/core/captions.js +47 -0
- package/plugins/aiinsight-shorts/styles/paper-atlas/example/src/core/kit.js +152 -0
- package/plugins/aiinsight-shorts/styles/paper-atlas/example/src/core/lib.js +44 -0
- package/plugins/aiinsight-shorts/styles/paper-atlas/example/src/core/timing.js +23 -0
- package/plugins/aiinsight-shorts/styles/paper-atlas/example/src/main.js +62 -0
- package/plugins/aiinsight-shorts/styles/paper-atlas/example/src/sheet.js +61 -0
- package/plugins/aiinsight-shorts/styles/paper-atlas/example/src/shots.js +139 -0
- package/plugins/aiinsight-shorts/styles/paper-atlas/example/tools/capture.mjs +122 -0
- package/plugins/aiinsight-shorts/styles/paper-atlas/example/tools/mix.py +172 -0
- package/plugins/aiinsight-shorts/styles/paper-atlas/style-sheet.png +0 -0
- package/plugins/aiinsight-shorts/styles/stick-story/STYLE.md +32 -0
- package/plugins/aiinsight-shorts/styles/stick-story/example/data/cues.json +182 -0
- package/plugins/aiinsight-shorts/styles/stick-story/example/data/lines.json +79 -0
- package/plugins/aiinsight-shorts/styles/stick-story/example/data/words.json +662 -0
- package/plugins/aiinsight-shorts/styles/stick-story/example/data/words.txt +110 -0
- package/plugins/aiinsight-shorts/styles/stick-story/example/fonts/Inter-Black.otf +0 -0
- package/plugins/aiinsight-shorts/styles/stick-story/example/fonts/Inter-ExtraBold.otf +0 -0
- package/plugins/aiinsight-shorts/styles/stick-story/example/index.html +13 -0
- package/plugins/aiinsight-shorts/styles/stick-story/example/script.json +27 -0
- package/plugins/aiinsight-shorts/styles/stick-story/example/sheet.html +10 -0
- package/plugins/aiinsight-shorts/styles/stick-story/example/src/core/board.js +62 -0
- package/plugins/aiinsight-shorts/styles/stick-story/example/src/core/captions.js +47 -0
- package/plugins/aiinsight-shorts/styles/stick-story/example/src/core/kit.js +166 -0
- package/plugins/aiinsight-shorts/styles/stick-story/example/src/core/lib.js +44 -0
- package/plugins/aiinsight-shorts/styles/stick-story/example/src/core/timing.js +23 -0
- package/plugins/aiinsight-shorts/styles/stick-story/example/src/main.js +62 -0
- package/plugins/aiinsight-shorts/styles/stick-story/example/src/sheet.js +64 -0
- package/plugins/aiinsight-shorts/styles/stick-story/example/src/shots.js +148 -0
- package/plugins/aiinsight-shorts/styles/stick-story/example/tools/capture.mjs +122 -0
- package/plugins/aiinsight-shorts/styles/stick-story/example/tools/mix.py +172 -0
- package/plugins/aiinsight-shorts/styles/stick-story/style-sheet.png +0 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/STYLE.md +51 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/data/cues.json +271 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/data/lines.json +127 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/data/words.json +908 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/data/words.txt +151 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/fonts/Caladea-Bold.ttf +0 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/fonts/Inter-Black.otf +0 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/fonts/Inter-ExtraBold.otf +0 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/index.html +19 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/script.json +37 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/sheet.html +13 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/src/core/board.js +62 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/src/core/captions.js +56 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/src/core/engine.js +65 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/src/core/lib.js +44 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/src/core/props.js +166 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/src/core/timing.js +23 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/src/core/toon.js +352 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/src/core/world.js +340 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/src/main.js +56 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/src/sheet.js +99 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/src/shots.js +377 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/tools/capture.mjs +122 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/tools/mix.py +204 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/vendor/LICENSE-three.txt +21 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/vendor/addons/environments/RoomEnvironment.js +144 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/vendor/addons/postprocessing/BokehPass.js +141 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/vendor/addons/postprocessing/EffectComposer.js +231 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/vendor/addons/postprocessing/MaskPass.js +104 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/vendor/addons/postprocessing/OutputPass.js +97 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/vendor/addons/postprocessing/Pass.js +95 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/vendor/addons/postprocessing/RenderPass.js +99 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/vendor/addons/postprocessing/ShaderPass.js +77 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/vendor/addons/postprocessing/UnrealBloomPass.js +415 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/vendor/addons/shaders/BokehShader.js +145 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/vendor/addons/shaders/CopyShader.js +45 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/vendor/addons/shaders/LuminosityHighPassShader.js +64 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/vendor/addons/shaders/OutputShader.js +85 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/example/vendor/three.module.js +6 -0
- package/plugins/aiinsight-shorts/styles/tall-tale/style-sheet.png +0 -0
- package/plugins/faceless-shorts/README.md +34 -0
- package/plugins/faceless-shorts/SKILL.md +124 -0
- package/plugins/faceless-shorts/styles/deep-dive/STYLE.md +58 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/data/cues.json +140 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/data/lines.json +67 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/data/words.json +614 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/data/words.txt +102 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/fonts/Inter-Black.otf +0 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/fonts/Inter-ExtraBold.otf +0 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/index.html +16 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/script.json +27 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/sheet.html +10 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/src/core/board.js +62 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/src/core/captions.js +68 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/src/core/engine.js +65 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/src/core/human.js +128 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/src/core/lib.js +44 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/src/core/look2d.js +33 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/src/core/sdf.js +79 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/src/core/sets.js +107 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/src/core/timing.js +23 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/src/main.js +56 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/src/sheet.js +79 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/src/shots.js +136 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/tools/capture.mjs +122 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/tools/mix.py +172 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/vendor/LICENSE-three.txt +21 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/vendor/addons/environments/RoomEnvironment.js +144 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/vendor/addons/postprocessing/BokehPass.js +141 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/vendor/addons/postprocessing/EffectComposer.js +231 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/vendor/addons/postprocessing/MaskPass.js +104 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/vendor/addons/postprocessing/OutputPass.js +97 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/vendor/addons/postprocessing/Pass.js +95 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/vendor/addons/postprocessing/RenderPass.js +99 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/vendor/addons/postprocessing/ShaderPass.js +77 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/vendor/addons/postprocessing/UnrealBloomPass.js +415 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/vendor/addons/shaders/BokehShader.js +145 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/vendor/addons/shaders/CopyShader.js +45 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/vendor/addons/shaders/LuminosityHighPassShader.js +64 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/vendor/addons/shaders/OutputShader.js +85 -0
- package/plugins/faceless-shorts/styles/deep-dive/example/vendor/three.module.js +6 -0
- package/plugins/faceless-shorts/styles/deep-dive/style-sheet.png +0 -0
- package/plugins/faceless-shorts/styles/inside-out/STYLE.md +97 -0
- package/plugins/faceless-shorts/styles/inside-out/example/data/cues.json +178 -0
- package/plugins/faceless-shorts/styles/inside-out/example/data/lines.json +73 -0
- package/plugins/faceless-shorts/styles/inside-out/example/data/words.json +662 -0
- package/plugins/faceless-shorts/styles/inside-out/example/fonts/Inter-Black.otf +0 -0
- package/plugins/faceless-shorts/styles/inside-out/example/index.html +16 -0
- package/plugins/faceless-shorts/styles/inside-out/example/script.json +26 -0
- package/plugins/faceless-shorts/styles/inside-out/example/src/core/captions.js +68 -0
- package/plugins/faceless-shorts/styles/inside-out/example/src/core/kit.js +345 -0
- package/plugins/faceless-shorts/styles/inside-out/example/src/core/lib.js +44 -0
- package/plugins/faceless-shorts/styles/inside-out/example/src/core/timing.js +23 -0
- package/plugins/faceless-shorts/styles/inside-out/example/src/main.js +62 -0
- package/plugins/faceless-shorts/styles/inside-out/example/src/shots.js +195 -0
- package/plugins/faceless-shorts/styles/inside-out/example/tools/capture.mjs +122 -0
- package/plugins/faceless-shorts/styles/inside-out/example/tools/mix.py +172 -0
- package/plugins/faceless-shorts/styles/inside-out/style-sheet.png +0 -0
- package/plugins/faceless-shorts/styles/night-file/STYLE.md +36 -0
- package/plugins/faceless-shorts/styles/night-file/example/data/cues.json +146 -0
- package/plugins/faceless-shorts/styles/night-file/example/data/lines.json +73 -0
- package/plugins/faceless-shorts/styles/night-file/example/data/words.json +572 -0
- package/plugins/faceless-shorts/styles/night-file/example/data/words.txt +95 -0
- package/plugins/faceless-shorts/styles/night-file/example/fonts/FreeMonoBold.ttf +0 -0
- package/plugins/faceless-shorts/styles/night-file/example/fonts/Inter-Black.otf +0 -0
- package/plugins/faceless-shorts/styles/night-file/example/index.html +16 -0
- package/plugins/faceless-shorts/styles/night-file/example/script.json +26 -0
- package/plugins/faceless-shorts/styles/night-file/example/sheet.html +11 -0
- package/plugins/faceless-shorts/styles/night-file/example/src/core/board.js +62 -0
- package/plugins/faceless-shorts/styles/night-file/example/src/core/captions.js +49 -0
- package/plugins/faceless-shorts/styles/night-file/example/src/core/engine.js +65 -0
- package/plugins/faceless-shorts/styles/night-file/example/src/core/human.js +128 -0
- package/plugins/faceless-shorts/styles/night-file/example/src/core/kit.js +151 -0
- package/plugins/faceless-shorts/styles/night-file/example/src/core/lib.js +44 -0
- package/plugins/faceless-shorts/styles/night-file/example/src/core/sdf.js +79 -0
- package/plugins/faceless-shorts/styles/night-file/example/src/core/sets3d.js +106 -0
- package/plugins/faceless-shorts/styles/night-file/example/src/core/timing.js +23 -0
- package/plugins/faceless-shorts/styles/night-file/example/src/main.js +56 -0
- package/plugins/faceless-shorts/styles/night-file/example/src/sheet.js +86 -0
- package/plugins/faceless-shorts/styles/night-file/example/src/shots.js +130 -0
- package/plugins/faceless-shorts/styles/night-file/example/tools/capture.mjs +122 -0
- package/plugins/faceless-shorts/styles/night-file/example/tools/mix.py +172 -0
- package/plugins/faceless-shorts/styles/night-file/example/vendor/LICENSE-three.txt +21 -0
- package/plugins/faceless-shorts/styles/night-file/example/vendor/addons/environments/RoomEnvironment.js +144 -0
- package/plugins/faceless-shorts/styles/night-file/example/vendor/addons/postprocessing/BokehPass.js +141 -0
- package/plugins/faceless-shorts/styles/night-file/example/vendor/addons/postprocessing/EffectComposer.js +231 -0
- package/plugins/faceless-shorts/styles/night-file/example/vendor/addons/postprocessing/MaskPass.js +104 -0
- package/plugins/faceless-shorts/styles/night-file/example/vendor/addons/postprocessing/OutputPass.js +97 -0
- package/plugins/faceless-shorts/styles/night-file/example/vendor/addons/postprocessing/Pass.js +95 -0
- package/plugins/faceless-shorts/styles/night-file/example/vendor/addons/postprocessing/RenderPass.js +99 -0
- package/plugins/faceless-shorts/styles/night-file/example/vendor/addons/postprocessing/ShaderPass.js +77 -0
- package/plugins/faceless-shorts/styles/night-file/example/vendor/addons/postprocessing/UnrealBloomPass.js +415 -0
- package/plugins/faceless-shorts/styles/night-file/example/vendor/addons/shaders/BokehShader.js +145 -0
- package/plugins/faceless-shorts/styles/night-file/example/vendor/addons/shaders/CopyShader.js +45 -0
- package/plugins/faceless-shorts/styles/night-file/example/vendor/addons/shaders/LuminosityHighPassShader.js +64 -0
- package/plugins/faceless-shorts/styles/night-file/example/vendor/addons/shaders/OutputShader.js +85 -0
- package/plugins/faceless-shorts/styles/night-file/example/vendor/three.module.js +6 -0
- package/plugins/faceless-shorts/styles/night-file/style-sheet.png +0 -0
- package/plugins/faceless-shorts/styles/paper-atlas/STYLE.md +30 -0
- package/plugins/faceless-shorts/styles/paper-atlas/example/data/cues.json +167 -0
- package/plugins/faceless-shorts/styles/paper-atlas/example/data/lines.json +67 -0
- package/plugins/faceless-shorts/styles/paper-atlas/example/data/words.json +614 -0
- package/plugins/faceless-shorts/styles/paper-atlas/example/data/words.txt +102 -0
- package/plugins/faceless-shorts/styles/paper-atlas/example/fonts/Caladea-Bold.ttf +0 -0
- package/plugins/faceless-shorts/styles/paper-atlas/example/fonts/Inter-Black.otf +0 -0
- package/plugins/faceless-shorts/styles/paper-atlas/example/index.html +13 -0
- package/plugins/faceless-shorts/styles/paper-atlas/example/script.json +26 -0
- package/plugins/faceless-shorts/styles/paper-atlas/example/sheet.html +10 -0
- package/plugins/faceless-shorts/styles/paper-atlas/example/src/core/board.js +62 -0
- package/plugins/faceless-shorts/styles/paper-atlas/example/src/core/captions.js +47 -0
- package/plugins/faceless-shorts/styles/paper-atlas/example/src/core/kit.js +152 -0
- package/plugins/faceless-shorts/styles/paper-atlas/example/src/core/lib.js +44 -0
- package/plugins/faceless-shorts/styles/paper-atlas/example/src/core/timing.js +23 -0
- package/plugins/faceless-shorts/styles/paper-atlas/example/src/main.js +62 -0
- package/plugins/faceless-shorts/styles/paper-atlas/example/src/sheet.js +61 -0
- package/plugins/faceless-shorts/styles/paper-atlas/example/src/shots.js +139 -0
- package/plugins/faceless-shorts/styles/paper-atlas/example/tools/capture.mjs +122 -0
- package/plugins/faceless-shorts/styles/paper-atlas/example/tools/mix.py +172 -0
- package/plugins/faceless-shorts/styles/paper-atlas/style-sheet.png +0 -0
- package/plugins/faceless-shorts/styles/stick-story/STYLE.md +32 -0
- package/plugins/faceless-shorts/styles/stick-story/example/data/cues.json +182 -0
- package/plugins/faceless-shorts/styles/stick-story/example/data/lines.json +79 -0
- package/plugins/faceless-shorts/styles/stick-story/example/data/words.json +662 -0
- package/plugins/faceless-shorts/styles/stick-story/example/data/words.txt +110 -0
- package/plugins/faceless-shorts/styles/stick-story/example/fonts/Inter-Black.otf +0 -0
- package/plugins/faceless-shorts/styles/stick-story/example/fonts/Inter-ExtraBold.otf +0 -0
- package/plugins/faceless-shorts/styles/stick-story/example/index.html +12 -0
- package/plugins/faceless-shorts/styles/stick-story/example/script.json +27 -0
- package/plugins/faceless-shorts/styles/stick-story/example/sheet.html +9 -0
- package/plugins/faceless-shorts/styles/stick-story/example/src/core/board.js +62 -0
- package/plugins/faceless-shorts/styles/stick-story/example/src/core/captions.js +47 -0
- package/plugins/faceless-shorts/styles/stick-story/example/src/core/kit.js +166 -0
- package/plugins/faceless-shorts/styles/stick-story/example/src/core/lib.js +44 -0
- package/plugins/faceless-shorts/styles/stick-story/example/src/core/timing.js +23 -0
- package/plugins/faceless-shorts/styles/stick-story/example/src/main.js +62 -0
- package/plugins/faceless-shorts/styles/stick-story/example/src/sheet.js +64 -0
- package/plugins/faceless-shorts/styles/stick-story/example/src/shots.js +148 -0
- package/plugins/faceless-shorts/styles/stick-story/example/tools/capture.mjs +122 -0
- package/plugins/faceless-shorts/styles/stick-story/example/tools/mix.py +172 -0
- package/plugins/faceless-shorts/styles/stick-story/style-sheet.png +0 -0
- package/plugins/faceless-shorts/styles/tall-tale/STYLE.md +51 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/data/cues.json +271 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/data/lines.json +127 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/data/words.json +908 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/data/words.txt +151 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/fonts/Caladea-Bold.ttf +0 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/fonts/Inter-Black.otf +0 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/fonts/Inter-ExtraBold.otf +0 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/index.html +17 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/script.json +37 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/sheet.html +11 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/src/core/board.js +62 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/src/core/captions.js +56 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/src/core/engine.js +65 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/src/core/lib.js +44 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/src/core/props.js +166 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/src/core/timing.js +23 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/src/core/toon.js +352 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/src/core/world.js +340 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/src/main.js +56 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/src/sheet.js +99 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/src/shots.js +377 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/tools/capture.mjs +122 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/tools/mix.py +204 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/vendor/LICENSE-three.txt +21 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/vendor/addons/environments/RoomEnvironment.js +144 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/vendor/addons/postprocessing/BokehPass.js +141 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/vendor/addons/postprocessing/EffectComposer.js +231 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/vendor/addons/postprocessing/MaskPass.js +104 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/vendor/addons/postprocessing/OutputPass.js +97 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/vendor/addons/postprocessing/Pass.js +95 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/vendor/addons/postprocessing/RenderPass.js +99 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/vendor/addons/postprocessing/ShaderPass.js +77 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/vendor/addons/postprocessing/UnrealBloomPass.js +415 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/vendor/addons/shaders/BokehShader.js +145 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/vendor/addons/shaders/CopyShader.js +45 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/vendor/addons/shaders/LuminosityHighPassShader.js +64 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/vendor/addons/shaders/OutputShader.js +85 -0
- package/plugins/faceless-shorts/styles/tall-tale/example/vendor/three.module.js +6 -0
- package/plugins/faceless-shorts/styles/tall-tale/style-sheet.png +0 -0
- package/plugins/motion-styles/LIBRARY.md +896 -0
- package/plugins/motion-styles/README.md +29 -0
- package/plugins/motion-styles/SKILL.md +70 -0
- package/plugins/motion-styles/catalog.json +2253 -0
- package/plugins/motion-styles/prompts/bio-glow.md +149 -0
- package/plugins/motion-styles/prompts/blueprint.md +145 -0
- package/plugins/motion-styles/prompts/breaking-desk.md +147 -0
- package/plugins/motion-styles/prompts/callout-kit.md +147 -0
- package/plugins/motion-styles/prompts/chalk-talk.md +153 -0
- package/plugins/motion-styles/prompts/chat-story.md +143 -0
- package/plugins/motion-styles/prompts/clay-diorama.md +149 -0
- package/plugins/motion-styles/prompts/clean-tech.md +147 -0
- package/plugins/motion-styles/prompts/comic-panels.md +145 -0
- package/plugins/motion-styles/prompts/cosmic-scale.md +147 -0
- package/plugins/motion-styles/prompts/creator-motion.md +149 -0
- package/plugins/motion-styles/prompts/data-city.md +149 -0
- package/plugins/motion-styles/prompts/data-story.md +147 -0
- package/plugins/motion-styles/prompts/deep-layers.md +147 -0
- package/plugins/motion-styles/prompts/doc-cinema.md +145 -0
- package/plugins/motion-styles/prompts/evidence-board.md +145 -0
- package/plugins/motion-styles/prompts/exploded-view.md +149 -0
- package/plugins/motion-styles/prompts/glass-icons.md +147 -0
- package/plugins/motion-styles/prompts/glitch-pack.md +145 -0
- package/plugins/motion-styles/prompts/globe-arcs.md +147 -0
- package/plugins/motion-styles/prompts/headline-backdrop.md +145 -0
- package/plugins/motion-styles/prompts/iso-cutaway.md +147 -0
- package/plugins/motion-styles/prompts/isotype.md +145 -0
- package/plugins/motion-styles/prompts/karaoke-subs.md +145 -0
- package/plugins/motion-styles/prompts/low-poly-atlas.md +149 -0
- package/plugins/motion-styles/prompts/lower-thirds.md +147 -0
- package/plugins/motion-styles/prompts/marker-board.md +145 -0
- package/plugins/motion-styles/prompts/market-tape.md +145 -0
- package/plugins/motion-styles/prompts/math-canvas.md +145 -0
- package/plugins/motion-styles/prompts/myth-or-fact.md +145 -0
- package/plugins/motion-styles/prompts/neon-line.md +145 -0
- package/plugins/motion-styles/prompts/paper-craft.md +145 -0
- package/plugins/motion-styles/prompts/parchment-map.md +147 -0
- package/plugins/motion-styles/prompts/physics-toybox.md +147 -0
- package/plugins/motion-styles/prompts/pixel-quest.md +145 -0
- package/plugins/motion-styles/prompts/podcast-clip.md +147 -0
- package/plugins/motion-styles/prompts/pop-info.md +145 -0
- package/plugins/motion-styles/prompts/product-turntable.md +149 -0
- package/plugins/motion-styles/prompts/punch-captions.md +145 -0
- package/plugins/motion-styles/prompts/quiz-countdown.md +145 -0
- package/plugins/motion-styles/prompts/quote-cinema.md +145 -0
- package/plugins/motion-styles/prompts/recipe-steps.md +145 -0
- package/plugins/motion-styles/prompts/rubber-hose-reel.md +145 -0
- package/plugins/motion-styles/prompts/shadow-puppets.md +145 -0
- package/plugins/motion-styles/prompts/size-lineup.md +149 -0
- package/plugins/motion-styles/prompts/software-walkthrough.md +147 -0
- package/plugins/motion-styles/prompts/stack-split.md +145 -0
- package/plugins/motion-styles/prompts/sticker-pop.md +145 -0
- package/plugins/motion-styles/prompts/storybook.md +145 -0
- package/plugins/motion-styles/prompts/swiss-grid.md +145 -0
- package/plugins/motion-styles/prompts/synth-grid.md +147 -0
- package/plugins/motion-styles/prompts/tactics-board.md +145 -0
- package/plugins/motion-styles/prompts/terminal.md +145 -0
- package/plugins/motion-styles/prompts/tier-list.md +143 -0
- package/plugins/motion-styles/prompts/timeline-rail.md +145 -0
- package/plugins/motion-styles/prompts/top-5-countdown.md +145 -0
- package/plugins/motion-styles/prompts/versus-split.md +145 -0
- package/plugins/motion-styles/prompts/vhs-camcorder.md +145 -0
- package/plugins/motion-styles/prompts/visual-novel.md +145 -0
- package/plugins/motion-styles/prompts/warm-canvas.md +145 -0
- package/plugins/motion-styles/prompts/woodcut-tale.md +145 -0
- package/plugins/motion-styles/prompts/zine-collage.md +145 -0
- package/plugins/motion-styles/sources/bio-glow.html +639 -0
- package/plugins/motion-styles/sources/blueprint.html +617 -0
- package/plugins/motion-styles/sources/breaking-desk.html +585 -0
- package/plugins/motion-styles/sources/callout-kit.html +586 -0
- package/plugins/motion-styles/sources/chalk-talk.html +597 -0
- package/plugins/motion-styles/sources/chat-story.html +597 -0
- package/plugins/motion-styles/sources/clay-diorama.html +681 -0
- package/plugins/motion-styles/sources/clean-tech.html +554 -0
- package/plugins/motion-styles/sources/comic-panels.html +608 -0
- package/plugins/motion-styles/sources/cosmic-scale.html +628 -0
- package/plugins/motion-styles/sources/creator-motion.html +805 -0
- package/plugins/motion-styles/sources/data-city.html +613 -0
- package/plugins/motion-styles/sources/data-story.html +539 -0
- package/plugins/motion-styles/sources/deep-layers.html +624 -0
- package/plugins/motion-styles/sources/doc-cinema.html +590 -0
- package/plugins/motion-styles/sources/evidence-board.html +610 -0
- package/plugins/motion-styles/sources/exploded-view.html +618 -0
- package/plugins/motion-styles/sources/glass-icons.html +612 -0
- package/plugins/motion-styles/sources/glitch-pack.html +583 -0
- package/plugins/motion-styles/sources/globe-arcs.html +621 -0
- package/plugins/motion-styles/sources/headline-backdrop.html +584 -0
- package/plugins/motion-styles/sources/iso-cutaway.html +621 -0
- package/plugins/motion-styles/sources/isotype.html +588 -0
- package/plugins/motion-styles/sources/karaoke-subs.html +577 -0
- package/plugins/motion-styles/sources/low-poly-atlas.html +621 -0
- package/plugins/motion-styles/sources/lower-thirds.html +582 -0
- package/plugins/motion-styles/sources/marker-board.html +598 -0
- package/plugins/motion-styles/sources/market-tape.html +598 -0
- package/plugins/motion-styles/sources/math-canvas.html +592 -0
- package/plugins/motion-styles/sources/myth-or-fact.html +587 -0
- package/plugins/motion-styles/sources/neon-line.html +597 -0
- package/plugins/motion-styles/sources/paper-craft.html +612 -0
- package/plugins/motion-styles/sources/parchment-map.html +624 -0
- package/plugins/motion-styles/sources/physics-toybox.html +617 -0
- package/plugins/motion-styles/sources/pixel-quest.html +609 -0
- package/plugins/motion-styles/sources/podcast-clip.html +585 -0
- package/plugins/motion-styles/sources/pop-info.html +677 -0
- package/plugins/motion-styles/sources/product-turntable.html +611 -0
- package/plugins/motion-styles/sources/punch-captions.html +583 -0
- package/plugins/motion-styles/sources/quiz-countdown.html +593 -0
- package/plugins/motion-styles/sources/quote-cinema.html +581 -0
- package/plugins/motion-styles/sources/recipe-steps.html +599 -0
- package/plugins/motion-styles/sources/rubber-hose-reel.html +627 -0
- package/plugins/motion-styles/sources/shadow-puppets.html +609 -0
- package/plugins/motion-styles/sources/size-lineup.html +620 -0
- package/plugins/motion-styles/sources/software-walkthrough.html +651 -0
- package/plugins/motion-styles/sources/stack-split.html +588 -0
- package/plugins/motion-styles/sources/sticker-pop.html +587 -0
- package/plugins/motion-styles/sources/storybook.html +600 -0
- package/plugins/motion-styles/sources/swiss-grid.html +590 -0
- package/plugins/motion-styles/sources/synth-grid.html +614 -0
- package/plugins/motion-styles/sources/tactics-board.html +608 -0
- package/plugins/motion-styles/sources/terminal.html +593 -0
- package/plugins/motion-styles/sources/tier-list.html +600 -0
- package/plugins/motion-styles/sources/timeline-rail.html +598 -0
- package/plugins/motion-styles/sources/top-5-countdown.html +589 -0
- package/plugins/motion-styles/sources/versus-split.html +592 -0
- package/plugins/motion-styles/sources/vhs-camcorder.html +587 -0
- package/plugins/motion-styles/sources/visual-novel.html +623 -0
- package/plugins/motion-styles/sources/warm-canvas.html +742 -0
- package/plugins/motion-styles/sources/woodcut-tale.html +598 -0
- package/plugins/motion-styles/sources/zine-collage.html +594 -0
- package/plugins/video-pipeline/.claude-plugin/plugin.json +2 -2
- package/plugins/video-pipeline/skills/.upstream-skills.json +156 -143
- package/plugins/video-pipeline/skills/video-pipeline/references/mcp-tools.md +3 -3
- package/scripts/deep-validate.js +3 -2
- package/src/audio-mixer/mixer.js +69 -0
- package/src/cli/make.js +19 -0
- package/src/harness/lib/browser.mjs +22 -1
- package/src/harness/lib/capture.mjs +33 -11
- package/src/harness/lib/jobs.mjs +16 -1
- package/src/mcp-server/server.js +726 -10
- package/src/pipeline/providers.js +77 -17
- package/src/skills/sync-upstream.js +15 -3
- package/src/utils/media-downloader.js +7 -0
- package/src/utils/tool-installer.js +212 -0
- package/src/utils/transcribe.js +9 -1
- package/src/video-renderer/renderer.js +68 -38
- package/src/video-renderer/scene-animator.js +50 -15
- package/src/workflows/assets.js +49 -5
- package/src/workflows/render.js +2 -0
- package/src/workflows/script.js +14 -3
|
@@ -0,0 +1,597 @@
|
|
|
1
|
+
<meta charset="utf-8">
|
|
2
|
+
<title>Chalk Talk</title>
|
|
3
|
+
<meta name="claude:viewport-fit-sides" content="cover">
|
|
4
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
5
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
6
|
+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Anton&family=Cabin+Sketch:wght@400;700&family=Inter:wght@400;600;700;800&family=Kalam:wght@400;700&family=Instrument+Serif:ital@0;1&display=block">
|
|
7
|
+
<style>
|
|
8
|
+
/* Layout: an editing-suite player. One dark look by choice: the stage, then the transport bar under it. */
|
|
9
|
+
:root {
|
|
10
|
+
color-scheme: dark;
|
|
11
|
+
--bg: #0b0b0d;
|
|
12
|
+
--panel: #141417;
|
|
13
|
+
--ink: #f2f0ea;
|
|
14
|
+
--dim: #8d8c93;
|
|
15
|
+
--line: #26262c;
|
|
16
|
+
--accent: #ffd60a;
|
|
17
|
+
--display: "Anton", "Bebas Neue", Impact, "Arial Narrow", sans-serif;
|
|
18
|
+
--body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
|
|
19
|
+
--serif: "Instrument Serif", Georgia, "Times New Roman", serif;
|
|
20
|
+
}
|
|
21
|
+
html, body { height: 100%; }
|
|
22
|
+
body {
|
|
23
|
+
background: var(--bg); color: var(--ink); font-family: var(--body);
|
|
24
|
+
padding-left: max(16px, env(safe-area-inset-left, 0px));
|
|
25
|
+
padding-right: max(16px, env(safe-area-inset-right, 0px));
|
|
26
|
+
padding-block: 20px 28px;
|
|
27
|
+
}
|
|
28
|
+
.wrap { max-width: 1180px; margin: 0 auto; display: grid; gap: 14px; }
|
|
29
|
+
.top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 18px; }
|
|
30
|
+
.name { font-family: var(--display); font-weight: 400; font-size: clamp(26px, 4vw, 40px); letter-spacing: 0.02em; text-transform: uppercase; margin: 0; line-height: 1; }
|
|
31
|
+
.name em { font-family: var(--serif); font-style: italic; text-transform: none; color: var(--accent); letter-spacing: 0; font-size: 1.12em; }
|
|
32
|
+
.meta { color: var(--dim); font-size: 14px; margin: 0; }
|
|
33
|
+
.stage { position: relative; width: 100%; max-width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
|
|
34
|
+
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
|
|
35
|
+
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
|
|
36
|
+
.bar button, .bar label.btn {
|
|
37
|
+
font: 600 14px var(--body); color: var(--ink); background: transparent; border: 1px solid var(--line);
|
|
38
|
+
border-radius: 7px; padding: 8px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
|
|
39
|
+
}
|
|
40
|
+
.bar button:hover, .bar label.btn:hover { border-color: var(--dim); }
|
|
41
|
+
.bar button:focus-visible, .bar label.btn:focus-within, #scrub:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
|
|
42
|
+
.bar button[aria-pressed="true"] { background: var(--accent); color: #0b0b0d; border-color: var(--accent); }
|
|
43
|
+
#play { min-width: 82px; justify-content: center; background: var(--ink); color: #0b0b0d; border-color: var(--ink); }
|
|
44
|
+
#scrub { flex: 1 1 220px; min-width: 0; accent-color: var(--accent); }
|
|
45
|
+
#time { font: 600 14px var(--body); font-variant-numeric: tabular-nums; color: var(--dim); min-width: 92px; text-align: right; }
|
|
46
|
+
#vofile { position: absolute; width: 1px; height: 1px; opacity: 0; }
|
|
47
|
+
.note { color: var(--dim); font-size: 13px; margin: 0; max-width: 70ch; }
|
|
48
|
+
</style>
|
|
49
|
+
|
|
50
|
+
<div class="wrap">
|
|
51
|
+
<div class="top">
|
|
52
|
+
<h1 class="name">Chalk <em>Talk</em></h1>
|
|
53
|
+
<p class="meta">Reference animation · 20.8 s · drawn in code, sound synthesized</p>
|
|
54
|
+
</div>
|
|
55
|
+
<div class="stage"><canvas id="stage" width="1280" height="720" aria-label="Chalk Talk reference animation"></canvas></div>
|
|
56
|
+
<div class="bar">
|
|
57
|
+
<button id="play" type="button">Play</button>
|
|
58
|
+
<input id="scrub" type="range" min="0" max="20.8" step="0.01" value="0" aria-label="Scrub timeline">
|
|
59
|
+
<span id="time">0.00 / 20.80</span>
|
|
60
|
+
<button id="sound" type="button" aria-pressed="true">Sound on</button>
|
|
61
|
+
<button id="loop" type="button" aria-pressed="true">Loop</button>
|
|
62
|
+
<label class="btn" for="vofile">Load voiceover<input id="vofile" type="file" accept="audio/*"></label>
|
|
63
|
+
</div>
|
|
64
|
+
<p class="note" id="vonote">Load a voiceover to play it in sync. The effects switch to a lighter mix under narration.</p>
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
<script>
|
|
68
|
+
// =====================================================================================================
|
|
69
|
+
// CREATOR MOTION GRAPHICS · core helpers (CM), sound kit (SFX), style, player
|
|
70
|
+
// Every frame is a pure function of t. All randomness is seeded. Times are seconds.
|
|
71
|
+
// =====================================================================================================
|
|
72
|
+
const CM = (() => {
|
|
73
|
+
const clamp = (v, a = 0, b = 1) => (v < a ? a : v > b ? b : v);
|
|
74
|
+
const lerp = (a, b, u) => a + (b - a) * u;
|
|
75
|
+
const span = (t, a, b) => clamp((t - a) / (b - a));
|
|
76
|
+
const rotl = (x, k) => (x << k) | (x >>> (32 - k));
|
|
77
|
+
const hash = (s) => { s = String(s); let h = 0x9e3779b1; for (let i = 0; i < s.length; i++) { h = Math.imul(h ^ s.charCodeAt(i), 0x85ebca6b); h ^= h >>> 13; } return h >>> 0; };
|
|
78
|
+
// xoshiro128** style generator, seeded from a number or string
|
|
79
|
+
const rng = (seed) => {
|
|
80
|
+
const s = typeof seed === 'number' ? seed >>> 0 : hash(seed);
|
|
81
|
+
let a = (s ^ 0xa5a5a5a5) >>> 0, b = (Math.imul(s, 0x27d4eb2d) >>> 0) || 1, c = (0x165667b1 ^ s) >>> 0, d = (rotl(s, 7) >>> 0) || 7;
|
|
82
|
+
const r = () => { const res = Math.imul(rotl(Math.imul(b, 5), 7), 9) >>> 0; const t = b << 9; c ^= a; d ^= b; b ^= c; a ^= d; c ^= t; d = rotl(d, 11); return res / 4294967296; };
|
|
83
|
+
for (let i = 0; i < 8; i++) r();
|
|
84
|
+
r.in = (lo, hi) => lo + r() * (hi - lo);
|
|
85
|
+
r.pick = (arr) => arr[(r() * arr.length) | 0];
|
|
86
|
+
return r;
|
|
87
|
+
};
|
|
88
|
+
// smooth 1D value noise, roughly -1..1
|
|
89
|
+
const noise1 = (seed) => { const r = rng(seed), v = Float32Array.from({ length: 256 }, () => r() * 2 - 1); return (x) => { const i = Math.floor(x), f = x - i, u = f * f * (3 - 2 * f); return lerp(v[i & 255], v[(i + 1) & 255], u); }; };
|
|
90
|
+
const ez = {
|
|
91
|
+
out3: (u) => 1 - Math.pow(1 - u, 3),
|
|
92
|
+
in3: (u) => u * u * u,
|
|
93
|
+
inout3: (u) => (u < 0.5 ? 4 * u * u * u : 1 - Math.pow(-2 * u + 2, 3) / 2),
|
|
94
|
+
outExpo: (u) => (u >= 1 ? 1 : 1 - Math.pow(2, -10 * u)),
|
|
95
|
+
back: (u, s = 1.7) => (u <= 0 ? 0 : u >= 1 ? 1 : 1 + (s + 1) * Math.pow(u - 1, 3) + s * Math.pow(u - 1, 2)),
|
|
96
|
+
spring: (u) => (u <= 0 ? 0 : u >= 1 ? 1 : 1 - Math.exp(-6 * u) * Math.cos(13 * u)),
|
|
97
|
+
};
|
|
98
|
+
const layer = (w, h) => { const c = document.createElement('canvas'); c.width = w; c.height = h; return c; };
|
|
99
|
+
return { clamp, lerp, span, hash, rng, noise1, ez, layer };
|
|
100
|
+
})();
|
|
101
|
+
|
|
102
|
+
// =====================================================================================================
|
|
103
|
+
// SFX: synthesized creator-edit sound kit. Plain Web Audio, no files.
|
|
104
|
+
// voiceover mode keeps the music low under narration and plays sounds marked `soft` at 55%.
|
|
105
|
+
// =====================================================================================================
|
|
106
|
+
const SFX = (() => {
|
|
107
|
+
const SEMI = { C: -9, D: -7, E: -5, F: -4, G: -2, A: 0, B: 2 };
|
|
108
|
+
const hz = (n) => { if (typeof n === 'number') return n; const m = /^([A-G])(#|b)?(-?\d)$/.exec(n); return 440 * Math.pow(2, (SEMI[m[1]] + (m[2] === '#' ? 1 : m[2] === 'b' ? -1 : 0) + (+m[3] - 4) * 12) / 12); };
|
|
109
|
+
|
|
110
|
+
function kit(ac, o = {}) {
|
|
111
|
+
const VO = !!o.voiceover, SR = ac.sampleRate, T0 = o.from || 0, base = ac.currentTime + (o.lead || 0);
|
|
112
|
+
// snap every start a little past the sample grid (avoids level spikes on some browsers)
|
|
113
|
+
const at = (t) => (Math.round((base + (t - T0)) * SR) + 0.3) / SR;
|
|
114
|
+
const skip = (t, dur) => at(t) + dur < ac.currentTime || (t < T0 - 0.005 && dur < 1.2);
|
|
115
|
+
|
|
116
|
+
const comp = ac.createDynamicsCompressor();
|
|
117
|
+
comp.threshold.value = -14; comp.knee.value = 6; comp.ratio.value = 4; comp.attack.value = 0.003; comp.release.value = 0.15;
|
|
118
|
+
const master = ac.createGain(); master.gain.value = o.master == null ? 0.85 : o.master;
|
|
119
|
+
comp.connect(master); master.connect(o.dest || ac.destination);
|
|
120
|
+
const mk = (g) => { const n = ac.createGain(); n.gain.value = g; n.connect(comp); return n; };
|
|
121
|
+
const bus = { fx: mk(VO ? 0.78 : 0.95), music: mk(VO ? 0.3 : 0.62), amb: mk(0.45) };
|
|
122
|
+
const duckIn = ac.createGain(); duckIn.connect(bus.music);
|
|
123
|
+
const DUCKS = [];
|
|
124
|
+
|
|
125
|
+
// generated plate-style reverb
|
|
126
|
+
const verb = ac.createConvolver();
|
|
127
|
+
{ const n = Math.floor(1.5 * SR), ir = ac.createBuffer(2, n, SR);
|
|
128
|
+
for (let ch = 0; ch < 2; ch++) { const r = CM.rng('plate' + ch), d = ir.getChannelData(ch); let lp = 0; for (let i = 0; i < n; i++) { const u = i / n; lp += (0.7 - 0.5 * u) * ((r() * 2 - 1) - lp); d[i] = lp * Math.pow(1 - u, 2.6) * 0.9; } }
|
|
129
|
+
verb.buffer = ir; }
|
|
130
|
+
const verbIn = ac.createGain(); verbIn.gain.value = 0.8; verbIn.connect(verb); verb.connect(comp);
|
|
131
|
+
|
|
132
|
+
// seeded noise buffers
|
|
133
|
+
const NB = {};
|
|
134
|
+
{ const n = Math.floor(2 * SR);
|
|
135
|
+
for (const kind of ['white', 'pink', 'brown']) {
|
|
136
|
+
const b = ac.createBuffer(1, n, SR), d = b.getChannelData(0), r = CM.rng('nz' + kind); let b0 = 0, b1 = 0, b2 = 0, br = 0;
|
|
137
|
+
for (let i = 0; i < n; i++) { const w = r() * 2 - 1;
|
|
138
|
+
if (kind === 'white') d[i] = w;
|
|
139
|
+
else if (kind === 'pink') { b0 = 0.99765 * b0 + w * 0.099; b1 = 0.963 * b1 + w * 0.2965; b2 = 0.57 * b2 + w * 1.0527; d[i] = (b0 + b1 + b2 + w * 0.1848) * 0.18; }
|
|
140
|
+
else { br = (br + 0.02 * w) / 1.02; d[i] = br * 3.4; } }
|
|
141
|
+
NB[kind] = b; } }
|
|
142
|
+
|
|
143
|
+
const ramp = (param, v, t) => { if (!Array.isArray(v)) { param.setValueAtTime(v, t); return; } param.setValueAtTime(v[0][1], t + v[0][0]); for (let i = 1; i < v.length; i++) param.exponentialRampToValueAtTime(Math.max(1e-3, v[i][1]), t + v[i][0]); };
|
|
144
|
+
const env = (g, t, peak, dur, a = 0.004, hold = 0) => {
|
|
145
|
+
a = Math.min(a, dur * 0.9); hold = Math.min(hold, dur - a);
|
|
146
|
+
g.gain.setValueAtTime(0, t); g.gain.linearRampToValueAtTime(peak, t + a);
|
|
147
|
+
if (hold > 0) g.gain.setValueAtTime(peak, t + a + hold);
|
|
148
|
+
g.gain.exponentialRampToValueAtTime(1e-4, t + dur); g.gain.setValueAtTime(0, t + dur + 0.002);
|
|
149
|
+
};
|
|
150
|
+
const level = (p, d) => (p.gain == null ? d : p.gain) * (VO && p.soft ? 0.55 : 1);
|
|
151
|
+
const route = (node, p, t) => {
|
|
152
|
+
const pan = ac.createStereoPanner();
|
|
153
|
+
if (Array.isArray(p.pan)) { pan.pan.setValueAtTime(p.pan[0], t); pan.pan.linearRampToValueAtTime(p.pan[1], t + (p.dur || 0.2)); } else pan.pan.value = CM.clamp(p.pan || 0, -1, 1);
|
|
154
|
+
node.connect(pan); pan.connect(p.bus === 'music' ? duckIn : bus[p.bus || 'fx']);
|
|
155
|
+
if (p.verb) { const s = ac.createGain(); s.gain.value = p.verb; pan.connect(s); s.connect(verbIn); }
|
|
156
|
+
};
|
|
157
|
+
const filt = (p, t) => { if (!p.filter) return null; const f = ac.createBiquadFilter(); f.type = p.filter; f.Q.value = p.q == null ? 0.9 : p.q; ramp(f.frequency, p.ff == null ? 1200 : p.ff, t); return f; };
|
|
158
|
+
|
|
159
|
+
// primitive: oscillator voice. f may be a value or [[dt, hz], ...]
|
|
160
|
+
function voice(time, p) {
|
|
161
|
+
const dur = p.dur || 0.2; if (skip(time, dur)) return; const t = at(time);
|
|
162
|
+
const osc = ac.createOscillator(); osc.type = p.type || 'sine';
|
|
163
|
+
ramp(osc.frequency, Array.isArray(p.f) ? p.f.map(([d, v]) => [d, hz(v)]) : hz(p.f || 440), t);
|
|
164
|
+
const g = ac.createGain(); env(g, t, level(p, 0.3), dur, p.a, p.hold);
|
|
165
|
+
const f = filt(p, t); if (f) { osc.connect(f); f.connect(g); } else osc.connect(g);
|
|
166
|
+
route(g, p, t); osc.start(t); osc.stop(t + dur + 0.03);
|
|
167
|
+
}
|
|
168
|
+
// primitive: noise voice
|
|
169
|
+
function hiss(time, p) {
|
|
170
|
+
const dur = p.dur || 0.2; if (skip(time, dur)) return; const t = at(time);
|
|
171
|
+
const src = ac.createBufferSource(); src.buffer = NB[p.color || 'white']; src.loop = true; if (p.rate) src.playbackRate.value = p.rate;
|
|
172
|
+
const g = ac.createGain(); env(g, t, level(p, 0.3), dur, p.a, p.hold);
|
|
173
|
+
const f = filt(p, t); if (f) { src.connect(f); f.connect(g); } else src.connect(g);
|
|
174
|
+
route(g, p, t); src.start(t, CM.rng('off' + time)() * 1.5); src.stop(t + dur + 0.03);
|
|
175
|
+
}
|
|
176
|
+
function duck(t, depth = 0.5, hold = 0.25) { DUCKS.push({ t, depth, hold }); }
|
|
177
|
+
|
|
178
|
+
// ---------------- named sounds (creator-edit palette) ----------------
|
|
179
|
+
const S = {
|
|
180
|
+
// text slam: a tight low thump with a short papery crack
|
|
181
|
+
slam: (t, o) => { voice(t, { f: [[0, 150], [0.12, 52]], dur: 0.2, gain: 0.42 * o.g, pan: o.pan, soft: o.soft }); hiss(t, { dur: 0.07, filter: 'lowpass', ff: 2600, gain: 0.22 * o.g, pan: o.pan, soft: o.soft }); hiss(t, { dur: 0.012, filter: 'highpass', ff: 5000, gain: 0.12 * o.g, pan: o.pan, soft: o.soft }); },
|
|
182
|
+
// big drop: sub boom with a dark tail
|
|
183
|
+
boom: (t, o) => { voice(t, { f: [[0, 90], [0.08, 52], [1.6, 34]], dur: 1.7, gain: 0.7 * o.g, a: 0.006, hold: 0.12 }); hiss(t, { color: 'brown', dur: 0.6, filter: 'lowpass', ff: [[0, 600], [0.5, 90]], gain: 0.35 * o.g, verb: 0.3 }); duck(t, 0.7, 0.35); },
|
|
184
|
+
pop: (t, o) => { const f = o.f || 760; voice(t, { f: [[0, f * 1.7], [0.05, f]], dur: 0.08, gain: 0.22 * o.g, pan: o.pan, soft: o.soft }); hiss(t, { dur: 0.01, filter: 'highpass', ff: 4500, gain: 0.08 * o.g, pan: o.pan, soft: o.soft }); },
|
|
185
|
+
tick: (t, o) => hiss(t, { dur: 0.016, filter: 'bandpass', ff: o.f || 3800, q: 3, gain: 0.32 * o.g, pan: o.pan, soft: o.soft }),
|
|
186
|
+
click: (t, o) => { hiss(t, { dur: 0.012, filter: 'bandpass', ff: 3200, q: 2, gain: 0.35 * o.g, pan: o.pan }); hiss(t + 0.045, { dur: 0.01, filter: 'bandpass', ff: 2400, q: 2, gain: 0.22 * o.g, pan: o.pan }); },
|
|
187
|
+
whoosh: (t, o) => { const d = o.dur || 0.35, dir = o.dir || 1; hiss(t, { color: 'pink', dur: d, filter: 'bandpass', ff: [[0, 260], [d * 0.55, o.top || 3200], [d, 520]], q: 0.75, gain: 0.5 * o.g, a: d * 0.55, pan: [-0.7 * dir, 0.7 * dir], verb: 0.12, soft: o.soft }); hiss(t + d * 0.2, { dur: d * 0.6, filter: 'highpass', ff: [[0, 3000], [d * 0.6, 7000]], gain: 0.08 * o.g, a: d * 0.3, pan: [-0.4 * dir, 0.5 * dir], soft: o.soft }); },
|
|
188
|
+
riser: (t, o) => { const d = o.dur || 0.8; hiss(t, { color: 'pink', dur: d, filter: 'bandpass', ff: [[0, 300], [d, 5200]], q: 1.1, gain: 0.32 * o.g, a: d * 0.96, verb: 0.2, soft: o.soft }); voice(t, { type: 'sawtooth', f: [[0, 110], [d, 440]], dur: d, gain: 0.06 * o.g, a: d * 0.95, filter: 'lowpass', ff: [[0, 400], [d, 2400]], soft: o.soft }); },
|
|
189
|
+
glitch: (t, o) => { const r = CM.rng('gl' + t); for (let i = 0; i < 9; i++) voice(t + i * 0.021, { type: 'square', f: 180 + r() * 2200, dur: 0.018, gain: 0.07 * o.g, a: 0.001, hold: 0.012, pan: r() * 1.4 - 0.7 }); hiss(t, { dur: 0.2, filter: 'bandpass', ff: [[0, 4000], [0.2, 900]], q: 0.7, gain: 0.18 * o.g }); hiss(t + 0.1, { dur: 0.05, color: 'brown', gain: 0.25 * o.g }); },
|
|
190
|
+
ping: (t, o) => { voice(t, { f: 'E6', dur: 0.5, gain: 0.16 * o.g, a: 0.003, verb: 0.3, pan: o.pan }); voice(t + 0.11, { f: 'B6', dur: 0.7, gain: 0.14 * o.g, a: 0.003, verb: 0.35, pan: o.pan }); },
|
|
191
|
+
send: (t, o) => { voice(t, { f: [[0, 520], [0.11, 1500]], dur: 0.13, gain: 0.14 * o.g, pan: o.pan }); hiss(t, { dur: 0.1, filter: 'highpass', ff: [[0, 2000], [0.1, 6000]], gain: 0.07 * o.g, pan: o.pan }); },
|
|
192
|
+
keys: (t, o) => { const r = CM.rng('k' + t), end = t + (o.dur || 0.4); for (let x = t; x < end; x += 0.055 + r() * 0.035) { hiss(x, { dur: 0.014, filter: 'bandpass', ff: 3200 + r() * 900, q: 3, gain: 0.2 * o.g, pan: o.pan, soft: true }); voice(x, { f: 1900 + r() * 300, dur: 0.012, gain: 0.025 * o.g, pan: o.pan, soft: true }); } },
|
|
193
|
+
// highlighter / marker swipe: grainy felt drag
|
|
194
|
+
marker: (t, o) => { const d = o.dur || 0.25, r = CM.rng('m' + t); for (let x = 0; x < d; x += 0.022 + r() * 0.012) hiss(t + x, { dur: 0.03, filter: 'bandpass', ff: 1700 + r() * 900, q: 1.4, gain: 0.16 * o.g * (0.6 + r() * 0.5), pan: o.pan, soft: o.soft }); },
|
|
195
|
+
strike: (t, o) => { hiss(t, { dur: 0.15, filter: 'bandpass', ff: [[0, 1200], [0.15, 3200]], q: 1.2, gain: 0.3 * o.g, a: 0.02, pan: o.pan }); },
|
|
196
|
+
tapeStop: (t, o) => { voice(t, { type: 'sawtooth', f: [[0, 196], [0.62, 18]], dur: 0.66, gain: 0.22 * o.g, a: 0.004, hold: 0.3, filter: 'lowpass', ff: [[0, 1800], [0.6, 160]] }); voice(t, { f: [[0, 98], [0.62, 12]], dur: 0.66, gain: 0.3 * o.g, a: 0.004, hold: 0.3 }); hiss(t, { color: 'brown', dur: 0.5, filter: 'lowpass', ff: [[0, 900], [0.5, 120]], gain: 0.18 * o.g }); },
|
|
197
|
+
stamp: (t, o) => { voice(t, { f: [[0, 160], [0.18, 48]], dur: 0.28, gain: 0.6 * o.g }); hiss(t, { dur: 0.06, filter: 'bandpass', ff: 1300, q: 1.1, gain: 0.4 * o.g }); hiss(t + 0.004, { dur: 0.014, filter: 'highpass', ff: 4200, gain: 0.25 * o.g }); },
|
|
198
|
+
shimmer: (t, o) => { ['C6', 'E6', 'G6', 'B6', 'D7', 'E7'].forEach((n, i) => voice(t + i * 0.035, { f: n, dur: 0.75, gain: 0.045 * o.g, a: 0.003, verb: 0.45, pan: (i % 2 ? 0.35 : -0.35) })); },
|
|
199
|
+
sparkle: (t, o) => { const r = CM.rng('sp' + t); for (let i = 0; i < 5; i++) voice(t + i * 0.05, { f: 2400 + r() * 2400, dur: 0.25, gain: 0.03 * o.g, a: 0.002, verb: 0.4, pan: r() * 1.2 - 0.6 }); },
|
|
200
|
+
};
|
|
201
|
+
function play(name, t, opts = {}) { const fn = S[name]; if (!fn) throw new Error('unknown sound ' + name); fn(t, Object.assign({}, opts, { g: opts.gain == null ? 1 : opts.gain })); }
|
|
202
|
+
|
|
203
|
+
// ---------------- music: half-time beat with bass and soft pad ----------------
|
|
204
|
+
function music(t0, t1, p = {}) {
|
|
205
|
+
const bpm = p.bpm || 98, step = 60 / bpm / 4, bar = step * 16, g = p.gain == null ? 1 : p.gain;
|
|
206
|
+
const roots = p.roots || ['A1', 'F1', 'C2', 'G1'];
|
|
207
|
+
const pads = p.pads || [['A3', 'C4', 'E4'], ['F3', 'A3', 'C4'], ['C4', 'E4', 'G4'], ['G3', 'B3', 'D4']];
|
|
208
|
+
let bi = 0;
|
|
209
|
+
for (let tb = t0; tb < t1 - 0.05; tb += bar, bi++) {
|
|
210
|
+
const root = roots[bi % roots.length], pad = pads[bi % pads.length], blen = Math.min(bar, t1 - tb);
|
|
211
|
+
pad.forEach((n, k) => voice(tb, { type: 'triangle', f: n, dur: blen + 0.2, gain: 0.03 * g, a: 0.3, hold: blen - 0.5, filter: 'lowpass', ff: 1100, pan: (k - 1) * 0.35, verb: 0.3, bus: 'music' }));
|
|
212
|
+
for (let s = 0; s < 16; s++) {
|
|
213
|
+
const ts = tb + s * step; if (ts >= t1 - 0.02) break;
|
|
214
|
+
if (s === 0 || s === 10) { voice(ts, { f: [[0, 150], [0.09, 46]], dur: 0.32, gain: 0.5 * g, bus: 'music' }); hiss(ts, { dur: 0.012, filter: 'highpass', ff: 3000, gain: 0.05 * g, bus: 'music' }); }
|
|
215
|
+
if (s === 4 || s === 12) { hiss(ts, { dur: 0.16, filter: 'bandpass', ff: 1700, q: 0.8, gain: 0.26 * g, verb: 0.25, bus: 'music' }); hiss(ts + 0.008, { dur: 0.05, filter: 'highpass', ff: 4500, gain: 0.1 * g, bus: 'music' }); }
|
|
216
|
+
if (s % 2 === 0) hiss(ts, { dur: s % 4 === 2 ? 0.05 : 0.028, filter: 'highpass', ff: 7500, gain: (s % 4 === 2 ? 0.06 : 0.035) * g, bus: 'music' });
|
|
217
|
+
if ([0, 3, 6, 10, 14].includes(s)) voice(ts, { type: 'triangle', f: root, dur: step * 2.6, gain: 0.2 * g, a: 0.006, hold: step, filter: 'lowpass', ff: 380, bus: 'music' });
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
function drone(t0, t1, p = {}) { const d = t1 - t0, g = p.gain == null ? 1 : p.gain; voice(t0, { f: p.note || 'A1', dur: d, gain: 0.12 * g, a: d * 0.4, hold: d * 0.4, bus: 'music' }); hiss(t0, { color: 'pink', dur: d, filter: 'bandpass', ff: 900, q: 0.5, gain: 0.03 * g, a: d * 0.5, hold: d * 0.3, bus: 'amb' }); }
|
|
222
|
+
function finish() {
|
|
223
|
+
DUCKS.sort((a, b) => a.t - b.t);
|
|
224
|
+
for (const e of DUCKS) { const s = at(e.t); if (s + e.hold < ac.currentTime) continue; duckIn.gain.setTargetAtTime(1 - e.depth, Math.max(s, ac.currentTime), 0.008); duckIn.gain.setTargetAtTime(1, s + e.hold, 0.14); }
|
|
225
|
+
}
|
|
226
|
+
return { play, voice, hiss, music, drone, duck, finish, hz, vo: VO };
|
|
227
|
+
}
|
|
228
|
+
function live(score, from, opts = {}) {
|
|
229
|
+
const ac = new (window.AudioContext || window.webkitAudioContext)();
|
|
230
|
+
const k = kit(ac, Object.assign({}, opts, { from: from || 0, lead: 0.04 })); score(k); k.finish();
|
|
231
|
+
return () => { try { ac.close(); } catch (e) {} };
|
|
232
|
+
}
|
|
233
|
+
async function render(score, dur, sr = 48000, opts = {}) {
|
|
234
|
+
const len = Math.ceil(dur * sr), ac = new OfflineAudioContext(2, len, sr);
|
|
235
|
+
const k = kit(ac, Object.assign({}, opts, { from: 0 })); score(k); k.finish();
|
|
236
|
+
const buf = await ac.startRendering(), L = buf.getChannelData(0), R = buf.getChannelData(1), inter = new Float32Array(len * 2);
|
|
237
|
+
let peak = 0; for (let i = 0; i < len; i++) { inter[2 * i] = L[i]; inter[2 * i + 1] = R[i]; peak = Math.max(peak, Math.abs(L[i]), Math.abs(R[i])); }
|
|
238
|
+
return { inter, peak, sr, frames: len };
|
|
239
|
+
}
|
|
240
|
+
return { kit, live, render, hz };
|
|
241
|
+
})();
|
|
242
|
+
|
|
243
|
+
// =====================================================================================================
|
|
244
|
+
// STYLE: Chalkboard
|
|
245
|
+
// Dusty chalk on a long green slate. Every stroke and letter is chalked on in sequence by a visible stick,
|
|
246
|
+
// the grain of the board breaks the strokes, dust falls from the tip, the camera tracks along the board,
|
|
247
|
+
// numbers are re-chalked as they count, and a felt eraser wipes a section clean for the next idea.
|
|
248
|
+
// Demo topic: "Get 1% better every day".
|
|
249
|
+
// =====================================================================================================
|
|
250
|
+
const W = 1280, HH = 720;
|
|
251
|
+
const { clamp, lerp, span, rng, noise1, ez } = CM;
|
|
252
|
+
const BW = 2700; // board width in world units (the board is one long slate, 720 tall)
|
|
253
|
+
const C = { slate: '#24392f', chalk: '#f2efe6', yellow: '#f4d35e', pink: '#f39bbb', blue: '#93cbef', dim: 'rgba(242,239,230,0.55)' };
|
|
254
|
+
const F = { head: '"Cabin Sketch", "Comic Sans MS", cursive', hand: '"Kalam", "Segoe Print", cursive' };
|
|
255
|
+
const head = (px) => `700 ${px}px ${F.head}`, hand = (px, w = 700) => `${w} ${px}px ${F.hand}`;
|
|
256
|
+
|
|
257
|
+
// ---------- the timeline: picture and sound both read these ----------
|
|
258
|
+
const TL = {
|
|
259
|
+
D: 20.8,
|
|
260
|
+
title1: [0.25, 1.25], title2: [1.3, 1.9], under: [1.95, 2.25],
|
|
261
|
+
eq1: [2.5, 3.3], lab1: [3.35, 3.8],
|
|
262
|
+
eq2: [3.95, 4.65], cnt: [4.75, 6.15], ring1: [6.25, 6.65], lab2: [6.7, 7.1],
|
|
263
|
+
eq3: [7.2, 7.95], lab3: [7.95, 8.3],
|
|
264
|
+
arrow: [8.35, 8.9],
|
|
265
|
+
yAxis: [9.5, 9.75], xAxis: [9.75, 10.0], axLab: [10.0, 10.35],
|
|
266
|
+
flat: [10.4, 11.0], flatLab: [11.0, 11.4],
|
|
267
|
+
curve: [11.5, 13.1], curveLab: [13.15, 13.5], ring2: [13.55, 13.9],
|
|
268
|
+
bracket: [14.0, 14.35], gapLab: [14.4, 14.75],
|
|
269
|
+
wipe: [15.2, 16.2],
|
|
270
|
+
take1: [16.4, 17.3], take2: [17.35, 18.1], take3: [18.2, 18.6], note: [18.75, 19.3],
|
|
271
|
+
};
|
|
272
|
+
// camera keys: [t, centerX, centerY, zoom]
|
|
273
|
+
const CAM = [[0, 640, 360, 1], [3.8, 640, 360, 1], [4.7, 560, 430, 1.12], [6.9, 560, 430, 1.12], [7.6, 640, 380, 1], [8.4, 640, 370, 1], [9.4, 1950, 370, 1], [15.0, 1950, 370, 1], [20.8, 1950, 360, 1.05]];
|
|
274
|
+
function camAt(t) {
|
|
275
|
+
if (t <= CAM[0][0]) return CAM[0].slice(1);
|
|
276
|
+
for (let i = 0; i < CAM.length - 1; i++) { const a = CAM[i], b = CAM[i + 1]; if (t <= b[0]) { const e = ez.inout3((t - a[0]) / (b[0] - a[0])); return [lerp(a[1], b[1], e), lerp(a[2], b[2], e), Math.exp(lerp(Math.log(a[3]), Math.log(b[3]), e))]; } }
|
|
277
|
+
return CAM[CAM.length - 1].slice(1);
|
|
278
|
+
}
|
|
279
|
+
const applyCam = (c, k) => { c.translate(640, 360); c.scale(k[2], k[2]); c.translate(-k[0], -k[1]); };
|
|
280
|
+
const toScreen = (k, x, y) => [(x - k[0]) * k[2] + 640, (y - k[1]) * k[2] + 360];
|
|
281
|
+
|
|
282
|
+
// shared value curve (picture and sound): 1.01^(365u), re-chalked 10 times a second
|
|
283
|
+
const cntStep = (t) => Math.floor(Math.max(0, t - TL.cnt[0]) * 10);
|
|
284
|
+
const cntVal = (t) => { const u = ez.out3(span(Math.min(t, TL.cnt[0] + cntStep(t) / 10), TL.cnt[0], TL.cnt[1])); return Math.pow(1.01, 365 * u); };
|
|
285
|
+
const cntText = (t) => (t >= TL.cnt[1] ? '37.8' : cntVal(t).toFixed(1));
|
|
286
|
+
|
|
287
|
+
// ---------- 2D value noise (for the slate) ----------
|
|
288
|
+
function noise2(seed) {
|
|
289
|
+
const r = rng(seed), N = 256, g = new Float32Array(N * N); for (let i = 0; i < g.length; i++) g[i] = r() * 2 - 1;
|
|
290
|
+
const at = (x, y) => g[((y & 255) << 8) | (x & 255)];
|
|
291
|
+
return (x, y) => { const xi = Math.floor(x), yi = Math.floor(y), fx = x - xi, fy = y - yi, u = fx * fx * (3 - 2 * fx), v = fy * fy * (3 - 2 * fy);
|
|
292
|
+
return lerp(lerp(at(xi, yi), at(xi + 1, yi), u), lerp(at(xi, yi + 1), at(xi + 1, yi + 1), u), v); };
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// ---------- the board: baked once ----------
|
|
296
|
+
let BOARD = null;
|
|
297
|
+
function board() {
|
|
298
|
+
if (BOARD) return BOARD;
|
|
299
|
+
const L = CM.layer(BW, HH), c = L.getContext('2d'), img = c.createImageData(BW, HH), d = img.data, n1 = noise2(5), n2 = noise2(9), r = rng('slate');
|
|
300
|
+
for (let y = 0; y < HH; y++) for (let x = 0; x < BW; x++) {
|
|
301
|
+
const v = 1 + 0.07 * n1(x / 140, y / 140) + 0.04 * n2(x / 22, y / 22) + (r() - 0.5) * 0.07 - 0.08 * (y / HH);
|
|
302
|
+
const i = (y * BW + x) * 4; d[i] = 36 * v; d[i + 1] = 58 * v; d[i + 2] = 47 * v; d[i + 3] = 255;
|
|
303
|
+
}
|
|
304
|
+
c.putImageData(img, 0, 0);
|
|
305
|
+
// ghosts of earlier lessons, then smeared by old eraser passes
|
|
306
|
+
c.save(); c.globalAlpha = 0.07; c.fillStyle = C.chalk;
|
|
307
|
+
[['x² − 4x + 4 = 0', 930, 90, 34], ['a² + b² = c²', 120, 690, 30], ['f(x) = 2x + 1', 1540, 110, 32], ['∑ n = n(n+1)/2', 2280, 680, 30], ['HW: p. 214', 860, 655, 30], ['y = mx + b', 2350, 120, 34]]
|
|
308
|
+
.forEach(([s, x, y, px]) => { c.font = hand(px, 400); c.fillText(s, x, y); });
|
|
309
|
+
c.restore();
|
|
310
|
+
const rs = rng('smear'); c.save(); c.lineCap = 'round'; c.filter = 'blur(9px)';
|
|
311
|
+
for (let i = 0; i < 70; i++) { const x = rs.in(-100, BW), y = rs.in(40, 700), len = rs.in(160, 460); c.strokeStyle = `rgba(215,228,218,${rs.in(0.018, 0.045)})`; c.lineWidth = rs.in(36, 90); c.beginPath(); c.moveTo(x, y); c.quadraticCurveTo(x + len / 2, y + rs.in(-30, 30), x + len, y + rs.in(-20, 20)); c.stroke(); }
|
|
312
|
+
c.restore();
|
|
313
|
+
BOARD = L; return L;
|
|
314
|
+
}
|
|
315
|
+
// board tooth: specks that chalk skips over (punched out of the chalk layer)
|
|
316
|
+
let TOOTH = null;
|
|
317
|
+
function tooth() {
|
|
318
|
+
if (TOOTH) return TOOTH;
|
|
319
|
+
const L = CM.layer(384, 384), c = L.getContext('2d'), img = c.createImageData(384, 384), r = rng('tooth'), n = noise2(31);
|
|
320
|
+
for (let y = 0; y < 384; y++) for (let x = 0; x < 384; x++) { const v = 0.5 + 0.5 * n(x / 3.2, y / 3.2), a = v > 0.62 ? (v - 0.62) * 2.4 : 0; const i = (y * 384 + x) * 4; img.data[i + 3] = Math.min(255, 255 * (a + (r() < 0.06 ? 0.55 : 0))); }
|
|
321
|
+
c.putImageData(img, 0, 0); TOOTH = L; return L;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
// ---------- chalk drawing primitives ----------
|
|
325
|
+
const resample = (pts, step = 3) => { const out = [pts[0]]; for (let i = 1; i < pts.length; i++) { const [x0, y0] = pts[i - 1], [x1, y1] = pts[i], n = Math.max(1, Math.ceil(Math.hypot(x1 - x0, y1 - y0) / step)); for (let j = 1; j <= n; j++) out.push([lerp(x0, x1, j / n), lerp(y0, y1, j / n)]); } return out; };
|
|
326
|
+
const quad = (a, q, b, n = 40) => Array.from({ length: n + 1 }, (_, i) => { const u = i / n, v = 1 - u; return [v * v * a[0] + 2 * v * u * q[0] + u * u * b[0], v * v * a[1] + 2 * v * u * q[1] + u * u * b[1]]; });
|
|
327
|
+
const ellipse = (cx, cy, rx, ry, a0 = -2.5, turns = 1.12, n = 70) => Array.from({ length: n + 1 }, (_, i) => { const a = a0 + (i / n) * turns * Math.PI * 2, k = 1 + 0.04 * Math.sin(i * 0.31); return [cx + Math.cos(a) * rx * k, cy + Math.sin(a) * ry * k]; });
|
|
328
|
+
let TIP = null; // where the chalk stick is right now (world coords)
|
|
329
|
+
|
|
330
|
+
// a chalk stroke: wobbly, slightly broken, drawn on to progress p
|
|
331
|
+
function chalkLine(c, it, p) {
|
|
332
|
+
if (p <= 0) return;
|
|
333
|
+
const P = it._P || (it._P = (() => { const n = noise1(it.seed), raw = resample(it.pts, 3); let len = 0; return raw.map((q, i) => { if (i) len += Math.hypot(q[0] - raw[i - 1][0], q[1] - raw[i - 1][1]); const o = n(len * 0.02) * 1.4; return [q[0] + o, q[1] - o * 0.6, len]; }); })());
|
|
334
|
+
const m = Math.max(2, Math.ceil(P.length * Math.min(1, p))), gap = noise1(it.seed + 7);
|
|
335
|
+
c.save(); c.strokeStyle = it.col; c.lineCap = 'round'; c.lineJoin = 'round';
|
|
336
|
+
for (const [w, a, dx] of [[it.w, 0.92, 0], [it.w * 0.55, 0.45, it.w * 0.35]]) {
|
|
337
|
+
c.lineWidth = w; c.globalAlpha = a; c.beginPath(); let pen = false;
|
|
338
|
+
for (let i = 0; i < m; i++) { const q = P[i], skip = gap(q[2] * 0.09) > 0.8; if (skip) { pen = false; continue; } pen ? c.lineTo(q[0] + dx, q[1] - dx) : c.moveTo(q[0] + dx, q[1] - dx); pen = true; }
|
|
339
|
+
c.stroke();
|
|
340
|
+
}
|
|
341
|
+
c.restore();
|
|
342
|
+
if (p < 1) TIP = [P[m - 1][0], P[m - 1][1]];
|
|
343
|
+
}
|
|
344
|
+
// chalk lettering: parts are runs of text, each with its own font and vertical shift (for exponents)
|
|
345
|
+
function layoutText(c, it) {
|
|
346
|
+
if (it._L) return it._L;
|
|
347
|
+
const chars = []; let x = 0;
|
|
348
|
+
for (const part of it.parts) { c.font = part.font; for (const ch of part.s) { const w = c.measureText(ch).width; chars.push({ ch, x, w, font: part.font, dy: part.dy || 0, col: part.col }); x += w; } }
|
|
349
|
+
const x0 = it.align === 'center' ? it.x - x / 2 : it.align === 'right' ? it.x - x : it.x;
|
|
350
|
+
return (it._L = { chars, x0, w: x });
|
|
351
|
+
}
|
|
352
|
+
function chalkText(c, it, p) {
|
|
353
|
+
if (p <= 0) return;
|
|
354
|
+
const L = layoutText(c, it), n = L.chars.length, shown = Math.min(n, p * n), r = rng('tx' + it.seed);
|
|
355
|
+
c.save(); c.textBaseline = 'alphabetic';
|
|
356
|
+
L.chars.forEach((g, i) => {
|
|
357
|
+
const jy = r.in(-2, 2), jr = r.in(-0.05, 0.05); if (i >= shown) return; const a = Math.min(1, shown - i);
|
|
358
|
+
c.save(); c.translate(L.x0 + g.x + g.w / 2, it.y + g.dy + jy); c.rotate(jr); c.font = g.font; c.textAlign = 'center';
|
|
359
|
+
c.globalAlpha = 0.95 * a; c.fillStyle = g.col || it.col; c.fillText(g.ch, 0, 0);
|
|
360
|
+
c.globalAlpha = 0.5 * a; c.strokeStyle = g.col || it.col; c.lineWidth = 1.4; c.strokeText(g.ch, 0.6, -0.4);
|
|
361
|
+
c.restore();
|
|
362
|
+
});
|
|
363
|
+
c.restore();
|
|
364
|
+
if (p < 1) { const g = L.chars[Math.min(n - 1, Math.floor(shown))]; TIP = [L.x0 + g.x + g.w * (shown % 1), it.y + g.dy - 18]; }
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
// ---------- the lesson, as timed chalk items ----------
|
|
368
|
+
const A = (k, a, extra) => Object.assign({ k, a: a[0], b: a[1], col: C.chalk, seed: (a[0] * 1000) | 0 }, extra);
|
|
369
|
+
const sup = (s) => ({ s, font: hand(36), dy: -34 });
|
|
370
|
+
const gx = (d) => 1440 + (d / 365) * 960, gy = (v) => 600 - (v / 40) * 400;
|
|
371
|
+
const ITEMS = [
|
|
372
|
+
// section A: the hook and the three equations
|
|
373
|
+
A('text', TL.title1, { parts: [{ s: 'Get 1% better', font: head(104) }], x: 110, y: 158 }),
|
|
374
|
+
A('text', TL.title2, { parts: [{ s: 'every day.', font: head(104) }], x: 110, y: 270, col: C.pink }),
|
|
375
|
+
A('line', TL.under, { pts: [[108, 296], [320, 291], [600, 298]], col: C.yellow, w: 7 }),
|
|
376
|
+
A('text', TL.eq1, { parts: [{ s: '1.00', font: hand(64) }, sup('365'), { s: ' = 1', font: hand(64) }], x: 140, y: 380 }),
|
|
377
|
+
A('text', TL.lab1, { parts: [{ s: '← stay the same', font: hand(40, 400) }], x: 640, y: 378, col: C.blue }),
|
|
378
|
+
A('text', TL.eq2, { parts: [{ s: '1.01', font: hand(64) }, sup('365'), { s: ' ≈', font: hand(64) }], x: 140, y: 495 }),
|
|
379
|
+
A('line', TL.ring1, { pts: ellipse(560, 472, 120, 52), col: C.pink, w: 5 }),
|
|
380
|
+
A('text', TL.lab2, { parts: [{ s: '← 1% better', font: hand(40, 400) }], x: 720, y: 493, col: C.blue }),
|
|
381
|
+
A('text', TL.eq3, { parts: [{ s: '0.99', font: hand(64) }, sup('365'), { s: ' ≈ 0.03', font: hand(64) }], x: 140, y: 610 }),
|
|
382
|
+
A('text', TL.lab3, { parts: [{ s: '← 1% worse', font: hand(40, 400) }], x: 720, y: 608, col: C.blue }),
|
|
383
|
+
A('line', TL.arrow, { pts: quad([900, 560], [1120, 420], [1340, 330], 50), w: 5 }),
|
|
384
|
+
A('line', [TL.arrow[1], TL.arrow[1] + 0.12], { pts: [[1306, 318], [1340, 330], [1318, 360]], w: 5 }),
|
|
385
|
+
// section B: the graph (erased later)
|
|
386
|
+
A('line', TL.yAxis, { pts: [[1440, 625], [1440, 170]], w: 5, tag: 'B' }),
|
|
387
|
+
A('line', TL.xAxis, { pts: [[1430, 625], [2470, 625]], w: 5, tag: 'B' }),
|
|
388
|
+
A('text', TL.axLab, { parts: [{ s: 'you', font: hand(40) }], x: 1400, y: 152, tag: 'B' }),
|
|
389
|
+
A('text', TL.axLab, { parts: [{ s: 'days →', font: hand(36, 400) }], x: 2120, y: 672, tag: 'B' }),
|
|
390
|
+
A('text', TL.axLab, { parts: [{ s: '365', font: hand(36, 400) }], x: 2400, y: 672, align: 'center', tag: 'B' }),
|
|
391
|
+
A('line', TL.flat, { pts: [[gx(0), gy(1)], [gx(365), gy(1)]], w: 5, tag: 'B' }),
|
|
392
|
+
A('text', TL.flatLab, { parts: [{ s: '1.00', font: hand(36) }, { s: 'n', font: hand(24), dy: -20 }, { s: ' same', font: hand(36, 400) }], x: 2440, y: 575, align: 'right', tag: 'B' }),
|
|
393
|
+
A('line', TL.curve, { pts: Array.from({ length: 121 }, (_, i) => { const d = (i / 120) * 365; return [gx(d), gy(Math.pow(1.01, d))]; }), col: C.yellow, w: 6, tag: 'B' }),
|
|
394
|
+
A('text', TL.curveLab, { parts: [{ s: '×37.8', font: head(64) }], x: 2190, y: 168, align: 'center', col: C.pink, tag: 'B' }),
|
|
395
|
+
A('line', TL.ring2, { pts: ellipse(gx(365), gy(37.8), 44, 40), col: C.pink, w: 5, tag: 'B' }),
|
|
396
|
+
A('line', TL.bracket, { pts: [[2480, 588], [2496, 578], [2496, 410], [2510, 397], [2496, 384], [2496, 216], [2480, 206]], col: C.yellow, w: 4, tag: 'B' }),
|
|
397
|
+
A('text', TL.gapLab, { parts: [{ s: 'the gap', font: hand(42) }], x: 2435, y: 470, align: 'right', col: C.yellow, tag: 'B' }),
|
|
398
|
+
// section B after the wipe: the takeaway
|
|
399
|
+
A('text', TL.take1, { parts: [{ s: 'Small wins', font: head(112) }], x: 1950, y: 300, align: 'center' }),
|
|
400
|
+
A('text', TL.take2, { parts: [{ s: 'compound.', font: head(132) }], x: 1950, y: 452, align: 'center', col: C.yellow }),
|
|
401
|
+
A('line', TL.take3, { pts: [[1690, 482], [1950, 474], [2215, 484]], col: C.pink, w: 6 }),
|
|
402
|
+
A('line', [TL.take3[0] + 0.12, TL.take3[1] + 0.05], { pts: [[1720, 500], [1960, 494], [2190, 502]], col: C.pink, w: 4 }),
|
|
403
|
+
A('text', TL.note, { parts: [{ s: 'start today, it adds up', font: hand(40, 400) }], x: 1950, y: 566, align: 'center', col: C.blue }),
|
|
404
|
+
];
|
|
405
|
+
// the counter is re-chalked on its own
|
|
406
|
+
function drawCounter(c, t) {
|
|
407
|
+
if (t < TL.cnt[0]) return;
|
|
408
|
+
const s = cntText(t), it = { parts: [{ s, font: head(76) }], x: 482, y: 497, col: C.pink, seed: 9000 + cntStep(t), _L: null };
|
|
409
|
+
chalkText(c, it, Math.min(1, (t - TL.cnt[0] - cntStep(t) / 10) / 0.06 + 0.35));
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
// ---------- eraser wipe over section B ----------
|
|
413
|
+
const WIPE = (() => { const pts = [], x0 = 1390, x1 = 2540, y0 = 150, y1 = 690, rows = 6; for (let r = 0; r <= rows; r++) { const y = lerp(y0, y1, r / rows); pts.push(r % 2 ? [x1, y] : [x0, y], r % 2 ? [x0, y + 12] : [x1, y + 12]); } return resample(pts, 14); })();
|
|
414
|
+
function wipeMask(c, p) {
|
|
415
|
+
const m = Math.max(2, Math.ceil(WIPE.length * p)); c.save(); c.globalCompositeOperation = 'destination-out'; c.lineCap = 'round'; c.lineJoin = 'round';
|
|
416
|
+
const sweep = (w, a, dy) => { c.lineWidth = w; c.strokeStyle = `rgba(0,0,0,${a})`; c.beginPath(); WIPE.slice(0, m).forEach(([x, y], i) => (i ? c.lineTo(x, y + dy) : c.moveTo(x, y + dy))); c.stroke(); };
|
|
417
|
+
sweep(110, 0.9, 0); sweep(30, 0.9, -38); sweep(30, 0.9, 38); c.restore();
|
|
418
|
+
return WIPE[m - 1];
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
// ---------- props in screen space: frame, tray, chalk stick, eraser, dust ----------
|
|
422
|
+
function wood(c, x, y, w, h, light) {
|
|
423
|
+
const g = c.createLinearGradient(0, y, 0, y + h); g.addColorStop(0, light ? '#b07a45' : '#8a5a31'); g.addColorStop(0.5, '#9a6738'); g.addColorStop(1, '#5f3b1e');
|
|
424
|
+
c.fillStyle = g; c.fillRect(x, y, w, h);
|
|
425
|
+
c.save(); c.beginPath(); c.rect(x, y, w, h); c.clip(); c.strokeStyle = 'rgba(50,25,8,0.28)'; c.lineWidth = 1;
|
|
426
|
+
for (let k = 0; k < 6; k++) { c.beginPath(); for (let s = 0; s <= 80; s++) { const px = x + (s / 80) * w, py = y + 3 + k * (h / 6) + Math.sin(s * 0.37 + k * 2) * 1.2; s ? c.lineTo(px, py) : c.moveTo(px, py); } c.stroke(); }
|
|
427
|
+
c.restore();
|
|
428
|
+
}
|
|
429
|
+
function chalkStick(c, x, y, col) {
|
|
430
|
+
c.save(); c.translate(x, y); c.rotate(0.62);
|
|
431
|
+
c.save(); c.filter = 'blur(6px)'; c.fillStyle = 'rgba(0,0,0,0.35)'; c.beginPath(); c.roundRect(10, 8, 120, 22, 10); c.fill(); c.restore();
|
|
432
|
+
const g = c.createLinearGradient(0, -11, 0, 11); g.addColorStop(0, '#ffffff'); g.addColorStop(0.5, col); g.addColorStop(1, 'rgba(150,150,140,1)');
|
|
433
|
+
c.fillStyle = g; c.beginPath(); c.moveTo(4, -9); c.lineTo(118, -11); c.quadraticCurveTo(126, 0, 118, 11); c.lineTo(4, 9); c.quadraticCurveTo(-4, 0, 4, -9); c.fill();
|
|
434
|
+
c.fillStyle = 'rgba(255,255,255,0.35)'; c.fillRect(14, -6, 90, 3);
|
|
435
|
+
c.restore();
|
|
436
|
+
}
|
|
437
|
+
function eraser(c, x, y) {
|
|
438
|
+
c.save(); c.translate(x, y); c.rotate(-0.06);
|
|
439
|
+
c.save(); c.filter = 'blur(8px)'; c.fillStyle = 'rgba(0,0,0,0.4)'; c.fillRect(-74, -18, 160, 66); c.restore();
|
|
440
|
+
wood(c, -80, -34, 160, 40, true); c.fillStyle = '#e9e4d6'; c.fillRect(-80, 6, 160, 18); c.fillStyle = 'rgba(0,0,0,0.12)'; c.fillRect(-80, 20, 160, 4);
|
|
441
|
+
c.restore();
|
|
442
|
+
}
|
|
443
|
+
function tray(c, t, hideEraser) {
|
|
444
|
+
wood(c, 0, 0, W, 20, true); c.fillStyle = 'rgba(0,0,0,0.35)'; c.fillRect(0, 20, W, 5);
|
|
445
|
+
const g = c.createLinearGradient(0, HH - 46, 0, HH); g.addColorStop(0, 'rgba(0,0,0,0)'); g.addColorStop(1, 'rgba(0,0,0,0.3)'); c.fillStyle = g; c.fillRect(0, HH - 80, W, 80);
|
|
446
|
+
wood(c, 0, HH - 34, W, 34, false); c.fillStyle = 'rgba(255,255,255,0.06)'; c.fillRect(0, HH - 34, W, 3);
|
|
447
|
+
c.fillStyle = 'rgba(240,236,226,0.12)'; for (let i = 0; i < 40; i++) { const r = rng('dust' + i); c.fillRect(r.in(0, W), HH - 33 + r.in(0, 6), r.in(2, 14), 1.5); }
|
|
448
|
+
[[880, '#f2efe6', 70], [960, '#f4d35e', 46], [1010, '#f39bbb', 58]].forEach(([x, col, len]) => { c.fillStyle = 'rgba(0,0,0,0.3)'; c.fillRect(x + 2, HH - 26, len, 13); c.fillStyle = col; c.beginPath(); c.roundRect(x, HH - 29, len, 12, 5); c.fill(); });
|
|
449
|
+
if (!hideEraser) { c.save(); c.translate(180, HH - 40); c.scale(0.8, 0.8); eraser(c, 0, 0); c.restore(); }
|
|
450
|
+
}
|
|
451
|
+
// dust that falls from the chalk while it draws (a pure function of t)
|
|
452
|
+
function dust(c, t, k) {
|
|
453
|
+
c.save(); c.fillStyle = 'rgba(240,236,226,0.8)';
|
|
454
|
+
for (const it of ITEMS) {
|
|
455
|
+
if (t < it.a || t > it.b + 0.9) continue;
|
|
456
|
+
const r = rng('du' + it.seed);
|
|
457
|
+
for (let ts = it.a; ts < Math.min(t, it.b); ts += 0.045) {
|
|
458
|
+
const age = t - ts; if (age > 0.9) { r(); r(); continue; }
|
|
459
|
+
const u = (ts - it.a) / (it.b - it.a); let x, y;
|
|
460
|
+
if (it.k === 'line') { const P = it._P; if (!P) continue; const q = P[Math.min(P.length - 1, Math.floor(u * (P.length - 1)))]; x = q[0]; y = q[1]; }
|
|
461
|
+
else { const L = it._L; if (!L) continue; x = L.x0 + L.w * u; y = it.y - 6; }
|
|
462
|
+
const dx = r.in(-8, 8), sz = r.in(0.8, 2.2); const [sx, sy] = toScreen(k, x + dx + age * 6, y + 40 * age + 120 * age * age);
|
|
463
|
+
c.globalAlpha = 0.55 * (1 - age / 0.9); c.fillRect(sx, sy, sz, sz);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
c.restore();
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
// ---------- compositor ----------
|
|
470
|
+
const LC = CM.layer(W, HH), LB2 = CM.layer(W, HH), HALO = CM.layer(W / 4, HH / 4);
|
|
471
|
+
function explainer(ctx, t) {
|
|
472
|
+
ctx.setTransform(1, 0, 0, 1, 0, 0); ctx.globalAlpha = 1; ctx.globalCompositeOperation = 'source-over'; ctx.filter = 'none';
|
|
473
|
+
const k = camAt(t); TIP = null;
|
|
474
|
+
// board
|
|
475
|
+
ctx.save(); applyCam(ctx, k); ctx.drawImage(board(), 0, 0); ctx.restore();
|
|
476
|
+
// chalk on two layers: the graph section (erasable) and everything else
|
|
477
|
+
const a = LC.getContext('2d'), b = LB2.getContext('2d');
|
|
478
|
+
for (const L of [a, b]) { L.setTransform(1, 0, 0, 1, 0, 0); L.globalCompositeOperation = 'source-over'; L.globalAlpha = 1; L.clearRect(0, 0, W, HH); }
|
|
479
|
+
a.save(); applyCam(a, k); b.save(); applyCam(b, k);
|
|
480
|
+
for (const it of ITEMS) { const p = span(t, it.a, it.b), L = it.tag === 'B' ? b : a; if (it.k === 'line') chalkLine(L, it, p); else chalkText(L, it, p); }
|
|
481
|
+
drawCounter(a, t);
|
|
482
|
+
let eraserAt = null;
|
|
483
|
+
if (t > TL.wipe[0]) { const p = ez.inout3(span(t, TL.wipe[0], TL.wipe[1])); const e = wipeMask(b, p); if (p < 1) eraserAt = toScreen(k, e[0], e[1]); TIP = null; }
|
|
484
|
+
a.restore(); b.restore();
|
|
485
|
+
a.drawImage(LB2, 0, 0);
|
|
486
|
+
// the board's tooth breaks the chalk; it sticks to the board as the camera moves
|
|
487
|
+
a.save(); a.globalCompositeOperation = 'destination-out'; a.globalAlpha = 0.85;
|
|
488
|
+
const pat = a.createPattern(tooth(), 'repeat'); pat.setTransform(new DOMMatrix().translateSelf(640 - k[0] * k[2], 360 - k[1] * k[2]).scaleSelf(k[2], k[2])); a.fillStyle = pat; a.fillRect(0, 0, W, HH); a.restore();
|
|
489
|
+
// dusty halo, then the chalk itself
|
|
490
|
+
{ const hc = HALO.getContext('2d'); hc.setTransform(1, 0, 0, 1, 0, 0); hc.clearRect(0, 0, W / 4, HH / 4); hc.drawImage(LC, 0, 0, W / 4, HH / 4); ctx.save(); ctx.globalAlpha = 0.35; ctx.imageSmoothingEnabled = true; ctx.drawImage(HALO, 0, 0, W, HH); ctx.restore(); }
|
|
491
|
+
ctx.drawImage(LC, 0, 0);
|
|
492
|
+
// eraser haze left behind on the wiped section
|
|
493
|
+
if (t > TL.wipe[0]) { ctx.save(); applyCam(ctx, k); ctx.globalAlpha = 0.6 * span(t, TL.wipe[0], TL.wipe[1]); ctx.filter = 'blur(10px)'; ctx.strokeStyle = 'rgba(215,228,218,0.06)'; ctx.lineWidth = 90; ctx.lineCap = 'round'; ctx.beginPath(); WIPE.forEach(([x, y], i) => (i ? ctx.lineTo(x, y) : ctx.moveTo(x, y))); ctx.stroke(); ctx.restore(); }
|
|
494
|
+
dust(ctx, t, k);
|
|
495
|
+
// classroom light, frame and tray
|
|
496
|
+
const lg = ctx.createRadialGradient(560, 120, 80, 640, 300, 900); lg.addColorStop(0, 'rgba(255,250,230,0.07)'); lg.addColorStop(1, 'rgba(0,0,0,0.32)'); ctx.fillStyle = lg; ctx.fillRect(0, 0, W, HH);
|
|
497
|
+
tray(ctx, t, !!eraserAt);
|
|
498
|
+
if (eraserAt) eraser(ctx, eraserAt[0], eraserAt[1]);
|
|
499
|
+
else if (TIP) { const [sx, sy] = toScreen(k, TIP[0], TIP[1]); const active = ITEMS.filter((it) => t > it.a && t < it.b).pop(); chalkStick(ctx, sx, sy, active ? active.col : C.chalk); }
|
|
500
|
+
else if (t > TL.cnt[0] && t < TL.cnt[1]) { const [sx, sy] = toScreen(k, 560, 470); chalkStick(ctx, sx + 30, sy, C.pink); }
|
|
501
|
+
// fine grain over everything
|
|
502
|
+
const fi = Math.floor(t * 12), r = rng('gr' + (fi % 6)); ctx.save(); ctx.globalAlpha = 0.05; ctx.globalCompositeOperation = 'overlay'; const gp = ctx.createPattern(tooth(), 'repeat'); gp.setTransform(new DOMMatrix().translateSelf(-r() * 384, -r() * 384)); ctx.fillStyle = gp; ctx.fillRect(0, 0, W, HH); ctx.restore();
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
// =================================== SOUND SCORE ===================================
|
|
506
|
+
// A quiet classroom. Chalk scratches for every word and stroke (one stroke per word, short taps where the stick
|
|
507
|
+
// lands), a felt eraser rubbing back and forth, a soft wooden knock at the start, and gentle plucks for the big moments.
|
|
508
|
+
function scoreSound(k) {
|
|
509
|
+
const G = 1.9; // overall level for this quiet medium
|
|
510
|
+
const px = (t, x) => { const c = camAt(t); return clamp(((x - c[0]) * c[2]) / 640, -1, 1) * 0.6; };
|
|
511
|
+
const tap = (t, pan = 0, g = 1) => { k.hiss(t, { dur: 0.018, filter: 'bandpass', ff: 2600, q: 2.2, gain: 0.32 * g * G, a: 0.001, pan, soft: true }); k.voice(t, { f: [[0, 1100], [0.015, 600]], dur: 0.02, gain: 0.05 * g * G, pan, soft: true }); };
|
|
512
|
+
// chalk scratch: grainy, uneven bursts in the upper mids
|
|
513
|
+
const scratch = (a, b, pan = 0, g = 1, soft = true) => { const r = CM.rng('ch' + a); tap(a, pan, g * 0.9); for (let x = a; x < b; x += 0.018 + r() * 0.02) { if (r() < 0.12) continue; const d = 0.02 + r() * 0.025; k.hiss(x, { dur: d, filter: 'bandpass', ff: 2400 + r() * 2200, q: 1.3, gain: (0.12 + r() * 0.1) * g * G, a: d * 0.3, pan, soft }); } };
|
|
514
|
+
const write = (s, a, b, pan, g = 1, soft = true) => { const n = s.length, re = /\S+/g; let m; while ((m = re.exec(s))) scratch(a + (b - a) * (m.index / n), a + (b - a) * ((m.index + m[0].length) / n), pan, g, soft); };
|
|
515
|
+
const pluck = (t, note, g = 1, pan = 0) => { const f = k.hz(note); k.voice(t, { f, dur: 0.9, gain: 0.16 * g * G, a: 0.004, verb: 0.3, pan }); k.voice(t, { f: f * 4, dur: 0.08, gain: 0.03 * g, a: 0.001, pan }); k.voice(t, { f: f * 2, type: 'triangle', dur: 0.3, gain: 0.04 * g, a: 0.003, pan }); };
|
|
516
|
+
|
|
517
|
+
k.hiss(0, { color: 'brown', dur: TL.D, filter: 'lowpass', ff: 300, gain: 0.07, a: 0.6, hold: TL.D - 1.2, bus: 'amb' }); // room tone
|
|
518
|
+
k.voice(0.05, { f: [[0, 190], [0.06, 120]], dur: 0.09, gain: 0.22 * G }); k.voice(0.15, { f: [[0, 200], [0.06, 125]], dur: 0.09, gain: 0.18 * G }); // knock knock on the board
|
|
519
|
+
|
|
520
|
+
write('Get 1% better', TL.title1[0], TL.title1[1], px(0.6, 400), 1, false);
|
|
521
|
+
write('every day.', TL.title2[0], TL.title2[1], px(1.5, 300), 1, false);
|
|
522
|
+
scratch(TL.under[0], TL.under[1], 0, 1.3, false);
|
|
523
|
+
write('1.00365 = 1', TL.eq1[0], TL.eq1[1], px(2.8, 300));
|
|
524
|
+
write('stay the same', TL.lab1[0], TL.lab1[1], px(3.5, 780), 0.7);
|
|
525
|
+
write('1.01365 ≈', TL.eq2[0], TL.eq2[1], px(4.3, 300));
|
|
526
|
+
// counter re-chalked ten times a second; ticks only when the number changes
|
|
527
|
+
{ let last = ''; for (let t = TL.cnt[0]; t <= TL.cnt[1] + 0.001; t += 0.1) { const s = cntText(t + 0.001); if (s !== last) { scratch(t, t + 0.05, px(t, 520), 0.8); last = s; } } }
|
|
528
|
+
pluck(TL.cnt[1], 'E5', 1.1, 0); pluck(TL.cnt[1] + 0.09, 'B5', 0.9, 0);
|
|
529
|
+
scratch(TL.ring1[0], TL.ring1[1], px(6.4, 560), 1.2, false);
|
|
530
|
+
write('1% better', TL.lab2[0], TL.lab2[1], px(6.9, 820), 0.7);
|
|
531
|
+
write('0.99365 ≈ 0.03', TL.eq3[0], TL.eq3[1], px(7.5, 300));
|
|
532
|
+
pluck(TL.eq3[1] - 0.1, 'A3', 0.7, -0.2);
|
|
533
|
+
write('1% worse', TL.lab3[0], TL.lab3[1], px(8.1, 820), 0.7);
|
|
534
|
+
scratch(TL.arrow[0], TL.arrow[1] + 0.12, 0.4, 1);
|
|
535
|
+
k.hiss(8.4, { color: 'pink', dur: 1.0, filter: 'lowpass', ff: [[0, 300], [0.5, 900], [1.0, 300]], gain: 0.07, a: 0.45 }); // camera slides along the board
|
|
536
|
+
|
|
537
|
+
scratch(TL.yAxis[0], TL.yAxis[1], px(9.6, 1440), 1.1); scratch(TL.xAxis[0], TL.xAxis[1], 0, 1.1);
|
|
538
|
+
write('you', TL.axLab[0], TL.axLab[0] + 0.12, -0.5, 0.6); write('days', TL.axLab[0] + 0.12, TL.axLab[1], 0.3, 0.6);
|
|
539
|
+
scratch(TL.flat[0], TL.flat[1], 0, 0.9); write('1.00 same', TL.flatLab[0], TL.flatLab[1], 0.45, 0.7);
|
|
540
|
+
scratch(TL.curve[0], TL.curve[1], 0, 1.1, false);
|
|
541
|
+
pluck(TL.curve[1], 'G4', 1, 0.4); pluck(TL.curve[1] + 0.1, 'D5', 0.9, 0.4); pluck(TL.curve[1] + 0.2, 'G5', 0.7, 0.4);
|
|
542
|
+
write('×37.8', TL.curveLab[0], TL.curveLab[1], 0.3, 1.1, false);
|
|
543
|
+
scratch(TL.ring2[0], TL.ring2[1], 0.55, 1.2, false);
|
|
544
|
+
scratch(TL.bracket[0], TL.bracket[1], 0.6, 1); write('the gap', TL.gapLab[0], TL.gapLab[1], 0.5, 0.9);
|
|
545
|
+
// felt eraser: back and forth passes, panned with the eraser
|
|
546
|
+
{ const rows = 6, d = (TL.wipe[1] - TL.wipe[0]) / (rows + 1); for (let i = 0; i <= rows; i++) { const t0 = TL.wipe[0] + i * d, dir = i % 2 ? 1 : -1; k.hiss(t0, { color: 'pink', dur: d + 0.02, filter: 'bandpass', ff: 700 + (i % 2) * 120, q: 0.7, gain: 0.26 * G, a: d * 0.25, hold: d * 0.4, pan: [-0.5 * dir, 0.5 * dir] }); k.hiss(t0, { color: 'brown', dur: d, filter: 'lowpass', ff: 400, gain: 0.12 * G, a: d * 0.3 }); } }
|
|
547
|
+
write('Small wins', TL.take1[0], TL.take1[1], 0, 1, false);
|
|
548
|
+
write('compound.', TL.take2[0], TL.take2[1], 0, 1.1, false);
|
|
549
|
+
scratch(TL.take3[0], TL.take3[1] + 0.05, 0, 1.2, false);
|
|
550
|
+
pluck(TL.take3[1], 'C5', 1, -0.2); pluck(TL.take3[1] + 0.1, 'E5', 0.9, 0); pluck(TL.take3[1] + 0.2, 'G5', 0.9, 0.2); pluck(TL.take3[1] + 0.32, 'C6', 0.7, 0.1);
|
|
551
|
+
write('start today, it adds up', TL.note[0], TL.note[1], 0, 0.6);
|
|
552
|
+
tap(TL.note[1] + 0.25, 0.3, 1.2); // the chalk goes back in the tray
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
// =================================== PLAYER ===================================
|
|
556
|
+
const cvs = document.getElementById('stage'), ctx = cvs.getContext('2d');
|
|
557
|
+
const DURATION = TL.D;
|
|
558
|
+
window.seek = (t) => explainer(ctx, clamp(t, 0, DURATION));
|
|
559
|
+
window.DURATION = DURATION;
|
|
560
|
+
window.scoreSound = scoreSound;
|
|
561
|
+
window.SFX = SFX;
|
|
562
|
+
|
|
563
|
+
const ui = { play: document.getElementById('play'), scrub: document.getElementById('scrub'), time: document.getElementById('time'), sound: document.getElementById('sound'), loop: document.getElementById('loop'), vo: document.getElementById('vofile'), note: document.getElementById('vonote') };
|
|
564
|
+
let T = 0, playing = false, last = 0, soundOn = true, loopOn = true, stopSound = null, voAudio = null;
|
|
565
|
+
const fmt = (t) => t.toFixed(2) + ' / ' + DURATION.toFixed(2);
|
|
566
|
+
function draw() { window.seek(T); ui.scrub.value = T; ui.time.textContent = fmt(T); }
|
|
567
|
+
function startAudio() {
|
|
568
|
+
stopAudio(); if (!playing) return;
|
|
569
|
+
if (soundOn) stopSound = SFX.live(scoreSound, T, { voiceover: !!voAudio });
|
|
570
|
+
if (voAudio) { try { voAudio.currentTime = T; voAudio.play().catch(() => {}); } catch (e) {} }
|
|
571
|
+
}
|
|
572
|
+
function stopAudio() { if (stopSound) { stopSound(); stopSound = null; } if (voAudio) voAudio.pause(); }
|
|
573
|
+
function setPlaying(p) { playing = p; ui.play.textContent = p ? 'Pause' : 'Play'; last = performance.now(); if (p) startAudio(); else stopAudio(); }
|
|
574
|
+
function tick(now) {
|
|
575
|
+
if (playing) {
|
|
576
|
+
T += (now - last) / 1000; last = now;
|
|
577
|
+
if (T >= DURATION) { if (loopOn) { T = 0; startAudio(); } else { T = DURATION; setPlaying(false); } }
|
|
578
|
+
draw();
|
|
579
|
+
}
|
|
580
|
+
requestAnimationFrame(tick);
|
|
581
|
+
}
|
|
582
|
+
ui.play.addEventListener('click', () => { if (!playing && T >= DURATION) T = 0; setPlaying(!playing); });
|
|
583
|
+
ui.scrub.addEventListener('input', () => { T = parseFloat(ui.scrub.value); draw(); if (playing) startAudio(); });
|
|
584
|
+
ui.sound.addEventListener('click', () => { soundOn = !soundOn; ui.sound.setAttribute('aria-pressed', soundOn); ui.sound.textContent = soundOn ? 'Sound on' : 'Sound off'; if (playing) startAudio(); });
|
|
585
|
+
ui.loop.addEventListener('click', () => { loopOn = !loopOn; ui.loop.setAttribute('aria-pressed', loopOn); });
|
|
586
|
+
ui.vo.addEventListener('change', () => {
|
|
587
|
+
const f = ui.vo.files && ui.vo.files[0]; if (!f) return;
|
|
588
|
+
if (voAudio) { voAudio.pause(); URL.revokeObjectURL(voAudio.src); }
|
|
589
|
+
voAudio = new Audio(URL.createObjectURL(f)); ui.note.textContent = 'Voiceover loaded: ' + f.name + '. Effects use the lighter mix.';
|
|
590
|
+
if (playing) startAudio();
|
|
591
|
+
});
|
|
592
|
+
(async () => {
|
|
593
|
+
try { await Promise.all(['700 60px "Cabin Sketch"', '700 40px "Kalam"', '400 40px "Kalam"', '600 14px "Inter"'].map((f) => document.fonts.load(f, 'AaZz09'))); await document.fonts.ready; } catch (e) {}
|
|
594
|
+
T = 12.6; draw(); window.__ready = true;
|
|
595
|
+
requestAnimationFrame((n) => { last = n; tick(n); });
|
|
596
|
+
})();
|
|
597
|
+
</script>
|