@autoaiai/aicut 0.1.7 → 0.1.13
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/MANUAL.md +94 -84
- package/package.json +1 -1
- package/product.json +2 -1
- package/skills/aicut/SKILL.md +4 -4
- package/skills/aicut/references/commands.md +15 -15
- package/skills/aicut/references/film-format.md +1 -1
- package/skills/aicut/references/recipes.md +4 -4
- package/skills/aicut/references/troubleshooting.md +2 -2
- package/skills/aicut-motion/SKILL.md +75 -9
- package/skills/aicut-motion/THIRD_PARTY_NOTICES.md +14 -0
- package/skills/aicut-motion/assets/atlas/lib/harness.js +116 -0
- package/skills/aicut-motion/assets/atlas/lib/sound.js +274 -0
- package/skills/aicut-motion/assets/atlas/styles/001-flat-vector-science/code.js +937 -0
- package/skills/aicut-motion/assets/atlas/styles/001-flat-vector-science/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/001-flat-vector-science/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/002-watercolor-wash/code.js +909 -0
- package/skills/aicut-motion/assets/atlas/styles/002-watercolor-wash/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/002-watercolor-wash/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/003-shadow-puppet-theatre/code.js +881 -0
- package/skills/aicut-motion/assets/atlas/styles/003-shadow-puppet-theatre/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/003-shadow-puppet-theatre/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/004-whiteboard-explainer/code.js +897 -0
- package/skills/aicut-motion/assets/atlas/styles/004-whiteboard-explainer/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/004-whiteboard-explainer/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/005-psychedelic-poster/code.js +814 -0
- package/skills/aicut-motion/assets/atlas/styles/005-psychedelic-poster/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/005-psychedelic-poster/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/006-tech-glow-explainer/code.js +990 -0
- package/skills/aicut-motion/assets/atlas/styles/006-tech-glow-explainer/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/006-tech-glow-explainer/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/007-papercraft-models/code.js +994 -0
- package/skills/aicut-motion/assets/atlas/styles/007-papercraft-models/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/007-papercraft-models/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/008-1940s-film-noir/code.js +792 -0
- package/skills/aicut-motion/assets/atlas/styles/008-1940s-film-noir/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/008-1940s-film-noir/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/009-manim-style-math/code.js +840 -0
- package/skills/aicut-motion/assets/atlas/styles/009-manim-style-math/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/009-manim-style-math/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/010-illuminated-manuscript/code.js +1126 -0
- package/skills/aicut-motion/assets/atlas/styles/010-illuminated-manuscript/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/010-illuminated-manuscript/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/011-editorial-essay-collage/code.js +854 -0
- package/skills/aicut-motion/assets/atlas/styles/011-editorial-essay-collage/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/011-editorial-essay-collage/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/012-bioluminescent-deep-sea/code.js +1124 -0
- package/skills/aicut-motion/assets/atlas/styles/012-bioluminescent-deep-sea/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/012-bioluminescent-deep-sea/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/013-product-launch-reveal/code.js +728 -0
- package/skills/aicut-motion/assets/atlas/styles/013-product-launch-reveal/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/013-product-launch-reveal/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/014-halftone-pop-panel/code.js +664 -0
- package/skills/aicut-motion/assets/atlas/styles/014-halftone-pop-panel/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/014-halftone-pop-panel/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/015-isometric-pastel/code.js +991 -0
- package/skills/aicut-motion/assets/atlas/styles/015-isometric-pastel/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/015-isometric-pastel/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/016-oscilloscope-vector-art/code.js +801 -0
- package/skills/aicut-motion/assets/atlas/styles/016-oscilloscope-vector-art/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/016-oscilloscope-vector-art/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/017-risograph-zine/code.js +692 -0
- package/skills/aicut-motion/assets/atlas/styles/017-risograph-zine/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/017-risograph-zine/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/018-claymation-set/code.js +756 -0
- package/skills/aicut-motion/assets/atlas/styles/018-claymation-set/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/018-claymation-set/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/019-neon-sign-at-night/code.js +922 -0
- package/skills/aicut-motion/assets/atlas/styles/019-neon-sign-at-night/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/019-neon-sign-at-night/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/020-kawaii-anime/code.js +852 -0
- package/skills/aicut-motion/assets/atlas/styles/020-kawaii-anime/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/020-kawaii-anime/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/021-ukiyo-e-woodblock/code.js +724 -0
- package/skills/aicut-motion/assets/atlas/styles/021-ukiyo-e-woodblock/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/021-ukiyo-e-woodblock/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/022-16-bit-pixel-odyssey/code.js +793 -0
- package/skills/aicut-motion/assets/atlas/styles/022-16-bit-pixel-odyssey/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/022-16-bit-pixel-odyssey/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/023-chalkboard-lesson/code.js +846 -0
- package/skills/aicut-motion/assets/atlas/styles/023-chalkboard-lesson/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/023-chalkboard-lesson/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/024-cut-paper-diorama/code.js +1008 -0
- package/skills/aicut-motion/assets/atlas/styles/024-cut-paper-diorama/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/024-cut-paper-diorama/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/025-cathedral-glass/code.js +680 -0
- package/skills/aicut-motion/assets/atlas/styles/025-cathedral-glass/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/025-cathedral-glass/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/026-editorial-chart/code.js +633 -0
- package/skills/aicut-motion/assets/atlas/styles/026-editorial-chart/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/026-editorial-chart/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/027-synthwave-outrun/code.js +757 -0
- package/skills/aicut-motion/assets/atlas/styles/027-synthwave-outrun/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/027-synthwave-outrun/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/028-origami-studio/code.js +828 -0
- package/skills/aicut-motion/assets/atlas/styles/028-origami-studio/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/028-origami-studio/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/029-linocut-relief-print/code.js +697 -0
- package/skills/aicut-motion/assets/atlas/styles/029-linocut-relief-print/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/029-linocut-relief-print/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/030-holographic-foil-card/code.js +687 -0
- package/skills/aicut-motion/assets/atlas/styles/030-holographic-foil-card/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/030-holographic-foil-card/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/031-voxel-diorama/code.js +727 -0
- package/skills/aicut-motion/assets/atlas/styles/031-voxel-diorama/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/031-voxel-diorama/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/032-sumi-e-ink-wash/code.js +903 -0
- package/skills/aicut-motion/assets/atlas/styles/032-sumi-e-ink-wash/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/032-sumi-e-ink-wash/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/033-etch-a-sketch-toy/code.js +662 -0
- package/skills/aicut-motion/assets/atlas/styles/033-etch-a-sketch-toy/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/033-etch-a-sketch-toy/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/034-cosmic-star-chart/code.js +951 -0
- package/skills/aicut-motion/assets/atlas/styles/034-cosmic-star-chart/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/034-cosmic-star-chart/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/035-punk-zine-collage/code.js +759 -0
- package/skills/aicut-motion/assets/atlas/styles/035-punk-zine-collage/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/035-punk-zine-collage/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/036-thermal-camera/code.js +738 -0
- package/skills/aicut-motion/assets/atlas/styles/036-thermal-camera/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/036-thermal-camera/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/037-engineering-blueprint/code.js +793 -0
- package/skills/aicut-motion/assets/atlas/styles/037-engineering-blueprint/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/037-engineering-blueprint/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/038-impasto-night/code.js +673 -0
- package/skills/aicut-motion/assets/atlas/styles/038-impasto-night/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/038-impasto-night/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/039-win95-desktop/code.js +907 -0
- package/skills/aicut-motion/assets/atlas/styles/039-win95-desktop/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/039-win95-desktop/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/040-low-poly-faceted/code.js +833 -0
- package/skills/aicut-motion/assets/atlas/styles/040-low-poly-faceted/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/040-low-poly-faceted/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/041-manga-page/code.js +845 -0
- package/skills/aicut-motion/assets/atlas/styles/041-manga-page/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/041-manga-page/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/042-wood-type-letterpress/code.js +496 -0
- package/skills/aicut-motion/assets/atlas/styles/042-wood-type-letterpress/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/042-wood-type-letterpress/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/043-light-painting/code.js +635 -0
- package/skills/aicut-motion/assets/atlas/styles/043-light-painting/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/043-light-painting/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/044-felt-patchwork/code.js +799 -0
- package/skills/aicut-motion/assets/atlas/styles/044-felt-patchwork/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/044-felt-patchwork/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/045-phosphor-terminal/code.js +547 -0
- package/skills/aicut-motion/assets/atlas/styles/045-phosphor-terminal/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/045-phosphor-terminal/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/046-glassmorphism-ui/code.js +592 -0
- package/skills/aicut-motion/assets/atlas/styles/046-glassmorphism-ui/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/046-glassmorphism-ui/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/047-tarot-card/code.js +768 -0
- package/skills/aicut-motion/assets/atlas/styles/047-tarot-card/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/047-tarot-card/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/048-transit-map/code.js +666 -0
- package/skills/aicut-motion/assets/atlas/styles/048-transit-map/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/048-transit-map/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/049-gouache-travel-poster/code.js +559 -0
- package/skills/aicut-motion/assets/atlas/styles/049-gouache-travel-poster/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/049-gouache-travel-poster/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/050-napkin-sketch/code.js +943 -0
- package/skills/aicut-motion/assets/atlas/styles/050-napkin-sketch/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/050-napkin-sketch/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/051-art-deco-foil/code.js +606 -0
- package/skills/aicut-motion/assets/atlas/styles/051-art-deco-foil/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/051-art-deco-foil/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/052-radiograph-on-lightbox/code.js +730 -0
- package/skills/aicut-motion/assets/atlas/styles/052-radiograph-on-lightbox/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/052-radiograph-on-lightbox/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/053-vaporwave/code.js +782 -0
- package/skills/aicut-motion/assets/atlas/styles/053-vaporwave/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/053-vaporwave/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/054-ebru-paper-marbling/code.js +504 -0
- package/skills/aicut-motion/assets/atlas/styles/054-ebru-paper-marbling/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/054-ebru-paper-marbling/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/055-isotype-pictograms/code.js +517 -0
- package/skills/aicut-motion/assets/atlas/styles/055-isotype-pictograms/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/055-isotype-pictograms/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/056-soft-3d-clay/code.js +713 -0
- package/skills/aicut-motion/assets/atlas/styles/056-soft-3d-clay/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/056-soft-3d-clay/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/057-cross-stitch-sampler/code.js +717 -0
- package/skills/aicut-motion/assets/atlas/styles/057-cross-stitch-sampler/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/057-cross-stitch-sampler/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/058-constructivist-propaganda/code.js +540 -0
- package/skills/aicut-motion/assets/atlas/styles/058-constructivist-propaganda/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/058-constructivist-propaganda/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/059-pocket-monochrome/code.js +524 -0
- package/skills/aicut-motion/assets/atlas/styles/059-pocket-monochrome/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/059-pocket-monochrome/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/060-botanical-plate/code.js +934 -0
- package/skills/aicut-motion/assets/atlas/styles/060-botanical-plate/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/060-botanical-plate/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/061-kinetic-type/code.js +690 -0
- package/skills/aicut-motion/assets/atlas/styles/061-kinetic-type/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/061-kinetic-type/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/062-byzantine-mosaic/code.js +612 -0
- package/skills/aicut-motion/assets/atlas/styles/062-byzantine-mosaic/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/062-byzantine-mosaic/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/063-y2k-liquid-chrome/code.js +666 -0
- package/skills/aicut-motion/assets/atlas/styles/063-y2k-liquid-chrome/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/063-y2k-liquid-chrome/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/064-sticky-note-wall/code.js +651 -0
- package/skills/aicut-motion/assets/atlas/styles/064-sticky-note-wall/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/064-sticky-note-wall/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/065-vintage-newsprint/code.js +656 -0
- package/skills/aicut-motion/assets/atlas/styles/065-vintage-newsprint/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/065-vintage-newsprint/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/066-hidden-line-wireframe/code.js +672 -0
- package/skills/aicut-motion/assets/atlas/styles/066-hidden-line-wireframe/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/066-hidden-line-wireframe/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/067-memphis-group/code.js +548 -0
- package/skills/aicut-motion/assets/atlas/styles/067-memphis-group/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/067-memphis-group/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/068-ballpoint-notebook/code.js +989 -0
- package/skills/aicut-motion/assets/atlas/styles/068-ballpoint-notebook/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/068-ballpoint-notebook/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/069-op-art-sphere/code.js +440 -0
- package/skills/aicut-motion/assets/atlas/styles/069-op-art-sphere/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/069-op-art-sphere/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/070-topographic-survey/code.js +895 -0
- package/skills/aicut-motion/assets/atlas/styles/070-topographic-survey/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/070-topographic-survey/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/071-pointillist-afternoon/code.js +563 -0
- package/skills/aicut-motion/assets/atlas/styles/071-pointillist-afternoon/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/071-pointillist-afternoon/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/072-vector-arcade-1980/code.js +627 -0
- package/skills/aicut-motion/assets/atlas/styles/072-vector-arcade-1980/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/072-vector-arcade-1980/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/073-patent-drawing/code.js +1096 -0
- package/skills/aicut-motion/assets/atlas/styles/073-patent-drawing/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/073-patent-drawing/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/074-bauhaus-poster/code.js +595 -0
- package/skills/aicut-motion/assets/atlas/styles/074-bauhaus-poster/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/074-bauhaus-poster/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/075-bitmap-paint-doodle/code.js +665 -0
- package/skills/aicut-motion/assets/atlas/styles/075-bitmap-paint-doodle/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/075-bitmap-paint-doodle/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/076-nail-thread-string-art/code.js +645 -0
- package/skills/aicut-motion/assets/atlas/styles/076-nail-thread-string-art/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/076-nail-thread-string-art/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/077-ridgeline/code.js +436 -0
- package/skills/aicut-motion/assets/atlas/styles/077-ridgeline/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/077-ridgeline/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/078-sketchbook-graphite/code.js +1237 -0
- package/skills/aicut-motion/assets/atlas/styles/078-sketchbook-graphite/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/078-sketchbook-graphite/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/079-teletext-page/code.js +622 -0
- package/skills/aicut-motion/assets/atlas/styles/079-teletext-page/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/079-teletext-page/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/080-silkscreen-grid/code.js +524 -0
- package/skills/aicut-motion/assets/atlas/styles/080-silkscreen-grid/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/080-silkscreen-grid/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/081-guilloch-security-print/code.js +689 -0
- package/skills/aicut-motion/assets/atlas/styles/081-guilloch-security-print/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/081-guilloch-security-print/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/082-ascii-demoscene/code.js +574 -0
- package/skills/aicut-motion/assets/atlas/styles/082-ascii-demoscene/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/082-ascii-demoscene/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/083-international-typographic-style/code.js +469 -0
- package/skills/aicut-motion/assets/atlas/styles/083-international-typographic-style/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/083-international-typographic-style/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/084-flow-field/code.js +531 -0
- package/skills/aicut-motion/assets/atlas/styles/084-flow-field/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/084-flow-field/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/085-macpaint-1984/code.js +675 -0
- package/skills/aicut-motion/assets/atlas/styles/085-macpaint-1984/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/085-macpaint-1984/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/086-multi-scale-truchet/code.js +609 -0
- package/skills/aicut-motion/assets/atlas/styles/086-multi-scale-truchet/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/086-multi-scale-truchet/style.json +13 -0
- package/skills/aicut-motion/references/design-systems/README.md +1 -1
- package/skills/aicut-motion/references/motion-delivery.md +55 -0
- package/skills/aicut-motion/references/pages.md +1 -1
- package/skills/aicut-motion/references/style-index.json +690 -0
- package/skills/aicut-motion/references/style-research.md +73 -0
- package/skills/aicut-motion/references/style-selection.md +71 -0
- package/skills/aicut-motion/scripts/atlas-viewer.html +195 -0
- package/skills/aicut-motion/scripts/atlas.mjs +109 -0
- package/studio/client.mjs +3 -3
- package/studio/server/fetch-github.mjs +14 -3
- package/studio/server/server.mjs +71 -6
- package/studio/server/skill-summaries.mjs +60 -0
- package/studio/server/skills.mjs +121 -7
- package/studio/server/styles-store.mjs +235 -0
- package/studio/server/template-posters.mjs +2 -2
- package/studio/server/templates-page.mjs +93 -93
- package/studio/server/templates.mjs +32 -7
- package/studio/ui/dist/assets/ExportCenter-DasulhAv.js +1 -0
- package/studio/ui/dist/assets/SettingsModal-BZw0Hz2_.js +2 -0
- package/studio/ui/dist/assets/apple-touch-icon-ClxQ7j-O.png +0 -0
- package/studio/ui/dist/assets/es-C8XPZARI.js +1 -0
- package/studio/ui/dist/assets/favicon-Blwx8Trs.png +0 -0
- package/studio/ui/dist/assets/index-BjJVmBzB.js +1623 -0
- package/studio/ui/dist/assets/index-C3BfKZFO.css +1 -0
- package/studio/ui/dist/assets/ja-BeNkdaEj.js +1 -0
- package/studio/ui/dist/assets/ko-DcTVhdzK.js +1 -0
- package/studio/ui/dist/assets/zh-CN-Cg51ctbL.js +1 -0
- package/studio/ui/dist/index.html +4 -3
- package/studio/ui/dist/assets/ExportCenter-F-2vF-lQ.js +0 -1
- package/studio/ui/dist/assets/SettingsModal-BgVYguNu.js +0 -2
- package/studio/ui/dist/assets/es-BRUzvuoM.js +0 -1
- package/studio/ui/dist/assets/index-Bhg-9dA3.css +0 -1
- package/studio/ui/dist/assets/index-CWur1Iw9.js +0 -1625
- package/studio/ui/dist/assets/ja-Cth-uDcW.js +0 -1
- package/studio/ui/dist/assets/ko-upvw591D.js +0 -1
- package/studio/ui/dist/assets/zh-CN-BCfJFazB.js +0 -1
|
@@ -0,0 +1,897 @@
|
|
|
1
|
+
// Whiteboard — dry-erase marker explainer on a glossy board.
|
|
2
|
+
{
|
|
3
|
+
const seg = (pts, step = 2.5) => {
|
|
4
|
+
const out = [];
|
|
5
|
+
for (let i = 0; i < pts.length - 1; i++) {
|
|
6
|
+
const [x0, y0] = pts[i], [x1, y1] = pts[i + 1];
|
|
7
|
+
const n = Math.max(1, Math.ceil(Math.hypot(x1 - x0, y1 - y0) / step));
|
|
8
|
+
for (let j = 0; j < n; j++) out.push([x0 + (x1 - x0) * j / n, y0 + (y1 - y0) * j / n]);
|
|
9
|
+
}
|
|
10
|
+
out.push(pts[pts.length - 1]);
|
|
11
|
+
return out;
|
|
12
|
+
};
|
|
13
|
+
const normals = (P) => P.map((p, i) => {
|
|
14
|
+
const a = P[Math.max(0, i - 1)], b = P[Math.min(P.length - 1, i + 1)];
|
|
15
|
+
const dx = b[0] - a[0], dy = b[1] - a[1], d = Math.hypot(dx, dy) || 1;
|
|
16
|
+
return [-dy / d, dx / d];
|
|
17
|
+
});
|
|
18
|
+
const wobble = (pts, nz, seed, amp = 1.6, freq = 0.011) => {
|
|
19
|
+
const N = normals(pts); let L = 0;
|
|
20
|
+
return pts.map((p, i) => {
|
|
21
|
+
if (i) L += Math.hypot(p[0] - pts[i - 1][0], p[1] - pts[i - 1][1]);
|
|
22
|
+
const o = nz.n2(L * freq + seed * 1.37, seed * 0.71) * amp + nz.n2(L * freq * 6 + seed, seed + 3.3) * amp * 0.25;
|
|
23
|
+
return [p[0] + N[i][0] * o, p[1] + N[i][1] * o];
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
const ell = (cx, cy, rx, ry, a0 = 0, a1 = Math.PI * 2, grow = 0) => {
|
|
27
|
+
const n = Math.max(10, Math.ceil(Math.abs(a1 - a0) * Math.max(rx, ry) / 2.5)), out = [];
|
|
28
|
+
for (let i = 0; i <= n; i++) {
|
|
29
|
+
const u = i / n, a = a0 + (a1 - a0) * u, g = 1 + grow * u;
|
|
30
|
+
out.push([cx + Math.cos(a) * rx * g, cy + Math.sin(a) * ry * g]);
|
|
31
|
+
}
|
|
32
|
+
return out;
|
|
33
|
+
};
|
|
34
|
+
const bez = (p0, p1, p2, p3) => {
|
|
35
|
+
const out = [];
|
|
36
|
+
for (let i = 0; i <= 60; i++) {
|
|
37
|
+
const t = i / 60, m = 1 - t;
|
|
38
|
+
out.push([m * m * m * p0[0] + 3 * m * m * t * p1[0] + 3 * m * t * t * p2[0] + t * t * t * p3[0],
|
|
39
|
+
m * m * m * p0[1] + 3 * m * m * t * p1[1] + 3 * m * t * t * p2[1] + t * t * t * p3[1]]);
|
|
40
|
+
}
|
|
41
|
+
return out;
|
|
42
|
+
};
|
|
43
|
+
const tracePath = (ctx, P) => { ctx.beginPath(); P.forEach((p, i) => (i ? ctx.lineTo(p[0], p[1]) : ctx.moveTo(p[0], p[1]))); };
|
|
44
|
+
|
|
45
|
+
// A dry-erase marker stroke: lighter wet center, darker pooled edges, streaky dry lines.
|
|
46
|
+
const BOARD = [236, 240, 239];
|
|
47
|
+
const MN = H.makeNoise(4242);
|
|
48
|
+
let TIP = null; // where the marker tip currently is (during the build)
|
|
49
|
+
const marker = (ctx, pts, col, w, seed, prog = 1) => {
|
|
50
|
+
if (prog <= 0) return;
|
|
51
|
+
if (prog < 1) { const q = pts[Math.max(1, Math.ceil(pts.length * prog)) - 1]; TIP = [q[0], q[1], col]; }
|
|
52
|
+
const P = prog < 1 ? pts.slice(0, Math.max(2, Math.ceil(pts.length * prog))) : pts;
|
|
53
|
+
const r = H.rng(seed), rgb = H.hex(col), N = normals(P);
|
|
54
|
+
ctx.save(); ctx.lineJoin = 'round'; ctx.lineCap = 'round';
|
|
55
|
+
ctx.strokeStyle = H.rgba(rgb, 0.3); ctx.lineWidth = w; tracePath(ctx, P); ctx.stroke();
|
|
56
|
+
ctx.lineCap = 'butt';
|
|
57
|
+
// body ink density drifts along the stroke (wetter / drier patches)
|
|
58
|
+
const CH = 10;
|
|
59
|
+
for (let i = 0; i < P.length - 1; i += CH) {
|
|
60
|
+
const a = 0.16 + 0.22 * (0.5 + 0.5 * MN.n2(i * 0.03 + seed * 3.1, seed * 0.37));
|
|
61
|
+
ctx.strokeStyle = H.rgba(rgb, a); ctx.lineWidth = w * 0.96;
|
|
62
|
+
ctx.beginPath(); ctx.moveTo(P[i][0], P[i][1]);
|
|
63
|
+
for (let j = i + 1; j <= Math.min(P.length - 1, i + CH); j++) ctx.lineTo(P[j][0], P[j][1]);
|
|
64
|
+
ctx.stroke();
|
|
65
|
+
}
|
|
66
|
+
const n = 7;
|
|
67
|
+
for (let k = 0; k < n; k++) {
|
|
68
|
+
const u = k / (n - 1) - 0.5, edge = Math.abs(u) * 2;
|
|
69
|
+
const a = (0.08 + 0.5 * Math.pow(edge, 2.2)) * (0.65 + r() * 0.7);
|
|
70
|
+
ctx.strokeStyle = H.rgba(rgb, a); ctx.lineWidth = (w / n) * 1.5;
|
|
71
|
+
const off = u * w * 0.84;
|
|
72
|
+
ctx.beginPath();
|
|
73
|
+
P.forEach((p, i) => { const x = p[0] + N[i][0] * off, y = p[1] + N[i][1] * off; i ? ctx.lineTo(x, y) : ctx.moveTo(x, y); });
|
|
74
|
+
ctx.stroke();
|
|
75
|
+
}
|
|
76
|
+
// dry streaks where the felt tip skipped
|
|
77
|
+
for (let k = 0; k < 4; k++) {
|
|
78
|
+
const off = (r() - 0.5) * w * 0.6;
|
|
79
|
+
ctx.strokeStyle = H.rgba(BOARD, 0.14 + r() * 0.2); ctx.lineWidth = 0.6 + r() * 0.6;
|
|
80
|
+
const s = Math.floor(r() * P.length * 0.4), e = Math.min(P.length, s + Math.floor(P.length * (0.3 + r() * 0.6)));
|
|
81
|
+
ctx.beginPath();
|
|
82
|
+
for (let i = s; i < e; i++) { const x = P[i][0] + N[i][0] * off, y = P[i][1] + N[i][1] * off; i > s ? ctx.lineTo(x, y) : ctx.moveTo(x, y); }
|
|
83
|
+
ctx.stroke();
|
|
84
|
+
}
|
|
85
|
+
// ink pools where the tip lands and lifts
|
|
86
|
+
[P[0], prog >= 1 ? P[P.length - 1] : null].forEach((p, j) => {
|
|
87
|
+
if (!p) return;
|
|
88
|
+
const g = ctx.createRadialGradient(p[0], p[1], 0, p[0], p[1], w * 0.62);
|
|
89
|
+
g.addColorStop(0, H.rgba(rgb, j ? 0.25 : 0.42)); g.addColorStop(1, H.rgba(rgb, 0));
|
|
90
|
+
ctx.fillStyle = g; ctx.beginPath(); ctx.arc(p[0], p[1], w * 0.62, 0, 7); ctx.fill();
|
|
91
|
+
});
|
|
92
|
+
ctx.restore();
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
// Marker lettering: per-glyph jitter, pale centers with darker rims.
|
|
96
|
+
const mText = (ctx, str, x, y, font, col, seed, prog = 1, rot = 0) => {
|
|
97
|
+
if (prog <= 0) return;
|
|
98
|
+
const r = H.rng(seed), rgb = H.hex(col);
|
|
99
|
+
ctx.save(); ctx.font = font; ctx.textBaseline = 'alphabetic';
|
|
100
|
+
ctx.translate(x, y); ctx.rotate(rot);
|
|
101
|
+
const nChars = Math.ceil(str.length * prog);
|
|
102
|
+
if (prog < 1) {
|
|
103
|
+
const wsofar = ctx.measureText(str.slice(0, nChars)).width;
|
|
104
|
+
TIP = [x + Math.cos(rot) * wsofar, y + Math.sin(rot) * wsofar - 10, col];
|
|
105
|
+
}
|
|
106
|
+
let cx = 0;
|
|
107
|
+
for (let i = 0; i < nChars; i++) {
|
|
108
|
+
const ch = str[i], wch = ctx.measureText(ch).width;
|
|
109
|
+
ctx.save(); ctx.translate(cx + wch / 2, (r() - 0.5) * 3); ctx.rotate((r() - 0.5) * 0.07);
|
|
110
|
+
ctx.fillStyle = H.rgba(rgb, 0.8 + r() * 0.1); ctx.fillText(ch, -wch / 2, 0);
|
|
111
|
+
ctx.strokeStyle = H.rgba(rgb, 0.7); ctx.lineWidth = 1.3; ctx.strokeText(ch, -wch / 2, 0);
|
|
112
|
+
ctx.restore();
|
|
113
|
+
cx += wch + (r() - 0.5) * 1.5;
|
|
114
|
+
}
|
|
115
|
+
ctx.restore();
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
// >>>XE-ENGINE
|
|
119
|
+
// ===================== explainer story engine (shared script: "How does AI learn?") =====================
|
|
120
|
+
// Builds the diagram as timed world-space strokes/texts; each style renders them with its own medium.
|
|
121
|
+
const XC = {}; // cache for static textures (output still depends only on t)
|
|
122
|
+
const XE = (() => {
|
|
123
|
+
const clamp = (v, a = 0, b = 1) => Math.max(a, Math.min(b, v));
|
|
124
|
+
const win = (t, a, b) => clamp((t - a) / (b - a));
|
|
125
|
+
const eio = (x) => (x < 0.5 ? 4 * x * x * x : 1 - Math.pow(-2 * x + 2, 3) / 2);
|
|
126
|
+
const camAt = (keys, t) => {
|
|
127
|
+
if (t <= keys[0][0]) return keys[0].slice(1);
|
|
128
|
+
for (let i = 0; i < keys.length - 1; i++) {
|
|
129
|
+
const a = keys[i], b = keys[i + 1];
|
|
130
|
+
if (t <= b[0]) {
|
|
131
|
+
const u = eio((t - a[0]) / Math.max(1e-6, b[0] - a[0]));
|
|
132
|
+
return [a[1] + (b[1] - a[1]) * u, a[2] + (b[2] - a[2]) * u, Math.exp(Math.log(a[3]) + (Math.log(b[3]) - Math.log(a[3])) * u)];
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return keys[keys.length - 1].slice(1);
|
|
136
|
+
};
|
|
137
|
+
const circ = (x, y, rx, ry, a0 = 0, a1 = Math.PI * 2, n = 0) => {
|
|
138
|
+
n = n || Math.max(12, Math.ceil(Math.abs(a1 - a0) * Math.max(rx, ry) / 6)); const o = [];
|
|
139
|
+
for (let i = 0; i <= n; i++) { const a = a0 + (a1 - a0) * i / n; o.push([x + Math.cos(a) * rx, y + Math.sin(a) * ry]); }
|
|
140
|
+
return o;
|
|
141
|
+
};
|
|
142
|
+
const quad = (p0, p1, p2, n = 30) => { const o = []; for (let i = 0; i <= n; i++) { const t = i / n, m = 1 - t; o.push([m * m * p0[0] + 2 * m * t * p1[0] + t * t * p2[0], m * m * p0[1] + 2 * m * t * p1[1] + t * t * p2[1]]); } return o; };
|
|
143
|
+
const cubic = (p0, p1, p2, p3, n = 40) => { const o = []; for (let i = 0; i <= n; i++) { const t = i / n, m = 1 - t; o.push([m * m * m * p0[0] + 3 * m * m * t * p1[0] + 3 * m * t * t * p2[0] + t * t * t * p3[0], m * m * m * p0[1] + 3 * m * m * t * p1[1] + 3 * m * t * t * p2[1] + t * t * t * p3[1]]); } return o; };
|
|
144
|
+
const rrect = (x, y, w, h, r) => {
|
|
145
|
+
const o = [[x + r, y], [x + w - r, y]]; o.push(...circ(x + w - r, y + r, r, r, -Math.PI / 2, 0, 5).slice(1));
|
|
146
|
+
o.push([x + w, y + h - r]); o.push(...circ(x + w - r, y + h - r, r, r, 0, Math.PI / 2, 5).slice(1));
|
|
147
|
+
o.push([x + r, y + h]); o.push(...circ(x + r, y + h - r, r, r, Math.PI / 2, Math.PI, 5).slice(1));
|
|
148
|
+
o.push([x, y + r]); o.push(...circ(x + r, y + r, r, r, Math.PI, Math.PI * 1.5, 5).slice(1));
|
|
149
|
+
o.push([x + r + 6, y - 1]); return o;
|
|
150
|
+
};
|
|
151
|
+
const head = (P, len = 20, spread = 0.5) => {
|
|
152
|
+
const a = P[P.length - 1], b = P[Math.max(0, P.length - 4)], an = Math.atan2(a[1] - b[1], a[0] - b[0]);
|
|
153
|
+
return [[a[0] - Math.cos(an - spread) * len, a[1] - Math.sin(an - spread) * len], a, [a[0] - Math.cos(an + spread) * len, a[1] - Math.sin(an + spread) * len]];
|
|
154
|
+
};
|
|
155
|
+
const cat = (x, y, s) => [
|
|
156
|
+
circ(x, y + 0.06 * s, 0.3 * s, 0.27 * s, -1.2, 5.1),
|
|
157
|
+
[[x - 0.27 * s, y - 0.02 * s], [x - 0.24 * s, y - 0.34 * s], [x - 0.07 * s, y - 0.2 * s]],
|
|
158
|
+
[[x + 0.07 * s, y - 0.2 * s], [x + 0.24 * s, y - 0.34 * s], [x + 0.27 * s, y - 0.02 * s]],
|
|
159
|
+
[[x - 0.03 * s, y + 0.1 * s], [x, y + 0.13 * s], [x + 0.03 * s, y + 0.1 * s]],
|
|
160
|
+
[[x - 0.12 * s, y + 0.12 * s], [x - 0.36 * s, y + 0.08 * s]], [[x - 0.12 * s, y + 0.16 * s], [x - 0.35 * s, y + 0.2 * s]],
|
|
161
|
+
[[x + 0.12 * s, y + 0.12 * s], [x + 0.36 * s, y + 0.08 * s]], [[x + 0.12 * s, y + 0.16 * s], [x + 0.35 * s, y + 0.2 * s]],
|
|
162
|
+
];
|
|
163
|
+
const dog = (x, y, s) => [
|
|
164
|
+
circ(x, y + 0.04 * s, 0.26 * s, 0.28 * s, -1.4, 4.9),
|
|
165
|
+
circ(x - 0.29 * s, y + 0.04 * s, 0.09 * s, 0.2 * s, 0, 6.4),
|
|
166
|
+
circ(x + 0.29 * s, y + 0.04 * s, 0.09 * s, 0.2 * s, 0, 6.4),
|
|
167
|
+
circ(x, y + 0.15 * s, 0.07 * s, 0.045 * s, 0, 6.4),
|
|
168
|
+
[[x - 0.08 * s, y + 0.23 * s], [x, y + 0.26 * s], [x + 0.08 * s, y + 0.23 * s]],
|
|
169
|
+
];
|
|
170
|
+
const eyes = (x, y, s, dy = 0.02) => [[x - 0.1 * s, y + dy * s], [x + 0.1 * s, y + dy * s]];
|
|
171
|
+
const fmt = (n) => Math.round(n).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
|
172
|
+
|
|
173
|
+
// L: layout options. mode: 'same' (progress drawn where the loop was) | 'below' | 'right'
|
|
174
|
+
// model(cx, cy, adj, add): style supplies its model drawing; adj 0..1 = how far the knobs have been adjusted.
|
|
175
|
+
const story = (t, L) => {
|
|
176
|
+
const items = [];
|
|
177
|
+
const line = (pts, role, w, a, b, g) => items.push({ k: 'line', pts, role, w, a, b, g });
|
|
178
|
+
const text = (s, x, y, size, font, role, a, b, opt = {}) => items.push({ k: 'text', s, x, y, size, font, role, a, b, rot: opt.rot || 0, align: opt.align || 'left', g: opt.g });
|
|
179
|
+
const dot = (x, y, r, role, a, g) => items.push({ k: 'dot', x, y, r, role, a, b: a + 0.05, g });
|
|
180
|
+
const S = L.s || 1;
|
|
181
|
+
// ---- 1 HOOK ----
|
|
182
|
+
const TX = L.titleX ?? 640, TY = L.titleY ?? 350;
|
|
183
|
+
text('How does AI learn?', TX, TY, 84 * S, 'title', 'ink', 0.15, 1.3, { align: 'center', rot: -0.015, g: 'A' });
|
|
184
|
+
line([[TX - 330 * S, TY + 32 * S], [TX + 330 * S, TY + 24 * S]], 'acc1', 7, 1.3, 1.55, 'A');
|
|
185
|
+
// ---- 2 DATA ----
|
|
186
|
+
const MX = L.modelX ?? 2250, MY = L.modelY ?? 640;
|
|
187
|
+
const mAdj = eio(win(t, 8.95, 9.5));
|
|
188
|
+
L.model(MX, MY, mAdj, (it) => { it.g = it.g || 'M'; items.push(it); }, { line, text, dot }, t);
|
|
189
|
+
text(L.modelName || 'model', MX, MY + 228, 38, 'label', 'ink', 3.15, 3.4, { align: 'center', g: 'M' });
|
|
190
|
+
const CS = 118, cx0 = MX - 870, cy0 = MY - 175;
|
|
191
|
+
for (let i = 0; i < 6; i++) {
|
|
192
|
+
const col = i % 3, row = (i / 3) | 0, x = cx0 + col * 150 + (row ? 40 : 0), y = cy0 + row * 170, isCat = [1, 0, 1, 1, 0, 0][i];
|
|
193
|
+
const a = 3.0 + i * 0.17;
|
|
194
|
+
line(rrect(x - CS / 2, y - CS / 2, CS, CS, 12), 'ink', 4, a, a + 0.12, 'B');
|
|
195
|
+
(isCat ? cat : dog)(x, y - 6, CS * 0.82).forEach((p) => line(p, 'ink', 3.2, a + 0.1, a + 0.22, 'B'));
|
|
196
|
+
eyes(x, y - 6, CS * 0.82).forEach(([ex, ey]) => dot(ex, ey, 3.2, 'ink', a + 0.22, 'B'));
|
|
197
|
+
// label tag hanging off the card
|
|
198
|
+
const tx = x + 18, ty = y + CS / 2 - 4;
|
|
199
|
+
line([[tx, ty], [tx + 70, ty], [tx + 84, ty + 19], [tx + 70, ty + 38], [tx, ty + 38], [tx, ty]], isCat ? 'acc1' : 'acc3', 3, a + 0.2, a + 0.3, 'B');
|
|
200
|
+
text(isCat ? 'cat' : 'dog', tx + 8, ty + 30, 31, 'label', isCat ? 'acc1' : 'acc3', a + 0.28, a + 0.36, { g: 'B' });
|
|
201
|
+
}
|
|
202
|
+
// flow arrow into the model
|
|
203
|
+
const fa = cubic([cx0 + 370, MY - 10], [cx0 + 470, MY - 60], [MX - 260, MY - 40], [MX - 165, MY - 10]);
|
|
204
|
+
line(fa, 'ink', 5, 4.15, 4.45, 'B'); line(head(fa, 24), 'ink', 5, 4.45, 4.55, 'B');
|
|
205
|
+
// little example cards streaming along the arrow
|
|
206
|
+
if (t > 4.5 && t < 6.2) {
|
|
207
|
+
for (let k = 0; k < 9; k++) {
|
|
208
|
+
const u = ((t - 4.5) * 0.9 + k / 9) % 1, ix = Math.min(fa.length - 1, Math.floor(u * fa.length));
|
|
209
|
+
const [px, py] = fa[ix], sz = 26 * (1 - 0.5 * u);
|
|
210
|
+
if (t - 4.5 < k / 9 / 0.9) continue;
|
|
211
|
+
items.push({ k: 'line', pts: rrect(px - sz / 2, py - sz / 2 - 18, sz, sz, 4), role: k % 2 ? 'acc1' : 'acc3', w: 2.5, a: -1, b: 0, g: 'F', inst: true });
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
// counter (numerals redrawn on twos)
|
|
215
|
+
if (t > 4.5) {
|
|
216
|
+
const u = win(Math.floor(t * 12) / 12, 4.55, 5.25), n = u >= 1 ? 1e6 : (Math.pow(10, u * 6) - 1) / (1e6 - 1) * 1e6;
|
|
217
|
+
items.push({ k: 'text', s: fmt(n), x: cx0 + 150, y: cy0 + 425, size: 76, font: 'num', role: 'ink', a: -1, b: 0, align: 'center', g: 'B', inst: true, live: true });
|
|
218
|
+
text('examples', cx0 + 150, cy0 + 472, 36, 'label', 'ink', 4.55, 4.8, { align: 'center', g: 'B' });
|
|
219
|
+
}
|
|
220
|
+
if (L.model2At) L.model(MX, MY, mAdj, (it) => { it.g = 'M2'; if (!it.inst) { it.a += L.model2At - 2.5; it.b += L.model2At - 2.5; } items.push(it); }, { line: (p, r, w, a, b) => line(p, r, w, a + L.model2At - 2.5, b + L.model2At - 2.5, 'M2'), text: (s2, x, y, sz, f, r, a, b, o = {}) => text(s2, x, y, sz, f, r, a + L.model2At - 2.5, b + L.model2At - 2.5, { ...o, g: 'M2' }), dot }, t - (L.model2At - 2.5));
|
|
221
|
+
// ---- 3 GUESS -> CHECK -> ADJUST ----
|
|
222
|
+
const qx = MX, qy = MY - 300;
|
|
223
|
+
line(rrect(qx - 62, qy - 62, 124, 124, 12), 'acc2', 4, 6.4, 6.55, 'C');
|
|
224
|
+
cat(qx, qy - 4, 100).forEach((p) => line(p, 'ink', 3.2, 6.5, 6.7, 'C'));
|
|
225
|
+
eyes(qx, qy - 4, 100).forEach(([ex, ey]) => dot(ex, ey, 3, 'ink', 6.7, 'C'));
|
|
226
|
+
text('new!', qx + 72, qy - 30, 30, 'label', 'acc2', 6.65, 6.8, { g: 'C' });
|
|
227
|
+
const dn = [[qx, qy + 70], [qx + 2, MY - 170]];
|
|
228
|
+
line(dn, 'ink', 5, 6.8, 6.95, 'C'); line(head(dn, 18), 'ink', 5, 6.95, 7.02, 'C');
|
|
229
|
+
const gA = [[MX + 175, MY - 10], [MX + 300, MY - 14], [MX + 400, MY - 8]];
|
|
230
|
+
line(gA, 'ink', 5, 7.02, 7.2, 'C'); line(head(gA, 20), 'ink', 5, 7.2, 7.26, 'C');
|
|
231
|
+
text('Guess', MX + 290, MY - 40, 38, 'label', 'ink', 7.15, 7.4, { align: 'center', g: 'C' });
|
|
232
|
+
const BX = MX + 540, BY = MY - 10;
|
|
233
|
+
line(rrect(BX - 120, BY - 55, 240, 110, 40), 'ink', 5, 7.3, 7.5, 'C');
|
|
234
|
+
line([[BX - 70, BY + 52], [BX - 96, BY + 92], [BX - 40, BY + 54]], 'ink', 5, 7.48, 7.55, 'C');
|
|
235
|
+
text('dog?', BX, BY + 18, 52, 'title', 'ink', 7.52, 7.75, { align: 'center', g: 'C' });
|
|
236
|
+
text('Check', BX, BY - 82, 38, 'label', 'acc2', 7.85, 8.05, { align: 'center', g: 'C' });
|
|
237
|
+
line([[BX + 140, BY - 40], [BX + 200, BY + 30]], 'acc2', 8, 8.0, 8.08, 'C');
|
|
238
|
+
line([[BX + 200, BY - 40], [BX + 140, BY + 30]], 'acc2', 8, 8.08, 8.16, 'C');
|
|
239
|
+
line(circ(BX + 4, BY + 2, 150, 82, -2.2, 4.4), 'acc2', 5, 8.15, 8.45, 'C'); // emphasis ring
|
|
240
|
+
const back = cubic([BX - 60, BY + 70], [BX - 80, BY + 290], [MX + 290, MY + 300], [MX + 155, MY + 190]);
|
|
241
|
+
line(back, 'acc2', 6, 8.45, 8.95, 'C'); line(head(back, 22), 'acc2', 6, 8.95, 9.02, 'C');
|
|
242
|
+
text('Adjust', (BX + MX) / 2 - 10, MY + 315, 40, 'label', 'acc2', 8.8, 9.05, { align: 'center', g: 'C' });
|
|
243
|
+
if (t > 8.95 && t < 9.4) { // error signal travelling back
|
|
244
|
+
const u = win(t, 8.95, 9.35), p = back[Math.min(back.length - 1, Math.floor((1 - u) * (back.length - 1)))];
|
|
245
|
+
items.push({ k: 'dot', x: p[0], y: p[1], r: 13, role: 'acc2', a: -1, b: 0, g: 'C', inst: true });
|
|
246
|
+
}
|
|
247
|
+
line([[BX - 66, BY + 4], [BX - 20, BY - 6], [BX + 24, BY + 6], [BX + 66, BY - 4]], 'ink', 5, 9.5, 9.62, 'C'); // strike
|
|
248
|
+
text('cat', BX + 30, BY + 118, 52, 'title', 'acc3', 9.62, 9.85, { align: 'center', g: 'C' });
|
|
249
|
+
line([[BX + 92, BY + 96], [BX + 112, BY + 122], [BX + 156, BY + 66]], 'acc3', 8, 9.85, 10.05, 'C');
|
|
250
|
+
if (L.bridge) { // a connector the hand draws while the camera travels to the next part
|
|
251
|
+
const B = L.bridge;
|
|
252
|
+
line(B.pts, 'acc1', 5, B.a, B.b, 'D'); line(head(B.pts, 22), 'acc1', 5, B.b, B.b + 0.06, 'D');
|
|
253
|
+
text(B.label, B.lx, B.ly, 40, 'label', 'acc1', B.b + 0.06, B.b + 0.3, { align: 'center', rot: B.rot || 0, g: 'D' });
|
|
254
|
+
}
|
|
255
|
+
// ---- 4 PROGRESS ----
|
|
256
|
+
const D = L.D;
|
|
257
|
+
const ox = D[0] - 380, oy = D[1] + 150, cw = 560, ch = 330;
|
|
258
|
+
line([[ox, oy - ch], [ox, oy], [ox + cw, oy]], 'ink', 5, L.pT, L.pT + 0.35, 'D');
|
|
259
|
+
line(head([[ox, oy], [ox, oy - ch]], 16), 'ink', 5, L.pT + 0.35, L.pT + 0.4, 'D');
|
|
260
|
+
line(head([[ox, oy], [ox + cw, oy]], 16), 'ink', 5, L.pT + 0.4, L.pT + 0.45, 'D');
|
|
261
|
+
text('training rounds', ox + cw / 2, oy + 48, 34, 'label', 'ink', L.pT + 0.3, L.pT + 0.55, { align: 'center', g: 'D' });
|
|
262
|
+
const cpts = [];
|
|
263
|
+
for (let i = 0; i <= 40; i++) {
|
|
264
|
+
const u = i / 40, acc = 61 + 36 * (1 - Math.pow(1 - u, 2.2)) + (i % 3 === 1 ? -2.5 : i % 3 === 2 ? 1.5 : 0) * (1 - u);
|
|
265
|
+
cpts.push([ox + 20 + u * (cw - 50), oy - (acc - 50) / 50 * ch]);
|
|
266
|
+
}
|
|
267
|
+
line(cpts, 'acc1', 6, L.pT + 0.5, L.pT + 1.7, 'D');
|
|
268
|
+
text('accuracy', D[0] + 330, D[1] - 120, 40, 'label', 'ink', L.pT + 0.45, L.pT + 0.7, { align: 'center', g: 'D' });
|
|
269
|
+
if (t > L.pT + 0.55) {
|
|
270
|
+
const u = win(Math.floor(t * 12) / 12, L.pT + 0.6, L.pT + 1.7), v = 61 + 36 * (1 - Math.pow(1 - u, 2.2));
|
|
271
|
+
items.push({ k: 'text', s: Math.round(v) + '%', x: D[0] + 330, y: D[1] + 10, size: 110, font: 'num', role: u >= 1 ? 'acc3' : 'ink', a: -1, b: 0, align: 'center', g: 'D', inst: true, live: true });
|
|
272
|
+
}
|
|
273
|
+
line(circ(D[0] + 335, D[1] - 25, 140, 90, -2.4, 4.2), 'acc2', 6, L.pT + 1.75, L.pT + 2.05, 'D');
|
|
274
|
+
// ---- 5 TAKEAWAY ----
|
|
275
|
+
text('More examples → better guesses', D[0], D[1] + 290, 62, 'title', 'ink', L.kT, L.kT + 0.75, { align: 'center', rot: -0.01, g: 'E' });
|
|
276
|
+
line([[D[0] - 450, D[1] + 316], [D[0] + 455, D[1] + 308]], 'acc1', 6, L.kT + 0.75, L.kT + 0.95, 'E');
|
|
277
|
+
return items;
|
|
278
|
+
};
|
|
279
|
+
// the 'tip' of whatever is currently being drawn (for the hand/tool)
|
|
280
|
+
const tipOf = (items, t, measure) => {
|
|
281
|
+
let tip = null;
|
|
282
|
+
for (const it of items) {
|
|
283
|
+
if (it.inst || it.k === 'dot') continue;
|
|
284
|
+
const p = win(t, it.a, it.b);
|
|
285
|
+
if (p > 0 && p < 1) {
|
|
286
|
+
if (it.k === 'line') { const P = it.pts; tip = P[Math.min(P.length - 1, Math.floor(p * (P.length - 1)))]; }
|
|
287
|
+
else tip = measure ? measure(it, p) : [it.x, it.y];
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
return tip;
|
|
291
|
+
};
|
|
292
|
+
return { clamp, win, eio, camAt, circ, quad, cubic, rrect, head, cat, dog, story, tipOf, fmt };
|
|
293
|
+
})();
|
|
294
|
+
// <<<XE-ENGINE
|
|
295
|
+
// Ghost residue of earlier lessons on the explainer's big board: baked once (world space, half resolution)
|
|
296
|
+
// with the hero's streaky eraser-wipe mask and haze, then simply drawn under the live diagram.
|
|
297
|
+
const ghostBoard = () => {
|
|
298
|
+
if (XC.ghost) return XC.ghost;
|
|
299
|
+
const x0 = -200, y0 = -100, w = 3600, h = 1400, s = 0.5;
|
|
300
|
+
const nz = H.makeNoise(23);
|
|
301
|
+
const g = H.layer(w * s, h * s), gc = g.getContext('2d');
|
|
302
|
+
gc.scale(s, s); gc.translate(-x0, -y0);
|
|
303
|
+
gc.strokeStyle = '#30343c'; gc.fillStyle = '#30343c'; gc.lineCap = 'round'; gc.lineJoin = 'round'; gc.lineWidth = 7;
|
|
304
|
+
const wl = (pts, sd, amp = 1.8) => { tracePath(gc, wobble(seg(pts), nz, sd, amp)); gc.stroke(); };
|
|
305
|
+
// A: an old quiz list (top right of the opening view)
|
|
306
|
+
gc.font = '400 52px "Permanent Marker"'; gc.fillText('WEEK 6 QUIZ', 850, 118);
|
|
307
|
+
gc.font = '700 34px "Kalam"';
|
|
308
|
+
['- read ch. 4', '- lab due Fri', '- bring calc!'].forEach((t, i) => gc.fillText(t, 872, 182 + i * 44));
|
|
309
|
+
wl([[840, 138], [1020, 135], [1210, 132]], 1);
|
|
310
|
+
// B: a pie and a wobbly line chart (bottom left of the opening view)
|
|
311
|
+
gc.beginPath(); gc.arc(190, 588, 72, 0, 7); gc.stroke();
|
|
312
|
+
gc.beginPath(); gc.moveTo(190, 588); gc.lineTo(190, 516); gc.moveTo(190, 588); gc.lineTo(252, 626); gc.stroke();
|
|
313
|
+
wl([[300, 660], [360, 600], [420, 630], [520, 540]], 2);
|
|
314
|
+
gc.font = '700 30px "Kalam"'; gc.fillText('sales / mo', 330, 694);
|
|
315
|
+
// C: a formula above the example cards
|
|
316
|
+
gc.font = '400 40px "Permanent Marker"'; gc.fillText('f(x) = w·x + b', 1740, 830);
|
|
317
|
+
wl([[1730, 850], [1890, 846], [2030, 852]], 3, 1.4);
|
|
318
|
+
// D: a little box diagram, top right of the loop view
|
|
319
|
+
gc.beginPath(); gc.rect(3070, 300, 150, 80); gc.stroke();
|
|
320
|
+
wl([[3010, 340], [3062, 340]], 4, 0.8);
|
|
321
|
+
gc.font = '700 30px "Kalam"'; gc.fillText('step 2', 3100, 350);
|
|
322
|
+
// E: homework note under the takeaway
|
|
323
|
+
gc.font = '400 44px "Permanent Marker"'; gc.fillText('HW: p. 112', 2180, 1086);
|
|
324
|
+
gc.beginPath(); gc.rect(2560, 1030, 200, 84); gc.stroke();
|
|
325
|
+
wl([[2470, 1070], [2550, 1072]], 5, 0.8);
|
|
326
|
+
gc.font = '700 30px "Kalam"'; gc.fillText('#3, #7', 2800, 1084);
|
|
327
|
+
// eraser-wipe mask: the residue survives only in streaky swipe bands
|
|
328
|
+
const m = H.layer(w * s, h * s), mc = m.getContext('2d'), rm = H.rng(77);
|
|
329
|
+
mc.scale(s, s); mc.translate(-x0, -y0); mc.lineCap = 'round';
|
|
330
|
+
for (let i = 0; i < 230; i++) {
|
|
331
|
+
const y = rm.range(0, 1250), x = rm.range(-150, 3300), len = rm.range(150, 420);
|
|
332
|
+
mc.strokeStyle = `rgba(0,0,0,${rm.range(0.15, 0.8)})`; mc.lineWidth = rm.range(4, 26);
|
|
333
|
+
mc.beginPath(); mc.moveTo(x, y); mc.quadraticCurveTo(x + len / 2, y + rm.range(-30, 30), x + len, y + rm.range(-18, 18)); mc.stroke();
|
|
334
|
+
}
|
|
335
|
+
gc.setTransform(1, 0, 0, 1, 0, 0); gc.globalCompositeOperation = 'destination-in'; gc.drawImage(m, 0, 0);
|
|
336
|
+
const cv = H.layer(w * s, h * s), c = cv.getContext('2d');
|
|
337
|
+
c.filter = 'blur(0.5px)'; c.globalAlpha = 0.12; c.drawImage(g, 0, 0); c.globalAlpha = 1;
|
|
338
|
+
// grey eraser haze smeared over each old lesson
|
|
339
|
+
const rh = H.rng(78);
|
|
340
|
+
c.scale(s, s); c.translate(-x0, -y0); c.lineCap = 'round'; c.filter = 'blur(3px)';
|
|
341
|
+
[[1040, 180, 200, 70], [330, 600, 200, 80], [1880, 820, 160, 30], [3140, 340, 90, 40], [2470, 1070, 330, 40]].forEach(([cx, cy, rx, ry]) => {
|
|
342
|
+
for (let i = 0; i < 4; i++) {
|
|
343
|
+
const x = cx + rh.range(-rx, rx) * 0.6, y = cy + rh.range(-ry, ry);
|
|
344
|
+
c.strokeStyle = `rgba(120,128,135,${rh.range(0.014, 0.03)})`; c.lineWidth = rh.range(30, 60);
|
|
345
|
+
c.beginPath(); c.moveTo(x - 120, y); c.quadraticCurveTo(x, y + rh.range(-25, 25), x + 120, y + rh.range(-10, 10)); c.stroke();
|
|
346
|
+
}
|
|
347
|
+
});
|
|
348
|
+
const out = { cv, x0, y0, w, h };
|
|
349
|
+
let ready = true;
|
|
350
|
+
try { ready = document.fonts.check('400 52px "Permanent Marker"') && document.fonts.check('700 34px "Kalam"'); } catch (e) { /* assume ready */ }
|
|
351
|
+
if (ready) XC.ghost = out;
|
|
352
|
+
return out;
|
|
353
|
+
};
|
|
354
|
+
// Streaky felt-eraser brush: a soft base wipe plus felt-fibre bands, so the residue left behind varies
|
|
355
|
+
// across the swipe (clean bands next to faint ghost bands) like a real dry-erase felt.
|
|
356
|
+
const FIBRES = (() => {
|
|
357
|
+
const r = H.rng(313), out = [];
|
|
358
|
+
for (let i = 0; i < 16; i++) out.push({ dy: (r() - 0.5) * 118, w: 5 + r() * 14, a: 0.45 + r() * 0.5 });
|
|
359
|
+
return out;
|
|
360
|
+
})();
|
|
361
|
+
registerStyle({
|
|
362
|
+
id: 'whiteboard',
|
|
363
|
+
name: 'Whiteboard Explainer',
|
|
364
|
+
category: 'Hand-Drawn',
|
|
365
|
+
description: 'Dry-erase marker on a glossy whiteboard: streaky chisel-tip strokes with pooled edges, wobbly double-traced boxes and arrows, a ghost of the last erased lesson, and a soft ceiling-light sheen.',
|
|
366
|
+
motion: 'Each stroke draws on in sequence like a hand drawing it live, with labels written letter by letter and the sheen drifting slightly as the camera breathes.',
|
|
367
|
+
fonts: ['400 66px "Permanent Marker"', '700 38px "Kalam"', '400 40px "Permanent Marker"'],
|
|
368
|
+
frameT: 5.9,
|
|
369
|
+
duration: 6,
|
|
370
|
+
readsPixels: true,
|
|
371
|
+
draw(ctx, W, H_, t) {
|
|
372
|
+
const nz = H.makeNoise(11);
|
|
373
|
+
const BX0 = 26, BY0 = 26, BX1 = W - 26, BY1 = 650;
|
|
374
|
+
|
|
375
|
+
// ---------- board surface ----------
|
|
376
|
+
const bg = ctx.createLinearGradient(0, 0, W, H_);
|
|
377
|
+
bg.addColorStop(0, '#f6f8f7'); bg.addColorStop(0.55, '#ecefee'); bg.addColorStop(1, '#dfe4e3');
|
|
378
|
+
ctx.fillStyle = bg; ctx.fillRect(0, 0, W, H_);
|
|
379
|
+
// faint large mottling (old cleaner residue)
|
|
380
|
+
const rb = H.rng(5);
|
|
381
|
+
for (let i = 0; i < 14; i++) {
|
|
382
|
+
const x = rb.range(BX0, BX1), y = rb.range(BY0, BY1), rr = rb.range(80, 260);
|
|
383
|
+
const g = ctx.createRadialGradient(x, y, 0, x, y, rr);
|
|
384
|
+
g.addColorStop(0, `rgba(150,160,165,${rb.range(0.015, 0.04)})`); g.addColorStop(1, 'rgba(150,160,165,0)');
|
|
385
|
+
ctx.fillStyle = g; ctx.fillRect(x - rr, y - rr, rr * 2, rr * 2);
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
// ---------- ghost of the previous (erased) diagram ----------
|
|
389
|
+
{
|
|
390
|
+
const g = H.layer(W, H_), gc = g.getContext('2d');
|
|
391
|
+
gc.strokeStyle = '#30343c'; gc.fillStyle = '#30343c'; gc.lineCap = 'round'; gc.lineJoin = 'round';
|
|
392
|
+
gc.lineWidth = 7;
|
|
393
|
+
gc.font = '400 52px "Permanent Marker"'; gc.fillText('Q3 ROADMAP', 840, 110);
|
|
394
|
+
gc.font = '700 34px "Kalam"';
|
|
395
|
+
['- ship v2 API', '- hire 2 eng', '- fix churn!!'].forEach((s, i) => gc.fillText(s, 860, 170 + i * 44));
|
|
396
|
+
tracePath(gc, wobble(seg([[830, 130], [1190, 126]]), nz, 40)); gc.stroke();
|
|
397
|
+
gc.beginPath(); gc.arc(190, 560, 70, 0, 7); gc.stroke();
|
|
398
|
+
gc.beginPath(); gc.moveTo(190, 560); gc.lineTo(190, 490); gc.moveTo(190, 560); gc.lineTo(250, 600); gc.stroke();
|
|
399
|
+
tracePath(gc, wobble(seg([[300, 620], [360, 560], [420, 590], [520, 500]]), nz, 41)); gc.stroke();
|
|
400
|
+
gc.font = '700 30px "Kalam"'; gc.fillText('users / wk', 330, 640);
|
|
401
|
+
gc.beginPath(); gc.rect(520, 150, 180, 90); gc.stroke();
|
|
402
|
+
// eraser wipe mask: residue survives in streaky bands
|
|
403
|
+
const m = H.layer(W, H_), mc = m.getContext('2d'), rm = H.rng(77);
|
|
404
|
+
mc.lineCap = 'round';
|
|
405
|
+
for (let i = 0; i < 70; i++) {
|
|
406
|
+
const y = rm.range(40, 660), x = rm.range(20, 1100), len = rm.range(150, 420);
|
|
407
|
+
mc.strokeStyle = `rgba(0,0,0,${rm.range(0.15, 0.8)})`; mc.lineWidth = rm.range(4, 26);
|
|
408
|
+
mc.beginPath(); mc.moveTo(x, y); mc.quadraticCurveTo(x + len / 2, y + rm.range(-30, 30), x + len, y + rm.range(-18, 18)); mc.stroke();
|
|
409
|
+
}
|
|
410
|
+
gc.globalCompositeOperation = 'destination-in'; gc.drawImage(m, 0, 0);
|
|
411
|
+
ctx.save(); ctx.filter = 'blur(0.7px)'; ctx.globalAlpha = 0.11; ctx.drawImage(g, 0, 0); ctx.restore();
|
|
412
|
+
// eraser haze smears
|
|
413
|
+
const rh = H.rng(78);
|
|
414
|
+
ctx.save(); ctx.lineCap = 'round'; ctx.filter = 'blur(6px)';
|
|
415
|
+
for (let i = 0; i < 9; i++) {
|
|
416
|
+
const x = rh.range(700, 1180), y = rh.range(70, 260);
|
|
417
|
+
ctx.strokeStyle = `rgba(120,128,135,${rh.range(0.012, 0.028)})`; ctx.lineWidth = rh.range(30, 60);
|
|
418
|
+
ctx.beginPath(); ctx.moveTo(x - 120, y); ctx.quadraticCurveTo(x, y + rh.range(-25, 25), x + 120, y + rh.range(-10, 10)); ctx.stroke();
|
|
419
|
+
}
|
|
420
|
+
ctx.restore();
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
// ---------- the live diagram (drawn on over time) ----------
|
|
424
|
+
const K = '#1d1f26', B = '#1f4fc2', R = '#d4262f', G = '#16884a';
|
|
425
|
+
const items = [];
|
|
426
|
+
let clock = 0.2;
|
|
427
|
+
const add = (dur, fn) => { items.push({ t0: clock, dur, fn }); clock += dur; };
|
|
428
|
+
const P = (pts, s, amp = 1.7) => wobble(seg(pts), nz, s, amp);
|
|
429
|
+
const prog = (it) => H.clamp((t - it.t0) / it.dur);
|
|
430
|
+
|
|
431
|
+
// Title + double blue underline
|
|
432
|
+
add(1.0, (p) => mText(ctx, 'HOW AI LEARNS', 84, 124, '400 66px "Permanent Marker"', K, 3, p, -0.012));
|
|
433
|
+
add(0.25, (p) => marker(ctx, P([[80, 150], [300, 146], [560, 141]], 1, 2.2), B, 8, 101, p));
|
|
434
|
+
add(0.2, (p) => marker(ctx, P([[96, 164], [330, 159], [520, 156]], 2, 2.2), B, 7, 102, p));
|
|
435
|
+
|
|
436
|
+
// DATA — database cylinder
|
|
437
|
+
const cx = 196;
|
|
438
|
+
add(0.25, (p) => marker(ctx, P(ell(cx, 272, 72, 21, -2.8, 3.62, 0.02), 3, 1.1), K, 7, 103, p));
|
|
439
|
+
add(0.18, (p) => marker(ctx, P([[cx - 72, 270], [cx - 70, 412]], 4), K, 7, 104, p));
|
|
440
|
+
add(0.18, (p) => marker(ctx, P([[cx + 72, 274], [cx + 71, 410]], 5), K, 7, 105, p));
|
|
441
|
+
add(0.18, (p) => marker(ctx, P(ell(cx, 410, 71, 21, Math.PI, 0, 0.0).reverse(), 6, 1.0), K, 7, 106, p));
|
|
442
|
+
add(0.14, (p) => marker(ctx, P(ell(cx, 320, 71, 20, Math.PI, 0).reverse(), 7, 1.0), K, 6, 107, p));
|
|
443
|
+
add(0.14, (p) => marker(ctx, P(ell(cx, 366, 71, 20, Math.PI, 0).reverse(), 8, 1.0), K, 6, 108, p));
|
|
444
|
+
add(0.4, (p) => mText(ctx, 'DATA', cx - 52, 478, '700 42px "Kalam"', K, 9, p));
|
|
445
|
+
|
|
446
|
+
// arrow data -> model
|
|
447
|
+
const arrow = (pts, col, w, s, headLen = 22) => {
|
|
448
|
+
const L = P(pts, s, 1.5), a = L[L.length - 1], b = L[L.length - 6];
|
|
449
|
+
const ang = Math.atan2(a[1] - b[1], a[0] - b[0]);
|
|
450
|
+
add(0.22, (p) => marker(ctx, L, col, w, s * 7, p));
|
|
451
|
+
add(0.12, (p) => marker(ctx, P([[a[0] - Math.cos(ang - 0.5) * headLen, a[1] - Math.sin(ang - 0.5) * headLen], a], s + 50, 0.6), col, w, s * 7 + 1, p));
|
|
452
|
+
add(0.12, (p) => marker(ctx, P([[a[0] - Math.cos(ang + 0.5) * headLen, a[1] - Math.sin(ang + 0.5) * headLen], [a[0] + 1, a[1] + 1]], s + 51, 0.6), col, w, s * 7 + 2, p));
|
|
453
|
+
};
|
|
454
|
+
arrow([[292, 340], [360, 336], [418, 340]], K, 7, 10);
|
|
455
|
+
|
|
456
|
+
// MODEL — neural net in blue
|
|
457
|
+
const cols = [[490, [252, 340, 428]], [612, [222, 300, 380, 458]], [734, [290, 392]]];
|
|
458
|
+
const nodes = cols.map(([x, ys]) => ys.map((y) => [x, y]));
|
|
459
|
+
const rN = 21;
|
|
460
|
+
const links = [];
|
|
461
|
+
for (let c = 0; c < 2; c++) for (const a of nodes[c]) for (const b of nodes[c + 1]) links.push([a, b]);
|
|
462
|
+
nodes.flat().forEach(([x, y], i) => {
|
|
463
|
+
add(0.09, (p) => marker(ctx, P(ell(x, y, rN, rN, -1.9 + i, -1.9 + i + Math.PI * 2.15, 0.06), 400 + i, 0.8), B, 5.5, 500 + i, p));
|
|
464
|
+
});
|
|
465
|
+
add(0.9, (p) => {
|
|
466
|
+
links.forEach(([a, b], i) => {
|
|
467
|
+
const d = Math.hypot(b[0] - a[0], b[1] - a[1]), ux = (b[0] - a[0]) / d, uy = (b[1] - a[1]) / d;
|
|
468
|
+
const lp = H.clamp(p * links.length - i * 0.6);
|
|
469
|
+
marker(ctx, P([[a[0] + ux * (rN + 3), a[1] + uy * (rN + 3)], [b[0] - ux * (rN + 3), b[1] - uy * (rN + 3)]], 200 + i, 1.0), B, 3.6, 300 + i, lp);
|
|
470
|
+
});
|
|
471
|
+
});
|
|
472
|
+
add(0.4, (p) => mText(ctx, 'neural net', 520, 530, '700 38px "Kalam"', B, 12, p, 0.01));
|
|
473
|
+
|
|
474
|
+
arrow([[772, 342], [830, 338], [876, 341]], K, 7, 11);
|
|
475
|
+
|
|
476
|
+
// OUTPUT — green box, double traced
|
|
477
|
+
const box = (x0, y0, x1, y1, s) => [[x0 - 6, y0 + 2], [x1 + 4, y0 - 2], [x1 + 1, y1 + 6], [x0 + 2, y1 + 1], [x0 + 1, y0 - 8]];
|
|
478
|
+
add(0.45, (p) => marker(ctx, P(box(900, 278, 1150, 404), 13, 2.0), G, 7, 600, p));
|
|
479
|
+
add(0.35, (p) => marker(ctx, P(box(905, 284, 1146, 398).map(([x, y]) => [x + 3, y - 2]), 14, 2.4), G, 5, 601, p));
|
|
480
|
+
// cat doodle
|
|
481
|
+
add(0.18, (p) => marker(ctx, P(ell(966, 350, 34, 30, -1.2, 5.3), 15, 0.8), K, 5, 602, p));
|
|
482
|
+
add(0.1, (p) => marker(ctx, P([[940, 330], [944, 300], [962, 320]], 16, 0.4), K, 5, 603, p));
|
|
483
|
+
add(0.1, (p) => marker(ctx, P([[972, 320], [990, 298], [994, 330]], 17, 0.4), K, 5, 604, p));
|
|
484
|
+
add(0.06, (p) => { if (p > 0) { ctx.fillStyle = H.rgba(K, 0.85); ctx.beginPath(); ctx.arc(955, 346, 3.4, 0, 7); ctx.arc(978, 346, 3.4, 0, 7); ctx.fill(); } });
|
|
485
|
+
add(0.12, (p) => marker(ctx, P([[960, 362], [966, 367], [972, 362]], 18, 0.3), K, 3, 605, p));
|
|
486
|
+
add(0.12, (p) => { marker(ctx, P([[938, 358], [912, 354]], 19, 0.3), K, 2.6, 606, p); marker(ctx, P([[994, 358], [1020, 354]], 20, 0.3), K, 2.6, 607, p); });
|
|
487
|
+
add(0.4, (p) => mText(ctx, '92%', 1030, 368, '400 40px "Permanent Marker"', G, 21, p));
|
|
488
|
+
add(0.4, (p) => mText(ctx, 'prediction', 918, 252, '700 36px "Kalam"', G, 22, p, -0.02));
|
|
489
|
+
// check mark
|
|
490
|
+
add(0.2, (p) => marker(ctx, P([[1112, 222], [1126, 244], [1166, 182]], 23, 0.8), G, 8, 608, p));
|
|
491
|
+
|
|
492
|
+
// feedback loop in red
|
|
493
|
+
const loop = P(bez([1020, 418], [1026, 600], [770, 610], [748, 430]), 24, 2.0);
|
|
494
|
+
add(0.5, (p) => marker(ctx, loop, R, 7, 700, p));
|
|
495
|
+
{
|
|
496
|
+
const a = loop[loop.length - 1], b = loop[loop.length - 8], ang = Math.atan2(a[1] - b[1], a[0] - b[0]);
|
|
497
|
+
add(0.12, (p) => marker(ctx, P([[a[0] - Math.cos(ang - 0.55) * 24, a[1] - Math.sin(ang - 0.55) * 24], a], 25, 0.5), R, 7, 701, p));
|
|
498
|
+
add(0.12, (p) => marker(ctx, P([[a[0] - Math.cos(ang + 0.55) * 24, a[1] - Math.sin(ang + 0.55) * 24], a], 26, 0.5), R, 7, 702, p));
|
|
499
|
+
}
|
|
500
|
+
add(0.5, (p) => mText(ctx, 'fix the error', 770, 626, '700 38px "Kalam"', R, 27, p, -0.03));
|
|
501
|
+
add(0.3, (p) => mText(ctx, '& repeat!', 1050, 520, '700 34px "Kalam"', R, 28, p, -0.06));
|
|
502
|
+
// a red emphasis tick next to the title
|
|
503
|
+
add(0.15, (p) => marker(ctx, P([[648, 74], [651, 112]], 29, 0.6), R, 7, 703, p));
|
|
504
|
+
add(0.08, (p) => { if (p > 0) { ctx.fillStyle = H.rgba(R, 0.8); ctx.beginPath(); ctx.arc(653, 128, 4.5, 0, 7); ctx.fill(); } });
|
|
505
|
+
|
|
506
|
+
const sc = 4.1 / clock;
|
|
507
|
+
TIP = null;
|
|
508
|
+
items.forEach((it) => { it.t0 *= sc; it.dur *= sc; });
|
|
509
|
+
items.forEach((it) => it.fn(prog(it)));
|
|
510
|
+
|
|
511
|
+
// ---------- gloss / sheen (sits over ink too) ----------
|
|
512
|
+
ctx.save();
|
|
513
|
+
const sh = ctx.createLinearGradient(220 + t * 6, -60, 760 + t * 6, 760);
|
|
514
|
+
sh.addColorStop(0.0, 'rgba(255,255,255,0)');
|
|
515
|
+
sh.addColorStop(0.36, 'rgba(255,255,255,0)');
|
|
516
|
+
sh.addColorStop(0.43, 'rgba(255,255,255,0.26)');
|
|
517
|
+
sh.addColorStop(0.47, 'rgba(255,255,255,0.12)');
|
|
518
|
+
sh.addColorStop(0.5, 'rgba(255,255,255,0.3)');
|
|
519
|
+
sh.addColorStop(0.58, 'rgba(255,255,255,0)');
|
|
520
|
+
sh.addColorStop(1, 'rgba(255,255,255,0)');
|
|
521
|
+
ctx.fillStyle = sh; ctx.fillRect(0, 0, W, H_);
|
|
522
|
+
// ceiling light reflections
|
|
523
|
+
[[380, 70, 260, 26], [930, 66, 230, 22]].forEach(([x, y, rx, ry]) => {
|
|
524
|
+
ctx.save(); ctx.translate(x, y); ctx.scale(1, ry / rx);
|
|
525
|
+
const g = ctx.createRadialGradient(0, 0, 0, 0, 0, rx);
|
|
526
|
+
g.addColorStop(0, 'rgba(255,255,255,0.55)'); g.addColorStop(0.5, 'rgba(255,255,255,0.18)'); g.addColorStop(1, 'rgba(255,255,255,0)');
|
|
527
|
+
ctx.fillStyle = g; ctx.beginPath(); ctx.arc(0, 0, rx, 0, 7); ctx.fill(); ctx.restore();
|
|
528
|
+
});
|
|
529
|
+
// darker falloff at bottom of board
|
|
530
|
+
const fo = ctx.createLinearGradient(0, BY1 - 200, 0, BY1);
|
|
531
|
+
fo.addColorStop(0, 'rgba(60,70,80,0)'); fo.addColorStop(1, 'rgba(60,70,80,0.07)');
|
|
532
|
+
ctx.fillStyle = fo; ctx.fillRect(0, BY1 - 200, W, 200);
|
|
533
|
+
ctx.restore();
|
|
534
|
+
|
|
535
|
+
// ---------- the marker in hand while drawing ----------
|
|
536
|
+
if (TIP) {
|
|
537
|
+
const [tx, ty, col] = TIP, ang = 0.95, len = 230;
|
|
538
|
+
ctx.save();
|
|
539
|
+
// soft shadow cast on the board
|
|
540
|
+
ctx.save(); ctx.filter = 'blur(8px)'; ctx.fillStyle = 'rgba(40,50,60,0.25)';
|
|
541
|
+
ctx.translate(tx + 14, ty + 18); ctx.rotate(ang); ctx.beginPath(); ctx.roundRect(8, -14, len, 28, 12); ctx.fill(); ctx.restore();
|
|
542
|
+
ctx.translate(tx, ty); ctx.rotate(ang);
|
|
543
|
+
// chisel nib
|
|
544
|
+
ctx.fillStyle = col; ctx.beginPath(); ctx.moveTo(-2, -3); ctx.lineTo(16, -6); ctx.lineTo(16, 6); ctx.lineTo(-2, 2); ctx.closePath(); ctx.fill();
|
|
545
|
+
// collar + barrel
|
|
546
|
+
const g = ctx.createLinearGradient(0, -14, 0, 14);
|
|
547
|
+
g.addColorStop(0, '#ffffff'); g.addColorStop(0.4, '#e4e6e8'); g.addColorStop(1, '#9ea3a8');
|
|
548
|
+
ctx.fillStyle = '#c9ccd0'; ctx.beginPath(); ctx.roundRect(14, -9, 20, 18, 4); ctx.fill();
|
|
549
|
+
ctx.fillStyle = g; ctx.beginPath(); ctx.roundRect(32, -14, len - 32, 28, 10); ctx.fill();
|
|
550
|
+
ctx.fillStyle = col; ctx.fillRect(len - 52, -14, 40, 28);
|
|
551
|
+
ctx.fillStyle = 'rgba(255,255,255,0.55)'; ctx.fillRect(40, -9, len - 100, 4);
|
|
552
|
+
ctx.fillStyle = H.rgba(col, 0.85); ctx.fillRect(70, -2, 60, 5);
|
|
553
|
+
ctx.restore();
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
// ---------- aluminium frame + tray ----------
|
|
557
|
+
ctx.save();
|
|
558
|
+
// inner shadow on board
|
|
559
|
+
const inner = (x, y, w, h, dir) => {
|
|
560
|
+
const g = dir === 'v' ? ctx.createLinearGradient(x, y, x, y + h) : ctx.createLinearGradient(x, y, x + w, y);
|
|
561
|
+
g.addColorStop(0, 'rgba(40,45,55,0.16)'); g.addColorStop(1, 'rgba(40,45,55,0)');
|
|
562
|
+
ctx.fillStyle = g; ctx.fillRect(x, y, w, h);
|
|
563
|
+
};
|
|
564
|
+
inner(BX0, BY0, BX1 - BX0, 10, 'v'); inner(BX0, BY0, 8, BY1 - BY0, 'h');
|
|
565
|
+
const metal = (g) => {
|
|
566
|
+
g.addColorStop(0, '#f4f5f6'); g.addColorStop(0.35, '#c6cace'); g.addColorStop(0.55, '#e7e9eb'); g.addColorStop(0.8, '#a3a8ae'); g.addColorStop(1, '#7c8187');
|
|
567
|
+
return g;
|
|
568
|
+
};
|
|
569
|
+
ctx.fillStyle = metal(ctx.createLinearGradient(0, 0, 0, BY0)); ctx.fillRect(0, 0, W, BY0);
|
|
570
|
+
ctx.fillStyle = metal(ctx.createLinearGradient(0, 0, BX0, 0)); ctx.fillRect(0, 0, BX0, BY1);
|
|
571
|
+
ctx.fillStyle = metal(ctx.createLinearGradient(W, 0, BX1, 0)); ctx.fillRect(BX1, 0, W - BX1, BY1);
|
|
572
|
+
ctx.strokeStyle = 'rgba(70,75,82,0.6)'; ctx.lineWidth = 1.5; ctx.strokeRect(BX0 - 0.5, BY0 - 0.5, BX1 - BX0 + 1, BY1 - BY0 + 1);
|
|
573
|
+
// grey corner caps
|
|
574
|
+
[[0, 1], [W, -1]].forEach(([x, sx]) => {
|
|
575
|
+
ctx.save(); ctx.translate(x, 0); ctx.scale(sx, 1);
|
|
576
|
+
const g = ctx.createLinearGradient(0, 0, 40, 40); g.addColorStop(0, '#6b6f75'); g.addColorStop(1, '#3d4045');
|
|
577
|
+
ctx.fillStyle = g; ctx.beginPath(); ctx.moveTo(0, 0); ctx.lineTo(42, 0); ctx.lineTo(42, 14); ctx.quadraticCurveTo(42, 42, 14, 42); ctx.lineTo(0, 42); ctx.closePath(); ctx.fill();
|
|
578
|
+
ctx.restore();
|
|
579
|
+
});
|
|
580
|
+
// tray: interior well + front lip
|
|
581
|
+
const tg = ctx.createLinearGradient(0, BY1, 0, 694);
|
|
582
|
+
tg.addColorStop(0, '#6f747b'); tg.addColorStop(0.4, '#9ca1a7'); tg.addColorStop(1, '#c3c7cb');
|
|
583
|
+
ctx.fillStyle = tg; ctx.fillRect(0, BY1, W, 694 - BY1);
|
|
584
|
+
// markers lying in tray
|
|
585
|
+
const mk = (x, len, body, cap, rot) => {
|
|
586
|
+
ctx.save(); ctx.translate(x, 674); ctx.rotate(rot);
|
|
587
|
+
const shg = ctx.createRadialGradient(len / 2, 12, 2, len / 2, 12, len / 2);
|
|
588
|
+
shg.addColorStop(0, 'rgba(0,0,0,0.35)'); shg.addColorStop(1, 'rgba(0,0,0,0)');
|
|
589
|
+
ctx.fillStyle = shg; ctx.fillRect(-10, 0, len + 20, 22);
|
|
590
|
+
const bg2 = ctx.createLinearGradient(0, -11, 0, 11);
|
|
591
|
+
bg2.addColorStop(0, H.rgba(H.mix(body, '#ffffff', 0.35))); bg2.addColorStop(0.35, body); bg2.addColorStop(1, H.rgba(H.mix(body, '#000000', 0.5)));
|
|
592
|
+
ctx.fillStyle = bg2; ctx.beginPath(); ctx.roundRect(0, -11, len * 0.72, 22, 8); ctx.fill();
|
|
593
|
+
const cg = ctx.createLinearGradient(0, -12, 0, 12);
|
|
594
|
+
cg.addColorStop(0, H.rgba(H.mix(cap, '#ffffff', 0.4))); cg.addColorStop(0.35, cap); cg.addColorStop(1, H.rgba(H.mix(cap, '#000000', 0.5)));
|
|
595
|
+
ctx.fillStyle = cg; ctx.beginPath(); ctx.roundRect(len * 0.7, -12, len * 0.3, 24, 9); ctx.fill();
|
|
596
|
+
ctx.fillStyle = 'rgba(255,255,255,0.75)'; ctx.fillRect(len * 0.18, -5, len * 0.3, 7);
|
|
597
|
+
ctx.fillStyle = cap; ctx.fillRect(len * 0.21, -3, len * 0.12, 3);
|
|
598
|
+
ctx.restore();
|
|
599
|
+
};
|
|
600
|
+
mk(860, 150, '#e9eaec', '#1f4fc2', -0.02);
|
|
601
|
+
mk(1040, 150, '#e9eaec', '#1d1f26', 0.015);
|
|
602
|
+
// felt eraser
|
|
603
|
+
ctx.save(); ctx.translate(180, 668);
|
|
604
|
+
ctx.fillStyle = 'rgba(0,0,0,0.3)'; ctx.fillRect(4, 10, 150, 18);
|
|
605
|
+
const eg = ctx.createLinearGradient(0, -14, 0, 14); eg.addColorStop(0, '#5b6470'); eg.addColorStop(1, '#2c323a');
|
|
606
|
+
ctx.fillStyle = eg; ctx.beginPath(); ctx.roundRect(0, -14, 150, 26, 5); ctx.fill();
|
|
607
|
+
ctx.fillStyle = '#3e3e3e'; ctx.fillRect(4, 10, 142, 6);
|
|
608
|
+
ctx.restore();
|
|
609
|
+
const lg = ctx.createLinearGradient(0, 692, 0, H_);
|
|
610
|
+
lg.addColorStop(0, '#f0f2f3'); lg.addColorStop(0.3, '#cfd3d7'); lg.addColorStop(0.75, '#a2a7ad'); lg.addColorStop(1, '#73787e');
|
|
611
|
+
ctx.fillStyle = lg; ctx.fillRect(0, 692, W, H_ - 692);
|
|
612
|
+
ctx.fillStyle = 'rgba(255,255,255,0.7)'; ctx.fillRect(0, 692, W, 1.5);
|
|
613
|
+
ctx.restore();
|
|
614
|
+
|
|
615
|
+
H.grain(ctx, W, H_, 0.018, 9 + Math.floor(t * 12));
|
|
616
|
+
},
|
|
617
|
+
// >>>EXPLAINER
|
|
618
|
+
explainerDuration: 15,
|
|
619
|
+
explainerNote: 'A marker in hand draws the diagram while the camera follows it across one big board; the felt eraser wipes the loop away (leaving ghost residue) to make room for the accuracy chart, and numbers are re-scrawled in marker.',
|
|
620
|
+
explainer(ctx, W, H_, t) {
|
|
621
|
+
const nz = H.makeNoise(11);
|
|
622
|
+
const COLS = { ink: '#1d1f26', acc1: '#1f4fc2', acc2: '#d4262f', acc3: '#16884a' };
|
|
623
|
+
const FONT = { title: '"Permanent Marker"', label: '"Kalam"', num: '"Permanent Marker"' };
|
|
624
|
+
const FW = { title: 400, label: 700, num: 400 };
|
|
625
|
+
const D = [2560, 640];
|
|
626
|
+
const L = {
|
|
627
|
+
D, pT: 11.0, kT: 13.05,
|
|
628
|
+
model: (cx, cy, adj, push, api, tt) => {
|
|
629
|
+
const g = 'M';
|
|
630
|
+
api.line(XE.rrect(cx - 170, cy - 152, 340, 330, 34), 'ink', 6, 2.5, 2.85, g);
|
|
631
|
+
const cols = [[cx - 110, [-110, -50, 10]], [cx, [-125, -75, -25, 25]], [cx + 110, [-90, -10]]];
|
|
632
|
+
const nodes = cols.map(([x, ys]) => ys.map((y) => [x, cy + y]));
|
|
633
|
+
let li = 0;
|
|
634
|
+
for (let c = 0; c < 2; c++) for (const a of nodes[c]) for (const b of nodes[c + 1]) {
|
|
635
|
+
const d = Math.hypot(b[0] - a[0], b[1] - a[1]), ux = (b[0] - a[0]) / d, uy = (b[1] - a[1]) / d;
|
|
636
|
+
const P = [[a[0] + ux * 16, a[1] + uy * 16], [b[0] - ux * 16, b[1] - uy * 16]];
|
|
637
|
+
api.line(P, 'acc1', 2.6, 2.95 + li * 0.012, 3.05 + li * 0.012, g);
|
|
638
|
+
if ([1, 6, 9, 15].includes(li)) api.line(P, 'acc3', 6, 9.15 + li * 0.01, 9.3 + li * 0.01, g); // strengthened weights
|
|
639
|
+
li++;
|
|
640
|
+
}
|
|
641
|
+
nodes.flat().forEach(([x, y], i) => api.line(XE.circ(x, y, 14, 14, -1.6 + i, -1.6 + i + 6.6), 'acc1', 4.5, 2.8 + i * 0.015, 2.88 + i * 0.015, g));
|
|
642
|
+
// three weight knobs
|
|
643
|
+
[-1, 0, 1].forEach((k, i) => {
|
|
644
|
+
const x = cx + k * 92, y = cy + 98;
|
|
645
|
+
api.line(XE.circ(x, y, 26, 26, -1.2, 5.2), 'ink', 4, 3.0 + i * 0.05, 3.12 + i * 0.05, g);
|
|
646
|
+
if (tt > 3.15 + i * 0.05) {
|
|
647
|
+
const a0 = [-2.4, -0.6, -1.9][i], a1 = [-0.7, -2.2, -0.4][i];
|
|
648
|
+
const a = a0 + (a1 - a0) * adj + Math.sin(adj * Math.PI) * 0.25;
|
|
649
|
+
push({ k: 'line', pts: [[x, y], [x + Math.cos(a) * 20, y + Math.sin(a) * 20]], role: adj > 0 && adj < 1 ? 'acc2' : 'ink', w: 4.5, a: -1, b: 0, inst: true, g });
|
|
650
|
+
}
|
|
651
|
+
});
|
|
652
|
+
api.text('weights', cx, cy + 158, 30, 'label', 'ink', 3.2, 3.35, { align: 'center', g });
|
|
653
|
+
},
|
|
654
|
+
};
|
|
655
|
+
const items = XE.story(t, L);
|
|
656
|
+
const cam = XE.camAt([[0, 640, 360, 1.0], [2.0, 650, 362, 1.05], [2.8, 1830, 610, 0.95], [5.95, 1860, 620, 0.97], [6.55, 2580, 640, 0.9], [10.3, 2600, 645, 0.93],
|
|
657
|
+
[10.95, 2560, 660, 0.92], [12.9, 2570, 670, 0.95], [13.6, 2560, 760, 0.88], [15, 2560, 760, 0.9]], t);
|
|
658
|
+
const apply = (c) => { c.translate(W / 2, H_ / 2); c.scale(cam[2], cam[2]); c.translate(-cam[0], -cam[1]); };
|
|
659
|
+
const toS = ([x, y]) => [(x - cam[0]) * cam[2] + W / 2, (y - cam[1]) * cam[2] + H_ / 2];
|
|
660
|
+
|
|
661
|
+
// ---------- board ----------
|
|
662
|
+
const bg = ctx.createLinearGradient(0, 0, W, H_);
|
|
663
|
+
bg.addColorStop(0, '#f6f8f7'); bg.addColorStop(0.55, '#ecefee'); bg.addColorStop(1, '#dfe4e3');
|
|
664
|
+
ctx.fillStyle = bg; ctx.fillRect(0, 0, W, H_);
|
|
665
|
+
ctx.save(); apply(ctx);
|
|
666
|
+
{ // faint residue blotches fixed to the board
|
|
667
|
+
const rb = H.rng(5);
|
|
668
|
+
for (let i = 0; i < 40; i++) {
|
|
669
|
+
const x = rb.range(-200, 3600), y = rb.range(-200, 1400), rr = rb.range(80, 260);
|
|
670
|
+
const g = ctx.createRadialGradient(x, y, 0, x, y, rr);
|
|
671
|
+
g.addColorStop(0, `rgba(150,160,165,${rb.range(0.02, 0.045)})`); g.addColorStop(1, 'rgba(150,160,165,0)');
|
|
672
|
+
ctx.fillStyle = g; ctx.fillRect(x - rr, y - rr, rr * 2, rr * 2);
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
{ // ghosts of earlier, half-erased lessons in the empty parts of the board (cached, world space)
|
|
676
|
+
const G = ghostBoard();
|
|
677
|
+
ctx.drawImage(G.cv, G.x0, G.y0, G.w, G.h);
|
|
678
|
+
}
|
|
679
|
+
ctx.restore();
|
|
680
|
+
|
|
681
|
+
const measure = (it, p) => {
|
|
682
|
+
ctx.save(); ctx.font = `${FW[it.font]} ${it.size}px ${FONT[it.font]}`;
|
|
683
|
+
const w = ctx.measureText(it.s).width, x0 = it.align === 'center' ? it.x - w / 2 : it.x;
|
|
684
|
+
const w2 = ctx.measureText(it.s.slice(0, Math.ceil(it.s.length * p))).width; ctx.restore();
|
|
685
|
+
return [x0 + w2, it.y - it.size * 0.35];
|
|
686
|
+
};
|
|
687
|
+
const drawItem = (c, it) => {
|
|
688
|
+
const p = it.inst ? 1 : XE.win(t, it.a, it.b);
|
|
689
|
+
if (p <= 0) return;
|
|
690
|
+
const col = COLS[it.role];
|
|
691
|
+
if (it.k === 'line') {
|
|
692
|
+
const seed = ((it.pts[0][0] * 13 + it.pts[0][1] * 7) | 0) + 17;
|
|
693
|
+
const P = wobble(seg(it.pts, 2.5), nz, seed % 97, it.inst ? 0.6 : 1.4);
|
|
694
|
+
marker(c, P, col, it.w * 1.25, seed, p);
|
|
695
|
+
} else if (it.k === 'dot') {
|
|
696
|
+
c.fillStyle = H.rgba(col, 0.85); c.beginPath(); c.arc(it.x, it.y, it.r, 0, 7); c.fill();
|
|
697
|
+
} else {
|
|
698
|
+
const font = `${FW[it.font]} ${it.size}px ${FONT[it.font]}`;
|
|
699
|
+
c.save(); c.font = font; const w = c.measureText(it.s).width; c.restore();
|
|
700
|
+
const x0 = it.align === 'center' ? it.x - w / 2 : it.x;
|
|
701
|
+
mText(c, it.s, x0, it.y, font, col, (it.s.length * 31 + (it.x | 0)) % 991, p, it.rot);
|
|
702
|
+
}
|
|
703
|
+
};
|
|
704
|
+
// loop scene + model get erased later: keep them on their own layer
|
|
705
|
+
const ERASE0 = 10.35, ERASE1 = 11.0;
|
|
706
|
+
const E = H.layer(W, H_), ec = E.getContext('2d');
|
|
707
|
+
ec.save(); apply(ec);
|
|
708
|
+
ctx.save(); apply(ctx);
|
|
709
|
+
TIP = null;
|
|
710
|
+
for (const it of items) drawItem((it.g === 'C' || it.g === 'M') ? ec : ctx, it);
|
|
711
|
+
ctx.restore(); ec.restore();
|
|
712
|
+
// eraser: back-and-forth felt swipes over the loop region
|
|
713
|
+
let eraserAt = null;
|
|
714
|
+
if (t > ERASE0) {
|
|
715
|
+
const u = XE.win(t, ERASE0, ERASE1), path = [];
|
|
716
|
+
const x0 = 2040, x1 = 3060, y0 = 250, y1 = 1050, rows = 7;
|
|
717
|
+
for (let r = 0; r <= rows; r++) { const y = y0 + (y1 - y0) * r / rows; path.push(r % 2 ? [x1, y] : [x0, y]); path.push(r % 2 ? [x0, y + 10] : [x1, y + 10]); }
|
|
718
|
+
const P = seg(path, 12), n = Math.max(2, Math.ceil(P.length * u));
|
|
719
|
+
const wipe = (c2, m) => {
|
|
720
|
+
c2.lineCap = 'round'; c2.lineJoin = 'round';
|
|
721
|
+
const sweep = (dy) => { c2.beginPath(); P.slice(0, m).forEach(([x, y], i) => (i ? c2.lineTo(x, y + dy) : c2.moveTo(x, y + dy))); c2.stroke(); };
|
|
722
|
+
c2.strokeStyle = 'rgba(0,0,0,0.95)'; c2.lineWidth = 135; sweep(0);
|
|
723
|
+
// felt fibres: streaky bands that lift more of the ink, leaving 0-5% ghost residue in swipe stripes
|
|
724
|
+
for (const f of FIBRES) { c2.strokeStyle = `rgba(0,0,0,${f.a})`; c2.lineWidth = f.w; sweep(f.dy); }
|
|
725
|
+
};
|
|
726
|
+
ec.save(); apply(ec); ec.globalCompositeOperation = 'destination-out';
|
|
727
|
+
if (u < 1) wipe(ec, n);
|
|
728
|
+
else { // finished wipe is static: bake its mask once in world space and reuse it
|
|
729
|
+
if (!XC.wipe) {
|
|
730
|
+
const mx0 = 1940, my0 = 160, mw = 1200, mh = 980, s = 0.5;
|
|
731
|
+
const mcv = H.layer(mw * s, mh * s), mc = mcv.getContext('2d');
|
|
732
|
+
mc.scale(s, s); mc.translate(-mx0, -my0); wipe(mc, P.length);
|
|
733
|
+
XC.wipe = { cv: mcv, mx0, my0, mw, mh };
|
|
734
|
+
}
|
|
735
|
+
const Wp = XC.wipe; ec.drawImage(Wp.cv, Wp.mx0, Wp.my0, Wp.mw, Wp.mh);
|
|
736
|
+
}
|
|
737
|
+
ec.restore();
|
|
738
|
+
if (u < 1) eraserAt = toS(P[n - 1]);
|
|
739
|
+
}
|
|
740
|
+
ctx.drawImage(E, 0, 0);
|
|
741
|
+
if (t > ERASE0) { // grey eraser haze left on the wiped area, building up with the passes
|
|
742
|
+
if (!XC.haze) {
|
|
743
|
+
const hx0 = 1960, hy0 = 200, hw = 1180, hh = 900, s = 0.5;
|
|
744
|
+
const hc = H.layer(hw * s, hh * s), c = hc.getContext('2d'), rh = H.rng(79);
|
|
745
|
+
c.scale(s, s); c.translate(-hx0, -hy0); c.lineCap = 'round'; c.filter = 'blur(6px)';
|
|
746
|
+
for (let i = 0; i < 16; i++) {
|
|
747
|
+
const x = rh.range(2150, 2950), y = rh.range(280, 1040);
|
|
748
|
+
c.strokeStyle = `rgba(120,128,135,${rh.range(0.007, 0.016)})`; c.lineWidth = rh.range(40, 90);
|
|
749
|
+
c.beginPath(); c.moveTo(x - 200, y); c.quadraticCurveTo(x, y + rh.range(-25, 25), x + 200, y + rh.range(-12, 12)); c.stroke();
|
|
750
|
+
}
|
|
751
|
+
XC.haze = { cv: hc, hx0, hy0, hw, hh };
|
|
752
|
+
}
|
|
753
|
+
const Z = XC.haze;
|
|
754
|
+
ctx.save(); apply(ctx); ctx.globalAlpha = XE.win(t, ERASE0, ERASE1);
|
|
755
|
+
ctx.drawImage(Z.cv, Z.hx0, Z.hy0, Z.hw, Z.hh); ctx.restore();
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
// ---------- gloss ----------
|
|
759
|
+
const sh = ctx.createLinearGradient(220 - cam[0] * 0.15, -60, 760 - cam[0] * 0.15, 760);
|
|
760
|
+
sh.addColorStop(0, 'rgba(255,255,255,0)'); sh.addColorStop(0.4, 'rgba(255,255,255,0)'); sh.addColorStop(0.46, 'rgba(255,255,255,0.22)');
|
|
761
|
+
sh.addColorStop(0.5, 'rgba(255,255,255,0.1)'); sh.addColorStop(0.53, 'rgba(255,255,255,0.24)'); sh.addColorStop(0.6, 'rgba(255,255,255,0)'); sh.addColorStop(1, 'rgba(255,255,255,0)');
|
|
762
|
+
ctx.fillStyle = sh; ctx.fillRect(0, 0, W, H_);
|
|
763
|
+
// ceiling-light reflections (a row of fixtures sliding by with parallax as the camera travels)
|
|
764
|
+
{
|
|
765
|
+
const off = -(cam[0] - 640) * 0.15;
|
|
766
|
+
for (let i = 0; i < 4; i++) {
|
|
767
|
+
const x = 380 + i * 550 + off, rx = i % 2 ? 230 : 260, ry = i % 2 ? 22 : 26, y = i % 2 ? 66 : 70;
|
|
768
|
+
if (x + rx < 0 || x - rx > W) continue;
|
|
769
|
+
ctx.save(); ctx.translate(x, y); ctx.scale(1, ry / rx);
|
|
770
|
+
const g = ctx.createRadialGradient(0, 0, 0, 0, 0, rx);
|
|
771
|
+
g.addColorStop(0, 'rgba(255,255,255,0.55)'); g.addColorStop(0.5, 'rgba(255,255,255,0.18)'); g.addColorStop(1, 'rgba(255,255,255,0)');
|
|
772
|
+
ctx.fillStyle = g; ctx.beginPath(); ctx.arc(0, 0, rx, 0, 7); ctx.fill(); ctx.restore();
|
|
773
|
+
}
|
|
774
|
+
// darker falloff toward the bottom of the board, away from the lights
|
|
775
|
+
const fo = ctx.createLinearGradient(0, H_ - 240, 0, H_);
|
|
776
|
+
fo.addColorStop(0, 'rgba(60,70,80,0)'); fo.addColorStop(1, 'rgba(60,70,80,0.08)');
|
|
777
|
+
ctx.fillStyle = fo; ctx.fillRect(0, H_ - 240, W, 240);
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
// ---------- tools ----------
|
|
781
|
+
if (eraserAt) {
|
|
782
|
+
const [ex, ey] = eraserAt;
|
|
783
|
+
ctx.save(); ctx.translate(ex, ey); ctx.rotate(-0.08);
|
|
784
|
+
ctx.save(); ctx.filter = 'blur(8px)'; ctx.fillStyle = 'rgba(30,40,50,0.3)'; ctx.fillRect(-70, -34, 160, 80); ctx.restore();
|
|
785
|
+
const eg = ctx.createLinearGradient(0, -40, 0, 30); eg.addColorStop(0, '#6a7480'); eg.addColorStop(1, '#2c323a');
|
|
786
|
+
ctx.fillStyle = eg; ctx.beginPath(); ctx.roundRect(-80, -42, 160, 66, 10); ctx.fill();
|
|
787
|
+
ctx.fillStyle = '#3b3b3b'; ctx.fillRect(-78, 18, 156, 14);
|
|
788
|
+
ctx.fillStyle = 'rgba(255,255,255,0.25)'; ctx.fillRect(-70, -36, 140, 5);
|
|
789
|
+
ctx.restore();
|
|
790
|
+
} else {
|
|
791
|
+
const tp = XE.tipOf(items, t, measure);
|
|
792
|
+
if (tp) {
|
|
793
|
+
const [tx, ty] = toS(tp), it = items.find((q) => !q.inst && XE.win(t, q.a, q.b) > 0 && XE.win(t, q.a, q.b) < 1 && q.k !== 'dot');
|
|
794
|
+
const col = COLS[(items.filter((q) => !q.inst && q.k !== 'dot' && XE.win(t, q.a, q.b) > 0 && XE.win(t, q.a, q.b) < 1).pop() || it || { role: 'ink' }).role];
|
|
795
|
+
const ang = 0.95, len = 230;
|
|
796
|
+
ctx.save();
|
|
797
|
+
ctx.save(); ctx.filter = 'blur(8px)'; ctx.fillStyle = 'rgba(40,50,60,0.25)'; ctx.translate(tx + 14, ty + 18); ctx.rotate(ang); ctx.beginPath(); ctx.roundRect(8, -14, len, 28, 12); ctx.fill(); ctx.restore();
|
|
798
|
+
ctx.translate(tx, ty); ctx.rotate(ang);
|
|
799
|
+
ctx.fillStyle = col; ctx.beginPath(); ctx.moveTo(-2, -3); ctx.lineTo(16, -6); ctx.lineTo(16, 6); ctx.lineTo(-2, 2); ctx.closePath(); ctx.fill();
|
|
800
|
+
const g = ctx.createLinearGradient(0, -14, 0, 14); g.addColorStop(0, '#ffffff'); g.addColorStop(0.4, '#e4e6e8'); g.addColorStop(1, '#9ea3a8');
|
|
801
|
+
ctx.fillStyle = '#c9ccd0'; ctx.beginPath(); ctx.roundRect(14, -9, 20, 18, 4); ctx.fill();
|
|
802
|
+
ctx.fillStyle = g; ctx.beginPath(); ctx.roundRect(32, -14, len - 32, 28, 10); ctx.fill();
|
|
803
|
+
ctx.fillStyle = col; ctx.fillRect(len - 52, -14, 40, 28);
|
|
804
|
+
ctx.fillStyle = 'rgba(255,255,255,0.55)'; ctx.fillRect(40, -9, len - 100, 4);
|
|
805
|
+
ctx.fillStyle = H.rgba(col, 0.85); ctx.fillRect(70, -2, 60, 5);
|
|
806
|
+
ctx.restore();
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
H.grain(ctx, W, H_, 0.018, 9 + (Math.floor(t * 12) % 5));
|
|
810
|
+
},
|
|
811
|
+
// <<<EXPLAINER
|
|
812
|
+
// Sound: a dry-erase marker on a glossy board. Every draw-on gets a marker stroke of the same length
|
|
813
|
+
// (pen lifts between items), the felt eraser scrubs in time with its 8 passes, counters tick on the
|
|
814
|
+
// 12 fps redraw grid. Times mirror explainer()/XE.story (pT 11.0, kT 13.05, ERASE 10.35-11.0).
|
|
815
|
+
explainerSound(k) {
|
|
816
|
+
const pT = 11.0, kT = 13.05, ERASE0 = 10.35, ERASE1 = 11.0;
|
|
817
|
+
// strokes are minor (dropped under a narrator) unless `minor` is passed false for a key moment
|
|
818
|
+
const mk = (a, b, gain = 1, pan = 0, material = 'marker', minor = true) => {
|
|
819
|
+
k.noise(a, { dur: 0.022, filter: 'bandpass', f: 1500, q: 1.4, gain: 0.22 * gain, a: 0.001, pan, minor }); // felt tip touching down
|
|
820
|
+
k.play('stroke', a, { material, dur: b - a, gain, pan, minor });
|
|
821
|
+
};
|
|
822
|
+
// handwriting: one stroke per word, timed by character position like mText's progress
|
|
823
|
+
const write = (s, a, b, gain = 0.9, pan = 0) => {
|
|
824
|
+
const n = s.length, re = /\S+/g; let m;
|
|
825
|
+
while ((m = re.exec(s))) mk(a + (b - a) * m.index / n, a + (b - a) * (m.index + m[0].length) / n, gain, pan);
|
|
826
|
+
};
|
|
827
|
+
|
|
828
|
+
k.bed('room', 0, 15, { gain: 0.5 });
|
|
829
|
+
k.play('pop', 0.03, { f: 330, gain: 0.45, minor: true }); // cap off
|
|
830
|
+
|
|
831
|
+
// 1 HOOK
|
|
832
|
+
write('How does AI learn?', 0.15, 1.3, 0.95);
|
|
833
|
+
mk(1.3, 1.55, 1.15, 0, 'marker', false); // blue underline, fast confident swipe
|
|
834
|
+
|
|
835
|
+
// 2 DATA: model box, nodes, then six cards (tip jumps to each new card)
|
|
836
|
+
mk(2.5, 2.8, 1.0, 0, 'marker', false); // model box: first mark in the new scene
|
|
837
|
+
for (let i = 0; i < 9; i += 3) mk(2.8 + i * 0.015, 2.85 + i * 0.015, 0.7); // little node circles
|
|
838
|
+
for (let i = 0; i < 6; i++) { const a = 3.0 + i * 0.17; mk(a, a + (i < 5 ? 0.15 : 0.21), 0.85, (i % 3 - 1) * 0.15); }
|
|
839
|
+
mk(4.15, 4.45, 1.0); mk(4.46, 4.55, 0.9); // flow arrow + head
|
|
840
|
+
k.play('paper', 4.5, { dur: 1.6, gain: 0.4, minor: true }); // example cards streaming into the model
|
|
841
|
+
write('examples', 4.55, 4.8, 0.7);
|
|
842
|
+
for (let f = 55; f < 63; f++) k.play('count', f / 12, { gain: 0.85, f: 3800 + (f - 55) * 180, minor: true }); // 0 -> 1,000,000
|
|
843
|
+
k.play('tock', 63 / 12, { f: 620, gain: 0.45 }); // 1,000,000 lands
|
|
844
|
+
|
|
845
|
+
// 3 GUESS -> CHECK -> ADJUST
|
|
846
|
+
[[6.4, 6.53], [6.55, 6.66], [6.67, 6.79], [6.8, 6.94], [6.96, 7.02], [7.03, 7.14]].forEach(([a, b]) => mk(a, b, 0.9));
|
|
847
|
+
write('Guess', 7.16, 7.29, 0.75);
|
|
848
|
+
mk(7.3, 7.47, 0.9); mk(7.48, 7.53, 0.8); // speech bubble + tail
|
|
849
|
+
write('dog?', 7.54, 7.75, 1.0);
|
|
850
|
+
write('Check', 7.86, 8.0, 0.7);
|
|
851
|
+
// the wrong guess: two hard red slashes + a low "nope"
|
|
852
|
+
mk(8.0, 8.08, 1.7, 0.1, 'sharpie', false); mk(8.08, 8.15, 1.7, 0.1, 'sharpie', false);
|
|
853
|
+
k.play('error', 8.0, { f: 'F3', gain: 0.6 });
|
|
854
|
+
mk(8.16, 8.45, 1.1, 0, 'sharpie'); // emphasis ring
|
|
855
|
+
mk(8.45, 8.79, 1.0); write('Adjust', 8.8, 9.05, 0.75);
|
|
856
|
+
for (let i = 0, x = 8.97; x < 9.48; i++, x += 0.07 + i * 0.006) k.play('click', x, { f: 1100, gain: 0.55, pan: -0.15, minor: true }); // knobs ratchet
|
|
857
|
+
mk(9.16, 9.45, 0.8); // green strengthened weights
|
|
858
|
+
mk(9.5, 9.62, 1.1); // strike "dog?"
|
|
859
|
+
write('cat', 9.62, 9.85, 1.0);
|
|
860
|
+
mk(9.85, 10.05, 1.1, 0, 'marker', false); // check mark
|
|
861
|
+
k.play('success', 9.98, { gain: 0.8 });
|
|
862
|
+
|
|
863
|
+
// eraser: 8 felt passes back and forth over the loop (path lengths from the explainer's sweep)
|
|
864
|
+
{
|
|
865
|
+
const run = 1020, step = 800 / 7 - 10, total = 8 * run + 7 * step, sp = (ERASE1 - ERASE0) / total;
|
|
866
|
+
for (let r = 0; r < 8; r++) {
|
|
867
|
+
const a = ERASE0 + r * (run + step) * sp, d = run * sp, dir = r % 2 ? -1 : 1;
|
|
868
|
+
for (let j = 0; j < 3; j++) k.noise(a + j * d / 3, { dur: d / 3 + 0.03, color: 'pink', filter: 'bandpass', f: 650 + j * 120, q: 0.7, gain: 0.3, a: 0.01, pan: dir * (j - 1) * 0.5 });
|
|
869
|
+
}
|
|
870
|
+
k.play('erase', ERASE0, { dur: ERASE1 - ERASE0, gain: 0.6 });
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
// 4 PROGRESS
|
|
874
|
+
mk(pT, pT + 0.29, 1.0); // axes
|
|
875
|
+
write('training rounds', pT + 0.3, pT + 0.44, 0.65);
|
|
876
|
+
write('accuracy', pT + 0.45, pT + 0.7, 0.7);
|
|
877
|
+
mk(pT + 0.7, pT + 1.7, 0.55); // the rising accuracy curve
|
|
878
|
+
{ // % counter: tick when the shown number changes, at most 12/s; slows by itself as it settles
|
|
879
|
+
let last = -1;
|
|
880
|
+
for (let f = Math.ceil((pT + 0.6) * 12); f < 153; f++) {
|
|
881
|
+
const u = Math.min(1, (f / 12 - (pT + 0.6)) / 1.1), v = Math.round(61 + 36 * (1 - Math.pow(1 - u, 2.2)));
|
|
882
|
+
if (v !== last) { k.play('tick', f / 12, { gain: 0.8, f: 3000 + (v - 61) * 30, pan: 0.2, minor: true }); last = v; }
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
// 97% lands (turns green) and gets circled: the biggest hit
|
|
886
|
+
k.play('impact', 153 / 12, { gain: 0.85 });
|
|
887
|
+
k.play('ding', 153 / 12 + 0.01, { f: 'E6', gain: 0.55 });
|
|
888
|
+
mk(pT + 1.75, pT + 2.05, 1.2, 0.2, 'sharpie', false);
|
|
889
|
+
|
|
890
|
+
// 5 TAKEAWAY
|
|
891
|
+
write('More examples → better guesses', kT, kT + 0.75, 0.9);
|
|
892
|
+
k.play('success', kT + 0.75, { f: 'G5', gain: 0.7 }); // resolving landing
|
|
893
|
+
mk(kT + 0.75, kT + 0.95, 1.1, 0, 'marker', false);
|
|
894
|
+
k.play('click', 14.35, { f: 1300, gain: 0.9, minor: true }); // cap back on
|
|
895
|
+
},
|
|
896
|
+
});
|
|
897
|
+
}
|