@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,672 @@
|
|
|
1
|
+
{
|
|
2
|
+
// ---------- perspective camera + hidden-line heightfield (back-to-front quads, each filled with bg then stroked) ----------
|
|
3
|
+
function makeCam(pos, pitch, f, cx, cy) {
|
|
4
|
+
const c = Math.cos(pitch), s = Math.sin(pitch);
|
|
5
|
+
return (x, y, z) => {
|
|
6
|
+
const dx = x - pos[0], dy = y - pos[1], dz = z - pos[2];
|
|
7
|
+
const yc = dy * c + dz * s, zc = -dy * s + dz * c;
|
|
8
|
+
return [cx + (f * dx) / zc, cy - (f * yc) / zc, zc];
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// ================= EXPLAINER: learning as a descent over the hidden-line "loss landscape"; the camera flies the terrain =================
|
|
13
|
+
function makeCamYP(pos, yaw, pitch, f, cx, cy) {
|
|
14
|
+
const cyw = Math.cos(yaw), syw = Math.sin(yaw), c = Math.cos(pitch), s = Math.sin(pitch);
|
|
15
|
+
return (x, y, z) => {
|
|
16
|
+
const dx0 = x - pos[0], dy = y - pos[1], dz0 = z - pos[2];
|
|
17
|
+
const dx = dx0 * cyw - dz0 * syw, dz = dx0 * syw + dz0 * cyw;
|
|
18
|
+
const yc = dy * c + dz * s, zc = -dy * s + dz * c;
|
|
19
|
+
return [cx + (f * dx) / zc, cy - (f * yc) / zc, zc];
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function wfIcon(ctx, kind, x, y, r, col) {
|
|
23
|
+
ctx.save(); ctx.translate(x, y); ctx.strokeStyle = col; ctx.lineWidth = 2; ctx.lineJoin = 'miter'; ctx.beginPath();
|
|
24
|
+
// vector-display line art: polygonal head, ears, eyes as short strokes
|
|
25
|
+
const head = [[-0.8, -0.2], [-0.55, 0.65], [0, 0.85], [0.55, 0.65], [0.8, -0.2], [0.45, -0.7], [-0.45, -0.7]];
|
|
26
|
+
head.forEach((p, i) => i ? ctx.lineTo(p[0] * r, p[1] * r) : ctx.moveTo(p[0] * r, p[1] * r)); ctx.closePath();
|
|
27
|
+
if (kind === 'cat') { ctx.moveTo(-0.75 * r, -0.35 * r); ctx.lineTo(-0.7 * r, -1.1 * r); ctx.lineTo(-0.3 * r, -0.7 * r); ctx.moveTo(0.75 * r, -0.35 * r); ctx.lineTo(0.7 * r, -1.1 * r); ctx.lineTo(0.3 * r, -0.7 * r); for (const sx of [-1, 1]) { ctx.moveTo(sx * 0.3 * r, 0.35 * r); ctx.lineTo(sx * 1.1 * r, 0.25 * r); } }
|
|
28
|
+
else { ctx.moveTo(-0.55 * r, -0.65 * r); ctx.lineTo(-1.1 * r, -0.2 * r); ctx.lineTo(-0.85 * r, 0.5 * r); ctx.moveTo(0.55 * r, -0.65 * r); ctx.lineTo(1.1 * r, -0.2 * r); ctx.lineTo(0.85 * r, 0.5 * r); ctx.moveTo(-0.15 * r, 0.35 * r); ctx.lineTo(0.15 * r, 0.35 * r); ctx.lineTo(0, 0.5 * r); ctx.closePath(); }
|
|
29
|
+
for (const sx of [-1, 1]) { ctx.moveTo(sx * 0.42 * r, -0.12 * r); ctx.lineTo(sx * 0.2 * r, -0.12 * r); }
|
|
30
|
+
ctx.stroke(); ctx.restore();
|
|
31
|
+
}
|
|
32
|
+
function hudBox(ctx, x, y, w, h, prog = 1, accent = '#7feaff') {
|
|
33
|
+
if (prog <= 0) return;
|
|
34
|
+
const ww = w * prog;
|
|
35
|
+
ctx.fillStyle = 'rgba(3,8,30,0.86)'; ctx.fillRect(x, y, ww, h);
|
|
36
|
+
ctx.strokeStyle = H.rgba(accent, 0.45); ctx.lineWidth = 1.2; ctx.strokeRect(x + 0.5, y + 0.5, ww - 1, h - 1);
|
|
37
|
+
ctx.fillStyle = accent; ctx.fillRect(x, y, 4, h);
|
|
38
|
+
const c = 12; ctx.strokeStyle = accent; ctx.lineWidth = 2; ctx.beginPath();
|
|
39
|
+
ctx.moveTo(x + ww - c, y); ctx.lineTo(x + ww, y); ctx.lineTo(x + ww, y + c); ctx.moveTo(x + ww, y + h - c); ctx.lineTo(x + ww, y + h); ctx.lineTo(x + ww - c, y + h); ctx.stroke();
|
|
40
|
+
}
|
|
41
|
+
function hudTag(ctx, x, y, text, o = {}) {
|
|
42
|
+
const k = o.k ?? 1; if (k <= 0) return;
|
|
43
|
+
ctx.save(); ctx.font = o.font || '600 24px "IBM Plex Mono"';
|
|
44
|
+
const full = text, shown = full.slice(0, Math.ceil(full.length * Math.min(1, k * 1.4)));
|
|
45
|
+
const w = ctx.measureText(full).width + 28, h = o.h || 42, col = o.col || '#7feaff';
|
|
46
|
+
const bx = o.align === 'left' ? x : x - w / 2;
|
|
47
|
+
ctx.fillStyle = o.bg || 'rgba(3,8,30,0.88)'; ctx.fillRect(bx, y - h / 2, w * Math.min(1, k * 2), h);
|
|
48
|
+
ctx.strokeStyle = H.rgba(col, 0.8); ctx.lineWidth = 1.5; ctx.strokeRect(bx + 0.5, y - h / 2 + 0.5, w * Math.min(1, k * 2) - 1, h - 1);
|
|
49
|
+
ctx.fillStyle = col; ctx.textBaseline = 'middle'; ctx.fillText(shown, bx + 14, y + 1);
|
|
50
|
+
ctx.restore();
|
|
51
|
+
}
|
|
52
|
+
function wfArrow(ctx, pts, prog, col, w = 2.5) {
|
|
53
|
+
if (prog <= 0 || pts.length < 2) return null;
|
|
54
|
+
const n = pts.length - 1, m = prog * n, i0 = Math.floor(m), f = m - i0;
|
|
55
|
+
const vis = pts.slice(0, i0 + 1); if (i0 < n) vis.push([H.lerp(pts[i0][0], pts[i0 + 1][0], f), H.lerp(pts[i0][1], pts[i0 + 1][1], f)]);
|
|
56
|
+
ctx.save(); ctx.strokeStyle = col; ctx.lineWidth = w; ctx.shadowColor = col; ctx.shadowBlur = 10; ctx.setLineDash([10, 6]);
|
|
57
|
+
ctx.beginPath(); vis.forEach((p, i) => i ? ctx.lineTo(p[0], p[1]) : ctx.moveTo(p[0], p[1])); ctx.stroke(); ctx.setLineDash([]);
|
|
58
|
+
const e = vis[vis.length - 1], e0 = vis[Math.max(0, vis.length - 2)], ang = Math.atan2(e[1] - e0[1], e[0] - e0[0]);
|
|
59
|
+
ctx.translate(e[0], e[1]); ctx.rotate(ang); ctx.beginPath(); ctx.moveTo(4, 0); ctx.lineTo(-12, -8); ctx.moveTo(4, 0); ctx.lineTo(-12, 8); ctx.lineWidth = 3; ctx.stroke();
|
|
60
|
+
ctx.restore();
|
|
61
|
+
return e;
|
|
62
|
+
}
|
|
63
|
+
function wfExplainer(ctx, W, H_, t) {
|
|
64
|
+
const ph = (a, b) => H.clamp((t - a) / (b - a));
|
|
65
|
+
const E = (a, b) => H.ease.inOut(ph(a, b));
|
|
66
|
+
const EO = (a, b) => H.ease.out(ph(a, b));
|
|
67
|
+
const typed = (str, a, b) => str.slice(0, Math.round(str.length * ph(a, b)));
|
|
68
|
+
const nz = H.makeNoise(12);
|
|
69
|
+
const NAVY = [5, 10, 34], CY = '#7feaff', AMB = '#ffd36b', RED = '#ff5a6e', GRN = '#5dffb0';
|
|
70
|
+
const height = (x, z) => {
|
|
71
|
+
const ridge = (u, v) => 1 - Math.abs(nz.n2(u, v));
|
|
72
|
+
let h = Math.pow(ridge(x * 0.04, z * 0.04), 2.2) * 11 + nz.fbm2(x * 0.08, z * 0.08, 3) * 3;
|
|
73
|
+
const side = Math.pow(Math.abs(x) / 70, 1.6) * 9;
|
|
74
|
+
h = h * (0.35 + H.smooth(4, 40, Math.abs(x)) * 0.9) + side;
|
|
75
|
+
h += H.smooth(105, 175, z) * Math.pow(ridge(x * 0.025 + 7, z * 0.02), 1.6) * (16 + 16 * H.smooth(-60, 20, x));
|
|
76
|
+
const db = Math.hypot(x - 4, z - 84);
|
|
77
|
+
h -= 10 * Math.exp(-(db * db) / 160);
|
|
78
|
+
return h - 2;
|
|
79
|
+
};
|
|
80
|
+
// the ball = current model weights, a point on the loss surface; one step downhill per training round
|
|
81
|
+
const PATH = [[-34, 66], [-24, 70], [-15, 74], [-8, 78], [-2, 81], [1, 83], [3, 84], [4, 84]];
|
|
82
|
+
const stepT = [8.75, 11.0, 11.3, 11.6, 11.9, 12.2, 12.5];
|
|
83
|
+
let bi = 0, bf = 0;
|
|
84
|
+
for (let i = 0; i < stepT.length; i++) { if (t >= stepT[i] + 0.3) bi = i + 1; else if (t > stepT[i]) { bi = i; bf = H.ease.inOut((t - stepT[i]) / 0.3); break; } else break; }
|
|
85
|
+
const bp = bi < PATH.length - 1 ? [H.lerp(PATH[bi][0], PATH[bi + 1][0], bf), H.lerp(PATH[bi][1], PATH[bi + 1][1], bf)] : PATH[PATH.length - 1];
|
|
86
|
+
const ball = [bp[0], height(bp[0], bp[1]) + 1.0, bp[1]];
|
|
87
|
+
// camera flight: [t, x, y, z, yaw, pitch]
|
|
88
|
+
const KF = [[0, 0, 22, -8, 0, 0.1], [1.8, 0, 22, -6, 0, 0.1], [2.9, 6, 24, 4, 0.12, 0.02], [5.9, 6, 24, 8, 0.14, 0.02], [7.0, -22, 21, 40, -0.08, 0.22], [10.3, -22, 21, 43, -0.06, 0.22], [11.2, -16, 40, 30, 0.02, 0.55], [12.9, -13, 40, 33, 0.05, 0.55], [13.9, -8, 50, 14, 0.04, 0.5], [20, -8, 50, 15, 0.04, 0.5]];
|
|
89
|
+
let k = 0; while (k < KF.length - 2 && t > KF[k + 1][0]) k++;
|
|
90
|
+
const A = KF[k], B = KF[k + 1], u = H.ease.inOut(H.clamp((t - A[0]) / (B[0] - A[0])));
|
|
91
|
+
const L = (i) => H.lerp(A[i], B[i], u);
|
|
92
|
+
const camPos = [L(1), L(2), L(3)], yaw = L(4), pitch = L(5);
|
|
93
|
+
const cam = makeCamYP(camPos, yaw, pitch, 760, W / 2, H_ / 2);
|
|
94
|
+
const HORIZON_Y = H_ / 2 - 760 * Math.tan(pitch);
|
|
95
|
+
// ---------- sky ----------
|
|
96
|
+
const sky = ctx.createLinearGradient(0, 0, 0, HORIZON_Y + 40);
|
|
97
|
+
sky.addColorStop(0, '#02051a'); sky.addColorStop(0.75, '#081440'); sky.addColorStop(1, '#0f2160');
|
|
98
|
+
ctx.fillStyle = sky; ctx.fillRect(0, 0, W, H_);
|
|
99
|
+
{ const gg = ctx.createLinearGradient(0, HORIZON_Y - 10, 0, HORIZON_Y + 120); gg.addColorStop(0, 'rgba(5,10,34,0)'); gg.addColorStop(1, 'rgba(5,10,34,1)'); ctx.fillStyle = gg; ctx.fillRect(0, HORIZON_Y - 10, W, H_); }
|
|
100
|
+
const r0 = H.rng(3);
|
|
101
|
+
for (let i = 0; i < 160; i++) { const x = r0() * W, y = r0() * Math.max(0, HORIZON_Y), a = r0() * 0.7; ctx.fillStyle = `rgba(190,240,255,${a})`; ctx.fillRect(x, y, 1, 1); }
|
|
102
|
+
// ---------- the model: wireframe sphere in the sky (front hemisphere only) ----------
|
|
103
|
+
const MOON = [W / 2 + 290 - yaw * 600, HORIZON_Y - 130 + (camPos[1] - 22) * 2, 104];
|
|
104
|
+
const err = ph(7.5, 7.9) * (1 - ph(9.0, 9.4));
|
|
105
|
+
{
|
|
106
|
+
const [mx, my, R] = MOON, tilt = 0.42, spin = t * 0.25 + E(8.6, 9.2) * 1.2;
|
|
107
|
+
const halo = ctx.createRadialGradient(mx, my, R * 0.9, mx, my, R * 2.2);
|
|
108
|
+
halo.addColorStop(0, err > 0 ? `rgba(255,90,110,${0.25 * err})` : 'rgba(80,220,255,0.18)'); halo.addColorStop(1, 'rgba(80,220,255,0)');
|
|
109
|
+
ctx.fillStyle = halo; ctx.fillRect(mx - R * 2.3, my - R * 2.3, R * 4.6, R * 4.6);
|
|
110
|
+
ctx.fillStyle = '#040a26'; ctx.beginPath(); ctx.arc(mx, my, R, 0, 7); ctx.fill();
|
|
111
|
+
const P = (lat, lon) => { const x = Math.cos(lat) * Math.cos(lon + spin), y = Math.sin(lat), z = Math.cos(lat) * Math.sin(lon + spin); return [mx + x * R, my - (y * Math.cos(tilt) - z * Math.sin(tilt)) * R, y * Math.sin(tilt) + z * Math.cos(tilt)]; };
|
|
112
|
+
const lc = H.mix(H.hex('#6eebff'), H.hex(RED), err);
|
|
113
|
+
const seg = (pts) => { for (let i = 1; i < pts.length; i++) { const a = pts[i - 1], b = pts[i]; if (a[2] < 0 && b[2] < 0) continue; ctx.strokeStyle = H.rgba(lc, 0.15 + 0.6 * H.clamp((a[2] + b[2]) / 2 + 0.25)); ctx.lineWidth = 1; ctx.beginPath(); ctx.moveTo(a[0], a[1]); ctx.lineTo(b[0], b[1]); ctx.stroke(); } };
|
|
114
|
+
for (let la = -75; la <= 75; la += 15) { const pts = []; for (let lo = 0; lo <= 360; lo += 8) pts.push(P(la * Math.PI / 180, lo * Math.PI / 180)); seg(pts); }
|
|
115
|
+
for (let lo = 0; lo < 360; lo += 15) { const pts = []; for (let la = -90; la <= 90; la += 8) pts.push(P(la * Math.PI / 180, lo * Math.PI / 180)); seg(pts); }
|
|
116
|
+
ctx.strokeStyle = H.rgba(H.mix(H.hex('#96f5ff'), H.hex(RED), err), 0.95); ctx.lineWidth = 1.6; ctx.beginPath(); ctx.arc(mx, my, R, 0, 7); ctx.stroke();
|
|
117
|
+
}
|
|
118
|
+
// ---------- hidden-line terrain ----------
|
|
119
|
+
const STEP = 2.5, X0 = -150, X1 = 150, Z0 = -10, Z1 = 190;
|
|
120
|
+
const nx = (X1 - X0) / STEP, nzr = (Z1 - Z0) / STEP;
|
|
121
|
+
const PTS = [];
|
|
122
|
+
for (let j = 0; j <= nzr; j++) { const row = []; for (let i = 0; i <= nx; i++) { const x = X0 + i * STEP, z = Z0 + j * STEP, y = height(x, z); row.push([...cam(x, y, z), y]); } PTS.push(row); }
|
|
123
|
+
const scanZ = camPos[2] + 30 + (((t) * 26) % 150);
|
|
124
|
+
// path tiles visited by the ball glow amber (the descent trail)
|
|
125
|
+
// the visited route (PATH[0] .. current ball position), sampled every 0.5 units so the trail is continuous
|
|
126
|
+
const route = [];
|
|
127
|
+
if (t > 6.9) {
|
|
128
|
+
route.push(PATH[0]);
|
|
129
|
+
for (let i = 0; i < PATH.length - 1 && i <= bi; i++) {
|
|
130
|
+
const a = PATH[i], b = i < bi ? PATH[i + 1] : bp, len = Math.hypot(b[0] - a[0], b[1] - a[1]), n = Math.ceil(len / 0.5);
|
|
131
|
+
for (let q = 1; q <= n; q++) route.push([H.lerp(a[0], b[0], q / n), H.lerp(a[1], b[1], q / n)]);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
const trail = new Set();
|
|
135
|
+
for (const [rx0, rz0] of route) trail.add(Math.round((rx0 - X0) / STEP) + ',' + Math.round((rz0 - Z0) / STEP));
|
|
136
|
+
// far edge of the mesh: when the camera pitches down (final shots) the last ~45 units dissolve into haze
|
|
137
|
+
const edgeK = H.smooth(0.25, 0.5, pitch), HAZE = [14, 30, 88];
|
|
138
|
+
{
|
|
139
|
+
let fy = 0, fn = 0, fyMax = -1e9; for (const p of PTS[nzr]) if (p[2] > 1 && p[0] > -40 && p[0] < W + 40) { fy += p[1]; fn++; fyMax = Math.max(fyMax, p[1]); }
|
|
140
|
+
if (fn && edgeK > 0) {
|
|
141
|
+
fy /= fn; const top = Math.min(0, fy - 260), bot = Math.min(H_, fyMax + 60), g = ctx.createLinearGradient(0, top, 0, fy + 40);
|
|
142
|
+
g.addColorStop(0, `rgba(6,14,48,${edgeK})`); g.addColorStop(0.75, `rgba(12,27,80,${edgeK})`); g.addColorStop(1, `rgba(14,30,88,${edgeK})`);
|
|
143
|
+
ctx.fillStyle = g; ctx.fillRect(0, top, W, bot - top);
|
|
144
|
+
const gl = ctx.createLinearGradient(0, fy - 60, 0, fy + 30); gl.addColorStop(0, 'rgba(60,150,255,0)'); gl.addColorStop(0.75, `rgba(70,170,255,${0.14 * edgeK})`); gl.addColorStop(1, 'rgba(60,150,255,0)');
|
|
145
|
+
ctx.fillStyle = gl; ctx.fillRect(0, fy - 60, W, 90);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
ctx.lineJoin = 'round';
|
|
149
|
+
for (let j = nzr - 1; j >= 0; j--) {
|
|
150
|
+
const zw = Z0 + j * STEP;
|
|
151
|
+
const fog = H.clamp(H.smooth(45, 200, zw - camPos[2]));
|
|
152
|
+
const edge = edgeK * H.smooth(Z1 - 45, Z1, zw + STEP);
|
|
153
|
+
const fill = H.mix(H.mix(NAVY, HAZE, fog), HAZE, edge);
|
|
154
|
+
const scan = Math.exp(-Math.pow((zw - scanZ) / 2.2, 2)) * 0.8 * (1 - edge);
|
|
155
|
+
const order = []; for (let i = 0; i < nx; i++) order.push(i);
|
|
156
|
+
const cx0 = camPos[0];
|
|
157
|
+
order.sort((a, b) => Math.abs(X0 + (b + 0.5) * STEP - cx0) - Math.abs(X0 + (a + 0.5) * STEP - cx0));
|
|
158
|
+
for (const i of order) {
|
|
159
|
+
const a = PTS[j][i], b = PTS[j][i + 1], c = PTS[j + 1][i + 1], d = PTS[j + 1][i];
|
|
160
|
+
if (a[2] < 1 || b[2] < 1 || c[2] < 1 || d[2] < 1) continue;
|
|
161
|
+
if (Math.max(a[0], b[0], c[0], d[0]) < -20 || Math.min(a[0], b[0], c[0], d[0]) > W + 20 || Math.min(a[1], b[1], c[1], d[1]) > H_ + 20) continue;
|
|
162
|
+
ctx.beginPath(); ctx.moveTo(a[0], a[1]); ctx.lineTo(b[0], b[1]); ctx.lineTo(c[0], c[1]); ctx.lineTo(d[0], d[1]); ctx.closePath();
|
|
163
|
+
const tr = trail.has(i + ',' + j);
|
|
164
|
+
const fc = tr ? H.mix(fill, [120, 84, 20], 0.22) : fill;
|
|
165
|
+
ctx.fillStyle = `rgb(${fc[0] | 0},${fc[1] | 0},${fc[2] | 0})`; ctx.fill();
|
|
166
|
+
const hk = H.clamp((a[3] + 2) / 16);
|
|
167
|
+
let col = H.mix([40, 200, 255], [210, 250, 255], hk * 0.8); if (tr) col = H.mix(col, H.hex(AMB), 0.55);
|
|
168
|
+
col = H.mix(col, [255, 255, 255], scan);
|
|
169
|
+
ctx.strokeStyle = H.rgba(col, H.clamp((1 - fog * 0.85) * (0.55 + hk * 0.45) + scan + (tr ? 0.1 : 0)) * (1 - edge));
|
|
170
|
+
ctx.lineWidth = H.clamp(1.6 - a[2] / 90, 0.45, 1.6);
|
|
171
|
+
ctx.stroke();
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
// the descent so far as one continuous glowing amber path draped on the surface
|
|
175
|
+
if (route.length > 1) {
|
|
176
|
+
const pp = route.map(([x, z]) => cam(x, height(x, z) + 0.35, z)).filter((p) => p[2] > 1);
|
|
177
|
+
if (pp.length > 1) {
|
|
178
|
+
ctx.save(); ctx.lineJoin = 'round'; ctx.lineCap = 'round'; ctx.shadowColor = AMB; ctx.shadowBlur = 12;
|
|
179
|
+
ctx.strokeStyle = 'rgba(255,211,107,0.55)'; ctx.lineWidth = 6; ctx.beginPath(); pp.forEach((p, i) => i ? ctx.lineTo(p[0], p[1]) : ctx.moveTo(p[0], p[1])); ctx.stroke();
|
|
180
|
+
ctx.shadowBlur = 0; ctx.strokeStyle = '#fff1c4'; ctx.lineWidth = 2.5; ctx.stroke();
|
|
181
|
+
ctx.restore();
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
// bloom
|
|
185
|
+
{ const Lb = H.layer(W, H_), lc = Lb.getContext('2d'); lc.filter = 'blur(6px)'; lc.drawImage(ctx.canvas, 0, 0, W, H_); ctx.save(); ctx.globalCompositeOperation = 'lighter'; ctx.globalAlpha = 0.5; ctx.drawImage(Lb, 0, 0); ctx.restore(); }
|
|
186
|
+
|
|
187
|
+
// ---------- beat 2: data feed panel streaming into the model ----------
|
|
188
|
+
if (t > 2.4 && t < 6.9) {
|
|
189
|
+
const pk = E(2.4, 2.8) * (1 - E(6.5, 6.9));
|
|
190
|
+
const px = 70, py = 150, pw = 520, ph2 = 470;
|
|
191
|
+
hudBox(ctx, px, py, pw, ph2, pk);
|
|
192
|
+
if (pk > 0.9) {
|
|
193
|
+
const cnt = Math.floor(1e6 * Math.pow(EO(2.9, 5.7), 1.6));
|
|
194
|
+
ctx.font = '400 22px "IBM Plex Mono"'; ctx.fillStyle = 'rgba(127,234,255,0.8)'; ctx.fillText('TRAINING DATA', px + 26, py + 42);
|
|
195
|
+
ctx.font = '700 68px "Space Mono"'; ctx.fillStyle = '#e8fbff'; ctx.fillText(cnt.toLocaleString('en-US'), px + 24, py + 118);
|
|
196
|
+
ctx.font = '600 24px "IBM Plex Mono"'; ctx.fillStyle = CY; ctx.fillText('EXAMPLES', px + 26, py + 156);
|
|
197
|
+
// scrolling feed of labelled examples
|
|
198
|
+
ctx.save(); ctx.beginPath(); ctx.rect(px + 10, py + 176, pw - 20, ph2 - 186); ctx.clip();
|
|
199
|
+
const scroll = (t - 2.8) * 140;
|
|
200
|
+
for (let i = -1; i < 6; i++) {
|
|
201
|
+
const idx = i + Math.floor(scroll / 92), y = py + 176 + i * 92 + (scroll % 92) - 92 + 92;
|
|
202
|
+
for (let c = 0; c < 2; c++) {
|
|
203
|
+
const kind = ((idx * 2 + c) * 7 + 3) % 5 < 2 ? 'dog' : 'cat';
|
|
204
|
+
const x = px + 30 + c * 240;
|
|
205
|
+
ctx.strokeStyle = 'rgba(127,234,255,0.35)'; ctx.lineWidth = 1; ctx.strokeRect(x + 0.5, y + 8.5, 220, 76);
|
|
206
|
+
wfIcon(ctx, kind, x + 42, y + 48, 20, '#e8fbff');
|
|
207
|
+
ctx.font = '600 26px "IBM Plex Mono"'; ctx.fillStyle = kind === 'cat' ? CY : AMB; ctx.fillText(kind.toUpperCase(), x + 84, y + 56);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
ctx.restore();
|
|
211
|
+
// data streams into the sphere: vector lines with moving packets
|
|
212
|
+
for (let s2 = 0; s2 < 3; s2++) {
|
|
213
|
+
const a = [px + pw, py + 230 + s2 * 90], b = [MOON[0] - MOON[2] * 0.9, MOON[1] + (s2 - 1) * 40];
|
|
214
|
+
const pr = E(3.2 + s2 * 0.15, 3.9 + s2 * 0.15);
|
|
215
|
+
ctx.strokeStyle = 'rgba(127,234,255,0.5)'; ctx.lineWidth = 1.5; ctx.setLineDash([4, 6]);
|
|
216
|
+
ctx.beginPath(); ctx.moveTo(a[0], a[1]); ctx.lineTo(H.lerp(a[0], b[0], pr), H.lerp(a[1], b[1], pr)); ctx.stroke(); ctx.setLineDash([]);
|
|
217
|
+
if (pr >= 1) for (let q = 0; q < 3; q++) { const uu = (t * 0.9 + q / 3 + s2 * 0.2) % 1; ctx.fillStyle = '#e8fbff'; ctx.shadowColor = CY; ctx.shadowBlur = 10; ctx.fillRect(H.lerp(a[0], b[0], uu) - 3, H.lerp(a[1], b[1], uu) - 3, 6, 6); ctx.shadowBlur = 0; }
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
hudTag(ctx, MOON[0], MOON[1] + MOON[2] + 40, 'MODEL', { k: EO(3.9, 4.3) * (1 - ph(6.5, 6.9)), font: '600 28px "IBM Plex Mono"', h: 44 });
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// ---------- beat 3: guess → check → adjust on the landscape ----------
|
|
224
|
+
const bS = cam(...ball);
|
|
225
|
+
if (t > 6.9 && bS[2] > 1 && bS[0] > 40 && bS[0] < W - 40 && bS[1] > 0 && bS[1] < H_) {
|
|
226
|
+
// the ball: weights as a point on the loss surface
|
|
227
|
+
const pulse = 1 + 0.2 * Math.sin(t * 6);
|
|
228
|
+
ctx.save(); ctx.strokeStyle = AMB; ctx.shadowColor = AMB; ctx.shadowBlur = 16; ctx.lineWidth = 2.5;
|
|
229
|
+
ctx.beginPath(); ctx.arc(bS[0], bS[1], 16 * pulse, 0, 7); ctx.stroke();
|
|
230
|
+
ctx.fillStyle = AMB; ctx.beginPath(); ctx.arc(bS[0], bS[1], 5, 0, 7); ctx.fill();
|
|
231
|
+
for (const [dx, dy] of [[1, 0], [-1, 0], [0, 1], [0, -1]]) { ctx.beginPath(); ctx.moveTo(bS[0] + dx * 18, bS[1] + dy * 18); ctx.lineTo(bS[0] + dx * 28, bS[1] + dy * 28); ctx.stroke(); }
|
|
232
|
+
ctx.restore();
|
|
233
|
+
if (t < 13.3) hudTag(ctx, bS[0] + 40, bS[1] + 38, 'MODEL WEIGHTS', { k: EO(7.0, 7.4) * (1 - ph(10.6, 11.0)), font: '600 28px "IBM Plex Mono"', h: 44, col: AMB, align: 'left' });
|
|
234
|
+
}
|
|
235
|
+
if (t > 6.9 && t < 10.8) {
|
|
236
|
+
const fade = 1 - ph(10.4, 10.8);
|
|
237
|
+
ctx.save(); ctx.globalAlpha = fade;
|
|
238
|
+
// readout panel
|
|
239
|
+
const rx = 760, ry = 120, rw = 450, rh = 250;
|
|
240
|
+
hudBox(ctx, rx, ry, rw, rh, E(6.95, 7.3), t > 7.45 && t < 9.4 ? RED : t >= 9.4 ? GRN : CY);
|
|
241
|
+
if (t > 7.25) {
|
|
242
|
+
ctx.strokeStyle = 'rgba(127,234,255,0.5)'; ctx.strokeRect(rx + 24.5, ry + 70.5, 120, 120); wfIcon(ctx, 'cat', rx + 84, ry + 136, 34, '#e8fbff');
|
|
243
|
+
ctx.font = '400 22px "IBM Plex Mono"'; ctx.fillStyle = 'rgba(127,234,255,0.8)'; ctx.fillText('INPUT', rx + 26, ry + 46);
|
|
244
|
+
const right = t >= 9.4;
|
|
245
|
+
ctx.fillText('GUESS', rx + 176, ry + 46);
|
|
246
|
+
ctx.font = '700 60px "Space Mono"'; ctx.fillStyle = right ? GRN : (t > 7.45 ? RED : '#e8fbff');
|
|
247
|
+
const g = right ? typed('CAT', 9.4, 9.6) : typed('DOG?', 7.25, 7.45);
|
|
248
|
+
ctx.fillText(g, rx + 172, ry + 130);
|
|
249
|
+
if (t > 7.45) {
|
|
250
|
+
const mk = right ? EO(9.6, 9.8) : EO(7.45, 7.6);
|
|
251
|
+
ctx.save(); ctx.strokeStyle = right ? GRN : RED; ctx.lineWidth = 6; ctx.shadowColor = ctx.strokeStyle; ctx.shadowBlur = 14; ctx.beginPath();
|
|
252
|
+
const cx2 = rx + 390, cy2 = ry + 112;
|
|
253
|
+
if (right) { ctx.moveTo(cx2 - 22, cy2); ctx.lineTo(cx2 - 22 + 14 * mk, cy2 + 16 * mk); if (mk > 0.5) ctx.lineTo(cx2 - 8 + 30 * (mk - 0.5) * 2, cy2 + 16 - 36 * (mk - 0.5) * 2); }
|
|
254
|
+
else { ctx.moveTo(cx2 - 20, cy2 - 20); ctx.lineTo(cx2 - 20 + 40 * mk, cy2 - 20 + 40 * mk); ctx.moveTo(cx2 + 20, cy2 - 20); ctx.lineTo(cx2 + 20 - 40 * mk, cy2 - 20 + 40 * mk); }
|
|
255
|
+
ctx.stroke(); ctx.restore();
|
|
256
|
+
ctx.font = '600 24px "IBM Plex Mono"'; ctx.fillStyle = right ? GRN : AMB;
|
|
257
|
+
ctx.fillText(right ? typed('LOSS LOWER ✓', 9.6, 10.0) : typed('ANSWER: CAT', 7.6, 8.0), rx + 176, ry + 186);
|
|
258
|
+
// loss meter
|
|
259
|
+
const loss = right ? 0.42 : 0.91;
|
|
260
|
+
ctx.fillStyle = 'rgba(127,234,255,0.15)'; ctx.fillRect(rx + 26, ry + 214, rw - 52, 12);
|
|
261
|
+
ctx.fillStyle = right ? GRN : RED; ctx.fillRect(rx + 26, ry + 214, (rw - 52) * loss, 12);
|
|
262
|
+
}
|
|
263
|
+
// emphasis: flashing red frame around the readout on the wrong guess
|
|
264
|
+
if (t > 7.45 && t < 9.4 && Math.floor(t * 8) % 2 === 0 && t < 8.2) { ctx.strokeStyle = RED; ctx.lineWidth = 4; ctx.strokeRect(rx - 8, ry - 8, rw + 16, rh + 16); }
|
|
265
|
+
}
|
|
266
|
+
// step labels pinned to things
|
|
267
|
+
hudTag(ctx, rx + rw / 2, ry - 34, '1 GUESS', { k: EO(7.0, 7.35), font: '700 28px "Space Mono"' });
|
|
268
|
+
if (t > 7.5) hudTag(ctx, rx + rw - 90, ry + rh + 34, '2 CHECK', { k: EO(7.5, 7.85), font: '700 28px "Space Mono"', col: t >= 9.4 ? GRN : RED });
|
|
269
|
+
// 3 Adjust: the error becomes a gradient arrow pointing downhill; the weights step along it
|
|
270
|
+
if (t > 8.0 && bS[2] > 1) {
|
|
271
|
+
const pts = [];
|
|
272
|
+
for (let q = 0; q <= 8; q++) { const xx = H.lerp(PATH[0][0], PATH[1][0] + 4, q / 8), zz = H.lerp(PATH[0][1], PATH[1][1] + 1.5, q / 8); const p = cam(xx, height(xx, zz) + 1.4, zz); pts.push(p); }
|
|
273
|
+
const e = wfArrow(ctx, pts, E(8.0, 8.6), RED, 3);
|
|
274
|
+
// keep the weights tag on top of the downhill vector (same tag as above, redrawn over the arrow)
|
|
275
|
+
if (bS[0] > 40 && bS[0] < W - 40 && bS[1] > 0 && bS[1] < H_) hudTag(ctx, bS[0] + 40, bS[1] + 38, 'MODEL WEIGHTS', { k: EO(7.0, 7.4) * (1 - ph(10.6, 11.0)), font: '600 28px "IBM Plex Mono"', h: 44, col: AMB, align: 'left' });
|
|
276
|
+
if (e) hudTag(ctx, e[0] + 30, e[1] - 54, '3 ADJUST', { k: EO(8.4, 8.8), font: '700 28px "Space Mono"', col: RED, align: 'left' });
|
|
277
|
+
if (t < 9.3) hudTag(ctx, pts[0][0] - 40, pts[0][1] + 90, 'ERROR → DOWNHILL', { k: EO(8.1, 8.5) * (1 - ph(9.0, 9.3)), font: '600 28px "IBM Plex Mono"', h: 44, col: RED, align: 'left' });
|
|
278
|
+
}
|
|
279
|
+
ctx.restore();
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
// ---------- beat 4: repeated rounds roll the weights into the basin; accuracy climbs ----------
|
|
283
|
+
const ACCS = [61, 72, 80, 86, 90, 93, 95, 97];
|
|
284
|
+
if (t > 10.7) {
|
|
285
|
+
const cur = Math.round(H.lerp(61, 97, H.ease.inOut(ph(11.0, 12.7))));
|
|
286
|
+
const pk = E(10.7, 11.0);
|
|
287
|
+
const px = 760, py = 120, pw = 450, ph2 = 300;
|
|
288
|
+
if (t < 13.3) {
|
|
289
|
+
ctx.save(); ctx.globalAlpha = 1 - ph(13.0, 13.3);
|
|
290
|
+
hudBox(ctx, px, py, pw, ph2, pk, cur >= 97 ? GRN : CY);
|
|
291
|
+
if (pk > 0.9) {
|
|
292
|
+
ctx.font = '400 22px "IBM Plex Mono"'; ctx.fillStyle = 'rgba(127,234,255,0.8)'; ctx.fillText('ACCURACY', px + 26, py + 42);
|
|
293
|
+
const pop = t > 12.7 ? 1 + 0.15 * Math.sin(Math.min(1, (t - 12.7) / 0.3) * Math.PI) : 1;
|
|
294
|
+
ctx.save(); ctx.translate(px + 24, py + 120); ctx.scale(pop, pop);
|
|
295
|
+
ctx.font = '700 80px "Space Mono"'; ctx.fillStyle = cur >= 97 ? GRN : '#e8fbff'; if (cur >= 97) { ctx.shadowColor = GRN; ctx.shadowBlur = 20; } ctx.fillText(cur + '%', 0, 0); ctx.restore();
|
|
296
|
+
ctx.font = '600 22px "IBM Plex Mono"'; ctx.fillStyle = AMB; ctx.fillText(`ROUND ${Math.min(8, 1 + Math.floor(ph(11.0, 12.7) * 7.99))}`, px + 300, py + 112);
|
|
297
|
+
// chart
|
|
298
|
+
const gx0 = px + 30, gx1 = px + pw - 30, gy0 = py + ph2 - 26, gy1 = py + 150;
|
|
299
|
+
ctx.strokeStyle = 'rgba(127,234,255,0.2)'; ctx.lineWidth = 1; for (let i = 0; i <= 3; i++) { const y = H.lerp(gy0, gy1, i / 3); ctx.beginPath(); ctx.moveTo(gx0, y); ctx.lineTo(gx1, y); ctx.stroke(); }
|
|
300
|
+
const cp = H.ease.inOut(ph(11.0, 12.7)) * 7, m = Math.floor(cp), f = cp - m;
|
|
301
|
+
const pts = ACCS.map((a, i) => [H.lerp(gx0, gx1, i / 7), H.lerp(gy0, gy1, (a - 55) / 45)]);
|
|
302
|
+
const vis = pts.slice(0, m + 1); if (m < 7) vis.push([H.lerp(pts[m][0], pts[m + 1][0], f), H.lerp(pts[m][1], pts[m + 1][1], f)]);
|
|
303
|
+
ctx.save(); ctx.strokeStyle = GRN; ctx.shadowColor = GRN; ctx.shadowBlur = 10; ctx.lineWidth = 2.5; ctx.beginPath(); vis.forEach((p, i) => i ? ctx.lineTo(p[0], p[1]) : ctx.moveTo(p[0], p[1])); ctx.stroke(); ctx.restore();
|
|
304
|
+
vis.forEach((p, i) => { if (i <= m) { ctx.fillStyle = '#e8fbff'; ctx.fillRect(p[0] - 3, p[1] - 3, 6, 6); } });
|
|
305
|
+
}
|
|
306
|
+
if (t > 12.7) { ctx.strokeStyle = GRN; ctx.lineWidth = 3; ctx.globalAlpha *= 1 - ph(12.7, 13.3); const g2 = 10 + 30 * EO(12.7, 13.3); ctx.strokeRect(px - g2, py - g2, pw + g2 * 2, ph2 + g2 * 2); }
|
|
307
|
+
ctx.restore();
|
|
308
|
+
}
|
|
309
|
+
// label at the basin once reached
|
|
310
|
+
const gm = cam(4, height(4, 84) + 1, 84);
|
|
311
|
+
if (gm[2] > 1 && t > 12.5) hudTag(ctx, gm[0], gm[1] + 60, 'LOWEST ERROR', { k: EO(12.5, 12.9) * (1 - ph(13.0, 13.2)), font: '700 28px "Space Mono"', col: GRN });
|
|
312
|
+
if (bS[2] > 1 && t > 10.9 && t < 12.5) hudTag(ctx, bS[0] - 40, bS[1] - 60, 'REPEAT × MANY', { k: EO(10.9, 11.2) * (1 - ph(12.2, 12.5)), font: '600 28px "IBM Plex Mono"', h: 44, col: AMB });
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
// ---------- HUD frame + hook → header ----------
|
|
316
|
+
ctx.strokeStyle = 'rgba(127,234,255,0.8)'; ctx.lineWidth = 1.5;
|
|
317
|
+
const br = (x, y, sx, sy) => { ctx.beginPath(); ctx.moveTo(x, y + sy * 26); ctx.lineTo(x, y); ctx.lineTo(x + sx * 26, y); ctx.stroke(); };
|
|
318
|
+
if (t > 0.08) { br(28, 28, 1, 1); br(W - 28, 28, -1, 1); br(28, H_ - 28, 1, -1); br(W - 28, H_ - 28, -1, -1); }
|
|
319
|
+
{
|
|
320
|
+
const sh = E(1.6, 2.4);
|
|
321
|
+
const size = H.lerp(60, 30, sh);
|
|
322
|
+
const str = 'HOW DOES AI LEARN?';
|
|
323
|
+
ctx.font = `700 ${size}px "Space Mono"`;
|
|
324
|
+
const w = ctx.measureText(str).width;
|
|
325
|
+
const x = H.lerp(640 - w / 2, 56, sh), y = H.lerp(330, 76, sh);
|
|
326
|
+
if (sh < 1) { ctx.fillStyle = `rgba(2,5,26,${0.6 * (1 - sh)})`; ctx.fillRect(0, 0, W, H_); }
|
|
327
|
+
ctx.fillStyle = 'rgba(2,5,26,0.85)'; ctx.fillRect(x - 16, y - size * 0.95, w + 32, size * 1.35);
|
|
328
|
+
ctx.fillStyle = '#e8fbff'; const tp = typed(str, 0.15, 1.1); ctx.fillText(tp, x, y);
|
|
329
|
+
if (t < 1.6 && Math.floor(t * 4) % 2 === 0) { ctx.fillStyle = CY; ctx.fillRect(x + ctx.measureText(tp).width + 4, y - size * 0.75, size * 0.5, size * 0.85); }
|
|
330
|
+
ctx.fillStyle = CY; ctx.fillRect(x, y + size * 0.3, H.lerp(120, 70, sh), 3);
|
|
331
|
+
}
|
|
332
|
+
if (t > 13.0) {
|
|
333
|
+
const kk = EO(13.0, 13.5), str = 'MORE EXAMPLES → BETTER GUESSES';
|
|
334
|
+
ctx.font = '700 40px "Space Mono"'; const w = ctx.measureText(str).width;
|
|
335
|
+
hudBox(ctx, 640 - w / 2 - 30, 560, w + 60, 86, kk, GRN);
|
|
336
|
+
ctx.fillStyle = '#e8fbff'; ctx.fillText(typed(str, 13.1, 13.6), 640 - w / 2, 616);
|
|
337
|
+
}
|
|
338
|
+
ctx.fillStyle = 'rgba(0,0,0,0.12)'; for (let y = 0; y < H_; y += 3) ctx.fillRect(0, y, W, 1);
|
|
339
|
+
H.vignette(ctx, W, H_, 0.45, '0,0,10');
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
// ---------- sound: flight-console HUD (scanner beeps, type-on chatter, a low console hum, soft flight drones) ----------
|
|
343
|
+
function wfSound(k) {
|
|
344
|
+
const D = 14.5;
|
|
345
|
+
const ph = (t, a, b) => H.clamp((t - a) / (b - a));
|
|
346
|
+
const inv = (u) => (u < 0.5 ? Math.cbrt(u / 4) : 1 - Math.cbrt((1 - u) * 2) / 2); // inverse of H.ease.inOut
|
|
347
|
+
const invO = (u) => 1 - Math.cbrt(1 - u); // inverse of H.ease.out
|
|
348
|
+
const busy = [];
|
|
349
|
+
// scanner beep: clean sine with a whisper of square edge, kept well under 2.5 kHz
|
|
350
|
+
const beep = (t, n, dur, g, p = 0, minor) => { busy.push(t); k.tone(t, { f: n, dur, gain: 0.11 * g, a: 0.003, hold: dur * 0.6, pan: p, verb: 0.15, minor }); k.tone(t, { f: n, type: 'square', dur, gain: 0.012 * g, a: 0.003, hold: dur * 0.5, filter: 'lowpass', f2: 1800, pan: p, minor }); };
|
|
351
|
+
// HUD type-on chatter: one short filtered square per printed glyph, at most ~12 per second
|
|
352
|
+
const typeOn = (str, a, b, p = 0, g = 1) => { const n = str.length; let last = -1; for (let i = 1; i <= n; i++) { const t = a + ((i - 0.5) / n) * (b - a); if (t - last < 1 / 12 || str[i - 1] === ' ') continue; busy.push(t); k.tone(t, { f: 'E5', type: 'square', dur: 0.022, gain: 0.035 * g, a: 0.001, hold: 0.012, filter: 'lowpass', f2: 1700, pan: p, minor: true }); last = t; } };
|
|
353
|
+
// hudTag(k = EO(a,b)) prints ceil(len * min(1, 1.4k)) chars: all printed once EO reaches 1/1.4
|
|
354
|
+
const tagOn = (str, a, b, p = 0) => { const tEnd = a + (b - a) * invO(1 / 1.4); typeOn(str, a, tEnd, p, 0.9); beep(a, 'A4', 0.05, 0.45, p, true); };
|
|
355
|
+
// hudBox opening (E over a..b): a quick upward servo sweep that clicks shut
|
|
356
|
+
const boxOpen = (a, b, p = 0, g = 1) => { k.tone(a, { f: [[0, 220], [b - a, 660]], type: 'triangle', dur: b - a + 0.02, gain: 0.05 * g, a: 0.02, pan: p, minor: true }); k.play('click', b, { f: 1500, gain: 0.5 * g, pan: p, minor: true }); busy.push(b); };
|
|
357
|
+
const fly = (t0, t1, g = 1) => { const d = t1 - t0; k.noise(t0, { dur: d + 0.2, color: 'pink', filter: 'bandpass', f: [[0, 160], [d * 0.5, 380], [d, 170]], q: 0.9, gain: 0.05 * g, a: d * 0.5, verb: 0.15 }); k.tone(t0, { f: [[0, 70], [d * 0.5, 95], [d, 72]], type: 'sawtooth', dur: d + 0.2, gain: 0.012 * g, a: d * 0.5, filter: 'lowpass', f2: 300 }); };
|
|
358
|
+
const counter = (a, b, val, f, g, p, minGap) => {
|
|
359
|
+
let last = -1, lastV = val(a); const top = Math.abs(val(b) - val(a)) / (b - a) * 0.22;
|
|
360
|
+
for (let t = a; t <= b + 1e-6; t += 1 / 120) {
|
|
361
|
+
const v = val(t); if (v === lastV) continue; lastV = v;
|
|
362
|
+
const speed = Math.abs(val(Math.min(b, t + 0.05)) - val(Math.max(a, t - 0.05)));
|
|
363
|
+
const gap = H.clamp(minGap / Math.max(0.2, Math.min(1, speed / top)), minGap, 0.4);
|
|
364
|
+
if (t - last >= gap && !busy.some((x) => t > x - 0.03 && t < x + 0.08)) { k.play('tick', t, { f, gain: g, pan: p, minor: true }); last = t; }
|
|
365
|
+
}
|
|
366
|
+
};
|
|
367
|
+
|
|
368
|
+
k.bed('hum', 0, D, { gain: 0.35 }); // the console
|
|
369
|
+
k.bed('hiss', 0, D, { gain: 0.6 });
|
|
370
|
+
k.music('pad', 0.3, D, { bpm: 90, gain: 0.24, chords: [['D3', 'F3', 'A3', 'C4'], ['Bb2', 'D3', 'F3', 'A3'], ['G2', 'Bb2', 'D3', 'F3'], ['A2', 'C#3', 'E3', 'G3'], ['D3', 'F3', 'A3', 'D4']] });
|
|
371
|
+
// the terrain scan line sweeps away from the camera every 150/26 s: a faint radar pass each cycle
|
|
372
|
+
for (let t = 0.2; t < D - 0.5; t += 150 / 26) k.noise(t, { dur: 1.4, color: 'pink', filter: 'bandpass', f: [[0, 500], [1.4, 1500]], q: 6, gain: 0.03, a: 0.5, verb: 0.2, minor: true });
|
|
373
|
+
|
|
374
|
+
// ---- hook: HUD brackets power on (0.08), the question types out (0.15-1.1), slides to the header (1.6-2.4)
|
|
375
|
+
k.tone(0.06, { f: [[0, 90], [0.3, 180]], dur: 0.35, gain: 0.1, a: 0.08 }); beep(0.08, 'A4', 0.08, 0.8);
|
|
376
|
+
typeOn('HOW DOES AI LEARN?', 0.15, 1.1, 0, 1.3);
|
|
377
|
+
beep(1.12, 'D5', 0.1, 0.8); // prompt complete
|
|
378
|
+
k.noise(1.6, { dur: 0.8, color: 'pink', filter: 'lowpass', f: [[0, 600], [0.8, 250]], gain: 0.04, a: 0.3, minor: true });
|
|
379
|
+
fly(1.8, 2.9);
|
|
380
|
+
|
|
381
|
+
// ---- beat 2: TRAINING DATA panel, feed scrolls, counter, streams into the sphere
|
|
382
|
+
boxOpen(2.4, 2.8, -0.5);
|
|
383
|
+
for (let t = 2.8 + 92 / 140; t < 6.5; t += 92 / 140) if (t > 3.0) { k.tone(t, { f: 'A3', type: 'square', dur: 0.03, gain: 0.02, a: 0.001, hold: 0.02, filter: 'lowpass', f2: 1200, pan: -0.5, minor: true }); busy.push(t); } // a new feed row
|
|
384
|
+
[0, 1, 2].forEach((s2) => { const a = 3.2 + s2 * 0.15; k.noise(a, { dur: 0.7, color: 'pink', filter: 'bandpass', f: [[0, 700], [0.7, 1500]], q: 5, gain: 0.04, a: 0.35, pan: -0.3 + s2 * 0.1, minor: true }); beep(a + 0.7, ['F5', 'A5', 'C6'][s2], 0.05, 0.4, 0.3, true); }); // data streams link to the model
|
|
385
|
+
tagOn('MODEL', 3.9, 4.3, 0.4);
|
|
386
|
+
counter(2.95, 5.66, (t) => Math.floor(1e6 * Math.pow(H.ease.out(ph(t, 2.9, 5.7)), 1.6)), 2800, 1.1, -0.5, 1 / 10);
|
|
387
|
+
beep(5.7, 'A5', 0.08, 0.6, -0.5); beep(5.8, 'D6', 0.14, 0.5, -0.5); // 1,000,000: confirm
|
|
388
|
+
|
|
389
|
+
// ---- beat 3: fly down to the marker, guess, check, adjust
|
|
390
|
+
k.tone(6.5, { f: [[0, 660], [0.4, 220]], type: 'triangle', dur: 0.42, gain: 0.045, a: 0.02, pan: -0.5, minor: true }); // data panel folds away
|
|
391
|
+
fly(5.9, 7.0);
|
|
392
|
+
beep(6.92, 'E5', 0.05, 0.7, -0.2); beep(7.02, 'E5', 0.05, 0.7, -0.2); // target lock on the weights marker
|
|
393
|
+
boxOpen(6.95, 7.3, 0.2);
|
|
394
|
+
tagOn('1 GUESS', 7.0, 7.35, 0.2);
|
|
395
|
+
typeOn('MODEL WEIGHTS', 7.0, 7.0 + 0.4 * invO(1 / 1.4), -0.2, 0.6);
|
|
396
|
+
typeOn('DOG?', 7.25, 7.45, 0.3, 1.2);
|
|
397
|
+
// CHECK: wrong. X strikes, readout frame flashes red (on at 7.5, 7.75, 8.0): one alarm beep per flash
|
|
398
|
+
k.play('error', 7.45, { f: 'A3', gain: 1.0, pan: 0.3 });
|
|
399
|
+
[7.5, 7.75, 8.0].forEach((t, i) => beep(t, 'B4', 0.1, 0.7 - i * 0.1, 0.3, i > 0));
|
|
400
|
+
tagOn('2 CHECK', 7.5, 7.85, 0.45);
|
|
401
|
+
typeOn('ANSWER: CAT', 7.6, 8.0, 0.3);
|
|
402
|
+
// ADJUST: the error becomes a red downhill arrow (E 8.0-8.6), the sphere spins to new weights (8.6-9.2)
|
|
403
|
+
k.tone(8.0, { f: [[0, 880], [0.6, 330]], type: 'triangle', dur: 0.62, gain: 0.05, a: 0.05, hold: 0.4, pan: -0.3 });
|
|
404
|
+
k.noise(8.0, { dur: 0.6, color: 'pink', filter: 'bandpass', f: [[0, 1400], [0.6, 500]], q: 4, gain: 0.04, a: 0.2, pan: -0.3, minor: true });
|
|
405
|
+
tagOn('ERROR → DOWNHILL', 8.1, 8.5, -0.4);
|
|
406
|
+
tagOn('3 ADJUST', 8.4, 8.8, -0.1);
|
|
407
|
+
k.tone(8.6, { f: [[0, 110], [0.3, 220], [0.6, 140]], type: 'sawtooth', dur: 0.62, gain: 0.03, a: 0.2, filter: 'lowpass', f2: 700, pan: 0.4, minor: true }); // sphere servo whir
|
|
408
|
+
k.tone(8.75, { f: [[0, 'D4'], [0.3, 'A3']], dur: 0.32, gain: 0.08, a: 0.01, pan: -0.3 }); // first step downhill
|
|
409
|
+
// CORRECT: CAT types in green (9.4-9.6), check draws (9.6-9.8), LOSS LOWER
|
|
410
|
+
typeOn('CAT', 9.4, 9.6, 0.3, 1.2);
|
|
411
|
+
k.play('success', 9.62, { f: 'D5', gain: 0.5, pan: 0.3 });
|
|
412
|
+
typeOn('LOSS LOWER ✓', 9.75, 10.0, 0.3, 0.7);
|
|
413
|
+
|
|
414
|
+
// ---- beat 4: rounds roll the weights into the basin, accuracy climbs
|
|
415
|
+
fly(10.3, 11.2);
|
|
416
|
+
boxOpen(10.7, 11.0, 0.2);
|
|
417
|
+
tagOn('REPEAT × MANY', 10.9, 11.2, -0.3);
|
|
418
|
+
['A4', 'G4', 'F4', 'E4', 'D4', 'C4'].forEach((n, i) => { const t = 11.3 + i * 0.3; beep(t, n, 0.07, 0.55, -0.3 + i * 0.08, true); }); // each training round steps the marker downhill
|
|
419
|
+
counter(11.03, 12.66, (t) => Math.round(H.lerp(61, 97, H.ease.inOut(ph(t, 11.0, 12.7)))), 2600, 1.1, 0.2, 1 / 10);
|
|
420
|
+
tagOn('LOWEST ERROR', 12.5, 12.9, 0);
|
|
421
|
+
// 97%: the big hit. readout turns green, its frame expands
|
|
422
|
+
k.play('impact', 12.7, { gain: 0.65, pan: 0.2 });
|
|
423
|
+
['D5', 'F#5', 'A5'].forEach((n, i) => beep(12.7 + i * 0.07, n, 0.5 - i * 0.08, 1.1 - i * 0.15, 0.2));
|
|
424
|
+
k.tone(12.7, { f: 'D3', type: 'triangle', dur: 1.0, gain: 0.14, a: 0.01 });
|
|
425
|
+
fly(12.9, 13.9, 0.8);
|
|
426
|
+
// takeaway box opens (EO 13.0-13.5) and types (13.1-13.6), then resolves
|
|
427
|
+
boxOpen(13.0, 13.4, 0, 0.8);
|
|
428
|
+
typeOn('MORE EXAMPLES → BETTER GUESSES', 13.1, 13.6, 0, 0.9);
|
|
429
|
+
beep(13.65, 'A4', 0.1, 0.6); beep(13.75, 'D5', 0.5, 0.55);
|
|
430
|
+
k.tone(13.75, { f: 'D3', type: 'triangle', dur: 1.0, gain: 0.1, a: 0.02 });
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
registerStyle({
|
|
434
|
+
id: 'wireframe-terrain',
|
|
435
|
+
name: 'Hidden-Line Wireframe',
|
|
436
|
+
category: 'Dimensional',
|
|
437
|
+
description: 'Vector-display 3D: a perspective wire-mesh landscape with true hidden-line removal (back-to-front quads filled with the night before stroking), a wireframe moon, phosphor-cyan lines with bloom on deep navy, and HUD coordinate labels.',
|
|
438
|
+
motion: 'HUD brackets snap on, the wireframe moon traces itself, then the hidden-line mesh is scanned in row by row from the camera to the horizon behind a bright scan front; markers lock on and labels type out while the camera glides forward and the scan keeps sweeping.',
|
|
439
|
+
duration: 5,
|
|
440
|
+
fonts: ['600 13px "IBM Plex Mono"', '400 11px "IBM Plex Mono"', '700 34px "Space Mono"', '400 14px "Space Mono"', '600 24px "IBM Plex Mono"', '400 22px "IBM Plex Mono"', '700 60px "Space Mono"'],
|
|
441
|
+
frameT: 4.6,
|
|
442
|
+
readsPixels: false,
|
|
443
|
+
explainerDuration: 14.5,
|
|
444
|
+
explainerNote: 'Learning is shown as descent over the hidden-line “loss landscape”: the camera flies the mesh from a data-feed HUD streaming into the wireframe-sphere model, down to an amber “model weights” marker whose error becomes a dashed downhill vector, then follows it into the glowing basin; labels are bracketed HUD tags that type on, numbers are big Space Mono readouts.',
|
|
445
|
+
explainer: wfExplainer,
|
|
446
|
+
explainerSound: wfSound,
|
|
447
|
+
draw(ctx, W, H_, t) {
|
|
448
|
+
const nz = H.makeNoise(12);
|
|
449
|
+
const ph = (a, b) => H.clamp((t - a) / (b - a));
|
|
450
|
+
const typed = (str, a, b) => str.slice(0, Math.round(str.length * ph(a, b)));
|
|
451
|
+
const camZ = -3.6 + (t - 4.6) * 1.2;
|
|
452
|
+
const NAVY = [5, 10, 34];
|
|
453
|
+
const HORIZON_Y = 300;
|
|
454
|
+
// ---------- sky ----------
|
|
455
|
+
const sky = ctx.createLinearGradient(0, 0, 0, HORIZON_Y + 40);
|
|
456
|
+
sky.addColorStop(0, '#02051a'); sky.addColorStop(0.75, '#081440'); sky.addColorStop(1, '#0f2160');
|
|
457
|
+
ctx.fillStyle = sky; ctx.fillRect(0, 0, W, H_);
|
|
458
|
+
const r = H.rng(3);
|
|
459
|
+
for (let i = 0; i < 160; i++) {
|
|
460
|
+
const x = r() * W, y = r() * HORIZON_Y, a = r() * 0.7 * (1 - y / HORIZON_Y * 0.6);
|
|
461
|
+
ctx.fillStyle = `rgba(190,240,255,${a})`; ctx.fillRect(x, y, r() < 0.08 ? 2 : 1, 1);
|
|
462
|
+
}
|
|
463
|
+
{ const gg = ctx.createLinearGradient(0, HORIZON_Y - 10, 0, HORIZON_Y + 120); gg.addColorStop(0, 'rgba(5,10,34,0)'); gg.addColorStop(1, 'rgba(5,10,34,1)'); ctx.fillStyle = gg; ctx.fillRect(0, HORIZON_Y - 10, W, H_); }
|
|
464
|
+
// ---------- wireframe moon (front hemisphere only = hidden lines removed) ----------
|
|
465
|
+
{
|
|
466
|
+
const mx = 925, my = 215, R = 112, tilt = 0.42, spin = t * 0.15;
|
|
467
|
+
const halo = ctx.createRadialGradient(mx, my, R * 0.9, mx, my, R * 2.2);
|
|
468
|
+
halo.addColorStop(0, 'rgba(80,220,255,0.18)'); halo.addColorStop(1, 'rgba(80,220,255,0)');
|
|
469
|
+
const mo = H.ease.inOut(ph(0.25, 1.1)), mlat = H.ease.inOut(ph(0.45, 1.4)), mlon = H.ease.inOut(ph(0.8, 1.7));
|
|
470
|
+
ctx.globalAlpha = H.ease.out(ph(0.9, 1.8));
|
|
471
|
+
ctx.fillStyle = halo; ctx.fillRect(mx - R * 2.3, my - R * 2.3, R * 4.6, R * 4.6);
|
|
472
|
+
ctx.globalAlpha = 1;
|
|
473
|
+
ctx.globalAlpha = mo; ctx.fillStyle = '#040a26'; ctx.beginPath(); ctx.arc(mx, my, R, 0, 7); ctx.fill(); ctx.globalAlpha = 1;
|
|
474
|
+
const P = (lat, lon) => {
|
|
475
|
+
let x = Math.cos(lat) * Math.cos(lon + spin), y = Math.sin(lat), z = Math.cos(lat) * Math.sin(lon + spin);
|
|
476
|
+
const y2 = y * Math.cos(tilt) - z * Math.sin(tilt), z2 = y * Math.sin(tilt) + z * Math.cos(tilt);
|
|
477
|
+
return [mx + x * R, my - y2 * R, z2];
|
|
478
|
+
};
|
|
479
|
+
ctx.lineWidth = 1;
|
|
480
|
+
const seg = (pts, prog = 1) => {
|
|
481
|
+
const nmax = Math.floor((pts.length - 1) * prog) + 1;
|
|
482
|
+
for (let i = 1; i < Math.min(pts.length, nmax); i++) {
|
|
483
|
+
const a = pts[i - 1], b = pts[i];
|
|
484
|
+
if (a[2] < 0 && b[2] < 0) continue;
|
|
485
|
+
const k = H.clamp((a[2] + b[2]) / 2 + 0.25);
|
|
486
|
+
ctx.strokeStyle = `rgba(110,235,255,${0.15 + 0.6 * k})`;
|
|
487
|
+
ctx.beginPath(); ctx.moveTo(a[0], a[1]); ctx.lineTo(b[0], b[1]); ctx.stroke();
|
|
488
|
+
}
|
|
489
|
+
};
|
|
490
|
+
for (let la = -75; la <= 75; la += 15) { const pts = []; for (let lo = 0; lo <= 360; lo += 6) pts.push(P(la * Math.PI / 180, lo * Math.PI / 180)); if (mlat > 0) seg(pts, mlat); }
|
|
491
|
+
for (let lo = 0; lo < 360; lo += 15) { const pts = []; for (let la = -90; la <= 90; la += 6) pts.push(P(la * Math.PI / 180, lo * Math.PI / 180)); if (mlon > 0) seg(pts, mlon); }
|
|
492
|
+
ctx.strokeStyle = 'rgba(150,245,255,0.95)'; ctx.lineWidth = 1.4; if (mo > 0) { ctx.beginPath(); ctx.arc(mx, my, R, -Math.PI / 2, -Math.PI / 2 + Math.PI * 2 * mo); ctx.stroke(); }
|
|
493
|
+
// orbit ring
|
|
494
|
+
ctx.save(); ctx.globalAlpha = ph(1.5, 1.9); ctx.translate(mx, my); ctx.rotate(-0.25);
|
|
495
|
+
ctx.strokeStyle = 'rgba(110,235,255,0.35)'; ctx.setLineDash([2, 5]); ctx.beginPath(); ctx.ellipse(0, 0, R * 1.6, R * 0.38, 0, Math.PI * 1.02, Math.PI * 1.98 + Math.PI * 1.0); ctx.stroke(); ctx.setLineDash([]);
|
|
496
|
+
const oa = t * 0.6; ctx.fillStyle = '#ffffff'; ctx.beginPath(); ctx.arc(Math.cos(oa) * R * 1.6, Math.sin(oa) * R * 0.38, 2.5, 0, 7); ctx.fill();
|
|
497
|
+
ctx.restore();
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
// ---------- terrain: "loss landscape" heightfield ----------
|
|
501
|
+
const cam = makeCam([0, 22, camZ], 0.105, 760, W / 2, H_ / 2);
|
|
502
|
+
const height = (x, z) => {
|
|
503
|
+
const ridge = (u, v) => 1 - Math.abs(nz.n2(u, v));
|
|
504
|
+
let h = Math.pow(ridge(x * 0.04, z * 0.04), 2.2) * 11 + nz.fbm2(x * 0.08, z * 0.08, 3) * 3;
|
|
505
|
+
const side = Math.pow(Math.abs(x) / 70, 1.6) * 9;
|
|
506
|
+
h = h * (0.35 + H.smooth(4, 40, Math.abs(x)) * 0.9) + side;
|
|
507
|
+
// distant range
|
|
508
|
+
h += H.smooth(105, 175, z) * Math.pow(ridge(x * 0.025 + 7, z * 0.02), 1.6) * (16 + 16 * H.smooth(-60, 20, x));
|
|
509
|
+
// the "global minimum" basin
|
|
510
|
+
const db = Math.hypot(x - 4, z - 84);
|
|
511
|
+
h -= 10 * Math.exp(-(db * db) / 160);
|
|
512
|
+
return h - 2;
|
|
513
|
+
};
|
|
514
|
+
const STEP = 2.5, X0 = -180, X1 = 180, Z0 = 25, Z1 = 185;
|
|
515
|
+
const nx = (X1 - X0) / STEP, nzr = (Z1 - Z0) / STEP;
|
|
516
|
+
const zOff = Math.floor((camZ + 6) / STEP) * STEP; // grid scrolls with camera so it never runs out
|
|
517
|
+
const PTS = [];
|
|
518
|
+
for (let j = 0; j <= nzr; j++) {
|
|
519
|
+
const row = [];
|
|
520
|
+
for (let i = 0; i <= nx; i++) {
|
|
521
|
+
const x = X0 + i * STEP, z = Z0 + j * STEP + zOff;
|
|
522
|
+
const y = height(x, z);
|
|
523
|
+
row.push([...cam(x, y, z), y]);
|
|
524
|
+
}
|
|
525
|
+
PTS.push(row);
|
|
526
|
+
}
|
|
527
|
+
const REV0 = 0.4, REV1 = 2.3;
|
|
528
|
+
const revealD = 18 + 180 * H.ease.inOut(ph(REV0, REV1));
|
|
529
|
+
const building = t < REV1;
|
|
530
|
+
const scanZ = building ? camZ + revealD : camZ + 40 + (((t - REV1) * 26 + 60) % 150);
|
|
531
|
+
// back-to-front
|
|
532
|
+
ctx.lineJoin = 'round';
|
|
533
|
+
for (let j = nzr - 1; j >= 0; j--) {
|
|
534
|
+
const zw = Z0 + j * STEP + zOff;
|
|
535
|
+
if (zw - camZ > revealD) continue;
|
|
536
|
+
const depth = PTS[j][0][2];
|
|
537
|
+
const fog = H.clamp(H.smooth(45, 190, zw - zOff + 6));
|
|
538
|
+
const fill = H.mix(NAVY, [14, 30, 88], fog);
|
|
539
|
+
const scan = Math.exp(-Math.pow((zw - scanZ) / (building ? 3.5 : 2.2), 2)) * (building ? 1 : 0.72); // sweeping scan row, kept below clipping
|
|
540
|
+
const lw = H.clamp(1.5 - depth / 90, 0.45, 1.5);
|
|
541
|
+
// order cells in the row from the outside in (camera is at x=0)
|
|
542
|
+
const order = [];
|
|
543
|
+
for (let i = 0; i < nx; i++) order.push(i);
|
|
544
|
+
order.sort((a, b) => Math.abs(X0 + (b + 0.5) * STEP) - Math.abs(X0 + (a + 0.5) * STEP));
|
|
545
|
+
for (const i of order) {
|
|
546
|
+
const a = PTS[j][i], b = PTS[j][i + 1], c = PTS[j + 1][i + 1], d = PTS[j + 1][i];
|
|
547
|
+
if (a[2] < 1) continue;
|
|
548
|
+
if (Math.max(a[0], b[0], c[0], d[0]) < -20 || Math.min(a[0], b[0], c[0], d[0]) > W + 20 || Math.min(a[1], b[1], c[1], d[1]) > H_ + 20) continue;
|
|
549
|
+
ctx.beginPath(); ctx.moveTo(a[0], a[1]); ctx.lineTo(b[0], b[1]); ctx.lineTo(c[0], c[1]); ctx.lineTo(d[0], d[1]); ctx.closePath();
|
|
550
|
+
ctx.fillStyle = `rgb(${fill[0] | 0},${fill[1] | 0},${fill[2] | 0})`; ctx.fill();
|
|
551
|
+
const hk = H.clamp((a[3] + 2) / 16);
|
|
552
|
+
let col = H.mix([40, 200, 255], [210, 250, 255], hk * 0.8);
|
|
553
|
+
col = H.mix(col, [255, 255, 255], scan);
|
|
554
|
+
const alpha = H.clamp((1 - fog * 0.85) * (0.55 + hk * 0.45) + scan, 0, 1);
|
|
555
|
+
ctx.strokeStyle = H.rgba(col, alpha); ctx.lineWidth = lw + scan * 1.2;
|
|
556
|
+
ctx.stroke();
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
// horizon haze line
|
|
560
|
+
const hz = ctx.createLinearGradient(0, HORIZON_Y - 60, 0, HORIZON_Y + 30);
|
|
561
|
+
hz.addColorStop(0, 'rgba(40,120,255,0)'); hz.addColorStop(0.7, 'rgba(40,140,255,0.10)'); hz.addColorStop(1, 'rgba(40,120,255,0)');
|
|
562
|
+
ctx.fillStyle = hz; ctx.fillRect(0, HORIZON_Y - 60, W, 90);
|
|
563
|
+
|
|
564
|
+
// ---------- bloom: blurred copy of the frame added on top ----------
|
|
565
|
+
{
|
|
566
|
+
const L = H.layer(W, H_), lc = L.getContext('2d');
|
|
567
|
+
lc.filter = 'blur(6px)'; lc.drawImage(ctx.canvas, 0, 0, W, H_);
|
|
568
|
+
ctx.save(); ctx.globalCompositeOperation = 'lighter'; ctx.globalAlpha = 0.55; ctx.drawImage(L, 0, 0); ctx.restore();
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
// ---------- HUD ----------
|
|
572
|
+
const CY = '#7feaff';
|
|
573
|
+
ctx.font = '400 11px "IBM Plex Mono"'; ctx.fillStyle = CY; ctx.strokeStyle = CY;
|
|
574
|
+
// global-minimum marker
|
|
575
|
+
{
|
|
576
|
+
const mzw = 84, mxw = 4;
|
|
577
|
+
const p = cam(mxw, height(mxw, mzw), mzw);
|
|
578
|
+
const lock = H.ease.out(ph(2.75, 3.15));
|
|
579
|
+
const blinkOn = t > 2.75 && (t > 3.15 || Math.floor(t * 16) % 2 === 0);
|
|
580
|
+
if (blinkOn) {
|
|
581
|
+
const pulse = lock < 1 ? 1 + (1 - lock) * 4 : 1 + 0.25 * Math.sin(t * 4);
|
|
582
|
+
ctx.lineWidth = 1.2;
|
|
583
|
+
ctx.strokeStyle = '#ffd36b';
|
|
584
|
+
ctx.beginPath(); ctx.arc(p[0], p[1], 9 * pulse, 0, 7); ctx.stroke();
|
|
585
|
+
ctx.beginPath(); ctx.arc(p[0], p[1], 2.5, 0, 7); ctx.fillStyle = '#ffd36b'; ctx.fill();
|
|
586
|
+
const g = 14 + (1 - lock) * 30;
|
|
587
|
+
for (const [dx, dy] of [[1, 0], [-1, 0], [0, 1], [0, -1]]) { ctx.beginPath(); ctx.moveTo(p[0] + dx * g, p[1] + dy * g); ctx.lineTo(p[0] + dx * (g + 8), p[1] + dy * (g + 8)); ctx.stroke(); }
|
|
588
|
+
}
|
|
589
|
+
const lk = H.ease.inOut(ph(3.1, 3.45));
|
|
590
|
+
if (lk > 0) {
|
|
591
|
+
const L1 = 79 * Math.SQRT2, L2 = 195, dd = (L1 + L2) * lk;
|
|
592
|
+
ctx.beginPath(); ctx.moveTo(p[0] + 16, p[1] - 16);
|
|
593
|
+
const a1 = Math.min(dd, L1) / Math.SQRT2; ctx.lineTo(p[0] + 16 + a1, p[1] - 16 - a1);
|
|
594
|
+
if (dd > L1) ctx.lineTo(p[0] + 95 + (dd - L1), p[1] - 95);
|
|
595
|
+
ctx.stroke();
|
|
596
|
+
}
|
|
597
|
+
ctx.fillStyle = '#ffd36b'; ctx.font = '600 13px "IBM Plex Mono"'; ctx.fillText(typed('GLOBAL MIN', 3.35, 3.6), p[0] + 100, p[1] - 102);
|
|
598
|
+
ctx.font = '400 11px "IBM Plex Mono"'; ctx.fillStyle = 'rgba(255,211,107,0.8)';
|
|
599
|
+
ctx.fillText(typed(`loss=0.0${(37 - Math.floor(t * 3) % 9)} x=${mxw.toFixed(1)} z=${mzw.toFixed(1)}`, 3.5, 3.9), p[0] + 100, p[1] - 80);
|
|
600
|
+
}
|
|
601
|
+
// peak markers
|
|
602
|
+
ctx.fillStyle = CY; ctx.strokeStyle = 'rgba(127,234,255,0.7)'; ctx.lineWidth = 1;
|
|
603
|
+
const peak = (x0, x1, z0, z1) => { let best = [x0, z0, -1e9]; for (let x = x0; x <= x1; x += 2.5) for (let z = z0; z <= z1; z += 2.5) { const h = height(x, z); if (h > best[2]) best = [x, z, h]; } return best; };
|
|
604
|
+
[[-50, -18, 70, 100, 'LOCAL MAX', 2.2], [22, 60, 92, 130, 'PEAK_B', 2.4], [50, 100, 150, 180, 'RIDGE_C', 2.6]].forEach(([x0, x1, z0, z1, name, a0]) => {
|
|
605
|
+
if (t < a0) return;
|
|
606
|
+
const [xw, zw] = peak(x0, x1, z0, z1);
|
|
607
|
+
const p = cam(xw, height(xw, zw), zw);
|
|
608
|
+
const st = H.ease.out(ph(a0, a0 + 0.25));
|
|
609
|
+
ctx.beginPath(); ctx.moveTo(p[0], p[1]); ctx.lineTo(p[0], p[1] - 34 * st); ctx.stroke();
|
|
610
|
+
if (Math.floor(t * 20) % 2 === 0 || t > a0 + 0.2) { ctx.beginPath(); ctx.rect(p[0] - 3, p[1] - 3, 6, 6); ctx.stroke(); }
|
|
611
|
+
{ // dark scrim so the tag reads over the scan row and the sphere rim
|
|
612
|
+
const tn = typed(name, a0 + 0.2, a0 + 0.45); if (tn) { ctx.save(); ctx.font = '600 11px "IBM Plex Mono"'; ctx.fillStyle = 'rgba(3,8,30,0.72)'; ctx.fillRect(p[0] + 2, p[1] - 49, Math.max(ctx.measureText(name).width, 44) + 8, 30); ctx.restore(); }
|
|
613
|
+
}
|
|
614
|
+
ctx.font = '600 11px "IBM Plex Mono"'; ctx.fillText(typed(name, a0 + 0.2, a0 + 0.45), p[0] + 5, p[1] - 36);
|
|
615
|
+
ctx.font = '400 10px "IBM Plex Mono"'; ctx.fillStyle = 'rgba(127,234,255,0.65)';
|
|
616
|
+
ctx.fillText(typed(`h=${(height(xw, zw) * 0.137).toFixed(3)}`, a0 + 0.35, a0 + 0.6), p[0] + 5, p[1] - 24); ctx.fillStyle = CY;
|
|
617
|
+
});
|
|
618
|
+
// corner brackets
|
|
619
|
+
ctx.strokeStyle = 'rgba(127,234,255,0.8)'; ctx.lineWidth = 1.5;
|
|
620
|
+
const br = (x, y, sx, sy) => { ctx.beginPath(); ctx.moveTo(x, y + sy * 26); ctx.lineTo(x, y); ctx.lineTo(x + sx * 26, y); ctx.stroke(); };
|
|
621
|
+
const bk = t < 0.05 ? 0 : t < 0.12 ? 1 : t < 0.17 ? 0 : 1; // power-on flicker
|
|
622
|
+
if (bk) { const o = Math.round((1 - H.ease.out(ph(0.05, 0.35))) * 3) * 12; br(28 + o, 28 + o, 1, 1); br(W - 28 - o, 28 + o, -1, 1); br(28 + o, H_ - 28 - o, 1, -1); br(W - 28 - o, H_ - 28 - o, -1, -1); }
|
|
623
|
+
// compass ribbon (top center)
|
|
624
|
+
{
|
|
625
|
+
const cx = W / 2, y = 44, heading = 12 + t * 3, cw = 220 * H.ease.inOut(ph(0.3, 0.9));
|
|
626
|
+
ctx.save(); ctx.beginPath(); ctx.rect(cx - cw, y - 20, cw * 2, 40); ctx.clip();
|
|
627
|
+
ctx.lineWidth = 1;
|
|
628
|
+
for (let d = Math.floor(heading - 40); d <= heading + 40; d++) {
|
|
629
|
+
const x = cx + (d - heading) * 5.5;
|
|
630
|
+
const a = 1 - Math.abs(d - heading) / 40;
|
|
631
|
+
ctx.strokeStyle = `rgba(127,234,255,${a * 0.8})`;
|
|
632
|
+
const len = d % 10 === 0 ? 10 : d % 5 === 0 ? 6 : 3;
|
|
633
|
+
ctx.beginPath(); ctx.moveTo(x, y); ctx.lineTo(x, y + len); ctx.stroke();
|
|
634
|
+
if (d % 10 === 0) { ctx.fillStyle = `rgba(127,234,255,${a})`; ctx.font = '400 10px "IBM Plex Mono"'; ctx.textAlign = 'center'; ctx.fillText(String((d + 360) % 360).padStart(3, '0'), x, y - 6); }
|
|
635
|
+
}
|
|
636
|
+
ctx.restore(); ctx.textAlign = 'left';
|
|
637
|
+
if (t > 0.6) ctx.fillStyle = CY; else ctx.fillStyle = 'rgba(0,0,0,0)'; ctx.beginPath(); ctx.moveTo(cx, y + 14); ctx.lineTo(cx - 5, y + 22); ctx.lineTo(cx + 5, y + 22); ctx.closePath(); ctx.fill();
|
|
638
|
+
}
|
|
639
|
+
// title block (top-left) on a soft scrim
|
|
640
|
+
{ const sg = ctx.createRadialGradient(170, 130, 20, 170, 130, 300); sg.addColorStop(0, 'rgba(2,5,26,0.75)'); sg.addColorStop(1, 'rgba(2,5,26,0)'); ctx.fillStyle = sg; ctx.fillRect(0, 0, 560, 520); }
|
|
641
|
+
ctx.fillStyle = 'rgba(127,234,255,0.75)'; ctx.font = '400 14px "Space Mono"';
|
|
642
|
+
ctx.fillText(typed('// SEQ 04 — OPTIMIZATION', 0.35, 0.8), 64, 86);
|
|
643
|
+
ctx.fillStyle = '#e8fbff'; ctx.font = '700 34px "Space Mono"';
|
|
644
|
+
const l1 = typed('THE LOSS', 0.8, 1.2), l2 = typed('LANDSCAPE', 1.2, 1.65);
|
|
645
|
+
ctx.fillText(l1, 62, 128); ctx.fillText(l2, 62, 166);
|
|
646
|
+
if (t > 0.8 && t < 2.6 && Math.floor(t * 4) % 2 === 0) { const onL2 = t > 1.2; const tw = ctx.measureText(onL2 ? l2 : l1).width; ctx.fillStyle = CY; ctx.fillRect(66 + tw, onL2 ? 140 : 102, 18, 30); }
|
|
647
|
+
ctx.fillStyle = CY; ctx.fillRect(64, 182, 46 * H.ease.out(ph(1.6, 1.9)), 2);
|
|
648
|
+
// telemetry (bottom-left)
|
|
649
|
+
ctx.font = '400 11px "IBM Plex Mono"';
|
|
650
|
+
const lines = [`CAM x=+0.00 y=+22.0 z=${camZ.toFixed(2)}`, `FOV 62.4° PITCH -6.0°`, `GRID 144×64 STEP 2.5`, `EPOCH ${String(120 + Math.floor(t * 10)).padStart(4, '0')} LR 3e-4`];
|
|
651
|
+
const pw = 262 * H.ease.out(ph(1.3, 1.6));
|
|
652
|
+
if (pw > 1) {
|
|
653
|
+
ctx.fillStyle = 'rgba(3,8,30,0.82)'; ctx.fillRect(52, H_ - 120, pw, 84);
|
|
654
|
+
ctx.strokeStyle = 'rgba(127,234,255,0.35)'; ctx.lineWidth = 1; ctx.strokeRect(52.5, H_ - 119.5, pw - 1, 83);
|
|
655
|
+
ctx.fillStyle = CY; ctx.fillRect(52, H_ - 120, 3, 84);
|
|
656
|
+
lines.forEach((l, i) => { ctx.fillStyle = i === 3 ? '#ffd36b' : 'rgba(127,234,255,0.8)'; ctx.fillText(typed(l, 1.55 + i * 0.18, 1.85 + i * 0.18), 64, H_ - 102 + i * 17); });
|
|
657
|
+
}
|
|
658
|
+
// axis scale (right)
|
|
659
|
+
const ax = H.ease.out(ph(1.7, 2.2));
|
|
660
|
+
ctx.strokeStyle = 'rgba(127,234,255,0.6)'; ctx.beginPath(); ctx.moveTo(W - 64, 640); ctx.lineTo(W - 64, 640 - 260 * ax); ctx.stroke();
|
|
661
|
+
for (let i = 0; ax > 0 && i <= Math.floor(10 * ax); i++) {
|
|
662
|
+
const y = 640 - i * 26; ctx.beginPath(); ctx.moveTo(W - 64, y); ctx.lineTo(W - 64 - (i % 5 === 0 ? 12 : 6), y); ctx.stroke();
|
|
663
|
+
if (i % 5 === 0) { ctx.fillStyle = 'rgba(127,234,255,0.7)'; ctx.textAlign = 'right'; ctx.fillText((i * 0.1).toFixed(1), W - 82, y + 4); ctx.textAlign = 'left'; }
|
|
664
|
+
}
|
|
665
|
+
ctx.save(); ctx.globalAlpha = ph(2.0, 2.3); ctx.translate(W - 44, 512); ctx.rotate(-Math.PI / 2); ctx.textAlign = 'center'; ctx.fillStyle = 'rgba(127,234,255,0.7)'; ctx.fillText('LOSS', 0, 0); ctx.restore();
|
|
666
|
+
// subtle scanlines for the vector-display feel
|
|
667
|
+
ctx.fillStyle = 'rgba(0,0,0,0.12)';
|
|
668
|
+
for (let y = 0; y < H_; y += 3) ctx.fillRect(0, y, W, 1);
|
|
669
|
+
H.vignette(ctx, W, H_, 0.45, '0,0,10');
|
|
670
|
+
},
|
|
671
|
+
});
|
|
672
|
+
}
|