@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,854 @@
|
|
|
1
|
+
// Editorial Essay Collage: the editorial "animated opinion essay" look. Warm paper, archival halftone prints with torn
|
|
2
|
+
// edges and white borders, newspaper clippings with a yellow highlighter sweep, masking tape, flat colour blocks,
|
|
3
|
+
// cut-out condensed headlines, flat diagrams with thin lines and pins. 2.5D parallax camera (smooth) over cutouts
|
|
4
|
+
// that move on 12 fps steps; cuts hidden inside fast blurred camera whips.
|
|
5
|
+
{
|
|
6
|
+
const TAU = Math.PI * 2;
|
|
7
|
+
const KRAFT = '#c9a878';
|
|
8
|
+
const PAPER = '#f0e9d9', INK = '#1a1816', RED = '#b8483a', CARD = '#f5f1e7', NEWS = '#e9e1cb';
|
|
9
|
+
const C = {}; // caches (static textures and sprites; output still depends only on t)
|
|
10
|
+
const NZ = () => C.nz || (C.nz = H.makeNoise(4242));
|
|
11
|
+
const q12 = (t) => Math.floor(t * 12 + 1e-6) / 12;
|
|
12
|
+
const gs = (v, a = 1) => { const k = Math.round(H.clamp(v) * 255); return a >= 1 ? `rgb(${k},${k},${k})` : `rgba(${k},${k},${k},${a})`; };
|
|
13
|
+
const ell = (c, x, y, rx, ry, rot = 0) => { c.beginPath(); c.ellipse(x, y, Math.abs(rx), Math.abs(ry), rot, 0, TAU); };
|
|
14
|
+
const pathPoly = (c, p) => { c.beginPath(); c.moveTo(p[0][0], p[0][1]); for (let i = 1; i < p.length; i++) c.lineTo(p[i][0], p[i][1]); c.closePath(); };
|
|
15
|
+
const measure = (font, s) => { const m = C.m || (C.m = H.layer(8, 8).getContext('2d')); m.font = font; return m.measureText(s); };
|
|
16
|
+
|
|
17
|
+
// rectangle centred on 0 -> polygon; torn sides get a ragged fibre edge, cut sides stay straight (scissor cut)
|
|
18
|
+
const edgePoly = (w, h, torn, seed, amp = 5) => {
|
|
19
|
+
const nz = NZ(), r = H.rng(seed);
|
|
20
|
+
const cs = [[-w / 2, -h / 2], [w / 2, -h / 2], [w / 2, h / 2], [-w / 2, h / 2]].map(([x, y]) => [x + (r() - 0.5) * 4, y + (r() - 0.5) * 4]);
|
|
21
|
+
const out = [];
|
|
22
|
+
for (let e = 0; e < 4; e++) {
|
|
23
|
+
const [ax, ay] = cs[e], [bx, by] = cs[(e + 1) % 4], len = Math.hypot(bx - ax, by - ay), dx = (bx - ax) / len, dy = (by - ay) / len;
|
|
24
|
+
if (!torn[e]) { out.push([ax, ay]); continue; }
|
|
25
|
+
const o = seed * 0.37 + e * 11.3;
|
|
26
|
+
for (let d = 0; d < len; d += 2.5) {
|
|
27
|
+
const fade = Math.min(1, d / 10, (len - d) / 10);
|
|
28
|
+
const off = (nz.fbm2(o + d * 0.021, o * 0.5, 4) * amp * 1.7 + (r() - 0.5) * amp * 0.3 - amp * 0.25) * fade;
|
|
29
|
+
out.push([ax + dx * d + dy * off, ay + dy * d - dx * off]);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return out;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const sprite = (w, h, pad, paint) => {
|
|
36
|
+
const cv = H.layer(Math.ceil(w + pad * 2), Math.ceil(h + pad * 2)), c = cv.getContext('2d');
|
|
37
|
+
c.translate(cv.width / 2, cv.height / 2); paint(c);
|
|
38
|
+
return { cv, ox: cv.width / 2, oy: cv.height / 2, w, h };
|
|
39
|
+
};
|
|
40
|
+
const drawSpr = (c, s) => c.drawImage(s.cv, -s.ox, -s.oy);
|
|
41
|
+
const shadowFill = (c, poly, col, sh = 1) => {
|
|
42
|
+
c.save(); c.shadowColor = `rgba(40,28,15,${0.4 * sh})`; c.shadowBlur = 15 * sh; c.shadowOffsetX = 4 * sh; c.shadowOffsetY = 8 * sh;
|
|
43
|
+
pathPoly(c, poly); c.fillStyle = col; c.fill(); c.restore();
|
|
44
|
+
c.save(); c.shadowColor = 'rgba(40,28,15,0.25)'; c.shadowBlur = 2; c.shadowOffsetY = 1; pathPoly(c, poly); c.fillStyle = col; c.fill(); c.restore();
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// ---------- paper fibre texture (white based; multiplied over paper colour and cutouts) ----------
|
|
48
|
+
const fibre = () => {
|
|
49
|
+
if (C.fib) return C.fib;
|
|
50
|
+
const W = 2000, Hh = 1100, cv = H.layer(W, Hh), c = cv.getContext('2d'), nz = NZ(), r = H.rng(31);
|
|
51
|
+
c.fillStyle = '#fff'; c.fillRect(0, 0, W, Hh);
|
|
52
|
+
const lo = H.layer(250, 138), lc = lo.getContext('2d'), im = lc.createImageData(250, 138);
|
|
53
|
+
for (let y = 0; y < 138; y++) for (let x = 0; x < 250; x++) {
|
|
54
|
+
const v = nz.fbm2(x * 0.05, y * 0.05, 4) * 0.6 + nz.n2(x * 0.3, y * 0.3) * 0.4, k = (y * 250 + x) * 4;
|
|
55
|
+
const g = 244 + v * 22; im.data[k] = g; im.data[k + 1] = g - 2; im.data[k + 2] = g - 6; im.data[k + 3] = 255;
|
|
56
|
+
}
|
|
57
|
+
lc.putImageData(im, 0, 0); c.imageSmoothingQuality = 'high'; c.drawImage(lo, 0, 0, W, Hh);
|
|
58
|
+
c.lineCap = 'round';
|
|
59
|
+
for (let i = 0; i < 2600; i++) {
|
|
60
|
+
const x = r() * W, y = r() * Hh, a = r() * TAU, l = 4 + r() * 16, dark = r() < 0.55;
|
|
61
|
+
c.strokeStyle = dark ? `rgba(120,100,70,${0.05 + r() * 0.08})` : `rgba(255,255,255,${0.2 + r() * 0.3})`; c.lineWidth = 0.6 + r() * 0.7;
|
|
62
|
+
c.beginPath(); c.moveTo(x, y); c.quadraticCurveTo(x + Math.cos(a + 0.4) * l * 0.5, y + Math.sin(a + 0.4) * l * 0.5, x + Math.cos(a) * l, y + Math.sin(a) * l); c.stroke();
|
|
63
|
+
}
|
|
64
|
+
for (let i = 0; i < 900; i++) { c.fillStyle = `rgba(80,60,40,${0.08 + r() * 0.2})`; c.fillRect(r() * W, r() * Hh, 0.8 + r() * 1.4, 0.8 + r() * 1.2); }
|
|
65
|
+
return (C.fib = cv);
|
|
66
|
+
};
|
|
67
|
+
const texture = (c, poly, alpha, ox = 0, oy = 0) => {
|
|
68
|
+
c.save(); pathPoly(c, poly); c.clip(); c.globalCompositeOperation = 'multiply'; c.globalAlpha = alpha; c.drawImage(fibre(), -1000 + ox, -550 + oy); c.restore();
|
|
69
|
+
};
|
|
70
|
+
const grainTiles = () => {
|
|
71
|
+
if (C.gr) return C.gr;
|
|
72
|
+
C.gr = [0, 1, 2, 3].map((s) => {
|
|
73
|
+
const cv = H.layer(256, 256), c = cv.getContext('2d'), im = c.createImageData(256, 256), r = H.rng(900 + s);
|
|
74
|
+
for (let i = 0; i < im.data.length; i += 4) { const v = 128 + (r() + r() + r() - 1.5) * 150; im.data[i] = im.data[i + 1] = im.data[i + 2] = v; im.data[i + 3] = 255; }
|
|
75
|
+
c.putImageData(im, 0, 0); return c.createPattern(cv, 'repeat');
|
|
76
|
+
});
|
|
77
|
+
return C.gr;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
// ---------- photographs: grey scene -> soft blur, grain, contrast, coarse halftone duotone ----------
|
|
81
|
+
const treat = (w, h, seed, paint, o = {}) => {
|
|
82
|
+
const cell = o.cell || 4, mix = o.mix == null ? 0.38 : o.mix, con = o.con || 1.25;
|
|
83
|
+
const a = H.layer(w, h), ac = a.getContext('2d'); paint(ac, w, h);
|
|
84
|
+
const b = H.layer(w, h), bc = b.getContext('2d'); bc.filter = `blur(${o.blur || 1}px)`; bc.drawImage(a, 0, 0); bc.filter = 'none';
|
|
85
|
+
const img = bc.getImageData(0, 0, w, h), d = img.data, r = H.rng(seed);
|
|
86
|
+
const ink = [30, 27, 25], pap = [238, 231, 214], ca = Math.cos(0.785), sa = Math.sin(0.785);
|
|
87
|
+
for (let py = 0; py < h; py++) for (let px = 0; px < w; px++) {
|
|
88
|
+
const k = (py * w + px) * 4, u = px / w - 0.5, v = py / h - 0.5;
|
|
89
|
+
let L = d[k] / 255;
|
|
90
|
+
L *= 1 - (u * u + v * v) * 1.1;
|
|
91
|
+
L += (r() + r() + r() - 1.5) * 0.11;
|
|
92
|
+
L = H.clamp((L - 0.5) * con + 0.5 + (o.lift || 0));
|
|
93
|
+
const D = 1 - L, rx = px * ca + py * sa, ry = -px * sa + py * ca;
|
|
94
|
+
const gx = (Math.floor(rx / cell) + 0.5) * cell, gy = (Math.floor(ry / cell) + 0.5) * cell;
|
|
95
|
+
const dot = H.clamp(cell * 0.74 * Math.sqrt(D) - Math.hypot(rx - gx, ry - gy) + 0.6);
|
|
96
|
+
const cov = dot * (1 - mix) + D * mix;
|
|
97
|
+
d[k] = pap[0] + (ink[0] - pap[0]) * cov; d[k + 1] = pap[1] + (ink[1] - pap[1]) * cov; d[k + 2] = pap[2] + (ink[2] - pap[2]) * cov;
|
|
98
|
+
}
|
|
99
|
+
bc.putImageData(img, 0, 0);
|
|
100
|
+
// dust and a hairline scratch, like an old print
|
|
101
|
+
for (let i = 0; i < w * h / 2500; i++) { bc.fillStyle = r() < 0.6 ? 'rgba(245,240,228,0.8)' : 'rgba(20,18,16,0.5)'; ell(bc, r() * w, r() * h, 0.5 + r() * 1.2, 0.5 + r() * 1.0); bc.fill(); }
|
|
102
|
+
bc.strokeStyle = 'rgba(245,240,228,0.45)'; bc.lineWidth = 0.8; bc.beginPath(); const sx = r() * w; bc.moveTo(sx, 0); bc.bezierCurveTo(sx + 20, h * 0.3, sx - 15, h * 0.6, sx + 10 + r() * 20, h); bc.stroke();
|
|
103
|
+
return b;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
const furStrokes = (c, cx, cy, rx, ry, base, n, seed) => {
|
|
107
|
+
const r = H.rng(seed); c.lineCap = 'round';
|
|
108
|
+
for (let i = 0; i < n; i++) {
|
|
109
|
+
const a = r() * TAU, rr = Math.sqrt(r()), x = cx + Math.cos(a) * rx * rr, y = cy + Math.sin(a) * ry * rr, l = 3 + r() * 6, ang = a + (r() - 0.5) * 0.8;
|
|
110
|
+
c.strokeStyle = gs(base + (r() - 0.5) * 0.5, 0.18); c.lineWidth = 0.8 + r();
|
|
111
|
+
c.beginPath(); c.moveTo(x, y); c.lineTo(x + Math.cos(ang) * l, y + Math.sin(ang) * l); c.stroke();
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
const room = (c, w, h, bg, seed) => {
|
|
115
|
+
const r = H.rng(seed);
|
|
116
|
+
let g = c.createLinearGradient(0, 0, w * 0.4, h); g.addColorStop(0, gs(bg + 0.15)); g.addColorStop(1, gs(bg - 0.22));
|
|
117
|
+
c.fillStyle = g; c.fillRect(0, 0, w, h);
|
|
118
|
+
g = c.createRadialGradient(w * (0.1 + r() * 0.2), h * 0.05, 0, w * 0.2, h * 0.1, w * 0.7); g.addColorStop(0, 'rgba(255,255,255,0.35)'); g.addColorStop(1, 'rgba(255,255,255,0)');
|
|
119
|
+
c.fillStyle = g; c.fillRect(0, 0, w, h);
|
|
120
|
+
c.fillStyle = gs(bg - 0.28); c.fillRect(0, h * (0.8 + r() * 0.06), w, h);
|
|
121
|
+
};
|
|
122
|
+
const catGray = (c, w, h, v) => {
|
|
123
|
+
room(c, w, h, v.bg, v.seed);
|
|
124
|
+
if (v.flip) { c.translate(w, 0); c.scale(-1, 1); }
|
|
125
|
+
const s = Math.min(w, h) * (v.sc || 1), cx = w * (0.5 + (v.dx || 0)), cy = h * (0.46 + (v.dy || 0)), f = v.fur;
|
|
126
|
+
let g = c.createRadialGradient(cx - 0.1 * s, cy + 0.3 * s, 0, cx, cy + 0.5 * s, 0.45 * s); g.addColorStop(0, gs(f + 0.18)); g.addColorStop(1, gs(f - 0.22));
|
|
127
|
+
ell(c, cx + 0.04 * s, cy + 0.52 * s, 0.36 * s, 0.36 * s); c.fillStyle = g; c.fill();
|
|
128
|
+
ell(c, cx, cy + 0.36 * s, 0.13 * s, 0.12 * s); c.fillStyle = gs(f + 0.3, 0.6); c.fill();
|
|
129
|
+
for (const sd of [-1, 1]) {
|
|
130
|
+
c.beginPath(); c.moveTo(cx + sd * 0.06 * s, cy - 0.16 * s); c.lineTo(cx + sd * 0.25 * s, cy - 0.4 * s); c.lineTo(cx + sd * 0.27 * s, cy - 0.02 * s); c.closePath(); c.fillStyle = gs(f - 0.08); c.fill();
|
|
131
|
+
c.beginPath(); c.moveTo(cx + sd * 0.11 * s, cy - 0.15 * s); c.lineTo(cx + sd * 0.23 * s, cy - 0.32 * s); c.lineTo(cx + sd * 0.23 * s, cy - 0.08 * s); c.closePath(); c.fillStyle = gs(f + 0.28); c.fill();
|
|
132
|
+
}
|
|
133
|
+
g = c.createRadialGradient(cx - 0.08 * s, cy - 0.1 * s, 0, cx, cy, 0.3 * s); g.addColorStop(0, gs(f + 0.2)); g.addColorStop(1, gs(f - 0.15));
|
|
134
|
+
ell(c, cx, cy, 0.28 * s, 0.23 * s); c.fillStyle = g; c.fill();
|
|
135
|
+
if (v.tabby) { c.strokeStyle = gs(f - 0.3, 0.75); c.lineWidth = 0.022 * s; c.lineCap = 'round'; for (const k of [-1, 0, 1]) { c.beginPath(); c.moveTo(cx + k * 0.05 * s, cy - 0.21 * s); c.quadraticCurveTo(cx + k * 0.06 * s, cy - 0.14 * s, cx + k * 0.035 * s, cy - 0.08 * s); c.stroke(); } for (const sd of [-1, 1]) for (let i = 0; i < 3; i++) { c.beginPath(); c.moveTo(cx + sd * (0.2 + i * 0.03) * s, cy + (0.04 + i * 0.06) * s); c.lineTo(cx + sd * (0.28) * s, cy + (0.02 + i * 0.07) * s); c.stroke(); } }
|
|
136
|
+
furStrokes(c, cx, cy, 0.27 * s, 0.22 * s, f, 160, v.seed + 3);
|
|
137
|
+
furStrokes(c, cx, cy + 0.5 * s, 0.34 * s, 0.32 * s, f, 160, v.seed + 4);
|
|
138
|
+
for (const sd of [-1, 1]) { ell(c, cx + sd * 0.045 * s, cy + 0.1 * s, 0.065 * s, 0.05 * s); c.fillStyle = gs(f + 0.32); c.fill(); }
|
|
139
|
+
c.beginPath(); c.moveTo(cx - 0.03 * s, cy + 0.045 * s); c.lineTo(cx + 0.03 * s, cy + 0.045 * s); c.lineTo(cx, cy + 0.08 * s); c.closePath(); c.fillStyle = gs(0.15); c.fill();
|
|
140
|
+
for (const sd of [-1, 1]) {
|
|
141
|
+
ell(c, cx + sd * 0.1 * s, cy - 0.02 * s, 0.058 * s, 0.042 * s, sd * 0.15); c.fillStyle = gs(0.86); c.fill();
|
|
142
|
+
ell(c, cx + sd * 0.1 * s, cy - 0.02 * s, 0.018 * s, 0.038 * s); c.fillStyle = gs(0.03); c.fill();
|
|
143
|
+
ell(c, cx + sd * 0.1 * s - 0.01 * s, cy - 0.035 * s, 0.009 * s, 0.009 * s); c.fillStyle = gs(1); c.fill();
|
|
144
|
+
}
|
|
145
|
+
c.strokeStyle = gs(0.97, 0.7); c.lineWidth = 1;
|
|
146
|
+
for (const sd of [-1, 1]) for (let i = 0; i < 3; i++) { c.beginPath(); c.moveTo(cx + sd * 0.08 * s, cy + 0.1 * s + i * 4); c.quadraticCurveTo(cx + sd * 0.25 * s, cy + 0.06 * s + i * 7, cx + sd * 0.4 * s, cy + 0.08 * s + i * 12); c.stroke(); }
|
|
147
|
+
};
|
|
148
|
+
const dogGray = (c, w, h, v) => {
|
|
149
|
+
room(c, w, h, v.bg, v.seed);
|
|
150
|
+
if (v.flip) { c.translate(w, 0); c.scale(-1, 1); }
|
|
151
|
+
const s = Math.min(w, h) * (v.sc || 1), cx = w * (0.5 + (v.dx || 0)), cy = h * (0.44 + (v.dy || 0)), f = v.fur;
|
|
152
|
+
let g = c.createRadialGradient(cx - 0.1 * s, cy + 0.4 * s, 0, cx, cy + 0.55 * s, 0.5 * s); g.addColorStop(0, gs(f + 0.15)); g.addColorStop(1, gs(f - 0.2));
|
|
153
|
+
ell(c, cx, cy + 0.6 * s, 0.4 * s, 0.36 * s); c.fillStyle = g; c.fill();
|
|
154
|
+
g = c.createRadialGradient(cx - 0.08 * s, cy - 0.12 * s, 0, cx, cy, 0.32 * s); g.addColorStop(0, gs(f + 0.2)); g.addColorStop(1, gs(f - 0.12));
|
|
155
|
+
ell(c, cx, cy - 0.02 * s, 0.22 * s, 0.25 * s); c.fillStyle = g; c.fill();
|
|
156
|
+
for (const sd of [-1, 1]) { ell(c, cx + sd * 0.22 * s, cy + 0.06 * s, 0.085 * s, 0.22 * s, -sd * 0.32); c.fillStyle = gs(f - 0.3); c.fill(); }
|
|
157
|
+
furStrokes(c, cx, cy, 0.22 * s, 0.25 * s, f, 160, v.seed + 3);
|
|
158
|
+
furStrokes(c, cx, cy + 0.6 * s, 0.38 * s, 0.32 * s, f, 160, v.seed + 4);
|
|
159
|
+
ell(c, cx, cy + 0.14 * s, 0.13 * s, 0.11 * s); c.fillStyle = gs(f + 0.3); c.fill();
|
|
160
|
+
ell(c, cx, cy + 0.255 * s, 0.045 * s, 0.05 * s); c.fillStyle = gs(0.5); c.fill();
|
|
161
|
+
c.strokeStyle = gs(0.1); c.lineWidth = 0.012 * s; c.beginPath(); c.moveTo(cx, cy + 0.1 * s); c.lineTo(cx, cy + 0.18 * s); c.moveTo(cx - 0.08 * s, cy + 0.19 * s); c.quadraticCurveTo(cx, cy + 0.24 * s, cx + 0.08 * s, cy + 0.19 * s); c.stroke();
|
|
162
|
+
ell(c, cx, cy + 0.075 * s, 0.062 * s, 0.042 * s); c.fillStyle = gs(0.05); c.fill();
|
|
163
|
+
ell(c, cx - 0.018 * s, cy + 0.062 * s, 0.018 * s, 0.01 * s); c.fillStyle = gs(0.6); c.fill();
|
|
164
|
+
for (const sd of [-1, 1]) {
|
|
165
|
+
ell(c, cx + sd * 0.09 * s, cy - 0.12 * s, 0.03 * s, 0.018 * s); c.fillStyle = gs(f + 0.3); c.fill();
|
|
166
|
+
ell(c, cx + sd * 0.09 * s, cy - 0.06 * s, 0.034 * s, 0.034 * s); c.fillStyle = gs(0.04); c.fill();
|
|
167
|
+
ell(c, cx + sd * 0.09 * s - 0.01 * s, cy - 0.07 * s, 0.01 * s, 0.01 * s); c.fillStyle = gs(1); c.fill();
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
// the archival "electronic brain" room: cabinets of tape drives receding, an operator at the console
|
|
171
|
+
const OPX = 0.71, OPY = 0.52; // operator position in the photo (fraction of w,h)
|
|
172
|
+
const mainframeGray = (c, w, h) => {
|
|
173
|
+
const vx = w * 0.58, vy = h * 0.4;
|
|
174
|
+
let g = c.createLinearGradient(0, 0, 0, h); g.addColorStop(0, gs(0.3)); g.addColorStop(0.45, gs(0.55)); g.addColorStop(1, gs(0.7)); c.fillStyle = g; c.fillRect(0, 0, w, h);
|
|
175
|
+
// ceiling light panels in perspective
|
|
176
|
+
for (let i = 0; i < 6; i++) { const z = 1 / (1 + i * 0.55), y = vy - (vy - 10) * z, hw = w * 0.32 * z, hh = 14 * z; c.fillStyle = gs(0.95, 0.85); c.fillRect(vx - hw, y - hh, hw * 2, hh); }
|
|
177
|
+
// back wall
|
|
178
|
+
c.fillStyle = gs(0.62); c.fillRect(vx - w * 0.09, vy - h * 0.18, w * 0.2, h * 0.3);
|
|
179
|
+
// floor with tiles and sheen
|
|
180
|
+
g = c.createLinearGradient(0, vy, 0, h); g.addColorStop(0, gs(0.62)); g.addColorStop(1, gs(0.82)); c.fillStyle = g;
|
|
181
|
+
c.beginPath(); c.moveTo(0, h); c.lineTo(vx - w * 0.09, vy + h * 0.12); c.lineTo(vx + w * 0.11, vy + h * 0.12); c.lineTo(w, h); c.fill();
|
|
182
|
+
c.strokeStyle = gs(0.5, 0.5); c.lineWidth = 1;
|
|
183
|
+
for (let i = -8; i <= 8; i++) { c.beginPath(); c.moveTo(vx + i * 6, vy + h * 0.12); c.lineTo(vx + i * w * 0.12, h); c.stroke(); }
|
|
184
|
+
for (let i = 1; i < 7; i++) { const z = 1 / (i * 0.6), y = vy + h * 0.12 + (h - vy - h * 0.12) * (1 - z * 0.25) * (i / 7); c.beginPath(); c.moveTo(0, y); c.lineTo(w, y); c.stroke(); }
|
|
185
|
+
// left wall of cabinets (tape drives)
|
|
186
|
+
const N = 7;
|
|
187
|
+
for (let i = N - 1; i >= 0; i--) {
|
|
188
|
+
const z0 = 1 / (1 + i * 0.42), z1 = 1 / (1 + (i + 1) * 0.42);
|
|
189
|
+
const x0 = vx - (vx + 40) * z0, x1 = vx - (vx + 40) * z1;
|
|
190
|
+
const t0 = vy - (vy - h * 0.02) * z0, b0 = vy + (h * 0.98 - vy) * z0 * 0.86, t1 = vy - (vy - h * 0.02) * z1, b1 = vy + (h * 0.98 - vy) * z1 * 0.86;
|
|
191
|
+
c.beginPath(); c.moveTo(x0, t0); c.lineTo(x1, t1); c.lineTo(x1, b1); c.lineTo(x0, b0); c.closePath();
|
|
192
|
+
c.fillStyle = gs(0.5 + (i % 2) * 0.06); c.fill(); c.strokeStyle = gs(0.18); c.lineWidth = 2 * z0; c.stroke();
|
|
193
|
+
const mx = (x0 + x1) / 2, cw = (x0 - x1);
|
|
194
|
+
for (const [fy, rr] of [[0.25, 0.22], [0.45, 0.22]]) {
|
|
195
|
+
const yy = H.lerp(t0, b0, fy) * 0.5 + H.lerp(t1, b1, fy) * 0.5;
|
|
196
|
+
for (const fx of [-0.22, 0.22]) {
|
|
197
|
+
ell(c, mx + fx * cw, yy, cw * rr * 0.7, (b0 - t0) * 0.085); c.fillStyle = gs(0.12); c.fill();
|
|
198
|
+
ell(c, mx + fx * cw, yy, cw * rr * 0.62, (b0 - t0) * 0.075); c.fillStyle = gs(0.78); c.fill();
|
|
199
|
+
ell(c, mx + fx * cw, yy, cw * rr * 0.2, (b0 - t0) * 0.024); c.fillStyle = gs(0.2); c.fill();
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
for (let k = 0; k < 6; k++) { ell(c, mx - cw * 0.3 + k * cw * 0.12, H.lerp(t0, b0, 0.7), 1.6 * z0 + 0.5, 1.6 * z0 + 0.5); c.fillStyle = gs(k % 2 ? 0.95 : 0.3); c.fill(); }
|
|
203
|
+
}
|
|
204
|
+
// right: console desk with blinking panel, foreground
|
|
205
|
+
c.fillStyle = gs(0.22); c.beginPath(); c.moveTo(w * 0.55, h * 0.66); c.lineTo(w, h * 0.6); c.lineTo(w, h); c.lineTo(w * 0.6, h); c.closePath(); c.fill();
|
|
206
|
+
c.fillStyle = gs(0.42); c.beginPath(); c.moveTo(w * 0.55, h * 0.66); c.lineTo(w, h * 0.6); c.lineTo(w, h * 0.66); c.lineTo(w * 0.56, h * 0.72); c.closePath(); c.fill();
|
|
207
|
+
for (let i = 0; i < 9; i++) for (let j = 0; j < 3; j++) { ell(c, w * 0.6 + i * w * 0.042, h * 0.75 + j * h * 0.04 - i * 2, 2.6, 2.6); c.fillStyle = gs((i * 7 + j * 3) % 4 ? 0.85 : 0.2); c.fill(); }
|
|
208
|
+
// operator, standing at the console
|
|
209
|
+
const ox = w * OPX, oy = h * OPY, s = h * 0.5;
|
|
210
|
+
c.fillStyle = gs(0.12); // skirt
|
|
211
|
+
c.beginPath(); c.moveTo(ox - 0.13 * s, oy + 0.15 * s); c.lineTo(ox + 0.13 * s, oy + 0.15 * s); c.lineTo(ox + 0.18 * s, oy + 0.62 * s); c.lineTo(ox - 0.17 * s, oy + 0.62 * s); c.fill();
|
|
212
|
+
g = c.createLinearGradient(ox - 0.14 * s, 0, ox + 0.14 * s, 0); g.addColorStop(0, gs(0.95)); g.addColorStop(1, gs(0.62)); c.fillStyle = g; // blouse
|
|
213
|
+
c.beginPath(); c.moveTo(ox - 0.12 * s, oy - 0.2 * s); c.quadraticCurveTo(ox, oy - 0.26 * s, ox + 0.12 * s, oy - 0.2 * s); c.lineTo(ox + 0.13 * s, oy + 0.17 * s); c.lineTo(ox - 0.13 * s, oy + 0.17 * s); c.fill();
|
|
214
|
+
c.strokeStyle = gs(0.85); c.lineWidth = 0.06 * s; c.lineCap = 'round'; c.beginPath(); c.moveTo(ox - 0.11 * s, oy - 0.15 * s); c.lineTo(ox - 0.2 * s, oy + 0.08 * s); c.lineTo(ox - 0.3 * s, oy + 0.18 * s); c.stroke();
|
|
215
|
+
ell(c, ox, oy - 0.33 * s, 0.075 * s, 0.09 * s); c.fillStyle = gs(0.72); c.fill();
|
|
216
|
+
ell(c, ox + 0.015 * s, oy - 0.38 * s, 0.09 * s, 0.07 * s); c.fillStyle = gs(0.1); c.fill(); // hair
|
|
217
|
+
ell(c, ox + 0.06 * s, oy - 0.3 * s, 0.04 * s, 0.07 * s); c.fill();
|
|
218
|
+
for (let i = 0; i < 2; i++) { c.fillStyle = gs(0.15); c.fillRect(ox - 0.08 * s + i * 0.1 * s, oy + 0.62 * s, 0.035 * s, 0.2 * s); }
|
|
219
|
+
// ceiling light falloff + floor sheen
|
|
220
|
+
g = c.createRadialGradient(vx, vy - h * 0.2, 0, vx, vy, w * 0.6); g.addColorStop(0, 'rgba(255,255,255,0.25)'); g.addColorStop(1, 'rgba(255,255,255,0)'); c.fillStyle = g; c.fillRect(0, 0, w, h);
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
const pets = () => {
|
|
224
|
+
if (C.pets) return C.pets;
|
|
225
|
+
const specs = [
|
|
226
|
+
['cat', { bg: 0.72, fur: 0.42, tabby: true, seed: 11 }], ['dog', { bg: 0.58, fur: 0.7, seed: 12 }], ['dog', { bg: 0.8, fur: 0.35, seed: 13, flip: true, dx: 0.04 }],
|
|
227
|
+
['cat', { bg: 0.5, fur: 0.75, seed: 14, flip: true }], ['cat', { bg: 0.82, fur: 0.25, seed: 15, dx: -0.05, sc: 1.1 }], ['dog', { bg: 0.66, fur: 0.52, seed: 16, sc: 0.95 }],
|
|
228
|
+
];
|
|
229
|
+
C.pets = specs.map(([k, v], i) => {
|
|
230
|
+
const img = treat(132, 112, 100 + i, (c, w, h) => (k === 'cat' ? catGray : dogGray)(c, w, h, v), { cell: 3.4, blur: 0.8 });
|
|
231
|
+
return { kind: k, spr: makePrint(img, 300 + i, [i % 2, (i + 1) % 2, 1, 0], 9, 6) };
|
|
232
|
+
});
|
|
233
|
+
return C.pets;
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
// ---------- cutout sprites ----------
|
|
237
|
+
const makePrint = (img, seed, torn = [0, 1, 1, 0], border = 12, amp = 7) => {
|
|
238
|
+
const w = img.width + border * 2, h = img.height + border * 2;
|
|
239
|
+
return sprite(w, h, 34, (c) => {
|
|
240
|
+
const outer = edgePoly(w, h, torn, seed, amp);
|
|
241
|
+
shadowFill(c, outer, '#f8f5ee');
|
|
242
|
+
texture(c, outer, 0.35, seed * 13 % 400, seed * 7 % 200);
|
|
243
|
+
const inner = edgePoly(w - 7, h - 7, torn, seed, amp);
|
|
244
|
+
c.save(); pathPoly(c, inner); c.clip(); c.beginPath(); c.rect(-img.width / 2, -img.height / 2, img.width, img.height); c.clip();
|
|
245
|
+
c.drawImage(img, -img.width / 2, -img.height / 2); c.restore();
|
|
246
|
+
c.strokeStyle = 'rgba(0,0,0,0.12)'; c.lineWidth = 1; c.strokeRect(-img.width / 2, -img.height / 2, img.width, img.height);
|
|
247
|
+
});
|
|
248
|
+
};
|
|
249
|
+
const makeStrip = (text, font, o = {}) => {
|
|
250
|
+
const m = measure(font, text), tw = m.width, asc = m.actualBoundingBoxAscent, desc = Math.max(1, m.actualBoundingBoxDescent);
|
|
251
|
+
const px = asc / 0.72, padX = o.padX == null ? px * 0.2 : o.padX, padY = o.padY == null ? px * 0.15 : o.padY, w = tw + padX * 2, h = asc + desc + padY * 2;
|
|
252
|
+
const base = -h / 2 + padY + asc;
|
|
253
|
+
const spr = sprite(w, h, 30, (c) => {
|
|
254
|
+
const poly = edgePoly(w, h, o.torn || [0, 0, 0, 0], o.seed || 1, o.amp || 4);
|
|
255
|
+
shadowFill(c, poly, o.bg || CARD, o.sh || 1);
|
|
256
|
+
texture(c, poly, o.bg === INK ? 0.12 : 0.45, (o.seed || 1) * 31 % 600, 0);
|
|
257
|
+
c.fillStyle = o.fg || INK; c.font = font; c.fillText(text, -tw / 2, base);
|
|
258
|
+
});
|
|
259
|
+
spr.base = base; spr.tw = tw; spr.asc = asc;
|
|
260
|
+
if (o.hl) {
|
|
261
|
+
const i = text.indexOf(o.hl), x0 = -tw / 2 + measure(font, text.slice(0, i)).width, ww = measure(font, o.hl).width;
|
|
262
|
+
spr.hl = [x0 - px * 0.07, base - asc * 0.9, ww + px * 0.14, asc * 1.0];
|
|
263
|
+
}
|
|
264
|
+
return spr;
|
|
265
|
+
};
|
|
266
|
+
const greek = (c, x, y, w, lines, lh, seed, font = '400 10px "Libre Baskerville"') => {
|
|
267
|
+
const r = H.rng(seed); c.font = font; c.fillStyle = 'rgba(52,47,41,0.85)';
|
|
268
|
+
for (let l = 0; l < lines; l++) {
|
|
269
|
+
let cx = x + (l === 0 ? 10 : 0); const end = l === lines - 1 ? x + w * (0.3 + r() * 0.5) : x + w;
|
|
270
|
+
while (cx < end - 12) {
|
|
271
|
+
let s = ''; const n = 1 + Math.floor(r() * 8); for (let i = 0; i < n; i++) s += 'etaoinshrdlucmfwypvbg'[Math.floor(Math.pow(r(), 1.6) * 21)];
|
|
272
|
+
const ww = c.measureText(s).width; if (cx + ww > end) break;
|
|
273
|
+
c.fillText(s, cx, y + l * lh); cx += ww + 3.4;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
// newspaper clipping: kicker, serif headline, italic deck with the key phrase (highlight rect returned), greeked columns
|
|
278
|
+
const makeClipping = (o) => {
|
|
279
|
+
const w = o.w, h = o.h; let hlRect = null;
|
|
280
|
+
const spr = sprite(w, h, 34, (c) => {
|
|
281
|
+
const poly = edgePoly(w, h, o.torn || [0, 1, 1, 1], o.seed, 5);
|
|
282
|
+
shadowFill(c, poly, NEWS); texture(c, poly, 0.8, o.seed % 500, 100);
|
|
283
|
+
c.save(); pathPoly(c, poly); c.clip();
|
|
284
|
+
const g = c.createRadialGradient(0, 0, w * 0.3, 0, 0, w * 0.8); g.addColorStop(0, 'rgba(180,150,90,0)'); g.addColorStop(1, 'rgba(180,150,90,0.18)'); c.fillStyle = g; c.fillRect(-w / 2, -h / 2, w, h);
|
|
285
|
+
const L = -w / 2 + 22, R = w / 2 - 22; let y = -h / 2 + 30;
|
|
286
|
+
c.fillStyle = INK; c.font = '400 13px "Oswald"'; c.fillText(o.kicker, L, y);
|
|
287
|
+
c.fillRect(L, y + 7, R - L, 2); c.fillRect(L, y + 11, R - L, 0.8); y += 14;
|
|
288
|
+
c.font = `700 ${o.headPx}px "Libre Baskerville"`;
|
|
289
|
+
for (const line of o.head) { y += o.headPx * 1.18; c.fillText(line, L, y); }
|
|
290
|
+
y += 14; c.font = `italic 400 ${o.deckPx}px "Libre Baskerville"`; c.fillStyle = '#2a2622';
|
|
291
|
+
for (const line of o.deck) {
|
|
292
|
+
y += o.deckPx * 1.4;
|
|
293
|
+
const parts = line.split('|');
|
|
294
|
+
let x = L; parts.forEach((p, i) => { const ww = c.measureText(p).width; if (i === 1) hlRect = [x - 4, y - o.deckPx * 0.86, ww + 8, o.deckPx * 1.12]; c.fillText(p, x, y); x += ww; });
|
|
295
|
+
}
|
|
296
|
+
y += 14; c.fillStyle = INK; c.fillRect(L, y, R - L, 0.8);
|
|
297
|
+
const cols = o.cols || 2, gap = 14, cw = (R - L - gap * (cols - 1)) / cols;
|
|
298
|
+
for (let k = 0; k < cols; k++) greek(c, L + k * (cw + gap), y + 18, cw, Math.floor((h / 2 - y - 18) / 13) + 1, 13, o.seed + k);
|
|
299
|
+
c.restore();
|
|
300
|
+
});
|
|
301
|
+
spr.hl = hlRect; return spr;
|
|
302
|
+
};
|
|
303
|
+
// flat map card: land mass, thin dashed route, pin
|
|
304
|
+
const makeMap = () => sprite(270, 180, 30, (c) => {
|
|
305
|
+
const w = 270, h = 180, poly = edgePoly(w, h, [0, 0, 0, 0], 61, 3), nz = NZ();
|
|
306
|
+
shadowFill(c, poly, '#dfe0d6'); texture(c, poly, 0.5, 300, 300);
|
|
307
|
+
c.save(); pathPoly(c, poly); c.clip();
|
|
308
|
+
c.beginPath();
|
|
309
|
+
for (let i = 0; i <= 80; i++) { const a = i / 80 * TAU, rr = 150 + nz.fbm2(Math.cos(a) * 1.5 + 9, Math.sin(a) * 1.5, 4) * 90; const x = -30 + Math.cos(a) * rr * 1.2, y = 40 + Math.sin(a) * rr * 0.7; i ? c.lineTo(x, y) : c.moveTo(x, y); }
|
|
310
|
+
c.fillStyle = '#c9c3b2'; c.fill(); c.strokeStyle = 'rgba(30,28,25,0.6)'; c.lineWidth = 1; c.stroke();
|
|
311
|
+
c.strokeStyle = 'rgba(30,28,25,0.25)'; c.lineWidth = 0.7; for (let i = -6; i < 7; i++) { c.beginPath(); c.moveTo(i * 40, -h); c.lineTo(i * 40 + 30, h); c.stroke(); }
|
|
312
|
+
c.setLineDash([5, 4]); c.strokeStyle = INK; c.lineWidth = 1.6; c.beginPath(); c.moveTo(-120, 70); c.bezierCurveTo(-60, 0, -10, 40, 30, -20); c.stroke(); c.setLineDash([]);
|
|
313
|
+
c.restore();
|
|
314
|
+
c.fillStyle = INK; c.font = '700 17px "Oswald"'; c.fillText('ITHACA, N.Y.', 46, -18); c.font = '400 12px "Oswald"'; c.fillText('1958', 46, -2);
|
|
315
|
+
});
|
|
316
|
+
// map pin, drawn live (so it can drop on steps)
|
|
317
|
+
const pin = (c, x, y, s = 1, col = RED) => {
|
|
318
|
+
c.save(); c.translate(x, y); c.scale(s, s);
|
|
319
|
+
c.fillStyle = 'rgba(30,20,10,0.25)'; ell(c, 5, 2, 7, 3); c.fill();
|
|
320
|
+
c.strokeStyle = '#555'; c.lineWidth = 1.6; c.beginPath(); c.moveTo(0, 0); c.lineTo(0, -16); c.stroke();
|
|
321
|
+
ell(c, 0, -22, 8, 8); c.fillStyle = col; c.fill(); ell(c, -2.5, -24.5, 2.5, 2.5); c.fillStyle = 'rgba(255,255,255,0.6)'; c.fill();
|
|
322
|
+
c.restore();
|
|
323
|
+
};
|
|
324
|
+
const blurred = (spr, px) => { const cv = H.layer(spr.cv.width, spr.cv.height), c = cv.getContext('2d'); c.filter = `blur(${px}px)`; c.drawImage(spr.cv, 0, 0); return { ...spr, cv }; };
|
|
325
|
+
|
|
326
|
+
// ---------- live marks: highlighter, tape, marker, ink arrows ----------
|
|
327
|
+
// highlighter: translucent, slightly uneven band sweeping left -> right, multiplied into the paper
|
|
328
|
+
const hilite = (c, rect, prog, seed) => {
|
|
329
|
+
if (!rect || prog <= 0) return;
|
|
330
|
+
const [x, y, w, h] = rect, nz = NZ(), L = w * H.clamp(prog), o = seed * 1.7, tilt = (H.rng(seed)() - 0.5) * h * 0.12;
|
|
331
|
+
const top = [], bot = [];
|
|
332
|
+
for (let d = 0; d <= L; d += 6) { top.push([x + d, y + nz.n2(o + d * 0.02, 1) * h * 0.07 + tilt * d / w]); bot.push([x + d, y + h + nz.n2(o + d * 0.02, 5) * h * 0.08 + tilt * d / w]); }
|
|
333
|
+
top.push([x + L + h * 0.08, y + tilt * L / w]); bot.push([x + L - h * 0.08, y + h + tilt * L / w]);
|
|
334
|
+
c.save(); c.globalCompositeOperation = 'multiply';
|
|
335
|
+
c.beginPath(); c.moveTo(x - h * 0.06, y + h * 0.05); top.forEach((p) => c.lineTo(p[0], p[1])); for (let i = bot.length - 1; i >= 0; i--) c.lineTo(bot[i][0], bot[i][1]); c.closePath();
|
|
336
|
+
c.fillStyle = 'rgba(255,226,38,0.84)'; c.fill(); c.clip();
|
|
337
|
+
for (let k = 0; k < 4; k++) { // felt streaks along the stroke
|
|
338
|
+
c.fillStyle = k % 2 ? 'rgba(235,190,20,0.22)' : 'rgba(255,240,150,0.3)';
|
|
339
|
+
c.fillRect(x - 10, y + h * (0.12 + k * 0.22) + nz.n2(o + k, 3) * 3, L + 20, h * (0.05 + (k % 3) * 0.03));
|
|
340
|
+
}
|
|
341
|
+
c.fillStyle = 'rgba(230,180,10,0.3)'; ell(c, x + h * 0.08, y + h * 0.5, h * 0.18, h * 0.55); c.fill(); // pooled ink where the tip landed
|
|
342
|
+
if (prog >= 1) { ell(c, x + L - h * 0.05, y + h * 0.5, h * 0.14, h * 0.55); c.fill(); }
|
|
343
|
+
c.restore();
|
|
344
|
+
};
|
|
345
|
+
const tape = (c, x, y, w, h, rot, seed) => {
|
|
346
|
+
const r = H.rng(seed);
|
|
347
|
+
c.save(); c.translate(x, y); c.rotate(rot);
|
|
348
|
+
const p = []; const n = 7;
|
|
349
|
+
p.push([-w / 2, -h / 2]); p.push([w / 2, -h / 2]);
|
|
350
|
+
for (let i = 1; i < n; i++) p.push([w / 2 + (i % 2 ? 3 : -2) + (r() - 0.5) * 3, -h / 2 + h * i / n]);
|
|
351
|
+
p.push([w / 2, h / 2]); p.push([-w / 2, h / 2]);
|
|
352
|
+
for (let i = n - 1; i > 0; i--) p.push([-w / 2 + (i % 2 ? -3 : 2) + (r() - 0.5) * 3, -h / 2 + h * i / n]);
|
|
353
|
+
c.shadowColor = 'rgba(40,28,15,0.22)'; c.shadowBlur = 3; c.shadowOffsetY = 1.5;
|
|
354
|
+
pathPoly(c, p); c.fillStyle = 'rgba(228,216,186,0.8)'; c.fill(); c.shadowColor = 'transparent';
|
|
355
|
+
c.clip(); c.strokeStyle = 'rgba(255,255,255,0.22)'; c.lineWidth = 1;
|
|
356
|
+
for (let i = 0; i < 5; i++) { const yy = -h / 2 + r() * h; c.beginPath(); c.moveTo(-w / 2, yy); c.lineTo(w / 2, yy + (r() - 0.5) * 2); c.stroke(); }
|
|
357
|
+
c.fillStyle = 'rgba(150,130,90,0.12)'; c.fillRect(-w / 2, -h / 2, w, 2); c.fillRect(-w / 2, h / 2 - 2, w, 2);
|
|
358
|
+
c.restore();
|
|
359
|
+
};
|
|
360
|
+
// polyline drawn on by fraction (partial last segment)
|
|
361
|
+
const partial = (c, pts, prog) => {
|
|
362
|
+
const n = pts.length - 1, f = H.clamp(prog) * n, k = Math.floor(f);
|
|
363
|
+
c.beginPath(); c.moveTo(pts[0][0], pts[0][1]);
|
|
364
|
+
for (let i = 1; i <= Math.min(k, n); i++) c.lineTo(pts[i][0], pts[i][1]);
|
|
365
|
+
if (k < n) { const a = pts[k], b = pts[k + 1], u = f - k; c.lineTo(a[0] + (b[0] - a[0]) * u, a[1] + (b[1] - a[1]) * u); }
|
|
366
|
+
};
|
|
367
|
+
const marker = (c, pts, prog, col = RED, lw = 7) => {
|
|
368
|
+
if (prog <= 0) return;
|
|
369
|
+
c.save(); c.lineCap = 'round'; c.lineJoin = 'round';
|
|
370
|
+
c.strokeStyle = col; c.globalAlpha = 0.9; c.lineWidth = lw; partial(c, pts, prog); c.stroke();
|
|
371
|
+
c.globalAlpha = 0.35; c.lineWidth = lw * 0.4; c.translate(lw * 0.18, -lw * 0.15); partial(c, pts, prog); c.stroke();
|
|
372
|
+
c.restore();
|
|
373
|
+
};
|
|
374
|
+
const loopPts = (cx, cy, rx, ry, seed) => {
|
|
375
|
+
const nz = NZ(), pts = [], a0 = -2.3 + seed % 1;
|
|
376
|
+
for (let i = 0; i <= 70; i++) { const u = i / 70, a = a0 + u * TAU * 1.12, k = 1 + nz.n2(seed + u * 3, 2) * 0.06 + u * 0.07; pts.push([cx + Math.cos(a) * rx * k, cy + Math.sin(a) * ry * k]); }
|
|
377
|
+
return pts;
|
|
378
|
+
};
|
|
379
|
+
const linePts = (ax, ay, bx, by, seed, n = 10, wob = 2) => { const r = H.rng(seed), p = []; for (let i = 0; i <= n; i++) { const u = i / n; p.push([ax + (bx - ax) * u + (r() - 0.5) * wob, ay + (by - ay) * u + (r() - 0.5) * wob]); } return p; };
|
|
380
|
+
const quadPts = (ax, ay, cx, cy, bx, by, n = 32) => { const p = []; for (let i = 0; i <= n; i++) { const u = i / n; p.push([(1 - u) * (1 - u) * ax + 2 * u * (1 - u) * cx + u * u * bx, (1 - u) * (1 - u) * ay + 2 * u * (1 - u) * cy + u * u * by]); } return p; };
|
|
381
|
+
const inkArrow = (c, pts, prog, lw = 2.6, col = INK, dash = null) => {
|
|
382
|
+
if (prog <= 0) return;
|
|
383
|
+
c.save(); c.strokeStyle = col; c.lineWidth = lw; c.lineCap = 'round'; c.lineJoin = 'round'; if (dash) c.setLineDash(dash);
|
|
384
|
+
partial(c, pts, prog); c.stroke(); c.setLineDash([]);
|
|
385
|
+
if (prog >= 1) {
|
|
386
|
+
const [x1, y1] = pts[pts.length - 1], [x0, y0] = pts[pts.length - 3], a = Math.atan2(y1 - y0, x1 - x0), L = 9 + lw * 3;
|
|
387
|
+
c.fillStyle = col; c.beginPath(); c.moveTo(x1 + Math.cos(a) * 3, y1 + Math.sin(a) * 3); c.lineTo(x1 + Math.cos(a + 2.7) * L, y1 + Math.sin(a + 2.7) * L); c.lineTo(x1 + Math.cos(a - 2.7) * L, y1 + Math.sin(a - 2.7) * L); c.closePath(); c.fill();
|
|
388
|
+
}
|
|
389
|
+
c.restore();
|
|
390
|
+
};
|
|
391
|
+
|
|
392
|
+
// ---------- camera + stepped cutout animation ----------
|
|
393
|
+
// place(): 2.5D parallax. p = depth factor (1 = main plane, <1 behind, >1 in front).
|
|
394
|
+
const place = (c, cam, p, x, y, rot, s, fn) => {
|
|
395
|
+
c.save(); c.translate(640, 360); const k = Math.pow(cam.z, p); c.scale(k, k); c.translate(-cam.x * p, -cam.y * p);
|
|
396
|
+
c.translate(x, y); if (rot) c.rotate(rot); if (s !== 1) c.scale(s, s); fn(c); c.restore();
|
|
397
|
+
};
|
|
398
|
+
// cutout arrival on 12 fps steps: returns null before it lands
|
|
399
|
+
const POP = {
|
|
400
|
+
drop: { s: [1.16, 1.05, 0.985, 1], r: [0.05, 0.015, -0.006, 0] },
|
|
401
|
+
slideL: { dx: [-300, -110, -26, 0], r: [-0.04, -0.015, 0.004, 0] }, slideR: { dx: [300, 110, 26, 0], r: [0.04, 0.015, -0.004, 0] },
|
|
402
|
+
slideU: { dy: [320, 120, 28, 0], r: [0.03, 0.01, -0.003, 0] }, slideD: { dy: [-320, -120, -28, 0], r: [-0.03, -0.01, 0.003, 0] },
|
|
403
|
+
};
|
|
404
|
+
const arrive = (tq, a, kind = 'drop') => {
|
|
405
|
+
if (tq < a - 1e-6) return null;
|
|
406
|
+
const f = Math.min(3, Math.round((tq - a) * 12)), P = POP[kind];
|
|
407
|
+
return { s: P.s ? P.s[f] : 1, r: P.r[f], dx: P.dx ? P.dx[f] : 0, dy: P.dy ? P.dy[f] : 0 };
|
|
408
|
+
};
|
|
409
|
+
const putSpr = (c, cam, p, spr, x, y, rot, s, tq, a, kind, extra) => {
|
|
410
|
+
const A = arrive(tq, a, kind); if (!A) return false;
|
|
411
|
+
place(c, cam, p, x + A.dx, y + A.dy, rot + A.r, s * A.s, (cc) => { drawSpr(cc, spr); if (extra) extra(cc); });
|
|
412
|
+
return true;
|
|
413
|
+
};
|
|
414
|
+
const bgPaper = (c, cam, tint) => {
|
|
415
|
+
c.save(); c.fillStyle = tint || PAPER; c.fillRect(0, 0, 1280, 720); c.restore();
|
|
416
|
+
place(c, cam, 0.2, 0, 0, 0, 1, (cc) => { cc.globalCompositeOperation = 'multiply'; cc.drawImage(fibre(), -1000, -550); });
|
|
417
|
+
};
|
|
418
|
+
const block = (c, cam, p, x, y, w, h, rot, col, seed, torn = [0, 0, 0, 0], amp = 6) => {
|
|
419
|
+
place(c, cam, p, x, y, rot, 1, (cc) => {
|
|
420
|
+
const poly = edgePoly(w, h, torn, seed, amp);
|
|
421
|
+
cc.save(); cc.shadowColor = 'rgba(40,28,15,0.25)'; cc.shadowBlur = 10; cc.shadowOffsetY = 4; pathPoly(cc, poly); cc.fillStyle = col; cc.fill(); cc.restore();
|
|
422
|
+
texture(cc, poly, 0.55, seed * 40 % 300, 0);
|
|
423
|
+
});
|
|
424
|
+
};
|
|
425
|
+
const finish = (c, t, vig = 0.32) => {
|
|
426
|
+
const pats = grainTiles(), f = Math.floor(t * 12), r = H.rng(5000 + f);
|
|
427
|
+
c.save(); c.globalCompositeOperation = 'overlay'; c.globalAlpha = 0.26; c.fillStyle = pats[f % 4];
|
|
428
|
+
c.translate(-r() * 256, -r() * 256); c.fillRect(0, 0, 1280 + 256, 720 + 256); c.restore();
|
|
429
|
+
c.save(); c.globalCompositeOperation = 'multiply';
|
|
430
|
+
const g = c.createRadialGradient(640, 360, 260, 640, 360, 820); g.addColorStop(0, 'rgba(255,255,255,1)'); g.addColorStop(1, `rgba(${255 - 90 * vig},${255 - 100 * vig},${255 - 120 * vig},1)`);
|
|
431
|
+
c.fillStyle = g; c.fillRect(0, 0, 1280, 720); c.restore();
|
|
432
|
+
};
|
|
433
|
+
|
|
434
|
+
// ---------- shared sprites ----------
|
|
435
|
+
const init = () => {
|
|
436
|
+
if (C.ready) return; C.ready = true;
|
|
437
|
+
fibre(); grainTiles(); pets();
|
|
438
|
+
C.mainImg = treat(560, 380, 7, mainframeGray, { cell: 4.6, blur: 1.1, con: 1.3 });
|
|
439
|
+
C.mainPrint = makePrint(C.mainImg, 21, [0, 1, 1, 0], 15, 9);
|
|
440
|
+
C.clip = makeClipping({ w: 380, h: 470, seed: 41, kicker: 'SCIENCE · JULY 8', head: ['Electronic', '‘Brain’ Teaches', 'Itself'], headPx: 34,
|
|
441
|
+
deck: ['A new machine, its makers say,', '|learns from its own mistakes|'], deckPx: 19, cols: 2 });
|
|
442
|
+
C.clipSmall = makeClipping({ w: 300, h: 260, seed: 43, kicker: 'THE MORNING RECORD', head: ['Can a machine', 'think?'], headPx: 26, deck: ['Experts |are not so sure|'], deckPx: 15, cols: 2, torn: [1, 1, 0, 1] });
|
|
443
|
+
C.map = makeMap();
|
|
444
|
+
C.fg = blurred(makeClipping({ w: 300, h: 240, seed: 47, kicker: 'CONTINUED', head: ['Learning'], headPx: 28, deck: ['…'], deckPx: 14, cols: 3, torn: [1, 1, 1, 1] }), 5);
|
|
445
|
+
C.t1 = makeStrip('THE MACHINE THAT', '400 74px "Anton"', { bg: INK, fg: '#f3efe5', seed: 3 });
|
|
446
|
+
C.t2 = makeStrip('TAUGHT ITSELF', '400 74px "Anton"', { seed: 4, hl: 'TAUGHT ITSELF' });
|
|
447
|
+
// explainer
|
|
448
|
+
C.h1 = makeStrip('HOW DOES', '400 112px "Anton"', { seed: 5 });
|
|
449
|
+
C.h2 = makeStrip('AI LEARN?', '400 112px "Anton"', { seed: 6, bg: CARD, hl: 'LEARN?' });
|
|
450
|
+
C.lab = {};
|
|
451
|
+
for (const s of ['CAT', 'DOG']) C.lab[s] = makeStrip(s, '700 26px "Oswald"', { bg: INK, fg: '#f3efe5', seed: s.length + s.charCodeAt(0), sh: 0.6, padX: 9, padY: 6 });
|
|
452
|
+
for (const s of ['GUESS', 'CHECK', 'ADJUST']) C.lab[s] = makeStrip(s, '700 30px "Oswald"', { bg: INK, fg: '#f3efe5', seed: s.charCodeAt(1), sh: 0.7, padX: 11, padY: 7 });
|
|
453
|
+
C.clipSoft = blurred(C.clip, 3.2);
|
|
454
|
+
C.counterBg = sprite(560, 112, 30, (c) => { const p = edgePoly(560, 112, [0, 0, 0, 0], 71, 3); shadowFill(c, p, CARD); texture(c, p, 0.45, 50, 50); });
|
|
455
|
+
C.card = sprite(360, 430, 34, (c) => {
|
|
456
|
+
const p = edgePoly(360, 430, [0, 0, 0, 0], 81, 3); shadowFill(c, p, CARD); texture(c, p, 0.4, 120, 60);
|
|
457
|
+
c.save(); pathPoly(c, p); c.clip(); c.strokeStyle = 'rgba(70,90,110,0.13)'; c.lineWidth = 1;
|
|
458
|
+
for (let x = -180; x <= 180; x += 20) { c.beginPath(); c.moveTo(x, -215); c.lineTo(x, 215); c.stroke(); }
|
|
459
|
+
for (let y = -215; y <= 215; y += 20) { c.beginPath(); c.moveTo(-180, y); c.lineTo(180, y); c.stroke(); }
|
|
460
|
+
c.restore();
|
|
461
|
+
});
|
|
462
|
+
C.modelTag = makeStrip('THE MODEL', '700 30px "Oswald"', { seed: 88, bg: '#f7f3ea', sh: 0.5, padX: 12, padY: 6 });
|
|
463
|
+
C.newCat = makePrint(treat(186, 156, 77, (c, w, h) => catGray(c, w, h, { bg: 0.62, fur: 0.5, tabby: true, seed: 19, sc: 0.95 }), { cell: 3.8, blur: 0.9 }), 90, [1, 0, 1, 0], 11, 7);
|
|
464
|
+
C.dogQ = makeStrip('dog?', '700 58px "Libre Baskerville"', { seed: 93, bg: NEWS, torn: [1, 0, 1, 0], amp: 5, padX: 22, padY: 16 });
|
|
465
|
+
C.catA = makeStrip('cat', '700 58px "Libre Baskerville"', { seed: 95, bg: NEWS, torn: [1, 0, 1, 0], amp: 5, padX: 30, padY: 16, hl: 'cat' });
|
|
466
|
+
C.accTag = makeStrip('ACCURACY', '700 40px "Oswald"', { seed: 101, bg: CARD, sh: 0.6, padX: 14, padY: 8 });
|
|
467
|
+
C.numBg = sprite(380, 220, 34, (c) => { const p = edgePoly(380, 220, [1, 1, 1, 0], 103, 6); shadowFill(c, p, CARD); texture(c, p, 0.45, 200, 10); });
|
|
468
|
+
C.chart = sprite(600, 430, 34, (c) => {
|
|
469
|
+
const p = edgePoly(600, 430, [0, 0, 0, 0], 105, 3); shadowFill(c, p, CARD); texture(c, p, 0.45, 400, 80);
|
|
470
|
+
c.save(); pathPoly(c, p); c.clip(); c.strokeStyle = 'rgba(70,90,110,0.12)'; c.lineWidth = 1;
|
|
471
|
+
for (let x = -300; x <= 300; x += 20) { c.beginPath(); c.moveTo(x, -215); c.lineTo(x, 215); c.stroke(); }
|
|
472
|
+
for (let y = -215; y <= 215; y += 20) { c.beginPath(); c.moveTo(-300, y); c.lineTo(300, y); c.stroke(); }
|
|
473
|
+
c.restore();
|
|
474
|
+
});
|
|
475
|
+
C.k1 = makeStrip('MORE EXAMPLES', '400 96px "Anton"', { seed: 111 });
|
|
476
|
+
C.k2 = makeStrip('BETTER GUESSES', '400 96px "Anton"', { seed: 112, hl: 'BETTER GUESSES' });
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
// =====================================================================================
|
|
480
|
+
// STILL + CLIP: "The machine that taught itself"
|
|
481
|
+
// =====================================================================================
|
|
482
|
+
const S = { block: 0.1, photo: 0.35, tapeA: 0.7, tapeB: 0.8, clip: 0.95, tapeC: 1.3, map: 1.45, pin: 1.7, t1: 1.85, t2: 2.1, hl1: [2.4, 2.85], hl2: [2.95, 3.35], ring: [3.45, 3.95] };
|
|
483
|
+
const drawStill = (c, t) => {
|
|
484
|
+
init();
|
|
485
|
+
const tq = q12(t);
|
|
486
|
+
const cam = { x: -14 + t * 5, y: 4 - t * 2, z: 1.0 + 0.055 * H.ease.inOut(H.clamp(t / 5)) };
|
|
487
|
+
bgPaper(c, cam);
|
|
488
|
+
{ const A = arrive(tq, S.block, 'slideR'); if (A) block(c, cam, 0.55, 430 + A.dx, 0, 560, 900, 0, RED, 12, [0, 0, 0, 1]); }
|
|
489
|
+
// foreground-less background clipping peeking at the top left (deep layer)
|
|
490
|
+
putSpr(c, cam, 0.7, C.clipSmall, -520, -250, -0.08, 0.9, tq, 0.2, 'slideD');
|
|
491
|
+
const mp = C.mainPrint, mw = C.mainImg.width, mh = C.mainImg.height;
|
|
492
|
+
putSpr(c, cam, 0.85, mp, -150, -50, -0.022, 1, tq, S.photo, 'drop', (cc) => {
|
|
493
|
+
if (tq >= S.tapeA) tape(cc, -mp.w / 2 + 20, -mp.h / 2 + 8, 110, 32, -0.6, 1);
|
|
494
|
+
if (tq >= S.tapeB) tape(cc, mp.w / 2 - 30, -mp.h / 2 + 4, 104, 30, 0.45, 2);
|
|
495
|
+
const ring = H.clamp((tq - S.ring[0]) / (S.ring[1] - S.ring[0]));
|
|
496
|
+
marker(cc, loopPts((OPX - 0.5) * mw, (OPY - 0.5) * mh + 10, 78, 132, 3.3), ring, RED, 6);
|
|
497
|
+
});
|
|
498
|
+
const cl = C.clip;
|
|
499
|
+
putSpr(c, cam, 0.95, cl, 410, -78, 0.03, 0.93, tq, S.clip, 'slideR', (cc) => {
|
|
500
|
+
hilite(cc, cl.hl, (t - S.hl2[0]) / (S.hl2[1] - S.hl2[0]), 9);
|
|
501
|
+
if (tq >= S.tapeC) tape(cc, -20, -cl.h / 2 + 2, 120, 32, -0.08, 3);
|
|
502
|
+
});
|
|
503
|
+
putSpr(c, cam, 1.05, C.map, 420, 240, -0.05, 1, tq, S.map, 'drop', (cc) => { if (tq >= S.pin) { const A = arrive(tq, S.pin, 'slideD'); pin(cc, 32, -14 + A.dy * 0.12, 1.2); } tape(cc, -120, -78, 70, 24, -0.7, 4); });
|
|
504
|
+
putSpr(c, cam, 1.1, C.t1, -268, 200, -0.022, 1, tq, S.t1, 'drop');
|
|
505
|
+
putSpr(c, cam, 1.1, C.t2, -170, 292, 0.012, 1, tq, S.t2, 'drop', (cc) => hilite(cc, C.t2.hl, (t - S.hl1[0]) / (S.hl1[1] - S.hl1[0]), 5));
|
|
506
|
+
place(c, cam, 1.6, 610, -330, 0.3, 1, (cc) => drawSpr(cc, C.fg));
|
|
507
|
+
finish(c, t);
|
|
508
|
+
};
|
|
509
|
+
|
|
510
|
+
// =====================================================================================
|
|
511
|
+
// EXPLAINER: "How does AI learn?" — scenes joined by blurred camera whips and a slid-in sheet
|
|
512
|
+
// =====================================================================================
|
|
513
|
+
const X = {
|
|
514
|
+
h1: 0.25, h2: 0.5, hl0: [0.95, 1.4], tape0: 0.15, whip1: [2.05, 2.35, 2.75],
|
|
515
|
+
card: 2.3, tag: 2.6, prints: [2.5, 2.68, 2.86, 3.04, 3.22, 3.4], labOff: 0.17, counter: 3.05, route: [3.3, 3.65], count: [3.35, 5.6],
|
|
516
|
+
flow0: 3.75, flowGap: 0.17, flowDur: 0.55, flowN: 10, push: [5.85, 6.55],
|
|
517
|
+
np: 6.5, guessLab: 6.95, guessArrow: [7.0, 7.2], dog: 7.25, checkLab: 7.65, ring: [7.75, 8.15], cross: [8.15, 8.4],
|
|
518
|
+
err: [8.45, 8.6], back: [8.6, 9.0], adjLab: 8.7, adjArrow: [8.5, 8.75], tune: [9.0, 9.45], pull: 9.5, cat: 9.6, hlCat: [9.75, 10.05], tick: [9.9, 10.1],
|
|
519
|
+
whip2: [10.2, 10.45, 10.85],
|
|
520
|
+
chart: 10.5, acc: 10.6, num: 10.65, line: [10.9, 12.2], hl97: [12.25, 12.6],
|
|
521
|
+
sheet: [12.85, 13.08], k1: 13.12, arrow: [13.25, 13.45], k2: 13.35, hlK: [13.6, 14.0], pets4: 12.85,
|
|
522
|
+
};
|
|
523
|
+
const D = 15;
|
|
524
|
+
// network on the model card (card-local coordinates)
|
|
525
|
+
const NET = (() => {
|
|
526
|
+
const L = [[-115, [-70, 10, 90]], [0, [-100, -33, 33, 100]], [115, [-30, 50]]], nodes = [], edges = [], r = H.rng(808);
|
|
527
|
+
L.forEach(([x, ys], li) => ys.forEach((y) => nodes.push({ x, y: y + 10, li })));
|
|
528
|
+
for (const a of nodes) for (const b of nodes) if (b.li === a.li + 1) edges.push({ a, b, w0: 0.15 + r() * 0.85, w1: 0.1 + r() * 0.9 });
|
|
529
|
+
return { nodes, edges };
|
|
530
|
+
})();
|
|
531
|
+
const KNOBS = [-100, -34, 34, 100];
|
|
532
|
+
const drawNet = (c, t, tq) => {
|
|
533
|
+
const back = H.clamp((tq - X.back[0]) / (X.back[1] - X.back[0])), tune = H.clamp((tq - X.tune[0]) / (X.tune[1] - X.tune[0]));
|
|
534
|
+
const front = 140 - back * 280; // the error front sweeps from the output side back to the input side
|
|
535
|
+
const redFade = H.clamp(1 - (tq - X.tune[1]) / 0.3);
|
|
536
|
+
for (const e of NET.edges) {
|
|
537
|
+
const w = H.lerp(e.w0, e.w1, tune), mx = (e.a.x + e.b.x) / 2, red = tq >= X.back[0] && mx > front ? redFade : 0;
|
|
538
|
+
c.strokeStyle = red > 0 ? H.rgba(H.mix('#2a2622', RED, red), 1) : `rgba(30,27,24,${0.3 + w * 0.6})`;
|
|
539
|
+
c.lineWidth = 0.8 + w * 3.6 + red * 1.2;
|
|
540
|
+
c.beginPath(); c.moveTo(e.a.x, e.a.y); c.lineTo(e.b.x, e.b.y); c.stroke();
|
|
541
|
+
}
|
|
542
|
+
// flow flashes on the inputs as prints arrive
|
|
543
|
+
let flash = 0; for (let i = 0; i < X.flowN; i++) { const end = X.flow0 + i * X.flowGap + X.flowDur; if (tq >= end - 0.01 && tq < end + 0.17) flash = 1; }
|
|
544
|
+
for (const n of NET.nodes) {
|
|
545
|
+
ell(c, n.x, n.y, 15, 15); c.fillStyle = CARD; c.fill(); c.lineWidth = 3; c.strokeStyle = INK; c.stroke();
|
|
546
|
+
const hot = (n.li === 0 && flash) || (tq >= X.back[0] && n.x > front && redFade > 0.5);
|
|
547
|
+
ell(c, n.x, n.y, 7, 7); c.fillStyle = hot ? RED : INK; c.fill();
|
|
548
|
+
}
|
|
549
|
+
// knobs (the weights you can turn)
|
|
550
|
+
c.save(); c.translate(0, 168);
|
|
551
|
+
c.strokeStyle = 'rgba(30,27,24,0.5)'; c.lineWidth = 1.2; c.beginPath(); c.moveTo(-150, -30); c.lineTo(150, -30); c.stroke();
|
|
552
|
+
KNOBS.forEach((x, i) => {
|
|
553
|
+
const a0 = -2.2 + i * 0.9, a1 = a0 + [1.4, -1.1, 0.9, -1.6][i], a = H.lerp(a0, a1, tune);
|
|
554
|
+
ell(c, x, 0, 20, 20); c.fillStyle = '#d8d1c0'; c.fill(); c.lineWidth = 2.5; c.strokeStyle = INK; c.stroke();
|
|
555
|
+
for (let k = 0; k < 7; k++) { const b = -Math.PI * 1.25 + k * Math.PI * 1.5 / 6; c.beginPath(); c.moveTo(x + Math.cos(b) * 24, Math.sin(b) * 24); c.lineTo(x + Math.cos(b) * 28, Math.sin(b) * 28); c.lineWidth = 1.5; c.stroke(); }
|
|
556
|
+
c.strokeStyle = tune > 0 && tune < 1 ? RED : INK; c.lineWidth = 4; c.lineCap = 'round'; c.beginPath(); c.moveTo(x, 0); c.lineTo(x + Math.cos(a) * 16, Math.sin(a) * 16); c.stroke();
|
|
557
|
+
});
|
|
558
|
+
c.restore();
|
|
559
|
+
};
|
|
560
|
+
|
|
561
|
+
const PR = [[-500, -40, -0.05], [-345, -62, 0.04], [-190, -34, -0.02], [-492, 168, 0.03], [-337, 152, -0.04], [-182, 176, 0.05]];
|
|
562
|
+
const ROUTE = quadPts(-110, 30, 50, -60, 205, 25, 36);
|
|
563
|
+
const CARDP = [400, 20, -0.012];
|
|
564
|
+
const scene1 = (c, cam, t, tq) => {
|
|
565
|
+
bgPaper(c, cam);
|
|
566
|
+
block(c, cam, 0.5, 430, 0, 620, 900, 0, RED, 14, [0, 0, 0, 1]);
|
|
567
|
+
putSpr(c, cam, 0.65, C.clipSmall, -500, 255, 0.07, 0.95, tq, 0, 'slideU');
|
|
568
|
+
const mp = C.mainPrint;
|
|
569
|
+
putSpr(c, cam, 0.8, mp, 345, -30, 0.035, 0.86, tq, 0, 'slideU', (cc) => {
|
|
570
|
+
if (tq >= X.tape0) { tape(cc, -mp.w / 2 + 24, -mp.h / 2 + 6, 110, 32, -0.55, 6); tape(cc, mp.w / 2 - 26, -mp.h / 2 + 6, 104, 30, 0.5, 7); }
|
|
571
|
+
});
|
|
572
|
+
putSpr(c, cam, 1, C.h1, -300, -95, -0.025, 1, tq, X.h1, 'drop');
|
|
573
|
+
putSpr(c, cam, 1, C.h2, -170, 50, 0.016, 1, tq, X.h2, 'drop', (cc) => hilite(cc, C.h2.hl, (t - X.hl0[0]) / (X.hl0[1] - X.hl0[0]), 4));
|
|
574
|
+
place(c, cam, 1.5, 640, -340, 0.4, 1, (cc) => drawSpr(cc, C.fg));
|
|
575
|
+
};
|
|
576
|
+
// counter strip: starts short and grows to the left as digits are added (right edge fixed, numerals right-aligned at x=92)
|
|
577
|
+
const counterStrip = (len) => {
|
|
578
|
+
const cs = C.cnt || (C.cnt = {}); if (cs[len]) return cs[len];
|
|
579
|
+
const proto = '1,000,000'.slice(-len), nw = measure('400 84px "Anton"', proto.replace(/\d/g, '0')).width;
|
|
580
|
+
const w = Math.min(560, Math.round(224 + nw)), off = 280 - w / 2;
|
|
581
|
+
const spr = sprite(560, 112, 30, (c) => { const p = edgePoly(w, 112, [0, 0, 0, 0], 71, 3).map(([x, y]) => [x + off, y]); shadowFill(c, p, CARD); texture(c, p, 0.45, 50, 50); });
|
|
582
|
+
return (cs[len] = spr);
|
|
583
|
+
};
|
|
584
|
+
const fmt = (n) => Math.round(n).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
|
585
|
+
const scene2 = (c, cam, t, tq) => {
|
|
586
|
+
bgPaper(c, cam);
|
|
587
|
+
// background collage (deep layers): red paper peeking behind the model card, a soft out-of-focus clipping, tape
|
|
588
|
+
block(c, cam, 0.45, 640, -380, 760, 300, -0.035, RED, 24, [0, 0, 1, 1], 8);
|
|
589
|
+
place(c, cam, 0.4, 660, 360, 0.07, 0.8, (cc) => drawSpr(cc, C.clipSoft));
|
|
590
|
+
// the data pile sits on a torn sheet of kraft paper (cut paper, not a grey rectangle)
|
|
591
|
+
block(c, cam, 0.55, -380, 60, 620, 560, 0.0, KRAFT, 21, [1, 1, 1, 1], 7);
|
|
592
|
+
place(c, cam, 0.55, -380, 60, 0, 1, (cc) => { tape(cc, 268, -262, 96, 28, 0.6, 25); tape(cc, 250, 268, 96, 28, -0.5, 26); });
|
|
593
|
+
place(c, cam, 0.8, -800, -170, -0.06, 1, (cc) => drawSpr(cc, C.clipSmall));
|
|
594
|
+
place(c, cam, 0.85, -930, 230, 0.05, 0.8, (cc) => { drawSpr(cc, C.mainPrint); tape(cc, 0, -C.mainPrint.h / 2 + 6, 110, 32, 0.05, 23); });
|
|
595
|
+
// the data pile: prints land one by one, each gets its label strip
|
|
596
|
+
const P = pets();
|
|
597
|
+
PR.forEach(([x, y, r], i) => {
|
|
598
|
+
putSpr(c, cam, 0.95, P[i].spr, x, y, r, 1, tq, X.prints[i], 'drop', (cc) => {
|
|
599
|
+
if (tq >= X.prints[i] + X.labOff) { const L = C.lab[P[i].kind.toUpperCase()], A = arrive(tq, X.prints[i] + X.labOff, 'drop'); cc.save(); cc.translate(10, 70); cc.rotate(-r * 1.4 + A.r); cc.scale(A.s, A.s); drawSpr(cc, L); cc.restore(); }
|
|
600
|
+
if (i === 0 && tq >= X.prints[0] + 0.1) tape(cc, 0, -70, 64, 22, 0.1, 30);
|
|
601
|
+
});
|
|
602
|
+
});
|
|
603
|
+
// counter: re-cut numerals on a paper strip
|
|
604
|
+
const cu = H.clamp((tq - X.count[0]) / (X.count[1] - X.count[0])), cv = cu >= 1 ? 1e6 : Math.round(1e6 * H.ease.inOut(cu) / 7) * 7;
|
|
605
|
+
putSpr(c, cam, 1, counterStrip(fmt(cv).length), -330, -262, -0.015, 1, tq, X.counter, 'slideD', (cc) => {
|
|
606
|
+
const v = cv;
|
|
607
|
+
cc.fillStyle = INK; cc.font = '400 84px "Anton"'; cc.textAlign = 'right'; cc.fillText(fmt(v), 92, 30);
|
|
608
|
+
cc.textAlign = 'left'; cc.font = 'italic 400 34px "Libre Baskerville"'; cc.fillText('examples', 110, 22);
|
|
609
|
+
});
|
|
610
|
+
// route line into the model + prints flowing along it
|
|
611
|
+
place(c, cam, 1, 0, 0, 0, 1, (cc) => inkArrow(cc, ROUTE, H.clamp((tq - X.route[0]) / (X.route[1] - X.route[0])), 3, INK, [10, 7]));
|
|
612
|
+
// model card with its network
|
|
613
|
+
putSpr(c, cam, 1, C.card, CARDP[0], CARDP[1], CARDP[2], 1, tq, X.card, 'slideR', (cc) => {
|
|
614
|
+
drawNet(cc, t, tq);
|
|
615
|
+
if (tq >= X.tag) { const A = arrive(tq, X.tag, 'drop'); cc.save(); cc.translate(0, -178); cc.rotate(-0.02 + A.r); cc.scale(A.s, A.s); drawSpr(cc, C.modelTag); cc.restore(); tape(cc, -100, -190, 56, 20, -0.5, 31); tape(cc, 100, -190, 56, 20, 0.5, 32); }
|
|
616
|
+
});
|
|
617
|
+
for (let i = 0; i < X.flowN; i++) {
|
|
618
|
+
const s0 = X.flow0 + i * X.flowGap, u = (tq - s0) / X.flowDur; if (u < 0 || u >= 1) continue;
|
|
619
|
+
const k = Math.min(ROUTE.length - 1, Math.floor(u * (ROUTE.length - 1))), [x, y] = ROUTE[k];
|
|
620
|
+
place(c, cam, 1.02, x, y - 6, (i % 3 - 1) * 0.08, 0.5 - u * 0.25, (cc) => drawSpr(cc, P[i % 6].spr));
|
|
621
|
+
}
|
|
622
|
+
// ---- the loop (camera pushed in on the model) ----
|
|
623
|
+
if (tq >= X.np) { // new photo travels along the route to the input side
|
|
624
|
+
const u = H.clamp((tq - X.np) / 0.34), k = Math.floor(H.ease.out(u) * (ROUTE.length - 1)), [x, y] = ROUTE[Math.min(k, ROUTE.length - 1)];
|
|
625
|
+
const fx = H.lerp(x, 108, u >= 1 ? 1 : 0), fy = H.lerp(y, 40, u >= 1 ? 1 : 0);
|
|
626
|
+
place(c, cam, 1.05, fx, fy, -0.04, 0.55 + 0.45 * H.ease.out(u), (cc) => drawSpr(cc, C.newCat));
|
|
627
|
+
}
|
|
628
|
+
const lab = (key, at, x, y, r) => { if (tq >= at) { const A = arrive(tq, at, 'drop'); place(c, cam, 1.08, x, y, r + A.r, A.s, (cc) => drawSpr(cc, C.lab[key])); } };
|
|
629
|
+
place(c, cam, 1, 0, 0, 0, 1, (cc) => inkArrow(cc, linePts(526, 12, 612, 14, 5, 8, 1.5), H.clamp((tq - X.guessArrow[0]) / (X.guessArrow[1] - X.guessArrow[0])), 3.2));
|
|
630
|
+
lab('GUESS', X.guessLab, 575, -62, -0.03);
|
|
631
|
+
const pulled = tq >= X.pull;
|
|
632
|
+
if (tq >= X.dog && !(pulled && tq >= X.pull + 2 / 12)) {
|
|
633
|
+
const pd = pulled ? -60 : 0;
|
|
634
|
+
putSpr(c, cam, 1.04, C.dogQ, 722, 22 + pd, 0.03, 1, tq, X.dog, 'drop', (cc) => {
|
|
635
|
+
marker(cc, loopPts(-2, 2, 128, 74, 5.5), (tq - X.ring[0]) / (X.ring[1] - X.ring[0]), RED, 7);
|
|
636
|
+
const cr = (tq - X.cross[0]) / (X.cross[1] - X.cross[0]);
|
|
637
|
+
marker(cc, linePts(-70, -34, 72, 36, 8, 8, 3), cr * 2, RED, 8);
|
|
638
|
+
marker(cc, linePts(70, -38, -66, 40, 9, 8, 3), cr * 2 - 1, RED, 8);
|
|
639
|
+
});
|
|
640
|
+
}
|
|
641
|
+
if (tq >= X.cat) putSpr(c, cam, 1.04, C.catA, 722, 18, -0.02, 1, tq, X.cat, 'drop', (cc) => {
|
|
642
|
+
hilite(cc, C.catA.hl, (t - X.hlCat[0]) / (X.hlCat[1] - X.hlCat[0]), 12);
|
|
643
|
+
marker(cc, [[96, -18], [110, 0], [122, 10], [140, -30], [160, -66]], (tq - X.tick[0]) / (X.tick[1] - X.tick[0]), INK, 8);
|
|
644
|
+
});
|
|
645
|
+
lab('CHECK', X.checkLab, 722, 132, 0.02);
|
|
646
|
+
// error signal: red dashed back from the answer into the network
|
|
647
|
+
place(c, cam, 1, 0, 0, 0, 1, (cc) => {
|
|
648
|
+
if (tq < X.tune[1] + 0.3) inkArrow(cc, linePts(612, 40, 520, 38, 6, 8, 1.5), H.clamp((tq - X.err[0]) / (X.err[1] - X.err[0])), 3.2, RED, [9, 6]);
|
|
649
|
+
inkArrow(cc, quadPts(735, 172, 660, 270, 520, 240, 28), H.clamp((tq - X.adjArrow[0]) / (X.adjArrow[1] - X.adjArrow[0])), 3);
|
|
650
|
+
});
|
|
651
|
+
lab('ADJUST', X.adjLab, 420, 242, -0.015);
|
|
652
|
+
};
|
|
653
|
+
const ACC = (u) => 61 + 36 * (1 - Math.pow(1 - u, 2.3));
|
|
654
|
+
const scene3 = (c, cam, t, tq) => {
|
|
655
|
+
bgPaper(c, cam);
|
|
656
|
+
// background collage: red paper and a soft clipping peeking out behind the chart, a clipping pasted on the black sheet
|
|
657
|
+
block(c, cam, 0.55, 560, 330, 700, 300, 0.04, RED, 33, [1, 0, 0, 1], 8);
|
|
658
|
+
place(c, cam, 0.45, 600, -350, -0.07, 0.8, (cc) => drawSpr(cc, C.clipSoft));
|
|
659
|
+
block(c, cam, 0.5, -400, 0, 560, 900, 0, INK, 31, [0, 1, 0, 0]);
|
|
660
|
+
place(c, cam, 0.6, -560, 310, 0.09, 0.85, (cc) => { drawSpr(cc, C.clipSmall); tape(cc, 40, -C.clipSmall.h / 2 + 4, 96, 28, -0.2, 34); });
|
|
661
|
+
const u = H.clamp((tq - X.line[0]) / (X.line[1] - X.line[0]));
|
|
662
|
+
putSpr(c, cam, 0.95, C.accTag, -385, -178, -0.03, 1, tq, X.acc, 'slideD');
|
|
663
|
+
putSpr(c, cam, 1, C.numBg, -385, 10, 0.02, 1, tq, X.num, 'drop', (cc) => {
|
|
664
|
+
const v = Math.round(ACC(u)); cc.fillStyle = INK; cc.font = '400 168px "Anton"'; cc.textAlign = 'center'; cc.fillText(v + '%', 0, 62);
|
|
665
|
+
const m = measure('400 168px "Anton"', v + '%'); hilite(cc, [-m.width / 2 - 14, -50, m.width + 28, 118], (t - X.hl97[0]) / (X.hl97[1] - X.hl97[0]), 21);
|
|
666
|
+
if (tq >= X.num) tape(cc, -150, -105, 80, 26, -0.4, 40);
|
|
667
|
+
});
|
|
668
|
+
putSpr(c, cam, 1, C.chart, 270, 18, 0.015, 1, tq, X.chart, 'slideR', (cc) => {
|
|
669
|
+
const ox = -240, oy = 150, xw = 500, yh = 300, Y = (a) => oy - (a - 55) / 45 * yh;
|
|
670
|
+
cc.strokeStyle = INK; cc.lineWidth = 2.5; cc.beginPath(); cc.moveTo(ox, oy - yh - 10); cc.lineTo(ox, oy); cc.lineTo(ox + xw + 10, oy); cc.stroke();
|
|
671
|
+
cc.font = '400 22px "Oswald"'; cc.fillStyle = INK; cc.textAlign = 'right';
|
|
672
|
+
for (const a of [60, 80, 100]) { cc.fillText(a + '%', ox - 10, Y(a) + 8); cc.strokeStyle = 'rgba(30,27,24,0.25)'; cc.lineWidth = 1; cc.beginPath(); cc.moveTo(ox, Y(a)); cc.lineTo(ox + xw, Y(a)); cc.stroke(); }
|
|
673
|
+
cc.textAlign = 'left'; cc.font = '700 26px "Oswald"'; cc.fillText('TRAINING ROUNDS', ox + 10, oy + 44);
|
|
674
|
+
inkArrow(cc, linePts(ox + 222, oy + 35, ox + 300, oy + 35, 3, 6, 0.5), 1, 2.6);
|
|
675
|
+
const nz = NZ(), pts = []; for (let i = 0; i <= 40; i++) { const k = i / 40; pts.push([ox + 10 + k * (xw - 20), Y(ACC(k) + nz.n2(k * 9, 3) * 4 * (1 - k))]); }
|
|
676
|
+
marker(cc, pts, u, RED, 5);
|
|
677
|
+
for (let i = 0; i <= 40; i += 5) if (i / 40 <= u + 1e-6) { ell(cc, pts[i][0], pts[i][1], 4.5, 4.5); cc.fillStyle = INK; cc.fill(); }
|
|
678
|
+
if (u > 0) { const k = Math.min(40, Math.floor(u * 40)); pin(cc, pts[k][0], pts[k][1], 1.3); }
|
|
679
|
+
if (tq >= X.chart) { tape(cc, -260, -205, 90, 26, -0.6, 41); tape(cc, 270, -200, 90, 26, 0.55, 42); }
|
|
680
|
+
});
|
|
681
|
+
};
|
|
682
|
+
const scene4 = (c, cam, t, tq) => {
|
|
683
|
+
bgPaper(c, cam);
|
|
684
|
+
place(c, cam, 0.45, 610, -330, 0.08, 0.8, (cc) => drawSpr(cc, C.clipSoft));
|
|
685
|
+
place(c, cam, 0.5, -560, 300, -0.07, 0.95, (cc) => { drawSpr(cc, C.map); pin(cc, 32, -14, 1.2); tape(cc, 60, -86, 80, 26, 0.2, 54); });
|
|
686
|
+
block(c, cam, 0.6, -20, 0, 1000, 420, -0.02, RED, 51, [1, 1, 1, 1], 7);
|
|
687
|
+
const P = pets();
|
|
688
|
+
putSpr(c, cam, 0.85, P[0].spr, -520, -235, -0.12, 0.95, tq, X.pets4, 'drop', (cc) => tape(cc, 0, -70, 70, 22, 0.15, 52));
|
|
689
|
+
putSpr(c, cam, 0.85, P[1].spr, 530, 240, 0.1, 0.95, tq, X.pets4 + 0.08, 'drop', (cc) => tape(cc, 0, -70, 70, 22, -0.2, 53));
|
|
690
|
+
putSpr(c, cam, 1, C.k1, -130, -70, -0.02, 1, tq, X.k1, 'drop');
|
|
691
|
+
place(c, cam, 1, 0, 0, 0, 1, (cc) => inkArrow(cc, quadPts(205, -96, 300, -110, 330, -40, 20), H.clamp((tq - X.arrow[0]) / (X.arrow[1] - X.arrow[0])), 9, INK));
|
|
692
|
+
putSpr(c, cam, 1, C.k2, 60, 70, 0.015, 1, tq, X.k2, 'drop', (cc) => hilite(cc, C.k2.hl, (t - X.hlK[0]) / (X.hlK[1] - X.hlK[0]), 31));
|
|
693
|
+
};
|
|
694
|
+
|
|
695
|
+
// camera: smooth (continuous t). Returns scene id + x,y,zoom.
|
|
696
|
+
const camAt = (t) => {
|
|
697
|
+
const e3 = (u) => u * u * u;
|
|
698
|
+
if (t < X.whip1[1]) {
|
|
699
|
+
const w = H.clamp((t - X.whip1[0]) / (X.whip1[1] - X.whip1[0]));
|
|
700
|
+
return { sc: 1, x: t * 9 + 1150 * e3(w), y: 0, z: 1 + 0.04 * H.clamp(t / 2.3) };
|
|
701
|
+
}
|
|
702
|
+
if (t < X.whip2[1]) {
|
|
703
|
+
const w = H.clamp((t - X.whip1[1]) / (X.whip1[2] - X.whip1[1])), p = H.ease.inOut(H.clamp((t - X.push[0]) / (X.push[1] - X.push[0])));
|
|
704
|
+
const tail = H.clamp((t - X.whip2[0]) / (X.whip2[1] - X.whip2[0]));
|
|
705
|
+
const z = H.lerp(1 + 0.025 * H.clamp((t - 2.35) / 3.5), 1.4 + 0.05 * H.clamp((t - X.push[1]) / 3.6), p);
|
|
706
|
+
return { sc: 2, x: -1150 * Math.pow(1 - w, 3) + H.lerp((t - 2.35) * 12, 410 + (t - X.push[1]) * 6, p), y: H.lerp(0, 45, p) + 900 * e3(tail) / z, z };
|
|
707
|
+
}
|
|
708
|
+
if (t < X.sheet[1]) {
|
|
709
|
+
const w = H.clamp((t - X.whip2[1]) / (X.whip2[2] - X.whip2[1])), e = H.ease.inOut(H.clamp((t - X.hl97[0] + 0.15) / 0.5));
|
|
710
|
+
return { sc: 3, x: H.lerp(0, -110, e), y: -900 * Math.pow(1 - w, 3), z: 1 + 0.05 * H.clamp((t - 10.45) / 2.4) + 0.1 * e };
|
|
711
|
+
}
|
|
712
|
+
return { sc: 4, x: 0, y: 0, z: 1 + 0.045 * H.clamp((t - 13.1) / 1.9) };
|
|
713
|
+
};
|
|
714
|
+
const SCENES = [null, scene1, scene2, scene3, scene4];
|
|
715
|
+
|
|
716
|
+
const drawExplainer = (ctx, t) => {
|
|
717
|
+
init();
|
|
718
|
+
const tq = q12(t), cam = camAt(t);
|
|
719
|
+
// whip blur from camera speed (screen px/s), measured within the same scene
|
|
720
|
+
const ca = camAt(t - 0.006), cb = camAt(t + 0.006);
|
|
721
|
+
const A = ca.sc === cam.sc ? ca : cam, B = cb.sc === cam.sc ? cb : cam, dt = (A === cam || B === cam) ? 0.006 : 0.012;
|
|
722
|
+
const vx = (B.x - A.x) * cam.z / dt, vy = (B.y - A.y) * cam.z / dt, sp = Math.hypot(vx, vy), blur = H.clamp((sp - 700) / 420, 0, 22);
|
|
723
|
+
const L = C.L || (C.L = H.layer(1280, 720)), L2 = C.L2 || (C.L2 = H.layer(1280, 720));
|
|
724
|
+
const target = blur > 0.8 ? L.getContext('2d') : ctx;
|
|
725
|
+
if (target !== ctx) { target.setTransform(1, 0, 0, 1, 0, 0); target.clearRect(0, 0, 1280, 720); }
|
|
726
|
+
SCENES[cam.sc](target, cam, t, tq);
|
|
727
|
+
// the next sheet slides up over the chart on 12 fps steps
|
|
728
|
+
if (cam.sc === 3 && tq >= X.sheet[0]) {
|
|
729
|
+
const u = H.clamp((tq - X.sheet[0]) / (X.sheet[1] - X.sheet[0])), y = 780 * (1 - H.ease.out(u));
|
|
730
|
+
target.save(); target.translate(0, y);
|
|
731
|
+
const poly = edgePoly(1400, 800, [1, 0, 0, 0], 61, 9).map(([x, yy]) => [x + 640, yy + 400 + 6]);
|
|
732
|
+
target.shadowColor = 'rgba(40,28,15,0.45)'; target.shadowBlur = 24; target.shadowOffsetY = -6; pathPoly(target, poly); target.fillStyle = PAPER; target.fill();
|
|
733
|
+
target.shadowColor = 'transparent'; pathPoly(target, poly); target.clip();
|
|
734
|
+
scene4(target, camAt(X.sheet[1]), t, tq);
|
|
735
|
+
target.restore();
|
|
736
|
+
}
|
|
737
|
+
if (target !== ctx) {
|
|
738
|
+
const l2 = L2.getContext('2d'); l2.setTransform(1, 0, 0, 1, 0, 0); l2.clearRect(0, 0, 1280, 720);
|
|
739
|
+
l2.filter = `blur(${(blur * 0.35).toFixed(1)}px)`; l2.drawImage(L, 0, 0); l2.filter = 'none';
|
|
740
|
+
const n = 7, ux = sp ? vx / sp : 1, uy = sp ? vy / sp : 0;
|
|
741
|
+
ctx.save(); ctx.fillStyle = PAPER; ctx.fillRect(0, 0, 1280, 720);
|
|
742
|
+
for (let i = 0; i < n; i++) { const o = (i / (n - 1) - 0.5) * blur * 2.6; ctx.globalAlpha = 1 / (i + 1); ctx.drawImage(L2, ux * o, uy * o); }
|
|
743
|
+
ctx.restore();
|
|
744
|
+
}
|
|
745
|
+
finish(ctx, t, 0.24);
|
|
746
|
+
};
|
|
747
|
+
|
|
748
|
+
registerStyle({
|
|
749
|
+
id: 'editorial-collage',
|
|
750
|
+
name: 'Editorial Essay Collage',
|
|
751
|
+
category: 'Popular Explainer Looks',
|
|
752
|
+
description: 'The editorial "animated essay" collage: warm grainy paper, archival halftone prints with torn white borders and soft shadows, newspaper clippings in serif type with a translucent yellow highlighter sweep, masking tape, flat colour blocks and big cut-out condensed headlines.',
|
|
753
|
+
motion: 'Cutouts drop and slide in on 12 fps hand-animated steps while the camera pushes smoothly through parallax layers; the highlighter sweeps left to right and a red marker rings the key detail.',
|
|
754
|
+
fonts: ['400 78px "Anton"', '700 30px "Oswald"', '400 13px "Oswald"', '700 34px "Libre Baskerville"', 'italic 400 19px "Libre Baskerville"', '400 10px "Libre Baskerville"'],
|
|
755
|
+
frameT: 4.8,
|
|
756
|
+
duration: 5,
|
|
757
|
+
readsPixels: false,
|
|
758
|
+
draw(ctx, W, H_, t) { drawStill(ctx, t); },
|
|
759
|
+
explainerDuration: D,
|
|
760
|
+
explainerNote: 'Scenes are joined by fast blurred camera whips that hide the cut, plus a new paper sheet slid up on steps; arrows are thin ink route lines and red marker, numbers are re-cut condensed numerals on paper strips, and the emphasis is the yellow highlighter sweep (plus a red marker ring and cross on the wrong guess).',
|
|
761
|
+
explainer(ctx, W, H_, t) { drawExplainer(ctx, t); },
|
|
762
|
+
explainerSound(k) {
|
|
763
|
+
// all times come from X (the explainer's own timeline above); stepped cutouts land 1-3 frames after they appear
|
|
764
|
+
const LAND = 1 / 12;
|
|
765
|
+
// a cutout sliding across paper: smooth low noise glide, no crinkle
|
|
766
|
+
const slide = (t, dur = 0.25, gain = 1, pan = 0, minor = false) => k.noise(t, { dur, color: 'pink', filter: 'lowpass', f: [[0, 420], [dur, 1100]], q: 0.7, gain: 0.2 * gain, a: dur * 0.35, pan, minor });
|
|
767
|
+
// a paper cutout set down on the table: soft low thump + a dry paper tap
|
|
768
|
+
const put = (t, gain = 1, pan = 0, minor = false) => {
|
|
769
|
+
k.noise(t, { dur: 0.07, color: 'brown', filter: 'lowpass', f: 650, gain: 0.32 * gain, a: 0.002, pan, minor });
|
|
770
|
+
k.tone(t, { f: [[0, 150], [0.07, 70]], dur: 0.09, gain: 0.1 * gain, pan, minor });
|
|
771
|
+
k.noise(t + 0.004, { dur: 0.018, filter: 'bandpass', f: 1700, q: 0.9, gain: 0.07 * gain, pan, minor });
|
|
772
|
+
};
|
|
773
|
+
// highlighter: broad felt tip, a soft breathy swipe (no squeak) plus the sharpie surface texture underneath
|
|
774
|
+
const hl = (a, b, gain = 1, pan = 0, minor = false) => {
|
|
775
|
+
const d = b - a;
|
|
776
|
+
k.noise(a, { dur: d + 0.05, color: 'pink', filter: 'bandpass', f: [[0, 800], [d, 1300]], q: 0.7, gain: 0.2 * gain, a: d * 0.2, hold: d * 0.6, pan, minor });
|
|
777
|
+
k.play('stroke', a, { material: 'sharpie', dur: d, gain: 0.45 * gain, pan, minor });
|
|
778
|
+
};
|
|
779
|
+
const mark = (a, b, gain = 1, pan = 0, minor = false, material = 'marker') => {
|
|
780
|
+
k.noise(a, { dur: 0.024, filter: 'bandpass', f: 1400, q: 1.2, gain: 0.24 * gain, a: 0.001, pan, minor }); // tip touching down
|
|
781
|
+
k.play('stroke', a, { material, dur: b - a, gain, pan, minor });
|
|
782
|
+
};
|
|
783
|
+
const tear = (t, gain = 0.8, pan = 0) => { k.noise(t, { dur: 0.03, filter: 'bandpass', f: 1500, q: 1, gain: 0.22 * gain, a: 0.001, pan, minor: true }); k.play('tape', t, { dur: 0.22, gain: gain * 1.3, pan, minor: true }); };
|
|
784
|
+
|
|
785
|
+
k.bed('room', 0, D, { gain: 0.35 });
|
|
786
|
+
k.music('pad', 0, D, { bpm: 70, gain: 0.22, chords: [['D3', 'F3', 'A3', 'C4'], ['Bb2', 'D3', 'F3', 'A3'], ['F3', 'A3', 'C4', 'E4'], ['G3', 'Bb3', 'D4', 'F4'], ['D3', 'F3', 'A3', 'D4']] });
|
|
787
|
+
|
|
788
|
+
// 1 HOOK: photo and clipping slide up, tape, the two headline strips drop, highlighter on LEARN?
|
|
789
|
+
slide(0, 0.2, 0.5, 0.4); put(LAND * 3, 0.7, 0.4, true);
|
|
790
|
+
tear(X.tape0, 0.7, 0.3); tear(X.tape0 + 0.1, 0.6, 0.55);
|
|
791
|
+
put(X.h1 + LAND, 1, -0.3); put(X.h2 + LAND, 1, -0.15);
|
|
792
|
+
hl(X.hl0[0], X.hl0[1], 1.1, -0.1);
|
|
793
|
+
// whip: subtle camera whoosh peaking on the hidden cut
|
|
794
|
+
k.play('whoosh', X.whip1[1] - 0.38, { dur: 0.72, top: 1500, gain: 0.5 });
|
|
795
|
+
|
|
796
|
+
// 2 DATA: card slides in, prints land one by one with their labels, counter, route line, prints flowing in
|
|
797
|
+
slide(X.card, 0.25, 0.7, 0.5, true); put(X.tag + LAND, 0.7, 0.4, true); tear(X.tag + 0.03, 0.6, 0.4);
|
|
798
|
+
X.prints.forEach((a, i) => { const pan = -0.6 + (i % 3) * 0.2; put(a + LAND, 0.85, pan, true); put(a + X.labOff + LAND, 0.45, pan, true); });
|
|
799
|
+
tear(X.prints[0] + 0.1, 0.7, -0.6);
|
|
800
|
+
slide(X.counter, 0.25, 0.7, -0.3, true);
|
|
801
|
+
mark(X.route[0], X.route[1], 0.6, 0, true, 'pen');
|
|
802
|
+
{ // counter ticks: one per visible change in the counting (stepped 12 fps), thinning as the number eases in and out
|
|
803
|
+
let last = -1;
|
|
804
|
+
for (let f = Math.ceil(X.count[0] * 12); f / 12 < X.count[1]; f++) {
|
|
805
|
+
const u = (f / 12 - X.count[0]) / (X.count[1] - X.count[0]), b = Math.floor(H.ease.inOut(u) * 22);
|
|
806
|
+
if (b !== last) { k.play('tick', f / 12, { f: 3000, gain: 1.5, pan: -0.3, minor: true }); last = b; }
|
|
807
|
+
}
|
|
808
|
+
k.play('tock', X.count[1], { f: 520, gain: 0.5, pan: -0.3 }); // 1,000,000 lands
|
|
809
|
+
}
|
|
810
|
+
for (let i = 0; i < X.flowN; i += 2) slide(X.flow0 + i * X.flowGap, X.flowDur, 0.18, -0.1 + i * 0.03, true);
|
|
811
|
+
k.play('whoosh', X.push[0], { dur: X.push[1] - X.push[0], top: 900, gain: 0.25 }); // camera push onto the model
|
|
812
|
+
|
|
813
|
+
// 3 GUESS -> CHECK -> ADJUST
|
|
814
|
+
slide(X.np, 0.34, 0.8, -0.3); put(X.np + 0.34, 0.8, -0.3);
|
|
815
|
+
put(X.guessLab + LAND, 0.7, 0.2, true);
|
|
816
|
+
mark(X.guessArrow[0], X.guessArrow[1], 0.6, 0.2, true, 'pen');
|
|
817
|
+
put(X.dog + LAND, 1.0, 0.4);
|
|
818
|
+
put(X.checkLab + LAND, 0.7, 0.4, true);
|
|
819
|
+
mark(X.ring[0], X.ring[1], 1.15, 0.4); // red marker ring round the wrong guess
|
|
820
|
+
mark(X.cross[0], (X.cross[0] + X.cross[1]) / 2, 1.4, 0.4); mark((X.cross[0] + X.cross[1]) / 2, X.cross[1], 1.4, 0.4); // the cross
|
|
821
|
+
k.play('thud', X.cross[0], { f: 95, gain: 0.45, pan: 0.3 });
|
|
822
|
+
k.play('error', X.cross[0] + 0.12, { f: 'D3', gain: 0.32, pan: 0.3 });
|
|
823
|
+
mark(X.err[0], X.err[1], 0.6, 0.3, true, 'pen'); // red dashed signal back
|
|
824
|
+
k.noise(X.back[0], { dur: X.back[1] - X.back[0] + 0.1, color: 'pink', filter: 'bandpass', f: [[0, 1300], [X.back[1] - X.back[0], 350]], q: 1.1, gain: 0.2, a: 0.08, pan: 0.1 }); // error travelling back through the network
|
|
825
|
+
mark(X.adjArrow[0], X.adjArrow[1], 0.55, 0.2, true, 'pen');
|
|
826
|
+
put(X.adjLab + LAND, 0.75, -0.05, true);
|
|
827
|
+
for (let f = Math.ceil(X.tune[0] * 12); f / 12 < X.tune[1]; f++) k.play('click', f / 12, { f: 850, gain: 0.45, pan: (f % 4 - 1.5) * 0.15, minor: true }); // knobs turning on steps
|
|
828
|
+
slide(X.pull, 0.17, 0.7, 0.4); // the wrong answer is pulled away
|
|
829
|
+
put(X.cat + LAND, 1.05, 0.4);
|
|
830
|
+
hl(X.hlCat[0], X.hlCat[1], 1.0, 0.4);
|
|
831
|
+
mark(X.tick[0], X.tick[1], 1.1, 0.5, false, 'sharpie');
|
|
832
|
+
k.play('ding', X.tick[1], { f: 'D5', gain: 0.32, pan: 0.4 });
|
|
833
|
+
k.play('whoosh', X.whip2[1] - 0.38, { dur: 0.72, top: 1300, gain: 0.5 });
|
|
834
|
+
|
|
835
|
+
// 4 PROGRESS: chart and number land, red line draws while the % counts, 97% gets the hit and the highlighter
|
|
836
|
+
slide(X.chart, 0.25, 0.6, 0.4, true); put(X.num + LAND, 0.7, -0.4, true); // number scrap drops in
|
|
837
|
+
tear(X.chart + 0.05, 0.6, 0.5); tear(X.num + 0.06, 0.6, -0.5);
|
|
838
|
+
mark(X.line[0], X.line[1], 0.5, 0.3, true);
|
|
839
|
+
{ let last = -1; for (let f = Math.ceil(X.line[0] * 12); f / 12 < X.line[1]; f++) { const v = Math.round(ACC(H.clamp((f / 12 - X.line[0]) / (X.line[1] - X.line[0])))); if (v !== last) { k.play('tick', f / 12, { f: 2800 + (v - 61) * 12, gain: 1.4, pan: -0.35, minor: true }); last = v; } } }
|
|
840
|
+
k.play('impact', X.line[1], { gain: 0.7, pan: -0.2 }); // 97% lands: biggest hit
|
|
841
|
+
k.play('ding', X.line[1] + 0.01, { f: 'A4', gain: 0.35, pan: -0.2 });
|
|
842
|
+
hl(X.hl97[0], X.hl97[1], 1.35, -0.3);
|
|
843
|
+
|
|
844
|
+
// 5 TAKEAWAY: a new sheet slides up over the chart, strips drop, arrow, highlighter, resolve
|
|
845
|
+
slide(X.sheet[0], X.sheet[1] - X.sheet[0] + 0.05, 1.6, 0);
|
|
846
|
+
put(X.sheet[1], 1.1, 0);
|
|
847
|
+
put(X.k1 + LAND, 1.0, -0.2);
|
|
848
|
+
mark(X.arrow[0], X.arrow[1], 0.9, 0.3, true, 'sharpie');
|
|
849
|
+
put(X.k2 + LAND, 1.0, 0.1);
|
|
850
|
+
hl(X.hlK[0], X.hlK[1], 1.2, 0.1);
|
|
851
|
+
k.play('success', X.hlK[1] + 0.02, { f: 'D5', gain: 0.4 });
|
|
852
|
+
},
|
|
853
|
+
});
|
|
854
|
+
}
|