@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,717 @@
|
|
|
1
|
+
{
|
|
2
|
+
const TAU = Math.PI * 2;
|
|
3
|
+
// 5x7 sampler alphabet
|
|
4
|
+
const FONT = {
|
|
5
|
+
H: ['10001', '10001', '10001', '11111', '10001', '10001', '10001'],
|
|
6
|
+
E: ['11111', '10000', '10000', '11110', '10000', '10000', '11111'],
|
|
7
|
+
L: ['10000', '10000', '10000', '10000', '10000', '10000', '11111'],
|
|
8
|
+
O: ['01110', '10001', '10001', '10001', '10001', '10001', '01110'],
|
|
9
|
+
W: ['10001', '10001', '10001', '10101', '10101', '10101', '01010'],
|
|
10
|
+
R: ['11110', '10001', '10001', '11110', '10100', '10010', '10001'],
|
|
11
|
+
D: ['11110', '10001', '10001', '10001', '10001', '10001', '11110'],
|
|
12
|
+
',': ['00', '00', '00', '00', '00', '01', '10'],
|
|
13
|
+
' ': ['00', '00', '00', '00', '00', '00', '00'],
|
|
14
|
+
};
|
|
15
|
+
const HEART = ['0110110', '1111111', '1111111', '0111110', '0011100', '0001000'];
|
|
16
|
+
const FLOWER = ['01010', '11111', '01210', '11111', '01010'];
|
|
17
|
+
|
|
18
|
+
// =====================================================================
|
|
19
|
+
// EXPLAINER: one long sampler; the cloth slides through the hoop from
|
|
20
|
+
// motif to motif. Everything is stitched cell by cell; arrows are backstitch.
|
|
21
|
+
// =====================================================================
|
|
22
|
+
const F7 = {
|
|
23
|
+
...FONT,
|
|
24
|
+
S: ['01111', '10000', '10000', '01110', '00001', '00001', '11110'],
|
|
25
|
+
A: ['01110', '10001', '10001', '11111', '10001', '10001', '10001'],
|
|
26
|
+
I: ['11111', '00100', '00100', '00100', '00100', '00100', '11111'],
|
|
27
|
+
N: ['10001', '11001', '10101', '10011', '10001', '10001', '10001'],
|
|
28
|
+
'?': ['01110', '10001', '00001', '00110', '00100', '00000', '00100'],
|
|
29
|
+
};
|
|
30
|
+
const F3 = {
|
|
31
|
+
A: ['010', '101', '111', '101', '101'], B: ['110', '101', '110', '101', '110'], C: ['011', '100', '100', '100', '011'],
|
|
32
|
+
D: ['110', '101', '101', '101', '110'], E: ['111', '100', '110', '100', '111'], G: ['011', '100', '101', '101', '011'],
|
|
33
|
+
H: ['101', '101', '111', '101', '101'], I: ['111', '010', '010', '010', '111'], J: ['001', '001', '001', '101', '010'],
|
|
34
|
+
K: ['101', '101', '110', '101', '101'], L: ['100', '100', '100', '100', '111'], M: ['10001', '11011', '10101', '10001', '10001'],
|
|
35
|
+
N: ['1001', '1101', '1011', '1001', '1001'], O: ['010', '101', '101', '101', '010'], P: ['110', '101', '110', '100', '100'],
|
|
36
|
+
R: ['110', '101', '110', '101', '101'], S: ['011', '100', '010', '001', '110'], T: ['111', '010', '010', '010', '010'],
|
|
37
|
+
U: ['101', '101', '101', '101', '111'], W: ['10001', '10001', '10101', '11011', '10001'], X: ['101', '101', '010', '101', '101'],
|
|
38
|
+
Y: ['101', '101', '010', '010', '010'], '?': ['110', '001', '010', '000', '010'], '%': ['100', '001', '010', '100', '001'],
|
|
39
|
+
',': ['00', '00', '00', '01', '10'], ' ': ['00', '00', '00', '00', '00'], '>': ['00100', '00010', '11111', '00010', '00100'],
|
|
40
|
+
0: ['111', '101', '101', '101', '111'], 1: ['010', '110', '010', '010', '111'], 2: ['110', '001', '010', '100', '111'],
|
|
41
|
+
3: ['110', '001', '010', '001', '110'], 4: ['101', '101', '111', '001', '001'], 5: ['111', '100', '110', '001', '110'],
|
|
42
|
+
6: ['011', '100', '110', '101', '010'], 7: ['111', '001', '010', '010', '010'], 8: ['010', '101', '010', '101', '010'], 9: ['010', '101', '011', '001', '110'],
|
|
43
|
+
};
|
|
44
|
+
const XPAL = { R: '#c43a46', N: '#2e3760', T: '#5fb3a9', t: '#3f8c86', Y: '#f2c14e', O: '#ef8a3c', B: '#a8673c', D: '#5e3a22', K: '#2a2433', P: '#e98aa0', p: '#c4566f', G: '#4f9a52', W: '#dfe3e8', g: '#9aa0a8' };
|
|
45
|
+
const ICON = {
|
|
46
|
+
cat: ['O.......O', 'OO.....OO', 'OOOOOOOOO', 'OOKOOOKOO', 'OOOOOOOOO', 'OOOOPOOOO', '.OOOOOOO.', '..OOOOO..'],
|
|
47
|
+
dog: ['DD.....DD', 'DDBBBBBDD', 'DBBBBBBBD', 'DBKBBBKBD', '.BBBBBBB.', '.BBBKBBB.', '..BBBBB..', '...BBB...'],
|
|
48
|
+
brain: ['...PPPPPP...', '.PPpPPPPpPP.', 'PPPPPpPPPPPP', 'PpPPPPPPpPPP', 'PPPPpPPPPPpP', 'PPpPPPPpPPPP', '.PPPPPpPPPP.', '..PPPPPPPP..', '.....pp.....', '.....pp.....'],
|
|
49
|
+
check: ['.......GG', '......GG.', 'GG...GG..', '.GG.GG...', '..GGG....'],
|
|
50
|
+
x: ['RR...RR', '.RR.RR.', '..RRR..', '.RR.RR.', 'RR...RR'],
|
|
51
|
+
};
|
|
52
|
+
const XC = {};
|
|
53
|
+
const xLeg = (c, x0, y0, x1, y1, rgb, rr) => {
|
|
54
|
+
const len = Math.hypot(x1 - x0, y1 - y0), ux = (x1 - x0) / len, uy = (y1 - y0) / len, nx = -uy, ny = ux;
|
|
55
|
+
c.lineCap = 'round'; c.strokeStyle = 'rgba(40,25,10,0.32)'; c.lineWidth = 5.8;
|
|
56
|
+
c.beginPath(); c.moveTo(x0 + 0.7, y0 + 1.1); c.lineTo(x1 + 0.7, y1 + 1.1); c.stroke();
|
|
57
|
+
for (let s = -1; s <= 1; s += 2) {
|
|
58
|
+
const ox = nx * s * 1.25, oy = ny * s * 1.25, g = c.createLinearGradient(x0, y0, x1, y1);
|
|
59
|
+
const dk = rgb.map((v) => v * 0.55), md = rgb.map((v) => Math.min(255, v * 1.08)), hi = rgb.map((v) => Math.min(255, v * 1.22 + 18));
|
|
60
|
+
g.addColorStop(0, H.rgba(dk)); g.addColorStop(0.22, H.rgba(md)); g.addColorStop(0.5, H.rgba(s < 0 ? hi : md)); g.addColorStop(0.78, H.rgba(md)); g.addColorStop(1, H.rgba(dk));
|
|
61
|
+
c.strokeStyle = g; c.lineWidth = 2.9; c.beginPath(); c.moveTo(x0 + ox, y0 + oy); c.lineTo(x1 + ox, y1 + oy); c.stroke();
|
|
62
|
+
c.lineWidth = 0.7;
|
|
63
|
+
for (let k = 2.2 + rr() * 1.5; k < len - 1.5; k += 2.3) {
|
|
64
|
+
const px = x0 + ox + ux * k, py = y0 + oy + uy * k;
|
|
65
|
+
c.strokeStyle = `rgba(255,255,255,${0.12 + rr() * 0.14})`; c.beginPath(); c.moveTo(px - nx * 1.3 - ux * 0.8, py - ny * 1.3 - uy * 0.8); c.lineTo(px + nx * 1.3 + ux * 0.8, py + ny * 1.3 + uy * 0.8); c.stroke();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
const xSprite = (key, v, half) => {
|
|
70
|
+
const id = key + v + (half ? 'h' : '');
|
|
71
|
+
if (XC[id]) return XC[id];
|
|
72
|
+
const S = 12, P = 4, cv = H.layer(S + P * 2, S + P * 2), c = cv.getContext('2d'), rr = H.rng(key.charCodeAt(0) * 31 + v * 7);
|
|
73
|
+
const rgb = H.hex(XPAL[key]).map((x) => x * (0.96 + rr() * 0.08));
|
|
74
|
+
xLeg(c, P + 1, P + S - 1, P + S - 1, P + 1, rgb.map((x) => x * 0.9), rr);
|
|
75
|
+
if (!half) xLeg(c, P + 1, P + 1, P + S - 1, P + S - 1, rgb, rr);
|
|
76
|
+
return (XC[id] = cv);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const EXPLAIN = (ctx, W, H_, t) => {
|
|
80
|
+
const S = 12, HC = [640, 372], HR = 548, HW = 30;
|
|
81
|
+
const seg = (a, b) => H.ease.inOut(H.clamp((t - a) / (b - a)));
|
|
82
|
+
// the cloth slides through the hoop (in whole-cell steps of motion blur-free px)
|
|
83
|
+
const camX = 1200 * seg(1.85, 2.35) + 408 * seg(5.6, 6.2) + 1200 * seg(10.1, 10.8);
|
|
84
|
+
const cam = Math.round(camX);
|
|
85
|
+
|
|
86
|
+
// ---------- aida (per-pixel, scrolls with the cloth) ----------
|
|
87
|
+
if (!XC.lut) {
|
|
88
|
+
const lut = new Float32Array(S * S);
|
|
89
|
+
for (let fy = 0; fy < S; fy++) for (let fx = 0; fx < S; fx++) {
|
|
90
|
+
const dx = Math.min(fx + 0.5, S - fx - 0.5), dy = Math.min(fy + 0.5, S - fy - 0.5);
|
|
91
|
+
const hole = Math.exp(-(dx * dx + dy * dy) / 1.9), groove = Math.exp((-dx * dx) / 0.9) * 0.5 + Math.exp((-dy * dy) / 0.9) * 0.5;
|
|
92
|
+
const sx = fx < S / 2 ? 0 : 1, sy = fy < S / 2 ? 0 : 1, horiz = (sx + sy) % 2 === 0, ph = horiz ? fy : fx, along = horiz ? fx : fy;
|
|
93
|
+
lut[fy * S + fx] = 1 - hole * 0.42 - groove * 0.13 + (Math.cos((ph * TAU) / 3) * 0.5 + Math.cos((along * TAU) / 6 + ph) * 0.15) * 0.06;
|
|
94
|
+
}
|
|
95
|
+
XC.lut = lut;
|
|
96
|
+
const cn = new Float32Array(4096), r = H.rng(2024); for (let i = 0; i < 4096; i++) cn[i] = r.gauss() * 0.018; XC.cn = cn;
|
|
97
|
+
const out = new Float32Array(W * H_), nz = H.makeNoise(11);
|
|
98
|
+
for (let y = 0; y < H_; y++) for (let x = 0; x < W; x++) {
|
|
99
|
+
const dist = Math.hypot(x - HC[0], y - HC[1]);
|
|
100
|
+
if (dist <= HR) { out[y * W + x] = 1; continue; }
|
|
101
|
+
const a = Math.atan2(y - HC[1], x - HC[0]), fold = Math.sin(a * 38 + nz.n2(x * 0.01, y * 0.01) * 4) * 0.5 + nz.n2(x * 0.006, y * 0.006) * 0.6;
|
|
102
|
+
out[y * W + x] = 0.78 + fold * 0.11 - Math.min(0.14, (dist - HR) * 0.0007);
|
|
103
|
+
}
|
|
104
|
+
XC.shade = out;
|
|
105
|
+
}
|
|
106
|
+
{
|
|
107
|
+
const img = ctx.createImageData(W, H_), d = img.data, lut = XC.lut, cn = XC.cn, sh = XC.shade, rn = H.rng(7 + Math.floor(t * 12));
|
|
108
|
+
for (let y = 0; y < H_; y++) {
|
|
109
|
+
const fy = y % S, cy = (y / S) | 0;
|
|
110
|
+
for (let x = 0; x < W; x++) {
|
|
111
|
+
const wx = x + cam, fx = wx % S, cx = (wx / S) | 0;
|
|
112
|
+
const v = (lut[fy * S + fx] + cn[(cy * 97 + cx * 13) & 4095] + (rn() - 0.5) * 0.05) * sh[y * W + x];
|
|
113
|
+
const k = (y * W + x) * 4;
|
|
114
|
+
d[k] = 238 * v; d[k + 1] = 230 * v; d[k + 2] = 211 * v; d[k + 3] = 255;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
ctx.putImageData(img, 0, 0);
|
|
118
|
+
const g = ctx.createRadialGradient(470 + t * 12, 280, 50, 640, 372, 660);
|
|
119
|
+
g.addColorStop(0, 'rgba(255,250,235,0.18)'); g.addColorStop(1, 'rgba(60,40,20,0.12)');
|
|
120
|
+
ctx.fillStyle = g; ctx.fillRect(0, 0, W, H_);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// ---------- chart: every stitch gets a time ----------
|
|
124
|
+
const cells = []; // [col,row,key,time]
|
|
125
|
+
const block = (pat, c0, r0, map, t0, t1, order = 'row') => {
|
|
126
|
+
const list = [];
|
|
127
|
+
pat.forEach((row, ry) => [...row].forEach((ch, rx) => { const k = map ? map[ch] : ch; if (k && XPAL[k]) list.push([c0 + rx, r0 + ry, k]); }));
|
|
128
|
+
if (order === 'col') list.sort((a, b) => a[0] - b[0] || a[1] - b[1]);
|
|
129
|
+
if (order === 'up') list.sort((a, b) => b[1] - a[1] || a[0] - b[0]);
|
|
130
|
+
list.forEach((c, i) => cells.push([...c, t0 + ((t1 - t0) * i) / Math.max(1, list.length)]));
|
|
131
|
+
};
|
|
132
|
+
const text3 = (str, c0, r0, key, t0, t1, scale = 1) => {
|
|
133
|
+
const rows = ['', '', '', '', ''].map(() => '');
|
|
134
|
+
for (const ch of str) { const g = F3[ch] || F3[' ']; for (let i = 0; i < 5; i++) rows[i] += g[i].replace(/1/g, 'x').replace(/0/g, '.') + '.'; }
|
|
135
|
+
const pat = scale === 1 ? rows : rows.flatMap((r) => { const rr = [...r].map((c) => c + c).join(''); return [rr, rr]; });
|
|
136
|
+
block(pat, c0, r0, { x: key }, t0, t1, 'col');
|
|
137
|
+
return (pat[0].length);
|
|
138
|
+
};
|
|
139
|
+
const text7 = (str, c0, r0, key, t0, t1) => {
|
|
140
|
+
const rows = Array(7).fill('');
|
|
141
|
+
for (const ch of str) { const g = F7[ch] || F7[' ']; for (let i = 0; i < 7; i++) rows[i] += g[i].replace(/1/g, 'x').replace(/0/g, '.') + '.'; }
|
|
142
|
+
block(rows, c0, r0, { x: key }, t0, t1, 'col');
|
|
143
|
+
};
|
|
144
|
+
const iconMap = { O: 'O', K: 'K', P: 'P', p: 'p', D: 'D', B: 'B', G: 'G', R: 'R' };
|
|
145
|
+
|
|
146
|
+
// BEAT 1: the question
|
|
147
|
+
text7('HOW DOES', 30, 16, 'R', 0.1, 0.85);
|
|
148
|
+
text7('AI LEARN?', 27, 26, 'N', 0.8, 1.6);
|
|
149
|
+
// BEAT 2: labelled examples stack up, model on the right
|
|
150
|
+
const s1 = 100;
|
|
151
|
+
const counterT = Math.floor(t * 6) / 6;
|
|
152
|
+
const n = Math.round(1e6 * Math.pow(H.clamp((counterT - 2.8) / 2.4), 2));
|
|
153
|
+
if (t > 2.2) {
|
|
154
|
+
const w = text3(n.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ','), s1 + 16, 8, 'Y', 0, 0);
|
|
155
|
+
text3('EXAMPLES', s1 + 18 + w, 8, 'T', 2.2, 2.6);
|
|
156
|
+
}
|
|
157
|
+
const kinds = ['cat', 'dog', 'dog', 'cat', 'cat', 'dog'];
|
|
158
|
+
kinds.forEach((k, i) => {
|
|
159
|
+
const c0 = s1 + 16 + (i % 3) * 13, r0 = 19 + Math.floor(i / 3) * 16, t0 = 2.35 + i * 0.45;
|
|
160
|
+
block(ICON[k], c0, r0, iconMap, t0, t0 + 0.3);
|
|
161
|
+
text3(k.toUpperCase(), c0 + 1, r0 + 9, k === 'cat' ? 'O' : 'D', t0 + 0.28, t0 + 0.4);
|
|
162
|
+
});
|
|
163
|
+
block(ICON.brain, 172, 22, iconMap, 2.0, 2.5);
|
|
164
|
+
text3('MODEL', 170, 34, 'p', 2.5, 2.7);
|
|
165
|
+
// BEAT 3: guess / check / adjust
|
|
166
|
+
block(ICON.cat, 155, 24, iconMap, 6.2, 6.45);
|
|
167
|
+
const dialAng = Math.floor(H.clamp((t - 8.9) / 0.6) * 6) * (t < 9.6 ? 1 : 1);
|
|
168
|
+
[0, 1, 2].forEach((i) => {
|
|
169
|
+
const c0 = 169 + i * 7, r0 = 40;
|
|
170
|
+
block(['.ggg.', 'ggggg', 'ggggg', 'ggggg', '.ggg.'], c0, r0, null, 2.6 + i * 0.05, 2.7 + i * 0.05);
|
|
171
|
+
const ring = [[2, 0], [3, 0.5], [4, 2], [3, 3.5], [2, 4], [1, 3.5], [0, 2], [1, 0.5]];
|
|
172
|
+
const pos = ring[((i * 3 + dialAng * (i % 2 ? 1 : 3)) % 8 + 8) % 8];
|
|
173
|
+
cells.push([c0 + Math.round(pos[0]), r0 + Math.round(pos[1]), 'K', 3.05 + i * 0.05 + (t > 8.9 ? 0 : 0)]);
|
|
174
|
+
cells.push([c0 + 2, r0 + 2, 'K', 3.05]);
|
|
175
|
+
});
|
|
176
|
+
text3('GUESS', 184, 21, 'N', 7.15, 7.35);
|
|
177
|
+
const wrong = t < 9.55;
|
|
178
|
+
text3(wrong ? 'DOG?' : 'CAT', 209, 25, wrong ? 'N' : 'G', wrong ? 7.4 : 9.6, wrong ? 7.65 : 9.8, 1);
|
|
179
|
+
if (wrong) { block(ICON.x, 222, 13, iconMap, 7.9, 8.05); text3('CHECK', 210, 39, 'R', 8.1, 8.3); }
|
|
180
|
+
else block(ICON.check, 222, 13, iconMap, 9.85, 10.0);
|
|
181
|
+
if (t < 9.55) text3('ADJUST', 186, 48, 'R', 8.7, 8.9);
|
|
182
|
+
// BEAT 4: bars stitched from the bottom up, accuracy restitched as it counts
|
|
183
|
+
const s3 = 234, accs = [61, 72, 80, 86, 90, 93, 95, 97];
|
|
184
|
+
let shown = 61;
|
|
185
|
+
accs.forEach((a, i) => {
|
|
186
|
+
const hgt = Math.round(a * 0.22), t0 = 10.75 + i * 0.24, key = i === 7 ? 'R' : i % 2 ? 'T' : 'Y';
|
|
187
|
+
const pat = Array.from({ length: hgt }, () => 'xxxx');
|
|
188
|
+
block(pat, s3 + 22 + i * 6, 36 - hgt, { x: key }, t0, t0 + 0.24, 'up');
|
|
189
|
+
if (t >= t0) shown = H.lerp(i ? accs[i - 1] : 61, a, H.clamp((t - t0) / 0.24));
|
|
190
|
+
});
|
|
191
|
+
if (t > 10.5) {
|
|
192
|
+
text3('ACCURACY', s3 + 18, 6, 'T', 10.5, 10.8);
|
|
193
|
+
text3(Math.round(Math.floor(shown * 2) / 2) + '%', s3 + 56, 3, t > 12.7 ? 'R' : 'N', 0, 0, 2);
|
|
194
|
+
text3('ROUNDS', s3 + 40, 38, 'g', 10.8, 11.0);
|
|
195
|
+
}
|
|
196
|
+
// BEAT 5: takeaway
|
|
197
|
+
text3('MORE EXAMPLES >', s3 + 22, 45, 'N', 13.0, 13.5);
|
|
198
|
+
text3('BETTER GUESSES', s3 + 24, 51, 'R', 13.4, 13.9);
|
|
199
|
+
|
|
200
|
+
// ---------- draw stitches (only what the hoop shows) ----------
|
|
201
|
+
const rs = H.rng(77);
|
|
202
|
+
let latest = null, lt = -1;
|
|
203
|
+
cells.forEach(([c, r, key, tm]) => {
|
|
204
|
+
const v = (c * 7 + r * 13) % 5, jx = ((c * 31 + r * 17) % 7) / 14 - 0.25, jy = ((c * 13 + r * 29) % 7) / 14 - 0.25;
|
|
205
|
+
if (t < tm) return;
|
|
206
|
+
const x = c * S - cam, y = r * S;
|
|
207
|
+
if (x < -20 || x > W + 20 || Math.hypot(x + 6 - HC[0], y + 6 - HC[1]) > HR - 6) return;
|
|
208
|
+
const half = t - tm < 0.06;
|
|
209
|
+
ctx.drawImage(xSprite(key, v, half), x - 4 + jx, y - 4 + jy);
|
|
210
|
+
if (tm > lt && tm > 0) { lt = tm; latest = [x + 12, y + 12, key]; }
|
|
211
|
+
});
|
|
212
|
+
void rs;
|
|
213
|
+
// ---------- backstitch arrows / outlines (one stitch per cell edge, revealed in order) ----------
|
|
214
|
+
// two-strand floss backstitch: each stitch runs hole to hole, inset so the aida hole shows between stitches
|
|
215
|
+
const BSC = XC.bsc || (XC.bsc = {});
|
|
216
|
+
const bsCols = (col, metal) => BSC[col + metal] || (BSC[col + metal] = (() => {
|
|
217
|
+
const rgb = H.hex(col);
|
|
218
|
+
return { dk: H.rgba(H.mix(rgb, [0, 0, 0], metal ? 0.45 : 0.4)), md: H.rgba(rgb), hi: metal ? 'rgba(255,243,192,0.95)' : H.rgba(H.mix(rgb, [255, 255, 255], 0.55), 0.8), tw: metal ? 'rgba(120,80,10,0.35)' : 'rgba(0,0,0,0.22)' };
|
|
219
|
+
})());
|
|
220
|
+
const bsSeg = (x0, y0, x1, y1, col, metal = false) => {
|
|
221
|
+
const len = Math.hypot(x1 - x0, y1 - y0);
|
|
222
|
+
if (len < 4) return;
|
|
223
|
+
const ux = (x1 - x0) / len, uy = (y1 - y0) / len, nx = -uy, ny = ux, ins = 2.0;
|
|
224
|
+
const ax = x0 + ux * ins, ay = y0 + uy * ins, bx = x1 - ux * ins, by = y1 - uy * ins;
|
|
225
|
+
const cs = bsCols(col, metal), h = ((Math.round(x0 + cam) * 7 + Math.round(y0) * 13) % 9) / 9;
|
|
226
|
+
ctx.lineCap = 'round';
|
|
227
|
+
ctx.strokeStyle = 'rgba(20,10,5,0.3)'; ctx.lineWidth = 3.6;
|
|
228
|
+
ctx.beginPath(); ctx.moveTo(ax + 0.8, ay + 1.3); ctx.lineTo(bx + 0.8, by + 1.3); ctx.stroke();
|
|
229
|
+
// strand bodies: dark 1px edges, then the floss colour
|
|
230
|
+
for (const [w, st] of [[3.1, cs.dk], [2.1, cs.md]]) {
|
|
231
|
+
ctx.strokeStyle = st; ctx.lineWidth = w; ctx.beginPath();
|
|
232
|
+
for (const sg of [-1, 1]) { const ox = nx * sg * 0.8, oy = ny * sg * 0.8; ctx.moveTo(ax + ox, ay + oy); ctx.lineTo(bx + ox, by + oy); }
|
|
233
|
+
ctx.stroke();
|
|
234
|
+
}
|
|
235
|
+
// twist: the two strands wrap round each other in short diagonal ridges
|
|
236
|
+
ctx.strokeStyle = cs.tw; ctx.lineWidth = 0.7; ctx.beginPath();
|
|
237
|
+
for (let k = 1.6 + h * 1.6; k < len - 2 * ins - 0.8; k += 2.6) { const px = ax + ux * k, py = ay + uy * k; ctx.moveTo(px - nx * 1.3 - ux * 0.7, py - ny * 1.3 - uy * 0.7); ctx.lineTo(px + nx * 1.3 + ux * 0.7, py + ny * 1.3 + uy * 0.7); }
|
|
238
|
+
ctx.stroke();
|
|
239
|
+
// sheen along the lit strand (gold floss: broken twist highlights)
|
|
240
|
+
ctx.strokeStyle = cs.hi; ctx.lineWidth = 0.75;
|
|
241
|
+
if (metal) ctx.setLineDash([3, 4]), (ctx.lineDashOffset = -h * 7);
|
|
242
|
+
ctx.beginPath(); ctx.moveTo(ax - nx * 1.0 + ux * 0.6, ay - ny * 1.0 + uy * 0.6); ctx.lineTo(bx - nx * 1.0 - ux * 0.6, by - ny * 1.0 - uy * 0.6); ctx.stroke();
|
|
243
|
+
if (metal) ctx.setLineDash([]), (ctx.lineDashOffset = 0);
|
|
244
|
+
};
|
|
245
|
+
const bsPath = (pts, col, t0, t1) => { // pts in cell-corner units
|
|
246
|
+
const steps = [];
|
|
247
|
+
for (let i = 0; i < pts.length - 1; i++) {
|
|
248
|
+
const [ax, ay] = pts[i], [bx, by] = pts[i + 1], n2 = Math.max(Math.abs(bx - ax), Math.abs(by - ay));
|
|
249
|
+
for (let k = 0; k < n2; k++) steps.push([ax + ((bx - ax) * k) / n2, ay + ((by - ay) * k) / n2, ax + ((bx - ax) * (k + 1)) / n2, ay + ((by - ay) * (k + 1)) / n2]);
|
|
250
|
+
}
|
|
251
|
+
const shown2 = Math.floor(steps.length * H.clamp((t - t0) / (t1 - t0)));
|
|
252
|
+
for (let i = 0; i < shown2; i++) { const [a, b, c, d] = steps[i]; bsSeg(a * S - cam, b * S, c * S - cam, d * S, col); }
|
|
253
|
+
if (shown2 > 0 && t < t1 + 0.05) { const [, , c, d] = steps[shown2 - 1]; latest = [c * S - cam, d * S, 'K']; lt = 99; }
|
|
254
|
+
};
|
|
255
|
+
const arrowPts = (x0, y0, x1, y1) => [[x0, y0], [x1, y1]];
|
|
256
|
+
ctx.save(); ctx.beginPath(); ctx.arc(HC[0], HC[1], HR - 6, 0, TAU); ctx.clip();
|
|
257
|
+
// flow arrow into the model
|
|
258
|
+
bsPath(arrowPts(s1 + 53, 37, 171, 33), '#3d3548', 3.6, 4.2);
|
|
259
|
+
bsPath([[168, 32], [171, 33], [169, 36]], '#3d3548', 4.2, 4.35);
|
|
260
|
+
// loop arrows
|
|
261
|
+
bsPath(arrowPts(165, 27, 171, 27), '#3d3548', 6.5, 6.8); bsPath([[169, 25], [171, 27], [169, 29]], '#3d3548', 6.8, 6.9);
|
|
262
|
+
bsPath(arrowPts(185, 28, 203, 28), '#3d3548', 6.95, 7.2); bsPath([[201, 26], [203, 28], [201, 30]], '#3d3548', 7.2, 7.3);
|
|
263
|
+
bsPath([[204, 20], [228, 20], [228, 34], [212, 34], [208, 37], [209, 34], [204, 34], [204, 20]], '#2e3760', 7.3, 7.6);
|
|
264
|
+
if (wrong) {
|
|
265
|
+
// emphasis: red running-stitch ring around the wrong guess
|
|
266
|
+
const ringN = 30, rp = Math.floor(ringN * H.clamp((t - 7.85) / 0.45));
|
|
267
|
+
for (let i = 0; i < rp; i += 2) {
|
|
268
|
+
const a0 = (i / ringN) * TAU - 2, a1 = ((i + 1) / ringN) * TAU - 2;
|
|
269
|
+
bsSeg(216 * S - cam + Math.cos(a0) * 215, 26 * S + Math.sin(a0) * 135, 216 * S - cam + Math.cos(a1) * 215, 26 * S + Math.sin(a1) * 135, '#c43a46');
|
|
270
|
+
}
|
|
271
|
+
bsPath([[204, 34], [204, 46], [190, 46]], '#c43a46', 8.35, 8.75);
|
|
272
|
+
bsPath([[192, 44], [190, 46], [192, 48]], '#c43a46', 8.75, 8.85);
|
|
273
|
+
}
|
|
274
|
+
// chart axes
|
|
275
|
+
bsPath([[s3 + 20, 12], [s3 + 20, 36], [s3 + 72, 36]], '#3d3548', 10.6, 10.9);
|
|
276
|
+
if (t > 12.7) { // emphasis rays around 97%
|
|
277
|
+
const k = Math.min(8, Math.floor((t - 12.7) * 24));
|
|
278
|
+
for (let i = 0; i < k; i++) { const a = (i / 8) * TAU, cx = (s3 + 68) * S - cam, cy = 9 * S; const p0 = [cx + Math.cos(a) * 172, cy + Math.sin(a) * 74], p1 = [cx + Math.cos(a) * 200, cy + Math.sin(a) * 92], ns = Math.max(1, Math.round(Math.hypot(p1[0] - p0[0], p1[1] - p0[1]) / 11)); for (let j = 0; j < ns; j++) bsSeg(H.lerp(p0[0], p1[0], j / ns), H.lerp(p0[1], p1[1], j / ns), H.lerp(p0[0], p1[0], (j + 1) / ns), H.lerp(p0[1], p1[1], (j + 1) / ns), '#f2c14e', true); }
|
|
279
|
+
}
|
|
280
|
+
ctx.restore();
|
|
281
|
+
|
|
282
|
+
// ---------- needle + floss at the newest stitch ----------
|
|
283
|
+
if (latest) {
|
|
284
|
+
const [lx, ly, key] = latest, nx0 = lx + 64, ny0 = ly + 30, ang = -0.5;
|
|
285
|
+
ctx.lineCap = 'round';
|
|
286
|
+
const fp = () => { ctx.beginPath(); ctx.moveTo(lx, ly); ctx.bezierCurveTo(lx + 36, ly + 60, nx0 + 36, ny0 + 70, nx0 + Math.cos(ang) * 64, ny0 + Math.sin(ang) * 64); };
|
|
287
|
+
ctx.strokeStyle = 'rgba(30,15,5,0.25)'; ctx.lineWidth = 4; ctx.save(); ctx.translate(1.5, 3); fp(); ctx.stroke(); ctx.restore();
|
|
288
|
+
ctx.strokeStyle = XPAL[key] || '#c43a46'; ctx.lineWidth = 2.6; fp(); ctx.stroke();
|
|
289
|
+
ctx.strokeStyle = 'rgba(255,235,225,0.35)'; ctx.lineWidth = 0.8; ctx.setLineDash([1.2, 2.2]); fp(); ctx.stroke(); ctx.setLineDash([]);
|
|
290
|
+
ctx.save(); ctx.translate(nx0, ny0); ctx.rotate(ang);
|
|
291
|
+
ctx.fillStyle = 'rgba(30,20,10,0.3)'; ctx.beginPath(); ctx.ellipse(36, 6, 40, 3.2, 0, 0, TAU); ctx.fill();
|
|
292
|
+
const ng = ctx.createLinearGradient(0, -3, 0, 3); ng.addColorStop(0, '#f4f6f8'); ng.addColorStop(0.35, '#b9c0c8'); ng.addColorStop(0.7, '#6f7780'); ng.addColorStop(1, '#a9b1ba');
|
|
293
|
+
ctx.fillStyle = ng; ctx.beginPath(); ctx.moveTo(0, 0); ctx.lineTo(10, -2.4); ctx.lineTo(70, -2.6); ctx.quadraticCurveTo(76, 0, 70, 2.6); ctx.lineTo(10, 2.4); ctx.closePath(); ctx.fill();
|
|
294
|
+
ctx.fillStyle = '#e9e1cf'; ctx.beginPath(); ctx.ellipse(64, 0, 4.2, 1.1, 0, 0, TAU); ctx.fill();
|
|
295
|
+
ctx.restore();
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// ---------- hoop (cached overlay) ----------
|
|
299
|
+
ctx.drawImage(XC.hoop || (XC.hoop = (() => {
|
|
300
|
+
const C = H.layer(W, H_), c = C.getContext('2d');
|
|
301
|
+
c.save(); c.beginPath(); c.arc(HC[0], HC[1], HR, 0, TAU); c.clip();
|
|
302
|
+
c.shadowColor = 'rgba(40,25,10,0.5)'; c.shadowBlur = 22; c.shadowOffsetX = 6; c.shadowOffsetY = 10;
|
|
303
|
+
c.lineWidth = 40; c.strokeStyle = '#000'; c.beginPath(); c.arc(HC[0], HC[1], HR + 20, 0, TAU); c.stroke(); c.restore();
|
|
304
|
+
c.save(); c.shadowColor = 'rgba(40,25,10,0.45)'; c.shadowBlur = 18; c.shadowOffsetX = 5; c.shadowOffsetY = 9;
|
|
305
|
+
c.lineWidth = HW; c.strokeStyle = '#c99d66'; c.beginPath(); c.arc(HC[0], HC[1], HR + HW / 2, 0, TAU); c.stroke(); c.restore();
|
|
306
|
+
const g = c.createRadialGradient(HC[0], HC[1], HR, HC[0], HC[1], HR + HW);
|
|
307
|
+
[[0, '#a8794a'], [0.15, '#d9b07a'], [0.45, '#ecc994'], [0.8, '#d2a46c'], [1, '#9b6b3e']].forEach(([p, col]) => g.addColorStop(p, col));
|
|
308
|
+
c.fillStyle = g; c.beginPath(); c.arc(HC[0], HC[1], HR + HW, 0, TAU); c.arc(HC[0], HC[1], HR, 0, TAU, true); c.fill('evenodd');
|
|
309
|
+
const gr = H.rng(303);
|
|
310
|
+
c.save(); c.beginPath(); c.arc(HC[0], HC[1], HR + HW, 0, TAU); c.arc(HC[0], HC[1], HR, 0, TAU, true); c.clip('evenodd');
|
|
311
|
+
for (let i = 0; i < 70; i++) {
|
|
312
|
+
const rr = HR + 2 + gr() * (HW - 4), a0 = gr() * TAU, al = gr.range(0.2, 1.4);
|
|
313
|
+
c.strokeStyle = gr() < 0.7 ? `rgba(120,70,30,${gr.range(0.12, 0.3)})` : `rgba(255,235,200,${gr.range(0.15, 0.3)})`; c.lineWidth = gr.range(0.5, 1.6);
|
|
314
|
+
c.beginPath(); for (let k = 0; k <= 30; k++) { const a = a0 + (al * k) / 30, w = Math.sin(a * 9 + i) * 1.2; const px = HC[0] + Math.cos(a) * (rr + w), py = HC[1] + Math.sin(a) * (rr + w); k ? c.lineTo(px, py) : c.moveTo(px, py); } c.stroke();
|
|
315
|
+
}
|
|
316
|
+
c.restore();
|
|
317
|
+
c.strokeStyle = 'rgba(255,240,210,0.6)'; c.lineWidth = 1.2; c.beginPath(); c.arc(HC[0], HC[1], HR + HW - 1, Math.PI * 0.95, Math.PI * 1.75); c.stroke();
|
|
318
|
+
c.strokeStyle = 'rgba(90,55,25,0.7)'; c.lineWidth = 1.5; c.beginPath(); c.arc(HC[0], HC[1], HR + 0.5, 0, TAU); c.stroke();
|
|
319
|
+
H.vignette(c, W, H_, 0.35, '50,30,10');
|
|
320
|
+
return C;
|
|
321
|
+
})()), 0, 0);
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
registerStyle({
|
|
325
|
+
id: 'cross-stitch',
|
|
326
|
+
name: 'Cross-Stitch Sampler',
|
|
327
|
+
category: 'Paper & Craft',
|
|
328
|
+
description: 'Pixel art worked as real counted cross-stitch on cream aida: every cell is an X of two-strand floss with sheen and twist, top legs all leaning the same way, dark backstitch outlines, all stretched in a wooden hoop.',
|
|
329
|
+
motion: 'The design fills in stitch by stitch in chart order, the needle hopping row to row trailing its floss, while the hoop drifts gently.',
|
|
330
|
+
fonts: [],
|
|
331
|
+
frameT: 5.8,
|
|
332
|
+
duration: 6,
|
|
333
|
+
readsPixels: true,
|
|
334
|
+
explainerDuration: 15,
|
|
335
|
+
explainerNote: 'One long sampler slides through the hoop from motif to motif; everything is stitched cell by cell with the needle chasing the newest stitch, arrows and outlines are backstitch laid one hole at a time, numbers are re-stitched in a 3x5 sampler font, and the wrong guess gets a red running-stitch ring.',
|
|
336
|
+
explainer(ctx, W, H_, t) { EXPLAIN(ctx, W, H_, t); },
|
|
337
|
+
// Sound: a needle and floss through aida held in a wooden hoop. While anything is being stitched, the needle
|
|
338
|
+
// punches through and the floss is drawn after it (one pass about every 0.1 s, never one per cell); backstitch
|
|
339
|
+
// arrows are the same with a darker floss; the cloth slides through the hoop as a soft fabric drag; counters are
|
|
340
|
+
// re-stitched one needle pass per change; the hoop itself is the drum for the big hits; a scissor snip ends it.
|
|
341
|
+
// Windows mirror the block()/text3()/bsPath() times in EXPLAIN() above (cloth slides 1.85-2.35, 5.6-6.2, 10.1-10.8).
|
|
342
|
+
explainerSound(k) {
|
|
343
|
+
const seg = (t, a, b) => H.ease.inOut(H.clamp((t - a) / (b - a)));
|
|
344
|
+
const camX = (t) => 1200 * seg(t, 1.85, 2.35) + 408 * seg(t, 5.6, 6.2) + 1200 * seg(t, 10.1, 10.8);
|
|
345
|
+
const pan = (col, t) => H.clamp(((col * 12 - camX(t)) / 1280) * 2 - 1, -1, 1) * 0.6;
|
|
346
|
+
let seed = 7; const rnd = () => ((seed = (seed * 16807) % 2147483647) / 2147483647);
|
|
347
|
+
// one needle pass: punch through the cloth, then the floss drawn after it
|
|
348
|
+
const pass = (t, g = 1, p = 0, dark = 1, minor = true) => {
|
|
349
|
+
k.noise(t, { dur: 0.02, filter: 'bandpass', f: 950 * dark, q: 1.4, gain: 0.34 * g, a: 0.001, pan: p, minor });
|
|
350
|
+
k.noise(t, { dur: 0.035, color: 'brown', filter: 'lowpass', f: 420, gain: 0.24 * g, a: 0.001, pan: p, minor });
|
|
351
|
+
const pd = 0.06 + rnd() * 0.03;
|
|
352
|
+
k.noise(t + 0.025, { dur: pd, filter: 'bandpass', f: [[0, 1700 * dark], [pd, 1150 * dark]], q: 0.9, gain: 0.2 * g, a: pd * 0.6, pan: p, minor });
|
|
353
|
+
};
|
|
354
|
+
// stitching windows [t0, t1, col, gain, dark]; passes are merged across overlapping windows and thinned
|
|
355
|
+
const W = [
|
|
356
|
+
[0.1, 0.85, 45, 1], [0.8, 1.6, 44, 1], // HOW DOES / AI LEARN?
|
|
357
|
+
[2.0, 2.5, 178, 0.9], [2.2, 2.6, 125, 0.8], [2.5, 2.7, 175, 0.8], [2.6, 2.75, 178, 0.6], // brain, EXAMPLES, MODEL, dials
|
|
358
|
+
...[0, 1, 2, 3, 4, 5].map((i) => [2.35 + i * 0.45, 2.75 + i * 0.45, 120 + (i % 3) * 13, 0.85]), // examples + labels
|
|
359
|
+
[3.6, 4.35, 160, 0.9, 0.8], // backstitch flow arrow
|
|
360
|
+
[6.2, 6.45, 159, 0.9], [6.5, 6.9, 168, 0.8, 0.8], [6.95, 7.3, 194, 0.8, 0.8], [7.15, 7.35, 190, 0.8], // cat, loop arrows, GUESS
|
|
361
|
+
[7.3, 7.6, 216, 0.8, 0.8], [7.4, 7.65, 214, 0.9], // bubble outline, DOG?
|
|
362
|
+
[8.1, 8.3, 216, 0.8], [8.35, 8.85, 198, 0.9, 0.8], [8.7, 8.9, 194, 0.8], // CHECK, red arrow, ADJUST
|
|
363
|
+
[9.6, 9.8, 214, 0.9], // CAT
|
|
364
|
+
[10.5, 10.8, 263, 0.8], [10.6, 10.9, 270, 0.8, 0.8], [10.8, 11.0, 280, 0.7], // ACCURACY, axes, ROUNDS
|
|
365
|
+
[13.0, 13.5, 265, 1], [13.4, 13.9, 267, 1], // takeaway
|
|
366
|
+
];
|
|
367
|
+
const passes = [];
|
|
368
|
+
W.forEach(([a, b, col, g, dark = 1]) => { for (let t = a; t < b - 0.02; t += 0.1 + rnd() * 0.025) passes.push([t, col, g, dark]); });
|
|
369
|
+
passes.sort((x, y) => x[0] - y[0]);
|
|
370
|
+
let lastT = -1;
|
|
371
|
+
for (const [t, col, g, dark] of passes) if (t - lastT >= 0.085) { pass(t, g * (0.85 + rnd() * 0.25), pan(col, t), dark, t > 0.15); lastT = t; }
|
|
372
|
+
|
|
373
|
+
// cloth slides through the hoop: a soft fabric drag against the wooden ring
|
|
374
|
+
const drag = (t, d, g = 1) => {
|
|
375
|
+
k.noise(t, { dur: d + 0.1, color: 'pink', filter: 'bandpass', f: [[0, 380], [d * 0.5, 800], [d + 0.1, 380]], q: 0.6, gain: 0.13 * g, a: d * 0.45 });
|
|
376
|
+
k.noise(t, { dur: d + 0.1, color: 'brown', filter: 'lowpass', f: 300, gain: 0.09 * g, a: d * 0.5 });
|
|
377
|
+
};
|
|
378
|
+
const hoop = (t, g = 1, p = 0) => { // knock on the taut cloth / wooden hoop
|
|
379
|
+
k.tone(t, { f: [[0, 150], [0.12, 80]], dur: 0.2, gain: 0.35 * g, pan: p });
|
|
380
|
+
k.noise(t, { dur: 0.05, filter: 'bandpass', f: 600, q: 2, gain: 0.25 * g, pan: p });
|
|
381
|
+
};
|
|
382
|
+
|
|
383
|
+
k.bed('room', 0, 15, { gain: 0.4 });
|
|
384
|
+
k.music('pad', 0.2, 14.8, { bpm: 60, gain: 0.22, chords: [['F3', 'A3', 'C4', 'E4'], ['D3', 'F3', 'A3', 'C4'], ['Bb2', 'D3', 'F3', 'A3'], ['C3', 'E3', 'G3', 'Bb3']] });
|
|
385
|
+
k.play('tock', 1.62, { f: 260, gain: 0.32 }); // floss pulled snug: the title is finished
|
|
386
|
+
|
|
387
|
+
// BEAT 2
|
|
388
|
+
drag(1.85, 0.5, 1);
|
|
389
|
+
{ // counter re-stitched on its 6 fps grid (n = 1e6 * ((floor(t*6)/6 - 2.8)/2.4)^2), 1,000,000 at 32/6 s
|
|
390
|
+
for (let f = 17; f < 32; f++) pass(f / 6 + 0.002, 0.5, pan(125, f / 6), 1.25, true);
|
|
391
|
+
hoop(32 / 6, 0.6, pan(125, 32 / 6));
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
// BEAT 3
|
|
395
|
+
drag(5.6, 0.6, 0.7);
|
|
396
|
+
// wrong guess (7.85): red X stitched, red running-stitch ring, a hard yank and a knock on the hoop
|
|
397
|
+
k.noise(7.85, { dur: 0.16, filter: 'bandpass', f: [[0, 1800], [0.16, 900]], q: 0.8, gain: 0.3, a: 0.01, pan: 0.5 }); // floss yanked tight
|
|
398
|
+
hoop(7.86, 1.3, 0.45);
|
|
399
|
+
k.tone(7.88, { f: 'D3', type: 'triangle', dur: 0.16, gain: 0.2, filter: 'lowpass', f2: 700 });
|
|
400
|
+
k.tone(8.04, { f: 'A2', type: 'triangle', dur: 0.32, gain: 0.22, filter: 'lowpass', f2: 600 });
|
|
401
|
+
for (let i = 1; i < 6; i++) pass(7.9 + i * 0.075, 0.7, 0.5, 1.1); // X cells + ring dashes
|
|
402
|
+
for (let j = 1; j <= 6; j++) k.play('tock', 8.9 + j * 0.1, { f: 380, gain: 0.3, pan: pan(176, 9.2), minor: true }); // dial pointer jumps a cell
|
|
403
|
+
// correction: the green tick is stitched (9.85)
|
|
404
|
+
pass(9.85, 1.1, pan(224, 9.9), 1, false);
|
|
405
|
+
k.play('success', 9.86, { f: 'G5', gain: 0.6, pan: pan(224, 9.9) });
|
|
406
|
+
pass(9.95, 0.7, pan(224, 10));
|
|
407
|
+
|
|
408
|
+
// BEAT 4: bars stitched bottom-up while the % is re-stitched: one pass per shown change, at most 10/s
|
|
409
|
+
drag(10.1, 0.7, 1);
|
|
410
|
+
{
|
|
411
|
+
const accs = [61, 72, 80, 86, 90, 93, 95, 97];
|
|
412
|
+
let last = -1, lt = -1;
|
|
413
|
+
for (let t = 10.76; t < 12.7; t += 1 / 120) {
|
|
414
|
+
const i = Math.min(7, Math.floor((t - 10.75) / 0.24)), t0 = 10.75 + i * 0.24;
|
|
415
|
+
const v = Math.round(Math.floor(H.lerp(i ? accs[i - 1] : 61, accs[i], H.clamp((t - t0) / 0.24)) * 2) / 2);
|
|
416
|
+
if (v !== last && t - lt >= 0.1) { pass(t, 0.8, pan(256 + i * 6, t), 0.9 + (v - 61) * 0.006); last = v; lt = t; }
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
// 97% (12.7): turns red and gold rays are backstitched round it: the hoop thumps like a drum (biggest hit)
|
|
420
|
+
k.play('impact', 12.7, { gain: 1.2, pan: 0.35 });
|
|
421
|
+
hoop(12.7, 1.2, 0.35);
|
|
422
|
+
k.play('ding', 12.7, { f: 'E5', gain: 0.6, pan: 0.3 });
|
|
423
|
+
for (let i = 1; i < 4; i++) pass(12.7 + i * 0.09, 0.55, 0.35, 0.8);
|
|
424
|
+
|
|
425
|
+
// BEAT 5: takeaway stitched (passes above), the thread is snipped, and it resolves
|
|
426
|
+
k.noise(13.92, { dur: 0.025, filter: 'bandpass', f: 2300, q: 2, gain: 0.3, a: 0.001, pan: 0.3 });
|
|
427
|
+
k.noise(13.96, { dur: 0.035, filter: 'bandpass', f: 1800, q: 1.6, gain: 0.32, a: 0.001, pan: 0.3 });
|
|
428
|
+
['C4', 'G4', 'E5'].forEach((f, i) => k.play('ding', 14.0 + i * 0.09, { f, gain: 0.46 - i * 0.04, pan: (i - 1) * 0.25 }));
|
|
429
|
+
},
|
|
430
|
+
draw(ctx, W, H_, t) {
|
|
431
|
+
const S = 12, COLS = Math.ceil(W / S), ROWS = Math.ceil(H_ / S);
|
|
432
|
+
const r = H.rng(2024), nz = H.makeNoise(11);
|
|
433
|
+
const HC = [640, 372], HR = 548, HW = 30; // hoop
|
|
434
|
+
|
|
435
|
+
// ---------- aida cloth (per-pixel, LUT for one cell) ----------
|
|
436
|
+
const lut = new Float32Array(S * S);
|
|
437
|
+
for (let fy = 0; fy < S; fy++) for (let fx = 0; fx < S; fx++) {
|
|
438
|
+
const dx = Math.min(fx + 0.5, S - fx - 0.5), dy = Math.min(fy + 0.5, S - fy - 0.5);
|
|
439
|
+
const hole = Math.exp(-(dx * dx + dy * dy) / 1.9);
|
|
440
|
+
const groove = Math.exp((-dx * dx) / 0.9) * 0.5 + Math.exp((-dy * dy) / 0.9) * 0.5;
|
|
441
|
+
const sx = fx < S / 2 ? 0 : 1, sy = fy < S / 2 ? 0 : 1, horiz = (sx + sy) % 2 === 0;
|
|
442
|
+
const ph = horiz ? fy : fx, along = horiz ? fx : fy;
|
|
443
|
+
const stripe = Math.cos((ph * TAU) / 3) * 0.5 + Math.cos((along * TAU) / 6 + ph) * 0.15;
|
|
444
|
+
lut[fy * S + fx] = 1 - hole * 0.42 - groove * 0.13 + stripe * 0.06;
|
|
445
|
+
}
|
|
446
|
+
const img = ctx.createImageData(W, H_), d = img.data;
|
|
447
|
+
const cellN = new Float32Array(COLS * ROWS);
|
|
448
|
+
for (let i = 0; i < cellN.length; i++) cellN[i] = r.gauss() * 0.018;
|
|
449
|
+
const base = [238, 230, 211];
|
|
450
|
+
for (let y = 0; y < H_; y++) {
|
|
451
|
+
const fy = y % S, cy = (y / S) | 0;
|
|
452
|
+
for (let x = 0; x < W; x++) {
|
|
453
|
+
const fx = x % S, cx = (x / S) | 0;
|
|
454
|
+
const dist = Math.hypot(x - HC[0], y - HC[1]);
|
|
455
|
+
let v = lut[fy * S + fx] + cellN[cy * COLS + cx] + (r() - 0.5) * 0.05;
|
|
456
|
+
if (dist > HR) {
|
|
457
|
+
// loose fabric outside the hoop: puckered, shaded folds
|
|
458
|
+
const a = Math.atan2(y - HC[1], x - HC[0]);
|
|
459
|
+
const fold = Math.sin(a * 38 + nz.n2(x * 0.01, y * 0.01) * 4) * 0.5 + nz.n2(x * 0.006, y * 0.006) * 0.6;
|
|
460
|
+
v *= 0.78 + fold * 0.11 - Math.min(0.14, (dist - HR) * 0.0007);
|
|
461
|
+
}
|
|
462
|
+
const k = (y * W + x) * 4;
|
|
463
|
+
d[k] = base[0] * v; d[k + 1] = base[1] * v; d[k + 2] = base[2] * v; d[k + 3] = 255;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
ctx.putImageData(img, 0, 0);
|
|
467
|
+
// soft light falloff on the cloth
|
|
468
|
+
{
|
|
469
|
+
const g = ctx.createRadialGradient(470 + t * 30, 280, 50, 640, 372, 660);
|
|
470
|
+
g.addColorStop(0, 'rgba(255,250,235,0.18)'); g.addColorStop(1, 'rgba(60,40,20,0.12)');
|
|
471
|
+
ctx.fillStyle = g; ctx.fillRect(0, 0, W, H_);
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
// ---------- chart (pattern grid) ----------
|
|
475
|
+
const grid = new Map(); // key col,row -> colour key
|
|
476
|
+
const grpOf = new Map();
|
|
477
|
+
let GRP = 0;
|
|
478
|
+
const put = (c, rr, k) => { grid.set(c + ',' + rr, k); grpOf.set(c + ',' + rr, GRP); };
|
|
479
|
+
const PAL = {
|
|
480
|
+
R: '#c43a46', r: '#8f2335', N: '#2e3760', T: '#5fb3a9', t: '#3f8c86', l: '#9fd8cc', G: '#7fd36b', Y: '#f2c14e',
|
|
481
|
+
S: '#495b8f', W: '#dfe3e8', K: '#2a2433', P: '#e98aa0', O: '#ef8a3c', g: '#4f9a52',
|
|
482
|
+
};
|
|
483
|
+
// title
|
|
484
|
+
const title = 'HELLO, WORLD';
|
|
485
|
+
let tw = 0;
|
|
486
|
+
for (const ch of title) tw += FONT[ch][0].length + 1;
|
|
487
|
+
tw -= 1;
|
|
488
|
+
let cx = Math.round(COLS / 2 - tw / 2), ty = 8;
|
|
489
|
+
for (let i = 0; i < title.length; i++) {
|
|
490
|
+
const gl = FONT[title[i]], col = i < 6 ? 'R' : 'N';
|
|
491
|
+
gl.forEach((row, ry) => [...row].forEach((b, rx) => { if (b === '1') put(cx + rx, ty + ry, col); }));
|
|
492
|
+
cx += gl[0].length + 1;
|
|
493
|
+
}
|
|
494
|
+
// sampler border under title (alternating diamonds)
|
|
495
|
+
GRP = 1;
|
|
496
|
+
for (let c = 22; c <= COLS - 23; c++) {
|
|
497
|
+
const m = (c - 22) % 6;
|
|
498
|
+
if (m === 0 || m === 2) put(c, 18, 'Y'); else if (m === 1) { put(c, 17, 'g'); put(c, 19, 'g'); put(c, 18, 'R'); }
|
|
499
|
+
}
|
|
500
|
+
// computer
|
|
501
|
+
GRP = 2;
|
|
502
|
+
const C0 = Math.round(COLS / 2 - 13), R0 = 22;
|
|
503
|
+
const comp = new Set();
|
|
504
|
+
const cput = (c, rr, k) => { put(C0 + c, R0 + rr, k); comp.add(C0 + c + ',' + (R0 + rr)); };
|
|
505
|
+
for (let rr = 0; rr < 18; rr++) for (let c = 1; c < 25; c++) {
|
|
506
|
+
if ((rr === 0 || rr === 17) && (c === 1 || c === 24)) continue;
|
|
507
|
+
const shade = c >= 23 || rr >= 16 ? 't' : rr === 0 || c === 1 ? 'l' : 'T';
|
|
508
|
+
cput(c, rr, shade);
|
|
509
|
+
}
|
|
510
|
+
for (let rr = 2; rr < 13; rr++) for (let c = 4; c < 21; c++) cput(c, rr, 'N');
|
|
511
|
+
cput(5, 3, 'S'); cput(6, 3, 'S'); cput(5, 4, 'S');
|
|
512
|
+
// friendly face on screen
|
|
513
|
+
[[9, 5], [9, 6], [16, 5], [16, 6]].forEach(([c, rr]) => cput(c, rr, 'G'));
|
|
514
|
+
[[8, 9], [9, 10], [10, 10], [11, 10], [12, 10], [13, 10], [14, 10], [15, 10], [16, 10], [17, 9]].forEach(([c, rr]) => cput(c, rr, 'G'));
|
|
515
|
+
[[7, 8], [18, 8]].forEach(([c, rr]) => cput(c, rr, 'P'));
|
|
516
|
+
cput(5, 15, 'R');
|
|
517
|
+
for (let c = 14; c < 21; c++) cput(c, 15, 'K');
|
|
518
|
+
for (let rr = 18; rr < 20; rr++) for (let c = 10; c < 16; c++) cput(c, rr, rr === 18 ? 't' : 'T');
|
|
519
|
+
for (let rr = 20; rr < 25; rr++) for (let c = -1; c < 27; c++) {
|
|
520
|
+
if ((rr === 20 || rr === 24) && (c === -1 || c === 26)) continue;
|
|
521
|
+
let k = rr === 24 || c === 26 ? 't' : 'T';
|
|
522
|
+
if ((rr === 21 || rr === 23) && c > 0 && c < 25 && c % 2 === 1) k = 'W';
|
|
523
|
+
if (rr === 22 && c > 3 && c < 22) k = c % 2 ? 'W' : 'T';
|
|
524
|
+
cput(c, rr, k);
|
|
525
|
+
}
|
|
526
|
+
// hearts + flowers flanking
|
|
527
|
+
GRP = 3;
|
|
528
|
+
const motif = (pat, c0, r0, map) => pat.forEach((row, ry) => [...row].forEach((b, rx) => { if (b !== '0') put(c0 + rx, r0 + ry, map[b]); }));
|
|
529
|
+
motif(HEART, C0 - 13, R0 + 5, { 1: 'R' });
|
|
530
|
+
motif(HEART, C0 + 32, R0 + 5, { 1: 'R' });
|
|
531
|
+
motif(FLOWER, C0 - 12, R0 + 15, { 1: 'P', 2: 'Y' });
|
|
532
|
+
motif(FLOWER, C0 + 33, R0 + 15, { 1: 'O', 2: 'Y' });
|
|
533
|
+
[[C0 - 10, R0 + 20], [C0 - 10, R0 + 21], [C0 + 35, R0 + 20], [C0 + 35, R0 + 21]].forEach(([c, rr]) => put(c, rr, 'g'));
|
|
534
|
+
put(C0 - 11, R0 + 21, 'g'); put(C0 + 36, R0 + 21, 'g');
|
|
535
|
+
// bottom border (work in progress: last stretch unstitched)
|
|
536
|
+
GRP = 4;
|
|
537
|
+
const bRow = 51, bStart = 26, bEnd = COLS - 27;
|
|
538
|
+
const done = t < 3.9 ? bStart - 1 : Math.floor(H.lerp(bStart, bEnd, 0.86 * H.clamp((t - 3.9) / 2.1)));
|
|
539
|
+
for (let c = bStart; c <= Math.min(done, bEnd); c++) {
|
|
540
|
+
const m = (c - bStart) % 6;
|
|
541
|
+
if (m === 0 || m === 2) put(c, bRow, 'Y'); else if (m === 1) { put(c, bRow - 1, 'g'); put(c, bRow + 1, 'g'); put(c, bRow, 'R'); }
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
// ---------- stitch sprites: 2-strand floss X with sheen & twist ----------
|
|
545
|
+
const PADS = 4, SP = S + PADS * 2;
|
|
546
|
+
const sprites = {};
|
|
547
|
+
const legPaint = (c, x0, y0, x1, y1, rgb, rr) => {
|
|
548
|
+
const len = Math.hypot(x1 - x0, y1 - y0), ux = (x1 - x0) / len, uy = (y1 - y0) / len, nx = -uy, ny = ux;
|
|
549
|
+
// shadow
|
|
550
|
+
c.lineCap = 'round';
|
|
551
|
+
c.strokeStyle = 'rgba(40,25,10,0.32)'; c.lineWidth = 5.8;
|
|
552
|
+
c.beginPath(); c.moveTo(x0 + 0.7, y0 + 1.1); c.lineTo(x1 + 0.7, y1 + 1.1); c.stroke();
|
|
553
|
+
// two strands
|
|
554
|
+
for (let s = -1; s <= 1; s += 2) {
|
|
555
|
+
const ox = nx * s * 1.25, oy = ny * s * 1.25;
|
|
556
|
+
const g = c.createLinearGradient(x0, y0, x1, y1);
|
|
557
|
+
const dk = rgb.map((v) => v * 0.55), md = rgb.map((v) => Math.min(255, v * 1.08)), hi = rgb.map((v) => Math.min(255, v * 1.22 + 18));
|
|
558
|
+
g.addColorStop(0, H.rgba(dk)); g.addColorStop(0.22, H.rgba(md)); g.addColorStop(0.5, H.rgba(s < 0 ? hi : md)); g.addColorStop(0.78, H.rgba(md)); g.addColorStop(1, H.rgba(dk));
|
|
559
|
+
c.strokeStyle = g; c.lineWidth = 2.9;
|
|
560
|
+
c.beginPath(); c.moveTo(x0 + ox, y0 + oy); c.lineTo(x1 + ox, y1 + oy); c.stroke();
|
|
561
|
+
// twist ridges
|
|
562
|
+
c.lineWidth = 0.7;
|
|
563
|
+
for (let k = 2.2 + rr() * 1.5; k < len - 1.5; k += 2.3) {
|
|
564
|
+
const px = x0 + ox + ux * k, py = y0 + oy + uy * k;
|
|
565
|
+
c.strokeStyle = `rgba(255,255,255,${0.12 + rr() * 0.14})`;
|
|
566
|
+
c.beginPath(); c.moveTo(px - nx * 1.3 - ux * 0.8, py - ny * 1.3 - uy * 0.8); c.lineTo(px + nx * 1.3 + ux * 0.8, py + ny * 1.3 + uy * 0.8); c.stroke();
|
|
567
|
+
c.strokeStyle = 'rgba(0,0,0,0.12)';
|
|
568
|
+
c.beginPath(); c.moveTo(px - nx * 1.0 - ux * 0.2, py - ny * 1.0 - uy * 0.2); c.lineTo(px + nx * 1.0 + ux * 1.2, py + ny * 1.0 + uy * 1.2); c.stroke();
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
};
|
|
572
|
+
const sprite = (key, v, half) => {
|
|
573
|
+
const id = key + v + (half ? 'h' : '');
|
|
574
|
+
if (sprites[id]) return sprites[id];
|
|
575
|
+
const cv = H.layer(SP, SP), c = cv.getContext('2d'), rr = H.rng(id.charCodeAt(0) * 31 + v * 7);
|
|
576
|
+
const rgb = H.hex(PAL[key]).map((x) => x * (0.96 + rr() * 0.08));
|
|
577
|
+
const a = 1.0, b = S - 1.0;
|
|
578
|
+
legPaint(c, PADS + a, PADS + b, PADS + b, PADS + a, rgb.map((x) => x * 0.9), rr); // under leg: / (darker)
|
|
579
|
+
if (!half) legPaint(c, PADS + a, PADS + a, PADS + b, PADS + b, rgb, rr); // top leg: \ (all the same way)
|
|
580
|
+
sprites[id] = cv;
|
|
581
|
+
return cv;
|
|
582
|
+
};
|
|
583
|
+
// order by appearance (stitched in chart order: rows top->bottom)
|
|
584
|
+
const keys = [...grid.keys()].map((k) => k.split(',').map(Number)).sort((a, b) => a[1] - b[1] || a[0] - b[0]);
|
|
585
|
+
// stitching schedule: Danish method - each row gets a pass of half-stitches (/) then crosses back (\)
|
|
586
|
+
const WIN = [[0.15, 1.5], [1.4, 1.85], [1.75, 3.55], [3.15, 3.95]];
|
|
587
|
+
const tim = new Map();
|
|
588
|
+
WIN.forEach(([w0, w1], g) => {
|
|
589
|
+
const cells = keys.filter(([c, rr]) => grpOf.get(c + ',' + rr) === g);
|
|
590
|
+
const rows = [...new Set(cells.map((k) => k[1]))].sort((a, b) => a - b), rd = (w1 - w0) / rows.length;
|
|
591
|
+
rows.forEach((row, ri) => {
|
|
592
|
+
const rc = cells.filter((k) => k[1] === row).sort((a, b) => a[0] - b[0]), n = rc.length;
|
|
593
|
+
rc.forEach(([c], k) => {
|
|
594
|
+
const r0 = w0 + ri * rd;
|
|
595
|
+
tim.set(c + ',' + row, [r0 + (k / n) * rd * 0.5, r0 + rd * 0.5 + ((n - 1 - k) / n) * rd * 0.5]);
|
|
596
|
+
});
|
|
597
|
+
});
|
|
598
|
+
});
|
|
599
|
+
const rs = H.rng(77);
|
|
600
|
+
let latest = null, latestT = -1;
|
|
601
|
+
keys.forEach(([c, rr]) => {
|
|
602
|
+
const key = grid.get(c + ',' + rr);
|
|
603
|
+
const x = c * S, y = rr * S;
|
|
604
|
+
if (Math.hypot(x + S / 2 - HC[0], y + S / 2 - HC[1]) > HR - 6) return;
|
|
605
|
+
const v = rs.int(0, 4), jx = rs.gauss() * 0.25, jy = rs.gauss() * 0.25;
|
|
606
|
+
const tm = tim.get(c + ',' + rr) || [0, 0];
|
|
607
|
+
if (t < tm[0]) return;
|
|
608
|
+
const full = t >= tm[1];
|
|
609
|
+
ctx.drawImage(sprite(key, v, !full), x - PADS + jx, y - PADS + jy);
|
|
610
|
+
const lt = full ? tm[1] : tm[0];
|
|
611
|
+
if (tim.has(c + ',' + rr) && lt >= latestT) { latestT = lt; latest = [c, rr, key, full]; }
|
|
612
|
+
});
|
|
613
|
+
|
|
614
|
+
// ---------- backstitch outline around the computer ----------
|
|
615
|
+
const rb = H.rng(88);
|
|
616
|
+
let bsVis = true;
|
|
617
|
+
const bs = (x0, y0, x1, y1, col) => {
|
|
618
|
+
const rr = rb;
|
|
619
|
+
const j0 = rr.gauss() * 0.3, j1 = rr.gauss() * 0.3, j2 = rr.gauss() * 0.3, j3 = rr.gauss() * 0.3;
|
|
620
|
+
if (!bsVis) return;
|
|
621
|
+
ctx.lineCap = 'round';
|
|
622
|
+
ctx.strokeStyle = 'rgba(20,10,5,0.35)'; ctx.lineWidth = 3;
|
|
623
|
+
ctx.beginPath(); ctx.moveTo(x0 + 0.6, y0 + 1); ctx.lineTo(x1 + 0.6, y1 + 1); ctx.stroke();
|
|
624
|
+
const g = ctx.createLinearGradient(x0, y0, x1, y1);
|
|
625
|
+
g.addColorStop(0, '#1b1622'); g.addColorStop(0.5, col); g.addColorStop(1, '#1b1622');
|
|
626
|
+
ctx.strokeStyle = g; ctx.lineWidth = 2.1;
|
|
627
|
+
ctx.beginPath(); ctx.moveTo(x0 + j0, y0 + j1); ctx.lineTo(x1 + j2, y1 + j3); ctx.stroke();
|
|
628
|
+
ctx.strokeStyle = 'rgba(255,255,255,0.18)'; ctx.lineWidth = 0.6;
|
|
629
|
+
ctx.beginPath(); ctx.moveTo(x0 * 0.8 + x1 * 0.2 - 0.5, y0 * 0.8 + y1 * 0.2 - 0.5); ctx.lineTo(x0 * 0.4 + x1 * 0.6 - 0.5, y0 * 0.4 + y1 * 0.6 - 0.5); ctx.stroke();
|
|
630
|
+
};
|
|
631
|
+
// backstitch travels around the outline after the cross stitches are done
|
|
632
|
+
const ccx = (C0 + 12.5) * S, ccy = (R0 + 12) * S;
|
|
633
|
+
const bsProg = (x, y, w0, w1) => { const a = (Math.atan2(y - ccy, x - ccx) + Math.PI * 1.5) % TAU; return t >= w0 + (a / TAU) * (w1 - w0); };
|
|
634
|
+
comp.forEach((k) => {
|
|
635
|
+
const [c, rr] = k.split(',').map(Number), x = c * S, y = rr * S;
|
|
636
|
+
bsVis = bsProg(x, y, 3.45, 4.1);
|
|
637
|
+
if (!comp.has(c + ',' + (rr - 1))) bs(x, y, x + S, y, '#3d3548');
|
|
638
|
+
if (!comp.has(c + ',' + (rr + 1))) bs(x, y + S, x + S, y + S, '#3d3548');
|
|
639
|
+
if (!comp.has(c - 1 + ',' + rr)) bs(x, y, x, y + S, '#3d3548');
|
|
640
|
+
if (!comp.has(c + 1 + ',' + rr)) bs(x + S, y, x + S, y + S, '#3d3548');
|
|
641
|
+
});
|
|
642
|
+
// screen bezel backstitch
|
|
643
|
+
{
|
|
644
|
+
const x0 = (C0 + 4) * S, y0 = (R0 + 2) * S, x1 = (C0 + 21) * S, y1 = (R0 + 13) * S;
|
|
645
|
+
for (let x = x0; x < x1; x += S) { bsVis = bsProg(x, y0, 3.7, 4.2); bs(x, y0, x + S, y0, '#2a2433'); bsVis = bsProg(x, y1, 3.7, 4.2); bs(x, y1, x + S, y1, '#2a2433'); }
|
|
646
|
+
for (let y = y0; y < y1; y += S) { bsVis = bsProg(x0, y, 3.7, 4.2); bs(x0, y, x0, y + S, '#2a2433'); bsVis = bsProg(x1, y, 3.7, 4.2); bs(x1, y, x1, y + S, '#2a2433'); }
|
|
647
|
+
bsVis = true;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
// ---------- needle parked in the cloth, floss trailing to the last stitch ----------
|
|
651
|
+
{
|
|
652
|
+
let lx, ly, fcol = '#c43a46';
|
|
653
|
+
if (done >= bStart) { lx = (Math.min(done, bEnd) + 1) * S; ly = bRow * S + S; }
|
|
654
|
+
else if (latest) { lx = (latest[0] + 1) * S; ly = (latest[1] + (latest[3] ? 1 : 0)) * S; fcol = PAL[latest[2]]; }
|
|
655
|
+
else { lx = 380; ly = 90; }
|
|
656
|
+
const nx0 = lx + 70, ny0 = ly + 34, ang = -0.5;
|
|
657
|
+
// floss from last stitch hole to the needle eye (loose, curvy)
|
|
658
|
+
ctx.lineCap = 'round';
|
|
659
|
+
const flossPath = () => { ctx.beginPath(); ctx.moveTo(lx, ly); ctx.bezierCurveTo(lx + 40, ly + 70, nx0 + 40, ny0 + 80, nx0 + Math.cos(ang) * 64, ny0 + Math.sin(ang) * 64); };
|
|
660
|
+
ctx.strokeStyle = 'rgba(30,15,5,0.25)'; ctx.lineWidth = 4; ctx.save(); ctx.translate(1.5, 3); flossPath(); ctx.stroke(); ctx.restore();
|
|
661
|
+
ctx.strokeStyle = fcol; ctx.lineWidth = 2.6; flossPath(); ctx.stroke();
|
|
662
|
+
ctx.strokeStyle = 'rgba(255,220,220,0.35)'; ctx.lineWidth = 0.8; ctx.setLineDash([1.2, 2.2]); flossPath(); ctx.stroke(); ctx.setLineDash([]);
|
|
663
|
+
// needle: tip dives into cloth at nx0,ny0
|
|
664
|
+
ctx.save(); ctx.translate(nx0, ny0); ctx.rotate(ang);
|
|
665
|
+
ctx.fillStyle = 'rgba(30,20,10,0.3)'; ctx.beginPath(); ctx.ellipse(36, 6, 40, 3.2, 0, 0, TAU); ctx.fill();
|
|
666
|
+
const ng = ctx.createLinearGradient(0, -3, 0, 3);
|
|
667
|
+
ng.addColorStop(0, '#f4f6f8'); ng.addColorStop(0.35, '#b9c0c8'); ng.addColorStop(0.7, '#6f7780'); ng.addColorStop(1, '#a9b1ba');
|
|
668
|
+
ctx.fillStyle = ng;
|
|
669
|
+
ctx.beginPath(); ctx.moveTo(0, 0); ctx.lineTo(10, -2.4); ctx.lineTo(70, -2.6); ctx.quadraticCurveTo(76, 0, 70, 2.6); ctx.lineTo(10, 2.4); ctx.closePath(); ctx.fill();
|
|
670
|
+
ctx.fillStyle = '#e9e1cf'; ctx.beginPath(); ctx.ellipse(64, 0, 4.2, 1.1, 0, 0, TAU); ctx.fill();
|
|
671
|
+
ctx.restore();
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
// ---------- wooden hoop ----------
|
|
675
|
+
{
|
|
676
|
+
// inner shadow on taut cloth
|
|
677
|
+
ctx.save();
|
|
678
|
+
ctx.beginPath(); ctx.arc(HC[0], HC[1], HR + 200, 0, TAU); ctx.arc(HC[0], HC[1], HR, 0, TAU, true); ctx.clip('evenodd');
|
|
679
|
+
ctx.restore();
|
|
680
|
+
ctx.save();
|
|
681
|
+
ctx.beginPath(); ctx.arc(HC[0], HC[1], HR, 0, TAU); ctx.clip();
|
|
682
|
+
ctx.shadowColor = 'rgba(40,25,10,0.5)'; ctx.shadowBlur = 22; ctx.shadowOffsetX = 6; ctx.shadowOffsetY = 10;
|
|
683
|
+
ctx.lineWidth = 40; ctx.strokeStyle = 'rgba(0,0,0,1)';
|
|
684
|
+
ctx.beginPath(); ctx.arc(HC[0], HC[1], HR + 20, 0, TAU); ctx.stroke();
|
|
685
|
+
ctx.restore();
|
|
686
|
+
// outer cast shadow on loose fabric
|
|
687
|
+
ctx.save(); ctx.shadowColor = 'rgba(40,25,10,0.45)'; ctx.shadowBlur = 18; ctx.shadowOffsetX = 5; ctx.shadowOffsetY = 9;
|
|
688
|
+
ctx.lineWidth = HW; ctx.strokeStyle = '#c99d66'; ctx.beginPath(); ctx.arc(HC[0], HC[1], HR + HW / 2, 0, TAU); ctx.stroke(); ctx.restore();
|
|
689
|
+
// wood body with round profile shading
|
|
690
|
+
const ring = (r0, r1, cols) => {
|
|
691
|
+
const g = ctx.createRadialGradient(HC[0], HC[1], r0, HC[0], HC[1], r1);
|
|
692
|
+
cols.forEach(([p, c]) => g.addColorStop(p, c));
|
|
693
|
+
ctx.fillStyle = g; ctx.beginPath(); ctx.arc(HC[0], HC[1], r1, 0, TAU); ctx.arc(HC[0], HC[1], r0, 0, TAU, true); ctx.fill('evenodd');
|
|
694
|
+
};
|
|
695
|
+
ring(HR, HR + HW, [[0, '#a8794a'], [0.15, '#d9b07a'], [0.45, '#ecc994'], [0.8, '#d2a46c'], [1, '#9b6b3e']]);
|
|
696
|
+
// grain
|
|
697
|
+
const gr = H.rng(303);
|
|
698
|
+
ctx.save(); ctx.beginPath(); ctx.arc(HC[0], HC[1], HR + HW, 0, TAU); ctx.arc(HC[0], HC[1], HR, 0, TAU, true); ctx.clip('evenodd');
|
|
699
|
+
for (let i = 0; i < 70; i++) {
|
|
700
|
+
const rr = HR + 2 + gr() * (HW - 4), a0 = gr() * TAU, al = gr.range(0.2, 1.4);
|
|
701
|
+
ctx.strokeStyle = gr() < 0.7 ? `rgba(120,70,30,${gr.range(0.12, 0.3)})` : `rgba(255,235,200,${gr.range(0.15, 0.3)})`;
|
|
702
|
+
ctx.lineWidth = gr.range(0.5, 1.6);
|
|
703
|
+
ctx.beginPath();
|
|
704
|
+
for (let k = 0; k <= 30; k++) { const a = a0 + (al * k) / 30, w = Math.sin(a * 9 + i) * 1.2; const px = HC[0] + Math.cos(a) * (rr + w), py = HC[1] + Math.sin(a) * (rr + w); k ? ctx.lineTo(px, py) : ctx.moveTo(px, py); }
|
|
705
|
+
ctx.stroke();
|
|
706
|
+
}
|
|
707
|
+
ctx.restore();
|
|
708
|
+
// lit top edge + inner ring sliver
|
|
709
|
+
ctx.strokeStyle = 'rgba(255,240,210,0.6)'; ctx.lineWidth = 1.2; ctx.beginPath(); ctx.arc(HC[0], HC[1], HR + HW - 1, Math.PI * 0.95, Math.PI * 1.75); ctx.stroke();
|
|
710
|
+
ctx.strokeStyle = 'rgba(90,55,25,0.7)'; ctx.lineWidth = 1.5; ctx.beginPath(); ctx.arc(HC[0], HC[1], HR + 0.5, 0, TAU); ctx.stroke();
|
|
711
|
+
ctx.strokeStyle = 'rgba(90,55,25,0.5)'; ctx.lineWidth = 1; ctx.beginPath(); ctx.arc(HC[0], HC[1], HR + HW * 0.42, 0, TAU); ctx.stroke();
|
|
712
|
+
}
|
|
713
|
+
H.vignette(ctx, W, H_, 0.35, '50,30,10');
|
|
714
|
+
H.grain(ctx, W, H_, 0.02, 5 + Math.floor(t * 12));
|
|
715
|
+
},
|
|
716
|
+
});
|
|
717
|
+
}
|