popost 4.6.1 → 4.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +59 -3
- package/README.md +20 -7
- package/SKILL.md +48 -131
- package/THIRD_PARTY_NOTICES +524 -0
- package/agents/openai.yaml +2 -2
- package/assets/video/examples/audio-bars.html +125 -0
- package/assets/video/examples/bouncing-ball.html +182 -0
- package/assets/video/examples/card-flip.html +92 -0
- package/assets/video/examples/catalogue.json +16335 -0
- package/assets/video/examples/counter-stat.html +155 -0
- package/assets/video/examples/folding-doors.html +94 -0
- package/assets/video/examples/glitch-title.html +120 -0
- package/assets/video/examples/goo-blobs.html +127 -0
- package/assets/video/examples/grid-reveal.html +151 -0
- package/assets/video/examples/hf/agent-cursor.html +781 -0
- package/assets/video/examples/hf/ai-answer-rank.html +767 -0
- package/assets/video/examples/hf/ai-chat-reveal.html +1260 -0
- package/assets/video/examples/hf/animated-bar-chart.html +312 -0
- package/assets/video/examples/hf/app-showcase.html +1115 -0
- package/assets/video/examples/hf/apple-money-count.html +453 -0
- package/assets/video/examples/hf/arc-motion-path.html +303 -0
- package/assets/video/examples/hf/ascii-render-pass.html +728 -0
- package/assets/video/examples/hf/ascii-trail-reveal.html +595 -0
- package/assets/video/examples/hf/aurora-drift.html +439 -0
- package/assets/video/examples/hf/aurora.html +258 -0
- package/assets/video/examples/hf/avatar-cloud.html +667 -0
- package/assets/video/examples/hf/avatar-group-hover.html +342 -0
- package/assets/video/examples/hf/badge-pop.html +400 -0
- package/assets/video/examples/hf/bar-chart-race.html +795 -0
- package/assets/video/examples/hf/beat-accent.html +507 -0
- package/assets/video/examples/hf/beat-freeze-cut.html +1050 -0
- package/assets/video/examples/hf/beat-pulse-background.html +422 -0
- package/assets/video/examples/hf/beat-timeline.html +488 -0
- package/assets/video/examples/hf/before-after-wipe.html +681 -0
- package/assets/video/examples/hf/blob.html +258 -0
- package/assets/video/examples/hf/blue-sweater-intro-video.html +1656 -0
- package/assets/video/examples/hf/blur-in.html +624 -0
- package/assets/video/examples/hf/blur-out-up.html +350 -0
- package/assets/video/examples/hf/bottom-up-letters.html +335 -0
- package/assets/video/examples/hf/browser-device-stage.html +847 -0
- package/assets/video/examples/hf/camcorder-hud.html +371 -0
- package/assets/video/examples/hf/camera-dolly-zoom.html +485 -0
- package/assets/video/examples/hf/camera-rig-depth-stack.html +246 -0
- package/assets/video/examples/hf/camera-scan-gate.html +708 -0
- package/assets/video/examples/hf/camera-shake.html +989 -0
- package/assets/video/examples/hf/canopy-part-title.html +2549 -0
- package/assets/video/examples/hf/caption-blend-difference.html +247 -0
- package/assets/video/examples/hf/caption-camera-follow.html +537 -0
- package/assets/video/examples/hf/caption-clip-wipe.html +363 -0
- package/assets/video/examples/hf/caption-editorial-emphasis.html +615 -0
- package/assets/video/examples/hf/caption-emoji-pop.html +623 -0
- package/assets/video/examples/hf/caption-glitch-rgb.html +475 -0
- package/assets/video/examples/hf/caption-gradient-fill.html +392 -0
- package/assets/video/examples/hf/caption-highlight.html +433 -0
- package/assets/video/examples/hf/caption-kinetic-slam.html +334 -0
- package/assets/video/examples/hf/caption-matrix-decode.html +399 -0
- package/assets/video/examples/hf/caption-neon-accent.html +684 -0
- package/assets/video/examples/hf/caption-neon-glow.html +373 -0
- package/assets/video/examples/hf/caption-parallax-layers.html +530 -0
- package/assets/video/examples/hf/caption-particle-burst.html +454 -0
- package/assets/video/examples/hf/caption-pill-karaoke.html +517 -0
- package/assets/video/examples/hf/caption-texture.html +368 -0
- package/assets/video/examples/hf/caption-weight-shift.html +566 -0
- package/assets/video/examples/hf/card-resize.html +435 -0
- package/assets/video/examples/hf/caret-swap.html +601 -0
- package/assets/video/examples/hf/carousel-circle-1.html +1175 -0
- package/assets/video/examples/hf/carousel-circle-2.html +1175 -0
- package/assets/video/examples/hf/carousel-circle-3.html +1175 -0
- package/assets/video/examples/hf/carousel-circle-4.html +1175 -0
- package/assets/video/examples/hf/carousel-circle-5.html +1175 -0
- package/assets/video/examples/hf/carousel-orbit-1.html +1198 -0
- package/assets/video/examples/hf/carousel-orbit-2.html +1198 -0
- package/assets/video/examples/hf/carousel-orbit-3.html +1198 -0
- package/assets/video/examples/hf/carousel-orbit-4.html +1214 -0
- package/assets/video/examples/hf/carousel-orbit-5.html +1198 -0
- package/assets/video/examples/hf/carousel-path-1.html +1219 -0
- package/assets/video/examples/hf/carousel-path-2.html +1176 -0
- package/assets/video/examples/hf/carousel-path-3.html +1190 -0
- package/assets/video/examples/hf/carousel-path-4.html +1219 -0
- package/assets/video/examples/hf/carousel-path-5.html +1218 -0
- package/assets/video/examples/hf/carousel-vision-1.html +1180 -0
- package/assets/video/examples/hf/carousel-vision-2.html +1180 -0
- package/assets/video/examples/hf/carousel-vision-3.html +1180 -0
- package/assets/video/examples/hf/carousel-vision-4.html +1187 -0
- package/assets/video/examples/hf/carousel-vision-5.html +1180 -0
- package/assets/video/examples/hf/char-slam-explode.html +546 -0
- package/assets/video/examples/hf/chart-story.html +973 -0
- package/assets/video/examples/hf/chat-message.html +635 -0
- package/assets/video/examples/hf/chat-thread.html +953 -0
- package/assets/video/examples/hf/chatgpt-exchange.html +1620 -0
- package/assets/video/examples/hf/chromatic-radial-split.html +613 -0
- package/assets/video/examples/hf/chrome-orb.html +258 -0
- package/assets/video/examples/hf/cinemagraph.html +422 -0
- package/assets/video/examples/hf/cinematic-zoom.html +613 -0
- package/assets/video/examples/hf/claude-exchange.html +1845 -0
- package/assets/video/examples/hf/code-3d-extrude.html +755 -0
- package/assets/video/examples/hf/code-diff.html +956 -0
- package/assets/video/examples/hf/code-highlight.html +885 -0
- package/assets/video/examples/hf/code-morph.html +1357 -0
- package/assets/video/examples/hf/code-particle-assemble.html +622 -0
- package/assets/video/examples/hf/code-scroll.html +1700 -0
- package/assets/video/examples/hf/code-shader-dissolve.html +677 -0
- package/assets/video/examples/hf/code-slice-hero.html +1276 -0
- package/assets/video/examples/hf/code-snippet-apple-terminal-pro.html +388 -0
- package/assets/video/examples/hf/code-snippet-dark-2026.html +1231 -0
- package/assets/video/examples/hf/code-snippet-dark-modern.html +1227 -0
- package/assets/video/examples/hf/code-terminal-run.html +766 -0
- package/assets/video/examples/hf/code-typing.html +903 -0
- package/assets/video/examples/hf/color-wheel.html +258 -0
- package/assets/video/examples/hf/colorama-wipe.html +503 -0
- package/assets/video/examples/hf/comparison-split.html +657 -0
- package/assets/video/examples/hf/confetti.html +349 -0
- package/assets/video/examples/hf/conic-progress-ring.html +441 -0
- package/assets/video/examples/hf/constellation-hub.html +662 -0
- package/assets/video/examples/hf/cosmic-orb.html +643 -0
- package/assets/video/examples/hf/count-up.html +552 -0
- package/assets/video/examples/hf/cross-warp-morph.html +624 -0
- package/assets/video/examples/hf/cta-close.html +492 -0
- package/assets/video/examples/hf/cta-lockup.html +470 -0
- package/assets/video/examples/hf/cuboid-carousel.html +2385 -0
- package/assets/video/examples/hf/cursor-annotate.html +827 -0
- package/assets/video/examples/hf/cursor-context-menu.html +757 -0
- package/assets/video/examples/hf/cursor-drag-drop.html +656 -0
- package/assets/video/examples/hf/cursor-glyph-trail.html +904 -0
- package/assets/video/examples/hf/cursor-marquee-select.html +1266 -0
- package/assets/video/examples/hf/cursor-text-select.html +638 -0
- package/assets/video/examples/hf/cursor-zoom-follow.html +973 -0
- package/assets/video/examples/hf/curtain-reveal.html +590 -0
- package/assets/video/examples/hf/cut-the-curve.html +715 -0
- package/assets/video/examples/hf/dart-cursor.html +863 -0
- package/assets/video/examples/hf/data-chart.html +666 -0
- package/assets/video/examples/hf/decision-tree.html +655 -0
- package/assets/video/examples/hf/decline-chart.html +485 -0
- package/assets/video/examples/hf/device-frame-stage.html +661 -0
- package/assets/video/examples/hf/domain-warp-dissolve.html +627 -0
- package/assets/video/examples/hf/drift-hold.html +392 -0
- package/assets/video/examples/hf/dynamic-grid.html +336 -0
- package/assets/video/examples/hf/echo-smear.html +994 -0
- package/assets/video/examples/hf/echo-trail.html +557 -0
- package/assets/video/examples/hf/editorial-flash-overlay.html +337 -0
- package/assets/video/examples/hf/exploded-stack.html +761 -0
- package/assets/video/examples/hf/extended-keyframe.html +715 -0
- package/assets/video/examples/hf/extruded-logo.html +757 -0
- package/assets/video/examples/hf/facet-morph.html +746 -0
- package/assets/video/examples/hf/fade-through.html +443 -0
- package/assets/video/examples/hf/falling-lines.html +259 -0
- package/assets/video/examples/hf/filmed-screen.html +1065 -0
- package/assets/video/examples/hf/flash-through-white.html +613 -0
- package/assets/video/examples/hf/flowchart-vertical.html +631 -0
- package/assets/video/examples/hf/flowchart.html +630 -0
- package/assets/video/examples/hf/flowing-gradient.html +258 -0
- package/assets/video/examples/hf/focus-blur-resolve.html +321 -0
- package/assets/video/examples/hf/focus-rack.html +542 -0
- package/assets/video/examples/hf/focus-swap.html +496 -0
- package/assets/video/examples/hf/fractal-noise.html +258 -0
- package/assets/video/examples/hf/freeze-frame-dressing.html +357 -0
- package/assets/video/examples/hf/frost.html +258 -0
- package/assets/video/examples/hf/gabor-noise.html +258 -0
- package/assets/video/examples/hf/gallery-tunnel.html +652 -0
- package/assets/video/examples/hf/gesture-tap.html +604 -0
- package/assets/video/examples/hf/glass-hero.html +505 -0
- package/assets/video/examples/hf/glass-shard-title.html +1618 -0
- package/assets/video/examples/hf/glitch.html +613 -0
- package/assets/video/examples/hf/gloss-sweep.html +418 -0
- package/assets/video/examples/hf/godrays.html +257 -0
- package/assets/video/examples/hf/goo.html +258 -0
- package/assets/video/examples/hf/gooey-split.html +1092 -0
- package/assets/video/examples/hf/grain-field.html +377 -0
- package/assets/video/examples/hf/grain-overlay.html +295 -0
- package/assets/video/examples/hf/gravitational-lens.html +612 -0
- package/assets/video/examples/hf/grid-card-assemble.html +671 -0
- package/assets/video/examples/hf/grid-pixelate-wipe.html +314 -0
- package/assets/video/examples/hf/halftone-dissolve.html +696 -0
- package/assets/video/examples/hf/halftone-field.html +598 -0
- package/assets/video/examples/hf/headline-slam.html +455 -0
- package/assets/video/examples/hf/heatmap.html +258 -0
- package/assets/video/examples/hf/heygen-avatar-promo-card.html +627 -0
- package/assets/video/examples/hf/hologram.html +258 -0
- package/assets/video/examples/hf/holographic.html +258 -0
- package/assets/video/examples/hf/hw-arrow.html +835 -0
- package/assets/video/examples/hf/hw-boil.html +632 -0
- package/assets/video/examples/hf/hw-box-label.html +741 -0
- package/assets/video/examples/hf/hw-callout-circle.html +820 -0
- package/assets/video/examples/hf/hw-frame.html +455 -0
- package/assets/video/examples/hf/hw-path-text.html +349 -0
- package/assets/video/examples/hf/hw-pipeline.html +472 -0
- package/assets/video/examples/hf/hw-scribble-transition.html +291 -0
- package/assets/video/examples/hf/hw-text-cloud.html +439 -0
- package/assets/video/examples/hf/hw-title.html +412 -0
- package/assets/video/examples/hf/hw-underline.html +403 -0
- package/assets/video/examples/hf/hw-write-title.html +1389 -0
- package/assets/video/examples/hf/icon-morph-beat.html +463 -0
- package/assets/video/examples/hf/icon-swap.html +380 -0
- package/assets/video/examples/hf/ink-bleed-reveal.html +659 -0
- package/assets/video/examples/hf/inline-highlight.html +322 -0
- package/assets/video/examples/hf/input-feedback.html +419 -0
- package/assets/video/examples/hf/instagram-follow.html +460 -0
- package/assets/video/examples/hf/ios26-liquid-glass.html +1597 -0
- package/assets/video/examples/hf/iris-reveal.html +684 -0
- package/assets/video/examples/hf/keyframe-scrub-stack.html +326 -0
- package/assets/video/examples/hf/kinetic-center-build.html +538 -0
- package/assets/video/examples/hf/kinetic-type-swap.html +610 -0
- package/assets/video/examples/hf/kinetic-type.html +862 -0
- package/assets/video/examples/hf/lens-flare.html +258 -0
- package/assets/video/examples/hf/light-edge.html +259 -0
- package/assets/video/examples/hf/light-leak.html +612 -0
- package/assets/video/examples/hf/light-sweep-pass.html +684 -0
- package/assets/video/examples/hf/line-by-line-slide.html +345 -0
- package/assets/video/examples/hf/line-swap.html +526 -0
- package/assets/video/examples/hf/liquid-glass-notification.html +1898 -0
- package/assets/video/examples/hf/liquid-glass-widgets.html +2175 -0
- package/assets/video/examples/hf/liquid-metal.html +259 -0
- package/assets/video/examples/hf/locked-nucleus-orbit.html +564 -0
- package/assets/video/examples/hf/logo-brand-close.html +598 -0
- package/assets/video/examples/hf/logo-outro.html +397 -0
- package/assets/video/examples/hf/logo-sting.html +378 -0
- package/assets/video/examples/hf/logo-wall.html +502 -0
- package/assets/video/examples/hf/lottie-character-walk.html +407 -0
- package/assets/video/examples/hf/lt-accent-underline.html +247 -0
- package/assets/video/examples/hf/lt-bold-block.html +249 -0
- package/assets/video/examples/hf/lt-clean-bar.html +251 -0
- package/assets/video/examples/hf/lt-color-block.html +241 -0
- package/assets/video/examples/hf/lt-dark-card.html +251 -0
- package/assets/video/examples/hf/lt-kicker-name.html +254 -0
- package/assets/video/examples/hf/lt-mask-reveal.html +260 -0
- package/assets/video/examples/hf/lt-neon-border.html +604 -0
- package/assets/video/examples/hf/lt-side-rule.html +254 -0
- package/assets/video/examples/hf/lt-soft-pill.html +259 -0
- package/assets/video/examples/hf/lt-stack-bars.html +249 -0
- package/assets/video/examples/hf/macos-notification.html +372 -0
- package/assets/video/examples/hf/macos-tahoe-liquid-glass.html +1701 -0
- package/assets/video/examples/hf/magnetic-cursor.html +684 -0
- package/assets/video/examples/hf/marble.html +257 -0
- package/assets/video/examples/hf/marker-checklist-card.html +727 -0
- package/assets/video/examples/hf/marker-highlight.html +589 -0
- package/assets/video/examples/hf/match-cut.html +505 -0
- package/assets/video/examples/hf/matrix-decode.html +363 -0
- package/assets/video/examples/hf/menu-morph.html +420 -0
- package/assets/video/examples/hf/mesh-gradient-bg.html +329 -0
- package/assets/video/examples/hf/mesh-gradient.html +257 -0
- package/assets/video/examples/hf/message-thread-reveal.html +1913 -0
- package/assets/video/examples/hf/micro-transitions.html +631 -0
- package/assets/video/examples/hf/mk-background.html +376 -0
- package/assets/video/examples/hf/mk-callout-highlight.html +322 -0
- package/assets/video/examples/hf/mk-clone-wall-transition.html +364 -0
- package/assets/video/examples/hf/mk-emphasis-type.html +235 -0
- package/assets/video/examples/hf/mk-line-graph.html +432 -0
- package/assets/video/examples/hf/mk-placeholder-grid.html +373 -0
- package/assets/video/examples/hf/mk-progress-stat.html +324 -0
- package/assets/video/examples/hf/mk-specs-list.html +362 -0
- package/assets/video/examples/hf/mk-usage-arc.html +297 -0
- package/assets/video/examples/hf/modal-morph.html +727 -0
- package/assets/video/examples/hf/morph-swap.html +590 -0
- package/assets/video/examples/hf/morph-text.html +409 -0
- package/assets/video/examples/hf/multi-device-splay.html +934 -0
- package/assets/video/examples/hf/multiplayer-cursors.html +642 -0
- package/assets/video/examples/hf/native-notification-pop.html +670 -0
- package/assets/video/examples/hf/nebula.html +258 -0
- package/assets/video/examples/hf/news-ticker.html +548 -0
- package/assets/video/examples/hf/north-korea-locked-down.html +447 -0
- package/assets/video/examples/hf/notes-reveal.html +2028 -0
- package/assets/video/examples/hf/notes-typing.html +631 -0
- package/assets/video/examples/hf/notification-cascade.html +740 -0
- package/assets/video/examples/hf/notification-pileup.html +667 -0
- package/assets/video/examples/hf/notification-stack.html +610 -0
- package/assets/video/examples/hf/number-pop-in.html +362 -0
- package/assets/video/examples/hf/number-wheel.html +378 -0
- package/assets/video/examples/hf/nyc-paris-flight.html +659 -0
- package/assets/video/examples/hf/nyt-graph.html +715 -0
- package/assets/video/examples/hf/obsidian.html +258 -0
- package/assets/video/examples/hf/offset-path-traveler.html +511 -0
- package/assets/video/examples/hf/onboarding-stepper-flow.html +292 -0
- package/assets/video/examples/hf/orbit-card.html +2457 -0
- package/assets/video/examples/hf/ordered-dither-pass.html +753 -0
- package/assets/video/examples/hf/organic-light-leak-overlay.html +336 -0
- package/assets/video/examples/hf/oscilloscope-trace.html +718 -0
- package/assets/video/examples/hf/outline-draw.html +394 -0
- package/assets/video/examples/hf/oversized-cursor.html +851 -0
- package/assets/video/examples/hf/overwhelm-surround.html +557 -0
- package/assets/video/examples/hf/page-slide.html +377 -0
- package/assets/video/examples/hf/pan-stations.html +555 -0
- package/assets/video/examples/hf/panel-reveal.html +370 -0
- package/assets/video/examples/hf/paper-collage-reveal.html +737 -0
- package/assets/video/examples/hf/parallax-device-dive.html +647 -0
- package/assets/video/examples/hf/parallax-unzoom.html +499 -0
- package/assets/video/examples/hf/parallax-zoom.html +515 -0
- package/assets/video/examples/hf/particle-image-reveal.html +595 -0
- package/assets/video/examples/hf/particle-text-dissolve.html +615 -0
- package/assets/video/examples/hf/path-traced-3d.html +508 -0
- package/assets/video/examples/hf/pendulum-swing.html +364 -0
- package/assets/video/examples/hf/per-word-crossfade.html +398 -0
- package/assets/video/examples/hf/per-word-rise.html +556 -0
- package/assets/video/examples/hf/perspective-marquee.html +366 -0
- package/assets/video/examples/hf/physical-exit.html +459 -0
- package/assets/video/examples/hf/plasma.html +258 -0
- package/assets/video/examples/hf/plastic.html +258 -0
- package/assets/video/examples/hf/play-mode.html +1035 -0
- package/assets/video/examples/hf/press-ripple.html +675 -0
- package/assets/video/examples/hf/prism.html +258 -0
- package/assets/video/examples/hf/product-promo.html +1311 -0
- package/assets/video/examples/hf/product-turntable.html +4569 -0
- package/assets/video/examples/hf/pull-back-reveal.html +546 -0
- package/assets/video/examples/hf/pull-to-refresh.html +861 -0
- package/assets/video/examples/hf/push-in.html +379 -0
- package/assets/video/examples/hf/rack-focus.html +779 -0
- package/assets/video/examples/hf/radial-surround.html +653 -0
- package/assets/video/examples/hf/reddit-post.html +515 -0
- package/assets/video/examples/hf/rgb-glitch-text.html +353 -0
- package/assets/video/examples/hf/ridged-burn.html +624 -0
- package/assets/video/examples/hf/ripple-waves.html +613 -0
- package/assets/video/examples/hf/ripples.html +259 -0
- package/assets/video/examples/hf/rubber-band-bumper.html +534 -0
- package/assets/video/examples/hf/scan-band.html +415 -0
- package/assets/video/examples/hf/scramble-reveal.html +510 -0
- package/assets/video/examples/hf/screen-flow-carousel.html +779 -0
- package/assets/video/examples/hf/scroll-camera-story.html +988 -0
- package/assets/video/examples/hf/scroll-feed.html +602 -0
- package/assets/video/examples/hf/sdf-iris.html +613 -0
- package/assets/video/examples/hf/segmentation-flood.html +748 -0
- package/assets/video/examples/hf/separator.html +620 -0
- package/assets/video/examples/hf/settings-toggle-flow.html +286 -0
- package/assets/video/examples/hf/share-sheet-carousel.html +591 -0
- package/assets/video/examples/hf/shared-axis-y.html +370 -0
- package/assets/video/examples/hf/shared-axis-z.html +514 -0
- package/assets/video/examples/hf/sheet-spring-up.html +681 -0
- package/assets/video/examples/hf/shimmer-sweep.html +301 -0
- package/assets/video/examples/hf/signup-flow.html +276 -0
- package/assets/video/examples/hf/sine-wave.html +258 -0
- package/assets/video/examples/hf/skeleton-reveal.html +373 -0
- package/assets/video/examples/hf/slack-notification-ad.html +901 -0
- package/assets/video/examples/hf/slit-scan-reveal.html +540 -0
- package/assets/video/examples/hf/slot-machine-roll.html +391 -0
- package/assets/video/examples/hf/snow.html +499 -0
- package/assets/video/examples/hf/social-proof-card.html +534 -0
- package/assets/video/examples/hf/soft-blur-in.html +322 -0
- package/assets/video/examples/hf/spain-map.html +583 -0
- package/assets/video/examples/hf/spiral-galaxy.html +507 -0
- package/assets/video/examples/hf/spiral.html +258 -0
- package/assets/video/examples/hf/split-flap-board.html +537 -0
- package/assets/video/examples/hf/split-tilt-cards.html +775 -0
- package/assets/video/examples/hf/spotify-card.html +470 -0
- package/assets/video/examples/hf/spotlight-card.html +328 -0
- package/assets/video/examples/hf/spring-pop.html +406 -0
- package/assets/video/examples/hf/spring-stack-shuffle.html +791 -0
- package/assets/video/examples/hf/stagger-cascade.html +465 -0
- package/assets/video/examples/hf/stagger-lattice.html +278 -0
- package/assets/video/examples/hf/staggered-fade-up.html +368 -0
- package/assets/video/examples/hf/star-rating-fill.html +511 -0
- package/assets/video/examples/hf/starfield.html +450 -0
- package/assets/video/examples/hf/state-chip-rail.html +585 -0
- package/assets/video/examples/hf/sticky-mock-swap.html +664 -0
- package/assets/video/examples/hf/stitched-text-draw.html +1053 -0
- package/assets/video/examples/hf/stop-motion-cadence.html +670 -0
- package/assets/video/examples/hf/store-badge-lockup.html +521 -0
- package/assets/video/examples/hf/strands.html +258 -0
- package/assets/video/examples/hf/streaming-text.html +581 -0
- package/assets/video/examples/hf/strikethrough-replace.html +356 -0
- package/assets/video/examples/hf/stripes.html +258 -0
- package/assets/video/examples/hf/success-check.html +390 -0
- package/assets/video/examples/hf/sun-burst.html +258 -0
- package/assets/video/examples/hf/svg-line-draw-loader.html +257 -0
- package/assets/video/examples/hf/svg-mask-reveal.html +523 -0
- package/assets/video/examples/hf/svg-stroke-trace.html +465 -0
- package/assets/video/examples/hf/swipe-rail.html +564 -0
- package/assets/video/examples/hf/swirl-vortex.html +623 -0
- package/assets/video/examples/hf/swirl.html +258 -0
- package/assets/video/examples/hf/swiss-grid.html +837 -0
- package/assets/video/examples/hf/tabs-slide-indicator.html +424 -0
- package/assets/video/examples/hf/telemetry-hud.html +760 -0
- package/assets/video/examples/hf/terminal-simulator.html +293 -0
- package/assets/video/examples/hf/testimonial-card.html +545 -0
- package/assets/video/examples/hf/testimonial-proof-card.html +720 -0
- package/assets/video/examples/hf/text-match-cut.html +1345 -0
- package/assets/video/examples/hf/text-shimmer.html +394 -0
- package/assets/video/examples/hf/text-stagger.html +373 -0
- package/assets/video/examples/hf/text-state-swap.html +421 -0
- package/assets/video/examples/hf/thermal-distortion.html +624 -0
- package/assets/video/examples/hf/thin-film.html +258 -0
- package/assets/video/examples/hf/thread-message-stack.html +377 -0
- package/assets/video/examples/hf/three-orbiting-cards.html +322 -0
- package/assets/video/examples/hf/ticker-takeover.html +534 -0
- package/assets/video/examples/hf/tiktok-follow.html +435 -0
- package/assets/video/examples/hf/tilt-card.html +406 -0
- package/assets/video/examples/hf/titlecard-calm.html +388 -0
- package/assets/video/examples/hf/titlecard-lockup.html +546 -0
- package/assets/video/examples/hf/toggle-flip.html +601 -0
- package/assets/video/examples/hf/top-down-letters.html +326 -0
- package/assets/video/examples/hf/torn-paper-rip.html +762 -0
- package/assets/video/examples/hf/touch-indicator.html +777 -0
- package/assets/video/examples/hf/tracing-beam.html +608 -0
- package/assets/video/examples/hf/tracking-in.html +317 -0
- package/assets/video/examples/hf/transitions-3d.html +434 -0
- package/assets/video/examples/hf/transitions-blur.html +524 -0
- package/assets/video/examples/hf/transitions-cover.html +508 -0
- package/assets/video/examples/hf/transitions-destruction.html +551 -0
- package/assets/video/examples/hf/transitions-dissolve.html +529 -0
- package/assets/video/examples/hf/transitions-distortion.html +522 -0
- package/assets/video/examples/hf/transitions-grid.html +442 -0
- package/assets/video/examples/hf/transitions-light.html +528 -0
- package/assets/video/examples/hf/transitions-mechanical.html +560 -0
- package/assets/video/examples/hf/transitions-other.html +532 -0
- package/assets/video/examples/hf/transitions-push.html +520 -0
- package/assets/video/examples/hf/transitions-radial.html +492 -0
- package/assets/video/examples/hf/transitions-scale.html +487 -0
- package/assets/video/examples/hf/trust-strip.html +445 -0
- package/assets/video/examples/hf/typed-prompt.html +619 -0
- package/assets/video/examples/hf/typewriter.html +350 -0
- package/assets/video/examples/hf/typing-indicator.html +702 -0
- package/assets/video/examples/hf/ui-3d-reveal.html +2929 -0
- package/assets/video/examples/hf/ui-focus-zoom.html +786 -0
- package/assets/video/examples/hf/us-map-bubble.html +669 -0
- package/assets/video/examples/hf/us-map-flow.html +621 -0
- package/assets/video/examples/hf/us-map-hex.html +733 -0
- package/assets/video/examples/hf/us-map.html +591 -0
- package/assets/video/examples/hf/variable-font-flex.html +538 -0
- package/assets/video/examples/hf/vector-editor-rig.html +977 -0
- package/assets/video/examples/hf/vfx-anamorphic-flare.html +572 -0
- package/assets/video/examples/hf/vfx-iphone-device.html +1089 -0
- package/assets/video/examples/hf/vfx-liquid-background.html +1479 -0
- package/assets/video/examples/hf/vfx-liquid-glass.html +2054 -0
- package/assets/video/examples/hf/vfx-magnetic.html +660 -0
- package/assets/video/examples/hf/vfx-portal.html +1090 -0
- package/assets/video/examples/hf/vfx-shatter.html +1382 -0
- package/assets/video/examples/hf/vignette.html +385 -0
- package/assets/video/examples/hf/voronoi.html +258 -0
- package/assets/video/examples/hf/vox-annotate.html +707 -0
- package/assets/video/examples/hf/vpn-youtube-spot.html +1118 -0
- package/assets/video/examples/hf/water.html +258 -0
- package/assets/video/examples/hf/waveform.html +258 -0
- package/assets/video/examples/hf/week-in-merges.html +673 -0
- package/assets/video/examples/hf/weight-wave.html +531 -0
- package/assets/video/examples/hf/whip-pan-cut.html +668 -0
- package/assets/video/examples/hf/whip-pan.html +613 -0
- package/assets/video/examples/hf/whiteboard-ink.html +763 -0
- package/assets/video/examples/hf/wireframe-portal-title.html +3840 -0
- package/assets/video/examples/hf/wordmark-tiles.html +559 -0
- package/assets/video/examples/hf/world-map.html +623 -0
- package/assets/video/examples/hf/worley-noise.html +259 -0
- package/assets/video/examples/hf/x-follow-card.html +286 -0
- package/assets/video/examples/hf/x-post.html +611 -0
- package/assets/video/examples/hf/yt-camera-move.html +308 -0
- package/assets/video/examples/hf/yt-circle-pointer.html +301 -0
- package/assets/video/examples/hf/yt-comment-card.html +458 -0
- package/assets/video/examples/hf/yt-feather-highlight.html +279 -0
- package/assets/video/examples/hf/yt-lcd-background.html +446 -0
- package/assets/video/examples/hf/yt-logo-intro.html +390 -0
- package/assets/video/examples/hf/yt-lower-third.html +414 -0
- package/assets/video/examples/hf/yt-prism-title.html +343 -0
- package/assets/video/examples/hf/yt-screen-warp.html +257 -0
- package/assets/video/examples/hf/yt-vertical-fill.html +367 -0
- package/assets/video/examples/kinetic-type.html +137 -0
- package/assets/video/examples/list-cards.html +155 -0
- package/assets/video/examples/motion-blur-streak.html +119 -0
- package/assets/video/examples/object-reveal.html +107 -0
- package/assets/video/examples/page-flip.html +163 -0
- package/assets/video/examples/parallax-layers.html +130 -0
- package/assets/video/examples/particle-burst.html +157 -0
- package/assets/video/examples/pen-draw.html +146 -0
- package/assets/video/examples/shape-morph.html +151 -0
- package/assets/video/examples/slam-title.html +125 -0
- package/assets/video/examples/speed-lines.html +123 -0
- package/assets/video/examples/spring-pop.html +129 -0
- package/assets/video/examples/streak-wipe.html +78 -0
- package/assets/video/examples/three-chrome-knot.html +155 -0
- package/assets/video/examples/three-clay.html +138 -0
- package/assets/video/examples/three-cube-wave.html +140 -0
- package/assets/video/examples/three-extruded-shape.html +148 -0
- package/assets/video/examples/type-on.html +128 -0
- package/assets/video/motion.js +991 -0
- package/assets/video/screen.js +298 -0
- package/assets/video/sfx/catalogue.json +2283 -0
- package/assets/video/times.js +59 -0
- package/dist/cli.js +36667 -2526
- package/dist/index.js +36429 -2459
- package/dist/types/args.d.ts +2 -0
- package/dist/types/cloud/service.d.ts +13 -0
- package/dist/types/commands/usage.d.ts +2 -0
- package/dist/types/commands/video.d.ts +10 -0
- package/dist/types/cpu-budget.d.ts +43 -0
- package/dist/types/images/batch-jobs.d.ts +2 -0
- package/dist/types/images/batch-run.d.ts +2 -1
- package/dist/types/images/jobs.d.ts +7 -0
- package/dist/types/images/pending.d.ts +40 -0
- package/dist/types/images/retry.d.ts +4 -1
- package/dist/types/images/run.d.ts +9 -1
- package/dist/types/node-runtime.d.ts +6 -1
- package/dist/types/providers/api.d.ts +9 -0
- package/dist/types/providers/base.d.ts +2 -0
- package/dist/types/providers/cli-generate.d.ts +5 -1
- package/dist/types/providers/cli-pending.d.ts +24 -0
- package/dist/types/providers/errors.d.ts +2 -1
- package/dist/types/providers/ledger.d.ts +10 -6
- package/dist/types/providers/popost-async.d.ts +35 -0
- package/dist/types/providers/popost-tasks.d.ts +16 -5
- package/dist/types/providers/popost.d.ts +16 -1
- package/dist/types/providers/task.d.ts +43 -0
- package/dist/types/render/browser.d.ts +16 -2
- package/dist/types/runtime.d.ts +73 -2
- package/dist/types/version.d.ts +1 -1
- package/dist/types/video/align/index.d.ts +43 -0
- package/dist/types/video/capture/director.d.ts +70 -0
- package/dist/types/video/capture/index.d.ts +141 -0
- package/dist/types/video/capture/stage.d.ts +99 -0
- package/dist/types/video/capture/steps.d.ts +138 -0
- package/dist/types/video/commands/cast.d.ts +3 -0
- package/dist/types/video/commands/clips.d.ts +2 -0
- package/dist/types/video/commands/compare-scope.d.ts +7 -0
- package/dist/types/video/commands/credits.d.ts +19 -0
- package/dist/types/video/commands/elements.d.ts +22 -0
- package/dist/types/video/commands/eval.d.ts +2 -0
- package/dist/types/video/commands/example.d.ts +1 -0
- package/dist/types/video/commands/generate.d.ts +14 -0
- package/dist/types/video/commands/loop-shared.d.ts +12 -0
- package/dist/types/video/commands/loop.d.ts +4 -0
- package/dist/types/video/commands/make.d.ts +9 -0
- package/dist/types/video/commands/materials.d.ts +1 -0
- package/dist/types/video/commands/measure.d.ts +2 -0
- package/dist/types/video/commands/media.d.ts +2 -0
- package/dist/types/video/commands/music-plan.d.ts +1 -0
- package/dist/types/video/commands/music.d.ts +2 -0
- package/dist/types/video/commands/read.d.ts +19 -0
- package/dist/types/video/commands/replication-books.d.ts +2 -0
- package/dist/types/video/commands/replication.d.ts +2 -0
- package/dist/types/video/commands/sfx-extract.d.ts +2 -0
- package/dist/types/video/commands/sfx-place.d.ts +3 -0
- package/dist/types/video/commands/sfx.d.ts +2 -0
- package/dist/types/video/commands/shared.d.ts +39 -0
- package/dist/types/video/commands/source.d.ts +2 -0
- package/dist/types/video/commands/speech-check.d.ts +1 -0
- package/dist/types/video/commands/speech-kind.d.ts +6 -0
- package/dist/types/video/commands/template.d.ts +10 -0
- package/dist/types/video/commands/voice-profile.d.ts +2 -0
- package/dist/types/video/commands/voice-sample.d.ts +1 -0
- package/dist/types/video/compile/footage.d.ts +36 -0
- package/dist/types/video/compile/index.d.ts +30 -0
- package/dist/types/video/compile/page-bundle.d.ts +1 -0
- package/dist/types/video/compile/page.d.ts +10 -0
- package/dist/types/video/compile/words.d.ts +9 -0
- package/dist/types/video/describe/aim.d.ts +20 -0
- package/dist/types/video/describe/beats.d.ts +53 -0
- package/dist/types/video/describe/curves.d.ts +27 -0
- package/dist/types/video/describe/frames.d.ts +62 -0
- package/dist/types/video/describe/index.d.ts +34 -0
- package/dist/types/video/describe/inset.d.ts +83 -0
- package/dist/types/video/describe/kind.d.ts +29 -0
- package/dist/types/video/describe/known.d.ts +31 -0
- package/dist/types/video/describe/movement.d.ts +17 -0
- package/dist/types/video/describe/parts.d.ts +52 -0
- package/dist/types/video/describe/paths.d.ts +21 -0
- package/dist/types/video/describe/speech-kind.d.ts +144 -0
- package/dist/types/video/describe/unrecovered.d.ts +29 -0
- package/dist/types/video/draft/build.d.ts +34 -0
- package/dist/types/video/draft/export.d.ts +19 -0
- package/dist/types/video/draft/lifecycle.d.ts +9 -0
- package/dist/types/video/draft/native.d.ts +27 -0
- package/dist/types/video/draft/schema.d.ts +316 -0
- package/dist/types/video/draft/targets.d.ts +19 -0
- package/dist/types/video/elements/caption-reading.d.ts +9 -0
- package/dist/types/video/elements/caption-roles.d.ts +6 -0
- package/dist/types/video/elements/carry.d.ts +45 -0
- package/dist/types/video/elements/check.d.ts +14 -0
- package/dist/types/video/elements/findings.d.ts +49 -0
- package/dist/types/video/elements/main.d.ts +54 -0
- package/dist/types/video/elements/picture.d.ts +31 -0
- package/dist/types/video/elements/questions.d.ts +35 -0
- package/dist/types/video/elements/read.d.ts +14 -0
- package/dist/types/video/elements/status.d.ts +23 -0
- package/dist/types/video/elements/types.d.ts +120 -0
- package/dist/types/video/eval/contrast.d.ts +136 -0
- package/dist/types/video/eval/dataset.d.ts +21 -0
- package/dist/types/video/eval/floor.d.ts +27 -0
- package/dist/types/video/eval/ledger.d.ts +27 -0
- package/dist/types/video/eval/legibility.d.ts +33 -0
- package/dist/types/video/eval/readback-frames.d.ts +41 -0
- package/dist/types/video/eval/readback-kept.d.ts +10 -0
- package/dist/types/video/eval/readback-run.d.ts +58 -0
- package/dist/types/video/eval/readback.d.ts +48 -0
- package/dist/types/video/eval/roundtrip.d.ts +71 -0
- package/dist/types/video/generate/approved.d.ts +74 -0
- package/dist/types/video/generate/cast.d.ts +60 -0
- package/dist/types/video/generate/character.d.ts +14 -0
- package/dist/types/video/generate/clip-sound.d.ts +63 -0
- package/dist/types/video/generate/cloud-image.d.ts +12 -0
- package/dist/types/video/generate/cloud.d.ts +67 -0
- package/dist/types/video/generate/dialogue.d.ts +116 -0
- package/dist/types/video/generate/index.d.ts +265 -0
- package/dist/types/video/generate/provenance.d.ts +11 -0
- package/dist/types/video/generate/speech-lock.d.ts +4 -0
- package/dist/types/video/generate/speech.d.ts +20 -0
- package/dist/types/video/host.d.ts +42 -0
- package/dist/types/video/hosted-api.d.ts +161 -0
- package/dist/types/video/look/index.d.ts +67 -0
- package/dist/types/video/look/like.d.ts +18 -0
- package/dist/types/video/look/sheets.d.ts +58 -0
- package/dist/types/video/measure/align.d.ts +33 -0
- package/dist/types/video/measure/amount.d.ts +52 -0
- package/dist/types/video/measure/bars.d.ts +22 -0
- package/dist/types/video/measure/boundaries.d.ts +18 -0
- package/dist/types/video/measure/cache.d.ts +6 -0
- package/dist/types/video/measure/camera.d.ts +21 -0
- package/dist/types/video/measure/colour.d.ts +12 -0
- package/dist/types/video/measure/curve.d.ts +29 -0
- package/dist/types/video/measure/cuts.d.ts +17 -0
- package/dist/types/video/measure/easing.d.ts +52 -0
- package/dist/types/video/measure/fill.d.ts +20 -0
- package/dist/types/video/measure/fits.d.ts +80 -0
- package/dist/types/video/measure/gradual.d.ts +23 -0
- package/dist/types/video/measure/index.d.ts +28 -0
- package/dist/types/video/measure/kinds.d.ts +71 -0
- package/dist/types/video/measure/motion.d.ts +26 -0
- package/dist/types/video/measure/move.d.ts +90 -0
- package/dist/types/video/measure/moves.d.ts +22 -0
- package/dist/types/video/measure/orientation.d.ts +11 -0
- package/dist/types/video/measure/pixels.d.ts +41 -0
- package/dist/types/video/measure/profile.d.ts +53 -0
- package/dist/types/video/measure/reveal.d.ts +48 -0
- package/dist/types/video/measure/rhythm.d.ts +7 -0
- package/dist/types/video/measure/robust.d.ts +18 -0
- package/dist/types/video/measure/signals.d.ts +48 -0
- package/dist/types/video/measure/signature.d.ts +10 -0
- package/dist/types/video/measure/span.d.ts +28 -0
- package/dist/types/video/measure/still-shots.d.ts +40 -0
- package/dist/types/video/measure/switch.d.ts +101 -0
- package/dist/types/video/measure/tracks.d.ts +20 -0
- package/dist/types/video/measure/unmix.d.ts +20 -0
- package/dist/types/video/media/decode.d.ts +59 -0
- package/dist/types/video/media/ffmpeg.d.ts +48 -0
- package/dist/types/video/media/footage.d.ts +53 -0
- package/dist/types/video/media/screenshot.d.ts +26 -0
- package/dist/types/video/media/selection.d.ts +4 -0
- package/dist/types/video/media/wav.d.ts +26 -0
- package/dist/types/video/music/hosted.d.ts +110 -0
- package/dist/types/video/music/plan.d.ts +103 -0
- package/dist/types/video/music/provenance.d.ts +86 -0
- package/dist/types/video/page/apply.d.ts +9 -0
- package/dist/types/video/page/contract.d.ts +164 -0
- package/dist/types/video/page/css.d.ts +9 -0
- package/dist/types/video/page/dom.d.ts +56 -0
- package/dist/types/video/page/fit.d.ts +13 -0
- package/dist/types/video/page/layout.d.ts +8 -0
- package/dist/types/video/page/main.d.ts +1 -0
- package/dist/types/video/page/scene.d.ts +38 -0
- package/dist/types/video/page/texts.d.ts +10 -0
- package/dist/types/video/page/times.d.ts +31 -0
- package/dist/types/video/page/words.d.ts +39 -0
- package/dist/types/video/paid-download.d.ts +19 -0
- package/dist/types/video/plan/ask.d.ts +77 -0
- package/dist/types/video/plan/generated.d.ts +29 -0
- package/dist/types/video/plan/index.d.ts +6 -0
- package/dist/types/video/plan/materials.d.ts +22 -0
- package/dist/types/video/plan/model.d.ts +59 -0
- package/dist/types/video/plan/prompt.d.ts +41 -0
- package/dist/types/video/plan/see.d.ts +35 -0
- package/dist/types/video/presets/camera.d.ts +27 -0
- package/dist/types/video/presets/easing.d.ts +11 -0
- package/dist/types/video/presets/fill.d.ts +16 -0
- package/dist/types/video/presets/loop.d.ts +20 -0
- package/dist/types/video/presets/motion.d.ts +47 -0
- package/dist/types/video/presets/spoken.d.ts +35 -0
- package/dist/types/video/presets/text-styles.d.ts +44 -0
- package/dist/types/video/presets/transition.d.ts +66 -0
- package/dist/types/video/preview/cloud.d.ts +13 -0
- package/dist/types/video/preview/edit/check.d.ts +15 -0
- package/dist/types/video/preview/edit/editor.d.ts +52 -0
- package/dist/types/video/preview/edit/ops.d.ts +52 -0
- package/dist/types/video/preview/edit/render.d.ts +11 -0
- package/dist/types/video/preview/edit/retime.d.ts +2 -0
- package/dist/types/video/preview/edit/routes.d.ts +1106 -0
- package/dist/types/video/preview/export-settings.d.ts +25 -0
- package/dist/types/video/preview/files.d.ts +25 -0
- package/dist/types/video/preview/html.d.ts +9 -0
- package/dist/types/video/preview/index.d.ts +20 -0
- package/dist/types/video/preview/project.d.ts +48 -0
- package/dist/types/video/preview/protocol.d.ts +91 -0
- package/dist/types/video/preview/server.d.ts +21 -0
- package/dist/types/video/preview/shell/app.d.ts +81 -0
- package/dist/types/video/preview/shell/dom.d.ts +49 -0
- package/dist/types/video/preview/shell/edit/controller.d.ts +32 -0
- package/dist/types/video/preview/shell/edit/fields.d.ts +49 -0
- package/dist/types/video/preview/shell/edit/form-parts.d.ts +17 -0
- package/dist/types/video/preview/shell/edit/form.d.ts +17 -0
- package/dist/types/video/preview/shell/edit/inline.d.ts +4 -0
- package/dist/types/video/preview/shell/edit/lanes-edit.d.ts +31 -0
- package/dist/types/video/preview/shell/edit/layer-order.d.ts +4 -0
- package/dist/types/video/preview/shell/edit/remove.d.ts +4 -0
- package/dist/types/video/preview/shell/edit/reveal.d.ts +4 -0
- package/dist/types/video/preview/shell/edit/scenes.d.ts +7 -0
- package/dist/types/video/preview/shell/edit/schema.d.ts +30 -0
- package/dist/types/video/preview/shell/edit/source.d.ts +83 -0
- package/dist/types/video/preview/shell/edit/split.d.ts +8 -0
- package/dist/types/video/preview/shell/edit/stage-edit.d.ts +21 -0
- package/dist/types/video/preview/shell/edit/text-fit.d.ts +4 -0
- package/dist/types/video/preview/shell/edit/toolbar.d.ts +14 -0
- package/dist/types/video/preview/shell/footage.d.ts +6 -0
- package/dist/types/video/preview/shell/i18n.d.ts +176 -0
- package/dist/types/video/preview/shell/lanes.d.ts +2 -0
- package/dist/types/video/preview/shell/main.d.ts +1 -0
- package/dist/types/video/preview/shell/model.d.ts +85 -0
- package/dist/types/video/preview/shell/panel.d.ts +3 -0
- package/dist/types/video/preview/shell/readonly.d.ts +1 -0
- package/dist/types/video/preview/shell/stage.d.ts +7 -0
- package/dist/types/video/preview/shell/studio/audio.d.ts +3 -0
- package/dist/types/video/preview/shell/studio/cloud.d.ts +3 -0
- package/dist/types/video/preview/shell/studio/code.d.ts +6 -0
- package/dist/types/video/preview/shell/studio/copy.d.ts +159 -0
- package/dist/types/video/preview/shell/studio/draft-result.d.ts +3 -0
- package/dist/types/video/preview/shell/studio/export.d.ts +3 -0
- package/dist/types/video/preview/shell/studio/scene-selection.d.ts +19 -0
- package/dist/types/video/preview/shell/studio/sidebar.d.ts +27 -0
- package/dist/types/video/preview/shell/studio/style.d.ts +2 -0
- package/dist/types/video/preview/shell/studio/timeline.d.ts +3 -0
- package/dist/types/video/preview/shell/studio/ui.d.ts +18 -0
- package/dist/types/video/preview/shell/studio/workspace.d.ts +11 -0
- package/dist/types/video/preview/shell/style.d.ts +5 -0
- package/dist/types/video/preview/shell/transport.d.ts +6 -0
- package/dist/types/video/preview/shell-bundle.d.ts +1 -0
- package/dist/types/video/preview/studio-actions.d.ts +4 -0
- package/dist/types/video/preview/studio-data.d.ts +32 -0
- package/dist/types/video/preview/thumbnails.d.ts +5 -0
- package/dist/types/video/preview/watch.d.ts +23 -0
- package/dist/types/video/progress.d.ts +28 -0
- package/dist/types/video/project/check-camera.d.ts +8 -0
- package/dist/types/video/project/check-caption.d.ts +8 -0
- package/dist/types/video/project/check-common.d.ts +25 -0
- package/dist/types/video/project/check-footage.d.ts +22 -0
- package/dist/types/video/project/check-look.d.ts +19 -0
- package/dist/types/video/project/check-sound.d.ts +57 -0
- package/dist/types/video/project/check-span.d.ts +11 -0
- package/dist/types/video/project/check-tracks.d.ts +8 -0
- package/dist/types/video/project/check-transition.d.ts +11 -0
- package/dist/types/video/project/check-words.d.ts +32 -0
- package/dist/types/video/project/check.d.ts +42 -0
- package/dist/types/video/project/issues.d.ts +43 -0
- package/dist/types/video/project/schema.d.ts +2074 -0
- package/dist/types/video/project/suggest.d.ts +4 -0
- package/dist/types/video/project/words.d.ts +6 -0
- package/dist/types/video/render/browser-step.d.ts +5 -0
- package/dist/types/video/render/chunked.d.ts +29 -0
- package/dist/types/video/render/chunks.d.ts +39 -0
- package/dist/types/video/render/encode.d.ts +54 -0
- package/dist/types/video/render/index.d.ts +116 -0
- package/dist/types/video/render/layout.d.ts +26 -0
- package/dist/types/video/render/record.d.ts +80 -0
- package/dist/types/video/render/session.d.ts +81 -0
- package/dist/types/video/render/shots.d.ts +11 -0
- package/dist/types/video/render/verify.d.ts +16 -0
- package/dist/types/video/replication/audio-provenance.d.ts +36 -0
- package/dist/types/video/replication/books.d.ts +64 -0
- package/dist/types/video/replication/browser.d.ts +1 -0
- package/dist/types/video/replication/check.d.ts +19 -0
- package/dist/types/video/replication/contract.d.ts +683 -0
- package/dist/types/video/replication/io.d.ts +22 -0
- package/dist/types/video/replication/motion-bundle.d.ts +1 -0
- package/dist/types/video/replication/motion.d.ts +109 -0
- package/dist/types/video/replication/pairs.d.ts +69 -0
- package/dist/types/video/replication/prefill.d.ts +34 -0
- package/dist/types/video/replication/production.d.ts +168 -0
- package/dist/types/video/replication/retiming.d.ts +16 -0
- package/dist/types/video/replication/review.d.ts +50 -0
- package/dist/types/video/replication/revision.d.ts +2 -0
- package/dist/types/video/replication/schema.d.ts +56 -0
- package/dist/types/video/replication/source-clock.d.ts +24 -0
- package/dist/types/video/replication/speech-observed.d.ts +121 -0
- package/dist/types/video/replication/voice-spans.d.ts +3 -0
- package/dist/types/video/retarget/caption-look.d.ts +14 -0
- package/dist/types/video/retarget/fps.d.ts +5 -0
- package/dist/types/video/retarget/index.d.ts +256 -0
- package/dist/types/video/retarget/items.d.ts +44 -0
- package/dist/types/video/retarget/marks.d.ts +12 -0
- package/dist/types/video/retarget/pace.d.ts +36 -0
- package/dist/types/video/retarget/speak.d.ts +43 -0
- package/dist/types/video/retarget/takes.d.ts +66 -0
- package/dist/types/video/retarget/tempo.d.ts +42 -0
- package/dist/types/video/retarget/titles.d.ts +76 -0
- package/dist/types/video/retarget/words.d.ts +39 -0
- package/dist/types/video/scene/author.d.ts +74 -0
- package/dist/types/video/scene/check.d.ts +64 -0
- package/dist/types/video/scene/copied.d.ts +30 -0
- package/dist/types/video/scene/cues.d.ts +40 -0
- package/dist/types/video/scene/examples.d.ts +129 -0
- package/dist/types/video/scene/findings.d.ts +71 -0
- package/dist/types/video/scene/fonts.d.ts +19 -0
- package/dist/types/video/scene/items.d.ts +23 -0
- package/dist/types/video/scene/library.d.ts +41 -0
- package/dist/types/video/scene/lint.d.ts +15 -0
- package/dist/types/video/scene/numbers.d.ts +39 -0
- package/dist/types/video/scene/pictures.d.ts +12 -0
- package/dist/types/video/scene/write.d.ts +41 -0
- package/dist/types/video/score/index.d.ts +13 -0
- package/dist/types/video/score/pair.d.ts +43 -0
- package/dist/types/video/score/picture.d.ts +14 -0
- package/dist/types/video/score/project-windows.d.ts +9 -0
- package/dist/types/video/score/shot-transition.d.ts +62 -0
- package/dist/types/video/score/shots.d.ts +101 -0
- package/dist/types/video/score/time.d.ts +22 -0
- package/dist/types/video/score/tracks.d.ts +42 -0
- package/dist/types/video/score/weights.d.ts +19 -0
- package/dist/types/video/sfx/cache.d.ts +16 -0
- package/dist/types/video/sfx/catalogue.d.ts +64 -0
- package/dist/types/video/sfx/extract.d.ts +65 -0
- package/dist/types/video/sfx/levels.d.ts +39 -0
- package/dist/types/video/sfx/library.d.ts +26 -0
- package/dist/types/video/sfx/place.d.ts +82 -0
- package/dist/types/video/sfx/project.d.ts +36 -0
- package/dist/types/video/sound/analysis.d.ts +46 -0
- package/dist/types/video/sound/breaks.d.ts +84 -0
- package/dist/types/video/sound/measure.d.ts +106 -0
- package/dist/types/video/sound/modes.d.ts +75 -0
- package/dist/types/video/sound/pcm.d.ts +21 -0
- package/dist/types/video/sound/reading.d.ts +124 -0
- package/dist/types/video/sound/speech-check.d.ts +76 -0
- package/dist/types/video/source/collect.d.ts +64 -0
- package/dist/types/video/source/read.d.ts +57 -0
- package/dist/types/video/source/used.d.ts +4 -0
- package/dist/types/video/speech/hosted.d.ts +36 -0
- package/dist/types/video/speech/index.d.ts +83 -0
- package/dist/types/video/speech/types.d.ts +46 -0
- package/dist/types/video/submit-retry.d.ts +15 -0
- package/dist/types/video/synth/generate.d.ts +53 -0
- package/dist/types/video/synth/truth.d.ts +8 -0
- package/dist/types/video/synth/write.d.ts +13 -0
- package/dist/types/video/template/capacity.d.ts +37 -0
- package/dist/types/video/template/card-elements.d.ts +17 -0
- package/dist/types/video/template/card.d.ts +22 -0
- package/dist/types/video/template/check-captions.d.ts +11 -0
- package/dist/types/video/template/check.d.ts +40 -0
- package/dist/types/video/template/facts.d.ts +90 -0
- package/dist/types/video/template/fill.d.ts +53 -0
- package/dist/types/video/template/fingerprint.d.ts +2 -0
- package/dist/types/video/template/fit.d.ts +60 -0
- package/dist/types/video/template/index.d.ts +8 -0
- package/dist/types/video/template/project.d.ts +21 -0
- package/dist/types/video/template/save.d.ts +54 -0
- package/dist/types/video/template/slots.d.ts +26 -0
- package/dist/types/video/template/speech-rules.d.ts +61 -0
- package/dist/types/video/template/split.d.ts +10 -0
- package/dist/types/video/template/structure.d.ts +82 -0
- package/dist/types/video/template/swap.d.ts +33 -0
- package/dist/types/video/template/types.d.ts +387 -0
- package/dist/types/video/text/bar.d.ts +63 -0
- package/dist/types/video/text/change.d.ts +19 -0
- package/dist/types/video/text/core.d.ts +25 -0
- package/dist/types/video/text/cues.d.ts +26 -0
- package/dist/types/video/text/fold.d.ts +9 -0
- package/dist/types/video/text/frame.d.ts +41 -0
- package/dist/types/video/text/highlight.d.ts +19 -0
- package/dist/types/video/text/index.d.ts +67 -0
- package/dist/types/video/text/letters.d.ts +85 -0
- package/dist/types/video/text/look.d.ts +53 -0
- package/dist/types/video/text/reader-command.d.ts +26 -0
- package/dist/types/video/text/reveal.d.ts +37 -0
- package/dist/types/video/text/rings.d.ts +39 -0
- package/dist/types/video/text/shadow.d.ts +44 -0
- package/dist/types/video/text/share.d.ts +2 -0
- package/dist/types/video/text/speech.d.ts +15 -0
- package/dist/types/video/text/strokes.d.ts +30 -0
- package/dist/types/video/text/types.d.ts +147 -0
- package/dist/types/video/timeline/cue-words.d.ts +27 -0
- package/dist/types/video/timeline/footage.d.ts +25 -0
- package/dist/types/video/timeline/frame.d.ts +55 -0
- package/dist/types/video/timeline/items.d.ts +28 -0
- package/dist/types/video/timeline/mix.d.ts +67 -0
- package/dist/types/video/timeline/resolve.d.ts +20 -0
- package/dist/types/video/timeline/spans.d.ts +32 -0
- package/dist/types/video/timeline/words.d.ts +64 -0
- package/dist/types/video/tool.d.ts +29 -0
- package/dist/types/video/types.d.ts +1057 -0
- package/dist/types/video/voice/cache.d.ts +10 -0
- package/dist/types/video/voice/create.d.ts +43 -0
- package/dist/types/video/voice/hosted.d.ts +42 -0
- package/dist/types/video/voice/index.d.ts +85 -0
- package/dist/types/video/voice/pace.d.ts +37 -0
- package/dist/types/video/voice/profile.d.ts +26 -0
- package/dist/types/video/voice/sample.d.ts +46 -0
- package/dist/types/video/wallet.d.ts +45 -0
- package/dist/types/video/work.d.ts +10 -0
- package/dist/types/workflow/post-bundle.d.ts +2 -2
- package/package.json +13 -4
- package/references/image-workflow.md +111 -0
- package/references/onboarding.md +50 -19
- package/references/post-bundle.md +1 -1
- package/references/providers.md +5 -2
- package/references/video-draft-export.md +13 -0
- package/references/video-editing.md +43 -0
- package/references/video-effects.md +613 -0
- package/references/video-elements.md +199 -0
- package/references/video-examples/showcase/assets/pattern.svg +18 -0
- package/references/video-examples/showcase/assets/voice.sbg +4 -0
- package/references/video-examples/showcase/assets/voice.words.json +68 -0
- package/references/video-examples/showcase/video.json +550 -0
- package/references/video-examples/template-demo/TEMPLATE.md +30 -0
- package/references/video-examples/template-demo/fill.json +29 -0
- package/references/video-examples/template-demo/slots.json +210 -0
- package/references/video-examples/template-demo/template.json +105 -0
- package/references/video-motion.md +315 -0
- package/references/video-native-observation.md +37 -0
- package/references/video-performers.md +96 -0
- package/references/video-project.md +65 -0
- package/references/video-replication.md +305 -0
- package/references/video-scenes.md +416 -0
- package/references/video-sfx.md +109 -0
- package/references/video-sound.md +222 -0
- package/references/video-step-0-machine.md +61 -0
- package/references/video-step-1-read.md +168 -0
- package/references/video-step-2-structure.md +24 -0
- package/references/video-step-3-content.md +117 -0
- package/references/video-step-4-lines.md +88 -0
- package/references/video-step-5-scenes.md +126 -0
- package/references/video-step-6-voice.md +53 -0
- package/references/video-step-7-deliver.md +92 -0
- package/references/video-templates.md +187 -0
- package/references/video-tools.md +562 -0
- package/references/video.md +140 -0
- package/templates/community/README.md +274 -1
- package/templates/community/index.json +3829 -0
- package/templates/community/instagram-age-expectations/README.md +14 -0
- package/templates/community/instagram-age-expectations/SKILL.md +52 -0
- package/templates/community/instagram-age-expectations/source.json +9 -0
- package/templates/community/instagram-age-expectations/template.json +53 -0
- package/templates/community/instagram-artwork-detail/README.md +19 -0
- package/templates/community/instagram-artwork-detail/SKILL.md +53 -0
- package/templates/community/instagram-artwork-detail/source.json +9 -0
- package/templates/community/instagram-artwork-detail/template.json +61 -0
- package/templates/community/instagram-balanced-traits/README.md +12 -0
- package/templates/community/instagram-balanced-traits/SKILL.md +52 -0
- package/templates/community/instagram-balanced-traits/source.json +9 -0
- package/templates/community/instagram-balanced-traits/template.json +53 -0
- package/templates/community/instagram-behind-the-scenes/README.md +12 -0
- package/templates/community/instagram-behind-the-scenes/SKILL.md +53 -0
- package/templates/community/instagram-behind-the-scenes/source.json +9 -0
- package/templates/community/instagram-behind-the-scenes/template.json +52 -0
- package/templates/community/instagram-brand-personification/README.md +26 -0
- package/templates/community/instagram-brand-personification/SKILL.md +53 -0
- package/templates/community/instagram-brand-personification/source.json +9 -0
- package/templates/community/instagram-brand-personification/template.json +66 -0
- package/templates/community/instagram-brand-system/README.md +17 -0
- package/templates/community/instagram-brand-system/SKILL.md +53 -0
- package/templates/community/instagram-brand-system/source.json +9 -0
- package/templates/community/instagram-brand-system/template.json +60 -0
- package/templates/community/instagram-calendar-cheat-sheet/README.md +8 -0
- package/templates/community/instagram-calendar-cheat-sheet/SKILL.md +53 -0
- package/templates/community/instagram-calendar-cheat-sheet/source.json +9 -0
- package/templates/community/instagram-calendar-cheat-sheet/template.json +47 -0
- package/templates/community/instagram-capacity-planning/README.md +12 -0
- package/templates/community/instagram-capacity-planning/SKILL.md +53 -0
- package/templates/community/instagram-capacity-planning/source.json +9 -0
- package/templates/community/instagram-capacity-planning/template.json +55 -0
- package/templates/community/instagram-category-use-guide/README.md +14 -0
- package/templates/community/instagram-category-use-guide/SKILL.md +53 -0
- package/templates/community/instagram-category-use-guide/source.json +9 -0
- package/templates/community/instagram-category-use-guide/template.json +55 -0
- package/templates/community/instagram-character-led-tour/README.md +17 -0
- package/templates/community/instagram-character-led-tour/SKILL.md +53 -0
- package/templates/community/instagram-character-led-tour/source.json +9 -0
- package/templates/community/instagram-character-led-tour/template.json +56 -0
- package/templates/community/instagram-comic-dialogue/README.md +16 -0
- package/templates/community/instagram-comic-dialogue/SKILL.md +53 -0
- package/templates/community/instagram-comic-dialogue/source.json +9 -0
- package/templates/community/instagram-comic-dialogue/template.json +59 -0
- package/templates/community/instagram-command-shortcuts/README.md +13 -0
- package/templates/community/instagram-command-shortcuts/SKILL.md +53 -0
- package/templates/community/instagram-command-shortcuts/source.json +9 -0
- package/templates/community/instagram-command-shortcuts/template.json +52 -0
- package/templates/community/instagram-context-changes-meaning/README.md +11 -0
- package/templates/community/instagram-context-changes-meaning/SKILL.md +53 -0
- package/templates/community/instagram-context-changes-meaning/source.json +9 -0
- package/templates/community/instagram-context-changes-meaning/template.json +54 -0
- package/templates/community/instagram-continuous-canvas/README.md +16 -0
- package/templates/community/instagram-continuous-canvas/SKILL.md +52 -0
- package/templates/community/instagram-continuous-canvas/source.json +9 -0
- package/templates/community/instagram-continuous-canvas/template.json +59 -0
- package/templates/community/instagram-conversation-questions/README.md +12 -0
- package/templates/community/instagram-conversation-questions/SKILL.md +52 -0
- package/templates/community/instagram-conversation-questions/source.json +9 -0
- package/templates/community/instagram-conversation-questions/template.json +51 -0
- package/templates/community/instagram-copy-alternatives/README.md +11 -0
- package/templates/community/instagram-copy-alternatives/SKILL.md +53 -0
- package/templates/community/instagram-copy-alternatives/source.json +9 -0
- package/templates/community/instagram-copy-alternatives/template.json +50 -0
- package/templates/community/instagram-copyable-notes/README.md +13 -0
- package/templates/community/instagram-copyable-notes/SKILL.md +52 -0
- package/templates/community/instagram-copyable-notes/source.json +9 -0
- package/templates/community/instagram-copyable-notes/template.json +51 -0
- package/templates/community/instagram-curated-resources/README.md +13 -0
- package/templates/community/instagram-curated-resources/SKILL.md +52 -0
- package/templates/community/instagram-curated-resources/source.json +9 -0
- package/templates/community/instagram-curated-resources/template.json +54 -0
- package/templates/community/instagram-destination-costs/README.md +17 -0
- package/templates/community/instagram-destination-costs/SKILL.md +52 -0
- package/templates/community/instagram-destination-costs/source.json +9 -0
- package/templates/community/instagram-destination-costs/template.json +56 -0
- package/templates/community/instagram-diagram-reference/README.md +10 -0
- package/templates/community/instagram-diagram-reference/SKILL.md +53 -0
- package/templates/community/instagram-diagram-reference/source.json +9 -0
- package/templates/community/instagram-diagram-reference/template.json +52 -0
- package/templates/community/instagram-different-perspectives/README.md +15 -0
- package/templates/community/instagram-different-perspectives/SKILL.md +53 -0
- package/templates/community/instagram-different-perspectives/source.json +9 -0
- package/templates/community/instagram-different-perspectives/template.json +55 -0
- package/templates/community/instagram-document-reveal/README.md +8 -0
- package/templates/community/instagram-document-reveal/SKILL.md +53 -0
- package/templates/community/instagram-document-reveal/source.json +9 -0
- package/templates/community/instagram-document-reveal/template.json +46 -0
- package/templates/community/instagram-effect-breakdown/README.md +14 -0
- package/templates/community/instagram-effect-breakdown/SKILL.md +53 -0
- package/templates/community/instagram-effect-breakdown/source.json +9 -0
- package/templates/community/instagram-effect-breakdown/template.json +55 -0
- package/templates/community/instagram-effort-and-outcome/README.md +13 -0
- package/templates/community/instagram-effort-and-outcome/SKILL.md +52 -0
- package/templates/community/instagram-effort-and-outcome/source.json +9 -0
- package/templates/community/instagram-effort-and-outcome/template.json +54 -0
- package/templates/community/instagram-emotion-and-meaning/README.md +16 -0
- package/templates/community/instagram-emotion-and-meaning/SKILL.md +52 -0
- package/templates/community/instagram-emotion-and-meaning/source.json +9 -0
- package/templates/community/instagram-emotion-and-meaning/template.json +56 -0
- package/templates/community/instagram-everyday-interface-story/README.md +12 -0
- package/templates/community/instagram-everyday-interface-story/SKILL.md +53 -0
- package/templates/community/instagram-everyday-interface-story/source.json +9 -0
- package/templates/community/instagram-everyday-interface-story/template.json +51 -0
- package/templates/community/instagram-everyday-photo-diary/README.md +16 -0
- package/templates/community/instagram-everyday-photo-diary/SKILL.md +52 -0
- package/templates/community/instagram-everyday-photo-diary/source.json +9 -0
- package/templates/community/instagram-everyday-photo-diary/template.json +61 -0
- package/templates/community/instagram-evidence-to-method/README.md +13 -0
- package/templates/community/instagram-evidence-to-method/SKILL.md +53 -0
- package/templates/community/instagram-evidence-to-method/source.json +9 -0
- package/templates/community/instagram-evidence-to-method/template.json +56 -0
- package/templates/community/instagram-expectation-reality-review/README.md +18 -0
- package/templates/community/instagram-expectation-reality-review/SKILL.md +53 -0
- package/templates/community/instagram-expectation-reality-review/source.json +9 -0
- package/templates/community/instagram-expectation-reality-review/template.json +57 -0
- package/templates/community/instagram-experiment-story/README.md +20 -0
- package/templates/community/instagram-experiment-story/SKILL.md +54 -0
- package/templates/community/instagram-experiment-story/source.json +9 -0
- package/templates/community/instagram-experiment-story/template.json +58 -0
- package/templates/community/instagram-fill-in-speech/README.md +14 -0
- package/templates/community/instagram-fill-in-speech/SKILL.md +53 -0
- package/templates/community/instagram-fill-in-speech/source.json +9 -0
- package/templates/community/instagram-fill-in-speech/template.json +53 -0
- package/templates/community/instagram-fill-in-workbook/README.md +16 -0
- package/templates/community/instagram-fill-in-workbook/SKILL.md +53 -0
- package/templates/community/instagram-fill-in-workbook/source.json +9 -0
- package/templates/community/instagram-fill-in-workbook/template.json +57 -0
- package/templates/community/instagram-font-pairing/README.md +14 -0
- package/templates/community/instagram-font-pairing/SKILL.md +52 -0
- package/templates/community/instagram-font-pairing/source.json +9 -0
- package/templates/community/instagram-font-pairing/template.json +53 -0
- package/templates/community/instagram-goal-benchmarks/README.md +12 -0
- package/templates/community/instagram-goal-benchmarks/SKILL.md +53 -0
- package/templates/community/instagram-goal-benchmarks/source.json +9 -0
- package/templates/community/instagram-goal-benchmarks/template.json +51 -0
- package/templates/community/instagram-identity-match/README.md +19 -0
- package/templates/community/instagram-identity-match/SKILL.md +52 -0
- package/templates/community/instagram-identity-match/source.json +9 -0
- package/templates/community/instagram-identity-match/template.json +64 -0
- package/templates/community/instagram-illustrated-opinion/README.md +16 -0
- package/templates/community/instagram-illustrated-opinion/SKILL.md +52 -0
- package/templates/community/instagram-illustrated-opinion/source.json +9 -0
- package/templates/community/instagram-illustrated-opinion/template.json +56 -0
- package/templates/community/instagram-illustrated-story-explainer/README.md +14 -0
- package/templates/community/instagram-illustrated-story-explainer/SKILL.md +53 -0
- package/templates/community/instagram-illustrated-story-explainer/source.json +9 -0
- package/templates/community/instagram-illustrated-story-explainer/template.json +55 -0
- package/templates/community/instagram-image-to-palette/README.md +17 -0
- package/templates/community/instagram-image-to-palette/SKILL.md +53 -0
- package/templates/community/instagram-image-to-palette/source.json +9 -0
- package/templates/community/instagram-image-to-palette/template.json +58 -0
- package/templates/community/instagram-incremental-assembly/README.md +15 -0
- package/templates/community/instagram-incremental-assembly/SKILL.md +52 -0
- package/templates/community/instagram-incremental-assembly/source.json +9 -0
- package/templates/community/instagram-incremental-assembly/template.json +55 -0
- package/templates/community/instagram-interview-storyboard/README.md +25 -0
- package/templates/community/instagram-interview-storyboard/SKILL.md +53 -0
- package/templates/community/instagram-interview-storyboard/source.json +9 -0
- package/templates/community/instagram-interview-storyboard/template.json +65 -0
- package/templates/community/instagram-launch-news/README.md +9 -0
- package/templates/community/instagram-launch-news/SKILL.md +53 -0
- package/templates/community/instagram-launch-news/source.json +9 -0
- package/templates/community/instagram-launch-news/template.json +55 -0
- package/templates/community/instagram-layout-anatomy/README.md +12 -0
- package/templates/community/instagram-layout-anatomy/SKILL.md +53 -0
- package/templates/community/instagram-layout-anatomy/source.json +9 -0
- package/templates/community/instagram-layout-anatomy/template.json +54 -0
- package/templates/community/instagram-learning-path/README.md +14 -0
- package/templates/community/instagram-learning-path/SKILL.md +53 -0
- package/templates/community/instagram-learning-path/source.json +9 -0
- package/templates/community/instagram-learning-path/template.json +55 -0
- package/templates/community/instagram-local-picks/README.md +16 -0
- package/templates/community/instagram-local-picks/SKILL.md +52 -0
- package/templates/community/instagram-local-picks/source.json +9 -0
- package/templates/community/instagram-local-picks/template.json +55 -0
- package/templates/community/instagram-matched-test/README.md +10 -0
- package/templates/community/instagram-matched-test/SKILL.md +53 -0
- package/templates/community/instagram-matched-test/source.json +9 -0
- package/templates/community/instagram-matched-test/template.json +49 -0
- package/templates/community/instagram-metric-formulas/README.md +15 -0
- package/templates/community/instagram-metric-formulas/SKILL.md +53 -0
- package/templates/community/instagram-metric-formulas/source.json +9 -0
- package/templates/community/instagram-metric-formulas/template.json +55 -0
- package/templates/community/instagram-milestones-and-feelings/README.md +13 -0
- package/templates/community/instagram-milestones-and-feelings/SKILL.md +52 -0
- package/templates/community/instagram-milestones-and-feelings/source.json +9 -0
- package/templates/community/instagram-milestones-and-feelings/template.json +56 -0
- package/templates/community/instagram-mistakes-and-alternatives/README.md +12 -0
- package/templates/community/instagram-mistakes-and-alternatives/SKILL.md +52 -0
- package/templates/community/instagram-mistakes-and-alternatives/source.json +9 -0
- package/templates/community/instagram-mistakes-and-alternatives/template.json +53 -0
- package/templates/community/instagram-myth-and-fact/README.md +12 -0
- package/templates/community/instagram-myth-and-fact/SKILL.md +53 -0
- package/templates/community/instagram-myth-and-fact/source.json +9 -0
- package/templates/community/instagram-myth-and-fact/template.json +51 -0
- package/templates/community/instagram-news-digest/README.md +13 -0
- package/templates/community/instagram-news-digest/SKILL.md +53 -0
- package/templates/community/instagram-news-digest/source.json +9 -0
- package/templates/community/instagram-news-digest/template.json +52 -0
- package/templates/community/instagram-numbers-at-human-scale/README.md +12 -0
- package/templates/community/instagram-numbers-at-human-scale/SKILL.md +53 -0
- package/templates/community/instagram-numbers-at-human-scale/source.json +9 -0
- package/templates/community/instagram-numbers-at-human-scale/template.json +52 -0
- package/templates/community/instagram-object-led-activities/README.md +16 -0
- package/templates/community/instagram-object-led-activities/SKILL.md +53 -0
- package/templates/community/instagram-object-led-activities/source.json +9 -0
- package/templates/community/instagram-object-led-activities/template.json +56 -0
- package/templates/community/instagram-object-name-origins/README.md +11 -0
- package/templates/community/instagram-object-name-origins/SKILL.md +52 -0
- package/templates/community/instagram-object-name-origins/source.json +9 -0
- package/templates/community/instagram-object-name-origins/template.json +52 -0
- package/templates/community/instagram-one-input-many-results/README.md +14 -0
- package/templates/community/instagram-one-input-many-results/SKILL.md +53 -0
- package/templates/community/instagram-one-input-many-results/source.json +9 -0
- package/templates/community/instagram-one-input-many-results/template.json +52 -0
- package/templates/community/instagram-one-variable-comparison/README.md +11 -0
- package/templates/community/instagram-one-variable-comparison/SKILL.md +53 -0
- package/templates/community/instagram-one-variable-comparison/source.json +9 -0
- package/templates/community/instagram-one-variable-comparison/template.json +52 -0
- package/templates/community/instagram-opportunity-guide/README.md +18 -0
- package/templates/community/instagram-opportunity-guide/SKILL.md +53 -0
- package/templates/community/instagram-opportunity-guide/source.json +9 -0
- package/templates/community/instagram-opportunity-guide/template.json +57 -0
- package/templates/community/instagram-palette-application-board/README.md +11 -0
- package/templates/community/instagram-palette-application-board/SKILL.md +52 -0
- package/templates/community/instagram-palette-application-board/source.json +9 -0
- package/templates/community/instagram-palette-application-board/template.json +52 -0
- package/templates/community/instagram-personal-budget-case/README.md +14 -0
- package/templates/community/instagram-personal-budget-case/SKILL.md +53 -0
- package/templates/community/instagram-personal-budget-case/source.json +9 -0
- package/templates/community/instagram-personal-budget-case/template.json +53 -0
- package/templates/community/instagram-personal-experiment/README.md +11 -0
- package/templates/community/instagram-personal-experiment/SKILL.md +53 -0
- package/templates/community/instagram-personal-experiment/source.json +9 -0
- package/templates/community/instagram-personal-experiment/template.json +52 -0
- package/templates/community/instagram-photo-and-technical-sketch/README.md +10 -0
- package/templates/community/instagram-photo-and-technical-sketch/SKILL.md +53 -0
- package/templates/community/instagram-photo-and-technical-sketch/source.json +9 -0
- package/templates/community/instagram-photo-and-technical-sketch/template.json +49 -0
- package/templates/community/instagram-photo-moment-story/README.md +12 -0
- package/templates/community/instagram-photo-moment-story/SKILL.md +53 -0
- package/templates/community/instagram-photo-moment-story/source.json +9 -0
- package/templates/community/instagram-photo-moment-story/template.json +53 -0
- package/templates/community/instagram-product-change/README.md +9 -0
- package/templates/community/instagram-product-change/SKILL.md +53 -0
- package/templates/community/instagram-product-change/source.json +10 -0
- package/templates/community/instagram-product-change/template.json +53 -0
- package/templates/community/instagram-prompt-result-reference/README.md +26 -0
- package/templates/community/instagram-prompt-result-reference/SKILL.md +53 -0
- package/templates/community/instagram-prompt-result-reference/source.json +9 -0
- package/templates/community/instagram-prompt-result-reference/template.json +68 -0
- package/templates/community/instagram-public-follow-up/README.md +15 -0
- package/templates/community/instagram-public-follow-up/SKILL.md +53 -0
- package/templates/community/instagram-public-follow-up/source.json +9 -0
- package/templates/community/instagram-public-follow-up/template.json +54 -0
- package/templates/community/instagram-reader-question-answer/README.md +10 -0
- package/templates/community/instagram-reader-question-answer/SKILL.md +53 -0
- package/templates/community/instagram-reader-question-answer/source.json +9 -0
- package/templates/community/instagram-reader-question-answer/template.json +48 -0
- package/templates/community/instagram-remaining-capacity/README.md +11 -0
- package/templates/community/instagram-remaining-capacity/SKILL.md +52 -0
- package/templates/community/instagram-remaining-capacity/source.json +9 -0
- package/templates/community/instagram-remaining-capacity/template.json +52 -0
- package/templates/community/instagram-research-brief/README.md +16 -0
- package/templates/community/instagram-research-brief/SKILL.md +53 -0
- package/templates/community/instagram-research-brief/source.json +9 -0
- package/templates/community/instagram-research-brief/template.json +54 -0
- package/templates/community/instagram-result-and-recipe/README.md +17 -0
- package/templates/community/instagram-result-and-recipe/SKILL.md +53 -0
- package/templates/community/instagram-result-and-recipe/source.json +9 -0
- package/templates/community/instagram-result-and-recipe/template.json +56 -0
- package/templates/community/instagram-result-to-steps/README.md +13 -0
- package/templates/community/instagram-result-to-steps/SKILL.md +53 -0
- package/templates/community/instagram-result-to-steps/source.json +9 -0
- package/templates/community/instagram-result-to-steps/template.json +51 -0
- package/templates/community/instagram-reverse-instruction/README.md +15 -0
- package/templates/community/instagram-reverse-instruction/SKILL.md +53 -0
- package/templates/community/instagram-reverse-instruction/source.json +9 -0
- package/templates/community/instagram-reverse-instruction/template.json +54 -0
- package/templates/community/instagram-said-and-meant/README.md +9 -0
- package/templates/community/instagram-said-and-meant/SKILL.md +52 -0
- package/templates/community/instagram-said-and-meant/source.json +10 -0
- package/templates/community/instagram-said-and-meant/template.json +46 -0
- package/templates/community/instagram-same-budget-choices/README.md +12 -0
- package/templates/community/instagram-same-budget-choices/SKILL.md +53 -0
- package/templates/community/instagram-same-budget-choices/source.json +9 -0
- package/templates/community/instagram-same-budget-choices/template.json +52 -0
- package/templates/community/instagram-screenshot-walkthrough/README.md +12 -0
- package/templates/community/instagram-screenshot-walkthrough/SKILL.md +53 -0
- package/templates/community/instagram-screenshot-walkthrough/source.json +9 -0
- package/templates/community/instagram-screenshot-walkthrough/template.json +58 -0
- package/templates/community/instagram-searchable-asset-index/README.md +13 -0
- package/templates/community/instagram-searchable-asset-index/SKILL.md +52 -0
- package/templates/community/instagram-searchable-asset-index/source.json +9 -0
- package/templates/community/instagram-searchable-asset-index/template.json +53 -0
- package/templates/community/instagram-similar-concepts/README.md +15 -0
- package/templates/community/instagram-similar-concepts/SKILL.md +52 -0
- package/templates/community/instagram-similar-concepts/source.json +9 -0
- package/templates/community/instagram-similar-concepts/template.json +54 -0
- package/templates/community/instagram-single-event-news/README.md +14 -0
- package/templates/community/instagram-single-event-news/SKILL.md +53 -0
- package/templates/community/instagram-single-event-news/source.json +9 -0
- package/templates/community/instagram-single-event-news/template.json +56 -0
- package/templates/community/instagram-style-assembly/README.md +13 -0
- package/templates/community/instagram-style-assembly/SKILL.md +53 -0
- package/templates/community/instagram-style-assembly/source.json +9 -0
- package/templates/community/instagram-style-assembly/template.json +53 -0
- package/templates/community/instagram-style-choice/README.md +14 -0
- package/templates/community/instagram-style-choice/SKILL.md +53 -0
- package/templates/community/instagram-style-choice/source.json +9 -0
- package/templates/community/instagram-style-choice/template.json +58 -0
- package/templates/community/instagram-symbolism-in-artifact/README.md +9 -0
- package/templates/community/instagram-symbolism-in-artifact/SKILL.md +52 -0
- package/templates/community/instagram-symbolism-in-artifact/source.json +9 -0
- package/templates/community/instagram-symbolism-in-artifact/template.json +47 -0
- package/templates/community/instagram-taste-matched-recommendations/README.md +17 -0
- package/templates/community/instagram-taste-matched-recommendations/SKILL.md +52 -0
- package/templates/community/instagram-taste-matched-recommendations/source.json +9 -0
- package/templates/community/instagram-taste-matched-recommendations/template.json +56 -0
- package/templates/community/instagram-then-now-pairs/README.md +14 -0
- package/templates/community/instagram-then-now-pairs/SKILL.md +52 -0
- package/templates/community/instagram-then-now-pairs/source.json +9 -0
- package/templates/community/instagram-then-now-pairs/template.json +52 -0
- package/templates/community/instagram-timed-action-plan/README.md +15 -0
- package/templates/community/instagram-timed-action-plan/SKILL.md +53 -0
- package/templates/community/instagram-timed-action-plan/source.json +9 -0
- package/templates/community/instagram-timed-action-plan/template.json +60 -0
- package/templates/community/instagram-tools-by-task/README.md +13 -0
- package/templates/community/instagram-tools-by-task/SKILL.md +53 -0
- package/templates/community/instagram-tools-by-task/source.json +9 -0
- package/templates/community/instagram-tools-by-task/template.json +57 -0
- package/templates/community/instagram-two-perspectives/README.md +8 -0
- package/templates/community/instagram-two-perspectives/SKILL.md +52 -0
- package/templates/community/instagram-two-perspectives/source.json +9 -0
- package/templates/community/instagram-two-perspectives/template.json +47 -0
- package/templates/community/instagram-two-views-one-dataset/README.md +8 -0
- package/templates/community/instagram-two-views-one-dataset/SKILL.md +53 -0
- package/templates/community/instagram-two-views-one-dataset/source.json +9 -0
- package/templates/community/instagram-two-views-one-dataset/template.json +51 -0
- package/templates/community/instagram-version-change-audit/README.md +10 -0
- package/templates/community/instagram-version-change-audit/SKILL.md +53 -0
- package/templates/community/instagram-version-change-audit/source.json +9 -0
- package/templates/community/instagram-version-change-audit/template.json +51 -0
- package/templates/community/instagram-visual-analogy/README.md +13 -0
- package/templates/community/instagram-visual-analogy/SKILL.md +53 -0
- package/templates/community/instagram-visual-analogy/source.json +9 -0
- package/templates/community/instagram-visual-analogy/template.json +53 -0
- package/templates/community/instagram-visual-guess/README.md +15 -0
- package/templates/community/instagram-visual-guess/SKILL.md +53 -0
- package/templates/community/instagram-visual-guess/source.json +9 -0
- package/templates/community/instagram-visual-guess/template.json +54 -0
- package/templates/community/instagram-visual-technique-reference/README.md +18 -0
- package/templates/community/instagram-visual-technique-reference/SKILL.md +53 -0
- package/templates/community/instagram-visual-technique-reference/source.json +9 -0
- package/templates/community/instagram-visual-technique-reference/template.json +60 -0
- package/templates/community/instagram-worked-examples/README.md +13 -0
- package/templates/community/instagram-worked-examples/SKILL.md +52 -0
- package/templates/community/instagram-worked-examples/source.json +9 -0
- package/templates/community/instagram-worked-examples/template.json +57 -0
|
@@ -0,0 +1,991 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* popost motion helper: easings, springs, seeded randomness and a set of effects, each a function of the shot's time.
|
|
3
|
+
* Part of the popost Skill. Copyright (c) 2026 CLIPCAT AI LTD. See the Skill's LICENSE.
|
|
4
|
+
*
|
|
5
|
+
* A scene loads it (<script src="../lib/popost-motion.js"></script>, written by
|
|
6
|
+
* `popost video scene library <project> --name motion`) and calls, for example
|
|
7
|
+
* var M = popostMotion;
|
|
8
|
+
* M.bounce('#ball', { at: 0.2, for: 1.6, from: [640, 120], floor: 560, bounces: 3, trail: 4, shadow: true });
|
|
9
|
+
* M.slam('#title', { at: 1.9 });
|
|
10
|
+
* Times are seconds from the start of the shot; positions are CSS pixels of the scene.
|
|
11
|
+
*
|
|
12
|
+
* Everything drawn is a function of the time only: no timers, no clock, no Math.random. The engine calls
|
|
13
|
+
* window.__popostScene.render(seconds, fps) for every frame, in any order; this helper adds itself to that function.
|
|
14
|
+
*
|
|
15
|
+
* Sound cues. Every effect says where a sound belongs: { at, cue, gain, effect } with `at` in seconds of the shot,
|
|
16
|
+
* `cue` one of CUES and `gain` 0..1 (1 the loudest hit of the shot). They are collected in
|
|
17
|
+
* window.__popostScene.cues, sorted by time, and read by `popost video scene cues <project>` without rendering.
|
|
18
|
+
* Pass `cue: false` to an effect to leave its cues out, or `cue: 'pop'` / `gain: 0.5` to change them.
|
|
19
|
+
*
|
|
20
|
+
* The motion rules these effects follow (squash on contact frames only, springs by damping ratio, a flash frame on a
|
|
21
|
+
* slam, titles that land and stay still) are in the Skill's references/video-motion.md, which credits its sources.
|
|
22
|
+
*/
|
|
23
|
+
(function () {
|
|
24
|
+
'use strict';
|
|
25
|
+
var SVG = 'http://www.w3.org/2000/svg';
|
|
26
|
+
/** The cue names the sound side knows. */
|
|
27
|
+
var CUES = ['whoosh', 'swish', 'pop', 'click', 'tick', 'type', 'impact', 'riser', 'shimmer', 'glitch', 'ding', 'rumble', 'draw', 'sparkle'];
|
|
28
|
+
|
|
29
|
+
// ---------------------------------------------------------------------------------------------------------------
|
|
30
|
+
// Numbers
|
|
31
|
+
// ---------------------------------------------------------------------------------------------------------------
|
|
32
|
+
var clamp = function (v, lo, hi) { return v < lo ? lo : v > hi ? hi : v; };
|
|
33
|
+
var clamp01 = function (p) { return p < 0 ? 0 : p > 1 ? 1 : p; };
|
|
34
|
+
var mix = function (a, b, p) { return a + (b - a) * p; };
|
|
35
|
+
/** 0 before t0, 1 after t0 + length, linear between. */
|
|
36
|
+
var progress = function (t, t0, length) { return length > 0 ? clamp01((t - t0) / length) : t >= t0 ? 1 : 0; };
|
|
37
|
+
var num = function (v, fallback) { return typeof v === 'number' && isFinite(v) ? v : fallback; };
|
|
38
|
+
|
|
39
|
+
/** A seeded generator: rng(seed)() is 0..1; the same seed gives the same numbers on every render. */
|
|
40
|
+
var rng = function (seed) {
|
|
41
|
+
var a = (num(seed, 1) * 2654435761) >>> 0;
|
|
42
|
+
var next = function () {
|
|
43
|
+
a = (a + 0x6d2b79f5) >>> 0;
|
|
44
|
+
var t = a;
|
|
45
|
+
t = Math.imul(t ^ (t >>> 15), t | 1);
|
|
46
|
+
t ^= t + Math.imul(t ^ (t >>> 7), t | 61);
|
|
47
|
+
return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
|
|
48
|
+
};
|
|
49
|
+
next.range = function (lo, hi) { return lo + (hi - lo) * next(); };
|
|
50
|
+
next.int = function (n) { return Math.floor(next() * n); };
|
|
51
|
+
next.pick = function (list) { return list[Math.floor(next() * list.length)]; };
|
|
52
|
+
next.sign = function () { return next() < 0.5 ? -1 : 1; };
|
|
53
|
+
return next;
|
|
54
|
+
};
|
|
55
|
+
/** A number 0..1 for an integer and a seed, with no state. */
|
|
56
|
+
var hash = function (i, seed) {
|
|
57
|
+
var t = (Math.imul(i | 0, 374761393) + Math.imul(num(seed, 1) | 0, 668265263)) >>> 0;
|
|
58
|
+
t = Math.imul(t ^ (t >>> 13), 1274126177) >>> 0;
|
|
59
|
+
return ((t ^ (t >>> 16)) >>> 0) / 4294967296;
|
|
60
|
+
};
|
|
61
|
+
/** Smooth noise of one number, -1..1: the same x and seed give the same value. */
|
|
62
|
+
var noise = function (x, seed) {
|
|
63
|
+
var i = Math.floor(x), f = x - i, u = f * f * (3 - 2 * f);
|
|
64
|
+
return mix(hash(i, seed), hash(i + 1, seed), u) * 2 - 1;
|
|
65
|
+
};
|
|
66
|
+
var noise2 = function (x, y, seed) {
|
|
67
|
+
var xi = Math.floor(x), yi = Math.floor(y), xf = x - xi, yf = y - yi;
|
|
68
|
+
var u = xf * xf * (3 - 2 * xf), v = yf * yf * (3 - 2 * yf);
|
|
69
|
+
var h = function (a, b) { return hash(a * 157 + b * 311, seed); };
|
|
70
|
+
return mix(mix(h(xi, yi), h(xi + 1, yi), u), mix(h(xi, yi + 1), h(xi + 1, yi + 1), u), v) * 2 - 1;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
// ---------------------------------------------------------------------------------------------------------------
|
|
74
|
+
// Easings: functions of 0..1. ease('power2.out'), ease('back.out(1.7)'), ease('spring(0.5,130)'), ease('steps(6)').
|
|
75
|
+
// ---------------------------------------------------------------------------------------------------------------
|
|
76
|
+
/** A spring from 0 to 1: damping is the damping ratio (1 never overshoots, 0.5 overshoots by 16%, 0.2 rings),
|
|
77
|
+
* stiffness the spring constant with mass 1 and the time in units of the tween's length. */
|
|
78
|
+
var spring = function (damping, stiffness) {
|
|
79
|
+
var z = Math.max(0.01, num(damping, 0.6)), w = Math.sqrt(Math.max(1e-6, num(stiffness, 130)));
|
|
80
|
+
return function (u) {
|
|
81
|
+
if (u <= 0) return 0;
|
|
82
|
+
if (z < 1) {
|
|
83
|
+
var wd = w * Math.sqrt(1 - z * z);
|
|
84
|
+
return 1 - Math.exp(-z * w * u) * (Math.cos(wd * u) + ((z * w) / wd) * Math.sin(wd * u));
|
|
85
|
+
}
|
|
86
|
+
return 1 - Math.exp(-w * u) * (1 + w * u);
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
var bounceOut = function (u) {
|
|
90
|
+
var n = 7.5625, d = 2.75, v;
|
|
91
|
+
if (u < 1 / d) return n * u * u;
|
|
92
|
+
if (u < 2 / d) { v = u - 1.5 / d; return n * v * v + 0.75; }
|
|
93
|
+
if (u < 2.5 / d) { v = u - 2.25 / d; return n * v * v + 0.9375; }
|
|
94
|
+
v = u - 2.625 / d;
|
|
95
|
+
return n * v * v + 0.984375;
|
|
96
|
+
};
|
|
97
|
+
var inOut = function (fin) { return function (u) { return u < 0.5 ? fin(2 * u) / 2 : 1 - fin(2 - 2 * u) / 2; }; };
|
|
98
|
+
var outOf = function (fin) { return function (u) { return 1 - fin(1 - u); }; };
|
|
99
|
+
var BASE = {
|
|
100
|
+
sine: function (u) { return 1 - Math.cos((u * Math.PI) / 2); },
|
|
101
|
+
expo: function (u) { return u <= 0 ? 0 : Math.pow(2, 10 * u - 10); },
|
|
102
|
+
circ: function (u) { return 1 - Math.sqrt(1 - Math.min(1, u * u)); }
|
|
103
|
+
};
|
|
104
|
+
var easeCache = {};
|
|
105
|
+
var buildEase = function (name) {
|
|
106
|
+
var n = String(name).replace(/\s+/g, '');
|
|
107
|
+
if (n === 'linear' || n === 'none') return function (u) { return u; };
|
|
108
|
+
if (n === 'in') n = 'power2.in'; if (n === 'out') n = 'power2.out'; if (n === 'in-out' || n === 'inOut') n = 'power2.inOut';
|
|
109
|
+
var m = /^([a-z]+)(\d)?(?:\.(in|out|inOut))?(?:\(([^)]*)\))?$/.exec(n);
|
|
110
|
+
if (!m) return null;
|
|
111
|
+
var family = m[1], k = m[2] ? Number(m[2]) : 0, dir = m[3] || 'out';
|
|
112
|
+
var args = m[4] ? m[4].split(',').map(Number) : [];
|
|
113
|
+
var fin;
|
|
114
|
+
if (family === 'power') fin = function (u) { return Math.pow(u, k + 1); };
|
|
115
|
+
else if (BASE[family]) fin = BASE[family];
|
|
116
|
+
else if (family === 'back') { var s = num(args[0], 1.70158); fin = function (u) { return u * u * ((s + 1) * u - s); }; }
|
|
117
|
+
else if (family === 'elastic') {
|
|
118
|
+
var p = num(args[1], 0.3);
|
|
119
|
+
var eo = function (u) { return u <= 0 ? 0 : u >= 1 ? 1 : Math.pow(2, -10 * u) * Math.sin(((u - p / 4) * 2 * Math.PI) / p) + 1; };
|
|
120
|
+
return dir === 'in' ? outOf(eo) : dir === 'inOut' ? inOut(outOf(eo)) : eo;
|
|
121
|
+
} else if (family === 'bounce') return dir === 'in' ? outOf(bounceOut) : dir === 'inOut' ? inOut(outOf(bounceOut)) : bounceOut;
|
|
122
|
+
else if (family === 'spring') return spring(args[0], args[1]);
|
|
123
|
+
else if (family === 'steps') { var st = Math.max(1, Math.round(num(args[0], 6))); return function (u) { return Math.min(1, Math.floor(u * st + 1e-9) / st); }; }
|
|
124
|
+
else return null;
|
|
125
|
+
return dir === 'in' ? fin : dir === 'inOut' ? inOut(fin) : outOf(fin);
|
|
126
|
+
};
|
|
127
|
+
/** The easing of a name (or a function, returned as it is). An unknown name is power2.out, and is reported once. */
|
|
128
|
+
var ease = function (name) {
|
|
129
|
+
if (typeof name === 'function') return name;
|
|
130
|
+
var key = name === undefined ? 'power2.out' : String(name);
|
|
131
|
+
if (!easeCache[key]) {
|
|
132
|
+
var f = buildEase(key);
|
|
133
|
+
if (!f) { problems.push('There is no ease named "' + key + '"; power2.out is used. Names: linear, power1-4 / sine / expo / circ / back(s) / elastic(1,p) / bounce with .in .out .inOut, steps(n), spring(damping,stiffness).'); f = buildEase('power2.out'); }
|
|
134
|
+
easeCache[key] = f;
|
|
135
|
+
}
|
|
136
|
+
return easeCache[key];
|
|
137
|
+
};
|
|
138
|
+
/** Stepped time, "on twos": the time held for `hold` frames at a time (2 by default), as hand-drawn animation is. */
|
|
139
|
+
var stepped = function (seconds, fps, hold) { var h = Math.max(1, hold || 2) / (fps || 30); return Math.floor(seconds / h + 1e-9) * h; };
|
|
140
|
+
|
|
141
|
+
// ---------------------------------------------------------------------------------------------------------------
|
|
142
|
+
// The scene: one render function for the engine, and the list of sound cues.
|
|
143
|
+
// ---------------------------------------------------------------------------------------------------------------
|
|
144
|
+
var problems = [];
|
|
145
|
+
var drawers = [];
|
|
146
|
+
var layers = [];
|
|
147
|
+
var scene = (window.__popostScene = window.__popostScene || {});
|
|
148
|
+
if (!Array.isArray(scene.cues)) scene.cues = [];
|
|
149
|
+
var before = scene.render;
|
|
150
|
+
var state = { seconds: 0, fps: 30 };
|
|
151
|
+
var pending = [];
|
|
152
|
+
/** Whether the page is laid out. A scene of a later shot loads in a layer that is not displayed: everything measures 0 until its first frame. */
|
|
153
|
+
var shown = function () { return document.documentElement.clientWidth > 0 && document.documentElement.clientHeight > 0; };
|
|
154
|
+
/**
|
|
155
|
+
* Runs a set-up that measures the page (an element's size, a path's length) now when the page is laid out, else on
|
|
156
|
+
* the first frame that shows it. Use it in a scene for anything that reads sizes: M.whenShown(function () { ... }).
|
|
157
|
+
*/
|
|
158
|
+
var whenShown = function (setup) { if (shown() && !pending.length) setup(); else pending.push(setup); };
|
|
159
|
+
scene.render = function (seconds, fps) {
|
|
160
|
+
state.seconds = seconds; state.fps = fps || 30;
|
|
161
|
+
if (before) before(seconds, fps);
|
|
162
|
+
var i;
|
|
163
|
+
if (pending.length && shown()) { var run = pending; pending = []; for (i = 0; i < run.length; i++) run[i](); }
|
|
164
|
+
for (i = 0; i < layers.length; i++) fitLayer(layers[i]);
|
|
165
|
+
for (i = 0; i < drawers.length; i++) drawers[i](seconds, state.fps);
|
|
166
|
+
};
|
|
167
|
+
/** Adds a function drawn on every frame: draw(seconds, fps). Everything it sets must follow from `seconds`. */
|
|
168
|
+
var on = function (draw) { drawers.push(draw); if (shown()) draw(state.seconds, state.fps); return draw; };
|
|
169
|
+
var r3 = function (v) { return Math.round(v * 1000) / 1000; };
|
|
170
|
+
/** Adds a sound cue of the shot. */
|
|
171
|
+
var cue = function (at, name, gain, effect) {
|
|
172
|
+
if (CUES.indexOf(name) < 0) problems.push('There is no cue named "' + name + '". Names: ' + CUES.join(', ') + '.');
|
|
173
|
+
scene.cues.push({ at: r3(Math.max(0, at)), cue: name, gain: r3(clamp01(num(gain, 0.7))), effect: effect || 'custom' });
|
|
174
|
+
scene.cues.sort(function (a, b) { return a.at - b.at; });
|
|
175
|
+
};
|
|
176
|
+
/** The cues an effect declares, unless its options say otherwise: o.cue false leaves them out, a name replaces the first one's. */
|
|
177
|
+
var declare = function (o, effect, list) {
|
|
178
|
+
if (o && o.cue === false) return [];
|
|
179
|
+
var out = list.map(function (c, i) {
|
|
180
|
+
return { at: c[0], cue: i === 0 && o && typeof o.cue === 'string' ? o.cue : c[1], gain: clamp01(c[2] * num(o && o.gain, 1)) };
|
|
181
|
+
});
|
|
182
|
+
out.forEach(function (c) { cue(c.at, c.cue, c.gain, effect); });
|
|
183
|
+
return out;
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
// ---------------------------------------------------------------------------------------------------------------
|
|
187
|
+
// Elements
|
|
188
|
+
// ---------------------------------------------------------------------------------------------------------------
|
|
189
|
+
var one = function (target) {
|
|
190
|
+
var e = typeof target === 'string' ? document.querySelector(target) : target;
|
|
191
|
+
if (!e) problems.push('No element matches "' + target + '".');
|
|
192
|
+
return e;
|
|
193
|
+
};
|
|
194
|
+
var all = function (target) {
|
|
195
|
+
if (typeof target === 'string') return Array.prototype.slice.call(document.querySelectorAll(target));
|
|
196
|
+
if (target && typeof target.length === 'number' && !target.tagName) return Array.prototype.slice.call(target);
|
|
197
|
+
return target ? [target] : [];
|
|
198
|
+
};
|
|
199
|
+
var make = function (tag, css, parent, ns) {
|
|
200
|
+
var e = ns ? document.createElementNS(SVG, tag) : document.createElement(tag);
|
|
201
|
+
if (css) e.setAttribute('style', css);
|
|
202
|
+
(parent || document.body).appendChild(e);
|
|
203
|
+
return e;
|
|
204
|
+
};
|
|
205
|
+
var px = function (n) { return Math.round(n * 100) / 100 + 'px'; };
|
|
206
|
+
/**
|
|
207
|
+
* A copy of an element for a trail or a split, put before it. The copy has no id (an id is one element's), so what
|
|
208
|
+
* the page's CSS gives the element by its id is written onto the copy.
|
|
209
|
+
*/
|
|
210
|
+
var LOOK = ['width', 'height', 'borderRadius', 'background', 'color', 'font', 'letterSpacing', 'textAlign', 'lineHeight', 'border', 'boxShadow', 'textShadow', 'padding', 'position', 'left', 'top', 'margin', 'display', 'transformOrigin'];
|
|
211
|
+
var ghostOf = function (el) {
|
|
212
|
+
var g = el.cloneNode(true), cs = getComputedStyle(el);
|
|
213
|
+
g.removeAttribute('id'); g.removeAttribute('data-slot');
|
|
214
|
+
LOOK.forEach(function (k) { g.style[k] = cs[k]; });
|
|
215
|
+
g.style.pointerEvents = 'none';
|
|
216
|
+
el.parentNode.insertBefore(g, el);
|
|
217
|
+
return g;
|
|
218
|
+
};
|
|
219
|
+
/**
|
|
220
|
+
* Sets what an effect moves on an element: { x, y, scale, scaleX, scaleY, rotate (degrees), skewX, opacity, blur
|
|
221
|
+
* (pixels) }. Several effects on one element are combined: each writes under its own key, and the element gets all.
|
|
222
|
+
*/
|
|
223
|
+
var parts = new WeakMap();
|
|
224
|
+
var put = function (el, key, s) {
|
|
225
|
+
if (!el) return;
|
|
226
|
+
var mine = parts.get(el);
|
|
227
|
+
if (!mine) { mine = { keys: [], by: {}, base: el.style.transform || '' }; parts.set(el, mine); }
|
|
228
|
+
if (!mine.by[key]) mine.keys.push(key);
|
|
229
|
+
mine.by[key] = s;
|
|
230
|
+
var tf = mine.base, opacity = 1, blur = 0, hasOpacity = false;
|
|
231
|
+
for (var i = 0; i < mine.keys.length; i++) {
|
|
232
|
+
var p = mine.by[mine.keys[i]];
|
|
233
|
+
if (p.x || p.y) tf += ' translate(' + px(p.x || 0) + ',' + px(p.y || 0) + ')';
|
|
234
|
+
if (p.rotate) tf += ' rotate(' + r3(p.rotate) + 'deg)';
|
|
235
|
+
if (p.skewX) tf += ' skewX(' + r3(p.skewX) + 'deg)';
|
|
236
|
+
var sx = num(p.scaleX, 1) * num(p.scale, 1), sy = num(p.scaleY, 1) * num(p.scale, 1);
|
|
237
|
+
if (sx !== 1 || sy !== 1) tf += ' scale(' + r3(sx) + ',' + r3(sy) + ')';
|
|
238
|
+
if (p.opacity !== undefined) { opacity *= p.opacity; hasOpacity = true; }
|
|
239
|
+
if (p.blur) blur += p.blur;
|
|
240
|
+
}
|
|
241
|
+
el.style.transform = tf.trim() || 'none';
|
|
242
|
+
if (hasOpacity) el.style.opacity = r3(clamp01(opacity));
|
|
243
|
+
el.style.filter = blur > 0.05 ? 'blur(' + px(blur) + ')' : '';
|
|
244
|
+
};
|
|
245
|
+
var keyCount = 0;
|
|
246
|
+
var newKey = function (name) { keyCount++; return name + keyCount; };
|
|
247
|
+
|
|
248
|
+
/** A canvas over (or, with under, behind) an element (the body by default) that the particle effects draw on; cleared on every frame. */
|
|
249
|
+
var layer = function (parent, under) {
|
|
250
|
+
var host = parent ? one(parent) : document.body;
|
|
251
|
+
for (var i = 0; i < layers.length; i++) if (layers[i].host === host && layers[i].under === !!under) return layers[i];
|
|
252
|
+
var canvas = make('canvas', 'position:absolute;left:0;top:0;pointer-events:none;', host);
|
|
253
|
+
// under: behind everything else of the host (a ground of rays or streaks), instead of over it.
|
|
254
|
+
if (under && host.firstChild !== canvas) host.insertBefore(canvas, host.firstChild);
|
|
255
|
+
var l = { host: host, under: !!under, canvas: canvas, ctx: canvas.getContext('2d'), width: 0, height: 0 };
|
|
256
|
+
layers.push(l);
|
|
257
|
+
fitLayer(l);
|
|
258
|
+
return l;
|
|
259
|
+
};
|
|
260
|
+
/** Gives a layer the size of its host (known only once the page is laid out) and clears it for the frame. */
|
|
261
|
+
var fitLayer = function (l) {
|
|
262
|
+
var w = l.host === document.body ? window.innerWidth : l.host.clientWidth, h = l.host === document.body ? window.innerHeight : l.host.clientHeight;
|
|
263
|
+
if (w > 0 && h > 0 && (l.width !== w || l.height !== h)) { l.width = l.canvas.width = w; l.height = l.canvas.height = h; l.canvas.style.width = w + 'px'; l.canvas.style.height = h + 'px'; }
|
|
264
|
+
else l.ctx.clearRect(0, 0, l.canvas.width, l.canvas.height);
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
// ---------------------------------------------------------------------------------------------------------------
|
|
268
|
+
// A generic tween: M.tween('#card', { at: 0.4, for: 0.6, ease: 'expo.out', from: { x: -400, opacity: 0 }, to: { x: 0, opacity: 1 } })
|
|
269
|
+
// ---------------------------------------------------------------------------------------------------------------
|
|
270
|
+
var KEYS = ['x', 'y', 'scale', 'scaleX', 'scaleY', 'rotate', 'skewX', 'opacity', 'blur'];
|
|
271
|
+
var REST = { x: 0, y: 0, scale: 1, scaleX: 1, scaleY: 1, rotate: 0, skewX: 0, opacity: 1, blur: 0 };
|
|
272
|
+
var between = function (from, to, p) {
|
|
273
|
+
var s = {};
|
|
274
|
+
KEYS.forEach(function (k) {
|
|
275
|
+
if (from[k] === undefined && to[k] === undefined) return;
|
|
276
|
+
s[k] = mix(num(from[k], REST[k]), num(to[k], REST[k]), p);
|
|
277
|
+
});
|
|
278
|
+
return s;
|
|
279
|
+
};
|
|
280
|
+
var tween = function (target, o) {
|
|
281
|
+
o = o || {};
|
|
282
|
+
var els = all(target), e = ease(o.ease), at = num(o.at, 0), len = num(o['for'], 0.5), from = o.from || {}, to = o.to || {}, key = newKey('tween');
|
|
283
|
+
on(function (t) {
|
|
284
|
+
// Opacity and blur never overshoot: a spring past its end would flash.
|
|
285
|
+
var raw = progress(t, at, len), p = e(raw), flat = clamp01(p);
|
|
286
|
+
var s = between(from, to, p);
|
|
287
|
+
if (s.opacity !== undefined) s.opacity = mix(num(from.opacity, 1), num(to.opacity, 1), flat);
|
|
288
|
+
if (s.blur !== undefined) s.blur = Math.max(0, mix(num(from.blur, 0), num(to.blur, 0), flat));
|
|
289
|
+
els.forEach(function (el) { put(el, key, s); });
|
|
290
|
+
});
|
|
291
|
+
return { at: at, end: at + len, cues: o.cue ? declare(o, 'tween', [[at, typeof o.cue === 'string' ? o.cue : 'swish', 0.5]]) : [] };
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
// ---------------------------------------------------------------------------------------------------------------
|
|
295
|
+
// Entrances
|
|
296
|
+
// ---------------------------------------------------------------------------------------------------------------
|
|
297
|
+
/** A spring pop: scale from `from` (0 by default) to 1 on a spring, opacity in the first fifth. Cue: pop. */
|
|
298
|
+
var pop = function (target, o) {
|
|
299
|
+
o = o || {};
|
|
300
|
+
var els = all(target), at = num(o.at, 0), len = num(o['for'], 0.5), from = num(o.from, 0), sp = spring(num(o.damping, 0.5), num(o.stiffness, 180)), key = newKey('pop');
|
|
301
|
+
on(function (t) {
|
|
302
|
+
var u = progress(t, at, len), s = t < at ? from : mix(from, 1, sp(u));
|
|
303
|
+
els.forEach(function (el) { put(el, key, { scale: s, opacity: clamp01(u * 5) }); });
|
|
304
|
+
});
|
|
305
|
+
return { at: at, end: at + len, cues: declare(o, 'pop', [[at + 0.03, 'pop', 0.7]]) };
|
|
306
|
+
};
|
|
307
|
+
/**
|
|
308
|
+
* A slam: the element arrives from large (or from a side) on an accelerating ease, lands, and the frame flashes for
|
|
309
|
+
* a frame or two; the ground can shake. Cues: whoosh at the start, impact on the landing frame.
|
|
310
|
+
*/
|
|
311
|
+
var slam = function (target, o) {
|
|
312
|
+
o = o || {};
|
|
313
|
+
var els = all(target), at = num(o.at, 0), len = num(o['for'], 0.22), from = num(o.from, 3.2), key = newKey('slam'), e = ease(o.ease || 'power3.in');
|
|
314
|
+
var land = at + len, settle = num(o.settle, 0.18), dip = num(o.dip, 0.06);
|
|
315
|
+
var white = o.flash === false ? null : make('div', 'position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;opacity:0;background:' + (o.flashColor || '#ffffff') + ';', o.flashOn ? one(o.flashOn) : document.body);
|
|
316
|
+
on(function (t, fps) {
|
|
317
|
+
var p = e(progress(t, at, len));
|
|
318
|
+
// After the landing: a small dip below 1 and back, never a second bounce.
|
|
319
|
+
var after = t > land ? Math.sin(Math.PI * clamp01((t - land) / settle)) * dip * (1 - clamp01((t - land) / settle)) : 0;
|
|
320
|
+
var s = { scale: mix(from, 1, p) - after, opacity: clamp01(progress(t, at, len * 0.4)), blur: (1 - p) * num(o.blur, 6), x: mix(num(o.x, 0), 0, p), y: mix(num(o.y, 0), 0, p) };
|
|
321
|
+
els.forEach(function (el) { put(el, key, s); });
|
|
322
|
+
if (white) { var frames = (t - land) * fps; white.style.opacity = frames >= -0.5 && frames < num(o.flashFrames, 2) - 0.5 ? String(num(o.flashOpacity, 0.85) * (frames < 0.5 ? 1 : 0.45)) : '0'; }
|
|
323
|
+
});
|
|
324
|
+
if (o.shake) shake(o.shake === true ? document.body : o.shake, { at: land, 'for': 0.3, amount: num(o.shakeAmount, 10), cue: false });
|
|
325
|
+
return { at: at, end: land + settle, land: land, cues: declare(o, 'slam', [[land, 'impact', 1], [at, 'whoosh', 0.5]]) };
|
|
326
|
+
};
|
|
327
|
+
/**
|
|
328
|
+
* The offsets of a staggered group. order: 'start', 'end', 'center', 'edges', 'random' (seeded) or, with cols, the
|
|
329
|
+
* grid orders 'diagonal', 'rows', 'columns', 'radial'. Returns seconds for each index.
|
|
330
|
+
*/
|
|
331
|
+
var offsets = function (n, each, order, o) {
|
|
332
|
+
o = o || {};
|
|
333
|
+
var rank = [], i, cols = o.cols, r = rng(num(o.seed, 7));
|
|
334
|
+
for (i = 0; i < n; i++) {
|
|
335
|
+
var col = cols ? i % cols : i, row = cols ? Math.floor(i / cols) : 0, rows = cols ? Math.ceil(n / cols) : 1;
|
|
336
|
+
if (order === 'end') rank.push(n - 1 - i);
|
|
337
|
+
else if (order === 'center') rank.push(Math.abs(i - (n - 1) / 2));
|
|
338
|
+
else if (order === 'edges') rank.push((n - 1) / 2 - Math.abs(i - (n - 1) / 2));
|
|
339
|
+
else if (order === 'random') rank.push(r() * n);
|
|
340
|
+
else if (order === 'diagonal') rank.push(col + row);
|
|
341
|
+
else if (order === 'columns') rank.push(col);
|
|
342
|
+
else if (order === 'rows') rank.push(row);
|
|
343
|
+
else if (order === 'radial') rank.push(Math.hypot(col - (cols - 1) / 2, row - (rows - 1) / 2));
|
|
344
|
+
else rank.push(i);
|
|
345
|
+
}
|
|
346
|
+
var lo = Math.min.apply(null, rank);
|
|
347
|
+
return rank.map(function (v) { return (v - lo) * each; });
|
|
348
|
+
};
|
|
349
|
+
var ENTER = {
|
|
350
|
+
rise: { from: { y: 28, opacity: 0 }, ease: 'power3.out', len: 0.45 },
|
|
351
|
+
drop: { from: { y: -28, opacity: 0 }, ease: 'power3.out', len: 0.45 },
|
|
352
|
+
fade: { from: { opacity: 0 }, ease: 'power1.out', len: 0.3 },
|
|
353
|
+
blur: { from: { opacity: 0, blur: 8 }, ease: 'power2.out', len: 0.3 },
|
|
354
|
+
scale: { from: { scale: 0.6, opacity: 0 }, ease: 'back.out(1.6)', len: 0.4 },
|
|
355
|
+
left: { from: { x: -60, opacity: 0 }, ease: 'expo.out', len: 0.5 },
|
|
356
|
+
right: { from: { x: 60, opacity: 0 }, ease: 'expo.out', len: 0.5 },
|
|
357
|
+
turn: { from: { rotate: -12, y: 20, opacity: 0 }, ease: 'back.out(1.4)', len: 0.45 }
|
|
358
|
+
};
|
|
359
|
+
/**
|
|
360
|
+
* One entrance for each element of a group, one after another: M.stagger('.row', { at: 0.4, each: 0.07, enter:
|
|
361
|
+
* 'rise' }). enter: a name of ENTER, 'pop', or a function (element, seconds, index) that starts an effect. Cues: a
|
|
362
|
+
* tick for each element, quieter than a hit.
|
|
363
|
+
*/
|
|
364
|
+
var stagger = function (target, o) {
|
|
365
|
+
o = o || {};
|
|
366
|
+
var els = all(target), at = num(o.at, 0), each = num(o.each, 0.06), offs = offsets(els.length, each, o.order || 'start', o);
|
|
367
|
+
var kind = o.enter || 'rise', end = at, list = [];
|
|
368
|
+
els.forEach(function (el, i) {
|
|
369
|
+
var t0 = at + offs[i];
|
|
370
|
+
if (typeof kind === 'function') kind(el, t0, i);
|
|
371
|
+
else if (kind === 'pop') pop(el, { at: t0, 'for': num(o['for'], 0.45), cue: false });
|
|
372
|
+
else {
|
|
373
|
+
var e = ENTER[kind] || ENTER.rise;
|
|
374
|
+
tween(el, { at: t0, 'for': num(o['for'], e.len), ease: o.ease || e.ease, from: o.from || e.from, to: {} });
|
|
375
|
+
}
|
|
376
|
+
end = Math.max(end, t0 + num(o['for'], 0.45));
|
|
377
|
+
// A cue for every element up to eight; a longer list gets every other one, so that it does not rattle.
|
|
378
|
+
if (els.length <= 8 || i % Math.ceil(els.length / 8) === 0) list.push([t0, o.sound || 'tick', 0.35]);
|
|
379
|
+
});
|
|
380
|
+
return { at: at, end: end, offsets: offs, cues: declare(o, 'stagger', list) };
|
|
381
|
+
};
|
|
382
|
+
/** A grid of elements revealed in an order: M.gridReveal('.cell', { cols: 4, order: 'diagonal', at: 0.2 }). Cue: swish. */
|
|
383
|
+
var gridReveal = function (target, o) {
|
|
384
|
+
o = o || {};
|
|
385
|
+
var r = stagger(target, { at: o.at, each: num(o.each, 0.05), order: o.order || 'diagonal', cols: o.cols || 4, enter: o.enter || 'scale', seed: o.seed, 'for': o['for'], cue: false });
|
|
386
|
+
r.cues = declare(o, 'gridReveal', [[num(o.at, 0), 'swish', 0.5]]);
|
|
387
|
+
return r;
|
|
388
|
+
};
|
|
389
|
+
|
|
390
|
+
// ---------------------------------------------------------------------------------------------------------------
|
|
391
|
+
// Text
|
|
392
|
+
// ---------------------------------------------------------------------------------------------------------------
|
|
393
|
+
/** Splits an element's text into spans, by 'chars', 'words' or 'lines' (lines: by <br> or \n). Returns the spans. */
|
|
394
|
+
var split = function (target, by) {
|
|
395
|
+
var el = one(target);
|
|
396
|
+
if (!el) return [];
|
|
397
|
+
if (el.__popostSplit && el.__popostSplit.by === by) return el.__popostSplit.spans;
|
|
398
|
+
var text = el.textContent || '', spans = [];
|
|
399
|
+
var piece = function (t, parent) { var s = document.createElement('span'); s.textContent = t; s.style.display = 'inline-block'; s.style.whiteSpace = 'pre'; parent.appendChild(s); spans.push(s); return s; };
|
|
400
|
+
el.textContent = '';
|
|
401
|
+
if (by === 'lines') text.split(/\n/).forEach(function (line) { var s = piece(line, el); s.style.display = 'block'; });
|
|
402
|
+
else text.split(/(\s+)/).forEach(function (word) {
|
|
403
|
+
if (!word) return;
|
|
404
|
+
if (/^\s+$/.test(word)) { el.appendChild(document.createTextNode(word)); return; }
|
|
405
|
+
if (by === 'words') { piece(word, el); return; }
|
|
406
|
+
// Characters stay inside a span of their word, so that a line never breaks inside a word.
|
|
407
|
+
var w = document.createElement('span'); w.style.display = 'inline-block'; w.style.whiteSpace = 'nowrap'; el.appendChild(w);
|
|
408
|
+
Array.from(word).forEach(function (ch) { piece(ch, w); });
|
|
409
|
+
});
|
|
410
|
+
el.__popostSplit = { by: by, spans: spans };
|
|
411
|
+
return spans;
|
|
412
|
+
};
|
|
413
|
+
/**
|
|
414
|
+
* Kinetic type: the words (or characters, or lines) of an element enter one after another. enter: 'rise', 'drop',
|
|
415
|
+
* 'blur', 'scale', 'fade', 'pop' or 'slam'. Cues: a tick a word; an impact a word for 'slam'.
|
|
416
|
+
*/
|
|
417
|
+
var kinetic = function (target, o) {
|
|
418
|
+
o = o || {};
|
|
419
|
+
var by = o.by || 'words', spans = split(target, by), enter = o.enter || 'rise';
|
|
420
|
+
var each = num(o.each, by === 'chars' ? 0.03 : by === 'words' ? 0.09 : 0.18);
|
|
421
|
+
if (enter === 'slam') return stagger(spans, { at: o.at, each: Math.max(each, 0.16), order: o.order, sound: 'impact', cue: o.cue, gain: o.gain, enter: function (el, t0) { slam(el, { at: t0, 'for': 0.16, from: 2.4, flash: false, cue: false }); } });
|
|
422
|
+
return stagger(spans, { at: o.at, each: each, order: o.order, enter: enter, 'for': o['for'], ease: o.ease, seed: o.seed, cue: by === 'chars' ? false : o.cue, gain: o.gain });
|
|
423
|
+
};
|
|
424
|
+
/**
|
|
425
|
+
* Types a text: characters appear one by one, with a cursor. for: the seconds the typing takes (or cps: characters
|
|
426
|
+
* a second). Cues: type, one for every third character.
|
|
427
|
+
*/
|
|
428
|
+
var typeOn = function (target, o) {
|
|
429
|
+
o = o || {};
|
|
430
|
+
var el = one(target);
|
|
431
|
+
if (!el) return { at: 0, end: 0, cues: [] };
|
|
432
|
+
var chars = Array.from(o.text !== undefined ? String(o.text) : el.textContent || ''), at = num(o.at, 0);
|
|
433
|
+
var len = o.cps ? chars.length / o.cps : num(o['for'], Math.max(0.3, chars.length * 0.05));
|
|
434
|
+
var cursor = o.cursor === false ? '' : typeof o.cursor === 'string' ? o.cursor : '|', blink = num(o.blink, 0.5);
|
|
435
|
+
on(function (t) {
|
|
436
|
+
var n = t < at ? 0 : Math.min(chars.length, Math.floor(((t - at) / Math.max(1e-6, len)) * chars.length + 1e-9));
|
|
437
|
+
var showCursor = cursor && t >= at && (n < chars.length || (o.cursorStays !== false && Math.floor((t - at - len) / blink) % 2 === 0));
|
|
438
|
+
el.textContent = chars.slice(0, n).join('') + (showCursor ? cursor : '');
|
|
439
|
+
});
|
|
440
|
+
var list = [];
|
|
441
|
+
for (var i = 0; i < chars.length; i += num(o.cueEvery, 3)) list.push([at + (i / Math.max(1, chars.length)) * len, 'type', 0.3]);
|
|
442
|
+
return { at: at, end: at + len, cues: declare(o, 'typeOn', list) };
|
|
443
|
+
};
|
|
444
|
+
/** A text that settles out of changing characters, left to right. Cue: glitch. */
|
|
445
|
+
var scramble = function (target, o) {
|
|
446
|
+
o = o || {};
|
|
447
|
+
var el = one(target);
|
|
448
|
+
if (!el) return { at: 0, end: 0, cues: [] };
|
|
449
|
+
var chars = Array.from(o.text !== undefined ? String(o.text) : el.textContent || ''), at = num(o.at, 0), len = num(o['for'], 0.9);
|
|
450
|
+
var pool = Array.from(o.chars || 'ABCDEFGHJKLMNPQRSTUVWXYZ0123456789#%&*+='), seed = num(o.seed, 3), rate = num(o.rate, 20);
|
|
451
|
+
on(function (t) {
|
|
452
|
+
var p = progress(t, at, len), tick = Math.floor(t * rate);
|
|
453
|
+
el.textContent = chars.map(function (ch, i) {
|
|
454
|
+
if (/\s/.test(ch) || p * chars.length > i + 1 || t >= at + len) return ch;
|
|
455
|
+
return t < at ? (o.hidden === false ? pool[Math.floor(hash(i, seed) * pool.length)] : ' ') : pool[Math.floor(hash(i * 131 + tick, seed) * pool.length)];
|
|
456
|
+
}).join('');
|
|
457
|
+
});
|
|
458
|
+
return { at: at, end: at + len, cues: declare(o, 'scramble', [[at, 'glitch', 0.5]]) };
|
|
459
|
+
};
|
|
460
|
+
/** A number that counts: M.counter('#n', { at: 0.5, for: 1.2, from: 0, to: 12800, separator: ',', prefix: '$' }). Cues: ticks while it runs, a pop when it lands. */
|
|
461
|
+
var counter = function (target, o) {
|
|
462
|
+
o = o || {};
|
|
463
|
+
var el = one(target), at = num(o.at, 0), len = num(o['for'], 1), from = num(o.from, 0), e = ease(o.ease || 'power3.out'), decimals = num(o.decimals, 0);
|
|
464
|
+
var format = function (v) {
|
|
465
|
+
var s = v.toFixed(decimals);
|
|
466
|
+
if (o.separator) { var bits = s.split('.'); bits[0] = bits[0].replace(/\B(?=(\d{3})+(?!\d))/g, o.separator); s = bits.join('.'); }
|
|
467
|
+
return (o.prefix || '') + s + (o.suffix || '');
|
|
468
|
+
};
|
|
469
|
+
on(function (t) {
|
|
470
|
+
if (!el) return;
|
|
471
|
+
// The slot's own text is the target when no "to" is given, read here because slots are filled after the scripts ran.
|
|
472
|
+
var to = o.to !== undefined ? o.to : Number(String(el.getAttribute('data-to') || el.__popostTo || (el.__popostTo = el.textContent)).replace(/[^0-9.-]/g, '')) || 0;
|
|
473
|
+
el.textContent = format(mix(from, to, e(progress(t, at, len))));
|
|
474
|
+
});
|
|
475
|
+
// The pop goes where the shown number stops changing: on an ease-out it reaches its last digit before the end of the
|
|
476
|
+
// count (0 to 12,800 on a long ease-out: a tenth of a second early), and a pop at the end is heard on a still number.
|
|
477
|
+
// The target is the given "to", else the slot's text as it is now (a later fill moves the landing by a frame or so).
|
|
478
|
+
var goal = o.to !== undefined ? o.to : Number(String((el && (el.getAttribute('data-to') || el.textContent)) || '').replace(/[^0-9.-]/g, '')) || 0;
|
|
479
|
+
var land = at + len, step = 0.5 * Math.pow(10, -decimals);
|
|
480
|
+
for (var s = 0; s <= 240; s++) if (Math.abs(goal - mix(from, goal, e(s / 240))) < step) { land = at + (len * s) / 240; break; }
|
|
481
|
+
var list = [[land, 'pop', 0.6]];
|
|
482
|
+
for (var i = 0; i < 6; i++) list.push([at + len * (1 - Math.pow(1 - i / 6, 2)) * 0.9, 'tick', 0.25]);
|
|
483
|
+
return { at: at, end: at + len, cues: declare(o, 'counter', list) };
|
|
484
|
+
};
|
|
485
|
+
|
|
486
|
+
// ---------------------------------------------------------------------------------------------------------------
|
|
487
|
+
// Paths
|
|
488
|
+
// ---------------------------------------------------------------------------------------------------------------
|
|
489
|
+
/**
|
|
490
|
+
* Draws an SVG path on, as a pen would: the stroke grows from its start. tip: an element (or true for a drawn dot)
|
|
491
|
+
* that rides the end of the stroke. Cue: draw.
|
|
492
|
+
*/
|
|
493
|
+
var drawOn = function (target, o) {
|
|
494
|
+
o = o || {};
|
|
495
|
+
var paths = all(target), at = num(o.at, 0), len = num(o['for'], 0.8), e = ease(o.ease || 'power2.inOut'), each = num(o.each, 0);
|
|
496
|
+
var tip = o.tip === true ? null : o.tip ? one(o.tip) : undefined;
|
|
497
|
+
var lengths = [];
|
|
498
|
+
if (o.tip === true && paths[0]) { tip = make('circle', '', paths[0].ownerSVGElement || paths[0].parentNode, true); tip.setAttribute('r', String(num(o.tipSize, 5))); tip.setAttribute('fill', o.tipColor || 'currentColor'); }
|
|
499
|
+
// Hidden until measured: a path's length is known only once the page is laid out.
|
|
500
|
+
paths.forEach(function (p) { p.style.visibility = 'hidden'; });
|
|
501
|
+
whenShown(function () {
|
|
502
|
+
lengths = paths.map(function (p) { return p.getTotalLength ? p.getTotalLength() : 0; });
|
|
503
|
+
paths.forEach(function (p, i) { p.style.strokeDasharray = lengths[i] + ' ' + lengths[i]; p.style.visibility = ''; });
|
|
504
|
+
});
|
|
505
|
+
on(function (t) {
|
|
506
|
+
if (!lengths.length) return;
|
|
507
|
+
var last = null;
|
|
508
|
+
paths.forEach(function (p, i) {
|
|
509
|
+
var u = e(progress(t, at + i * each, len));
|
|
510
|
+
p.style.strokeDashoffset = String(lengths[i] * (1 - u));
|
|
511
|
+
if (u > 0 && u < 1) last = { p: p, d: lengths[i] * u };
|
|
512
|
+
});
|
|
513
|
+
if (!tip) return;
|
|
514
|
+
tip.style.display = last ? '' : 'none';
|
|
515
|
+
if (!last) return;
|
|
516
|
+
var pt = last.p.getPointAtLength(last.d);
|
|
517
|
+
if (tip.namespaceURI === SVG) { tip.setAttribute('cx', String(pt.x)); tip.setAttribute('cy', String(pt.y)); }
|
|
518
|
+
else put(tip, 'tip', { x: pt.x, y: pt.y });
|
|
519
|
+
});
|
|
520
|
+
var end = at + len + each * Math.max(0, paths.length - 1);
|
|
521
|
+
return { at: at, end: end, cues: declare(o, 'drawOn', [[at, 'draw', 0.5]]) };
|
|
522
|
+
};
|
|
523
|
+
/** Points along a path's "d", evenly spaced: for morphing between two shapes with any commands. */
|
|
524
|
+
var samplePath = function (d, n) {
|
|
525
|
+
var svg = make('svg', 'position:absolute;width:0;height:0;visibility:hidden;', document.body, true), p = make('path', '', svg, true);
|
|
526
|
+
p.setAttribute('d', d);
|
|
527
|
+
var len = p.getTotalLength(), pts = [];
|
|
528
|
+
for (var i = 0; i < n; i++) { var q = p.getPointAtLength((i / n) * len); pts.push([q.x, q.y]); }
|
|
529
|
+
svg.parentNode.removeChild(svg);
|
|
530
|
+
return pts;
|
|
531
|
+
};
|
|
532
|
+
/**
|
|
533
|
+
* Morphs a path from one shape to another: both are sampled to the same number of points and each point travels.
|
|
534
|
+
* M.morph('#blob', { to: 'M..Z', at: 1, for: 0.6 }) (from: the path's own d). Closed shapes. Cue: swish.
|
|
535
|
+
*/
|
|
536
|
+
var morph = function (target, o) {
|
|
537
|
+
o = o || {};
|
|
538
|
+
var path = one(target), n = num(o.points, 96), at = num(o.at, 0), len = num(o['for'], 0.6), e = ease(o.ease || 'power2.inOut');
|
|
539
|
+
if (!path) return { at: at, end: at + len, cues: [] };
|
|
540
|
+
// Several morphs of one path make a chain: one drawer for the path takes the latest that has started, so that a
|
|
541
|
+
// frame before the first morph shows the first shape again whichever frame was drawn before it.
|
|
542
|
+
var mine = { at: at, len: len, e: e, a: null, b: null, fromD: o.from || path.getAttribute('d') }, chain = path.__popostMorphs;
|
|
543
|
+
whenShown(function () {
|
|
544
|
+
mine.a = samplePath(mine.fromD, n); mine.b = samplePath(o.to, n);
|
|
545
|
+
// The start point of the second shape is turned to the one nearest the first shape's start: no twist.
|
|
546
|
+
var best = 0, bestD = Infinity;
|
|
547
|
+
for (var i = 0; i < n; i++) { var d = Math.hypot(mine.b[i][0] - mine.a[0][0], mine.b[i][1] - mine.a[0][1]); if (d < bestD) { bestD = d; best = i; } }
|
|
548
|
+
mine.b = mine.b.slice(best).concat(mine.b.slice(0, best));
|
|
549
|
+
});
|
|
550
|
+
if (chain) { chain.push(mine); chain.sort(function (x, y) { return x.at - y.at; }); }
|
|
551
|
+
else {
|
|
552
|
+
chain = path.__popostMorphs = [mine];
|
|
553
|
+
on(function (t) {
|
|
554
|
+
var m = chain[0];
|
|
555
|
+
for (var i = 1; i < chain.length; i++) if (t >= chain[i].at) m = chain[i];
|
|
556
|
+
if (!m.a) return;
|
|
557
|
+
var p = m.e(progress(t, m.at, m.len)), out = '';
|
|
558
|
+
for (var k = 0; k < m.a.length; k++) out += (k ? 'L' : 'M') + r3(mix(m.a[k][0], m.b[k][0], p)) + ' ' + r3(mix(m.a[k][1], m.b[k][1], p));
|
|
559
|
+
path.setAttribute('d', out + 'Z');
|
|
560
|
+
});
|
|
561
|
+
}
|
|
562
|
+
return { at: at, end: at + len, cues: declare(o, 'morph', [[at, 'swish', 0.45]]) };
|
|
563
|
+
};
|
|
564
|
+
/** Moves an element along an SVG path (its centre on the path), turned to the path's direction when rotate is true. Cue: whoosh. */
|
|
565
|
+
var follow = function (target, pathTarget, o) {
|
|
566
|
+
o = o || {};
|
|
567
|
+
var el = one(target), path = one(pathTarget), at = num(o.at, 0), len = num(o['for'], 1), e = ease(o.ease || 'power2.inOut'), key = newKey('follow');
|
|
568
|
+
var total = path && path.getTotalLength ? path.getTotalLength() : 0;
|
|
569
|
+
on(function (t) {
|
|
570
|
+
if (!el || !total) return;
|
|
571
|
+
var d = total * e(progress(t, at, len)), p = path.getPointAtLength(d), q = path.getPointAtLength(Math.min(total, d + 1)), back = path.getPointAtLength(Math.max(0, d - 1));
|
|
572
|
+
put(el, key, { x: p.x, y: p.y, rotate: o.rotate ? (Math.atan2(q.y - back.y, q.x - back.x) * 180) / Math.PI : 0 });
|
|
573
|
+
});
|
|
574
|
+
return { at: at, end: at + len, cues: declare(o, 'follow', [[at, 'whoosh', 0.4]]) };
|
|
575
|
+
};
|
|
576
|
+
|
|
577
|
+
// ---------------------------------------------------------------------------------------------------------------
|
|
578
|
+
// A bouncing thing: parabolic arcs with restitution.
|
|
579
|
+
// ---------------------------------------------------------------------------------------------------------------
|
|
580
|
+
/**
|
|
581
|
+
* The path of a ball that is dropped and bounces: bouncePath({ height, bounces, restitution, for }) returns
|
|
582
|
+
* at(u) for seconds u from the release: { y (0 at the floor, `height` at the release), v (speed, pixels a second,
|
|
583
|
+
* positive downwards), contact (0..1: 1 on the frame it touches) } and the contact times. Each arc is a parabola;
|
|
584
|
+
* each bounce keeps `restitution` of the speed (0.55 a rubber ball, 0.75 a lively one, 0.35 a heavy one).
|
|
585
|
+
*/
|
|
586
|
+
var bouncePath = function (o) {
|
|
587
|
+
o = o || {};
|
|
588
|
+
var height = num(o.height, 300), n = Math.max(0, Math.round(num(o.bounces, 3))), e = clamp(num(o.restitution, 0.6), 0.05, 0.95), total = num(o['for'], 1.5);
|
|
589
|
+
// Time units of sqrt(2h/g): the fall takes 1, bounce i takes 2 e^i.
|
|
590
|
+
var units = 1, i;
|
|
591
|
+
for (i = 1; i <= n; i++) units += 2 * Math.pow(e, i);
|
|
592
|
+
var fall = total / units, g = (2 * height) / (fall * fall), contacts = [fall], arcs = [];
|
|
593
|
+
for (i = 1; i <= n; i++) { arcs.push({ t0: contacts[i - 1], v: Math.pow(e, i) * g * fall, len: 2 * Math.pow(e, i) * fall }); contacts.push(contacts[i - 1] + 2 * Math.pow(e, i) * fall); }
|
|
594
|
+
var window_ = num(o.contact, 0.045);
|
|
595
|
+
var at = function (u) {
|
|
596
|
+
var y, v, k;
|
|
597
|
+
if (u <= 0) { y = height; v = 0; }
|
|
598
|
+
else if (u < fall) { y = height - 0.5 * g * u * u; v = g * u; }
|
|
599
|
+
else {
|
|
600
|
+
y = 0; v = 0;
|
|
601
|
+
for (k = 0; k < arcs.length; k++) {
|
|
602
|
+
var a = arcs[k];
|
|
603
|
+
if (u >= a.t0 && u < a.t0 + a.len) { var s = u - a.t0; y = a.v * s - 0.5 * g * s * s; v = -(a.v - g * s); break; }
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
var contact = 0;
|
|
607
|
+
for (k = 0; k < contacts.length; k++) contact = Math.max(contact, 1 - Math.abs(u - contacts[k]) / window_);
|
|
608
|
+
// The strength of each contact falls with the bounces.
|
|
609
|
+
return { y: Math.max(0, y), v: v, contact: clamp01(contact), g: g };
|
|
610
|
+
};
|
|
611
|
+
return { at: at, contacts: contacts, end: contacts[contacts.length - 1], gravity: g, restitution: e };
|
|
612
|
+
};
|
|
613
|
+
/**
|
|
614
|
+
* A ball (any element) that drops and bounces. from: [x, y] of its centre at the release; floor: the y its bottom
|
|
615
|
+
* rests on; to: the x it travels to while bouncing (default: stays). squash: how flat it gets on the frames it
|
|
616
|
+
* touches (0.3); stretch: how long it gets along its path at full speed (0.25); trail: ghost copies behind it;
|
|
617
|
+
* shadow: a contact shadow on the floor that tightens as it comes down. The element is positioned by its centre:
|
|
618
|
+
* give it position: absolute; left: 0; top: 0 and a negative margin of half its size, or let the helper do it
|
|
619
|
+
* (center: true, the default). Cues: an impact at every contact, quieter each time.
|
|
620
|
+
*/
|
|
621
|
+
var bounce = function (target, o) {
|
|
622
|
+
o = o || {};
|
|
623
|
+
var el = one(target);
|
|
624
|
+
if (!el) return { at: 0, end: 0, cues: [] };
|
|
625
|
+
var at = num(o.at, 0), key = newKey('bounce');
|
|
626
|
+
// The times of the landings do not depend on any size: they are known at once, for the cues and for the caller.
|
|
627
|
+
var path = bouncePath({ height: 1, bounces: o.bounces, restitution: o.restitution, 'for': num(o['for'], 1.6), contact: o.contact });
|
|
628
|
+
var squash = num(o.squash, 0.3), stretch = num(o.stretch, 0.25);
|
|
629
|
+
whenShown(function () {
|
|
630
|
+
var from = o.from || [window.innerWidth / 2, 100], floor = num(o.floor, window.innerHeight - 100);
|
|
631
|
+
var size = num(o.size, el.offsetHeight || 60), half = size / 2, drop = floor - half - from[1];
|
|
632
|
+
var toX = o.to !== undefined ? num(o.to[0] !== undefined ? o.to[0] : o.to, from[0]) : from[0];
|
|
633
|
+
var vmax = path.gravity * path.contacts[0];
|
|
634
|
+
if (o.center !== false) { el.style.position = 'absolute'; el.style.left = '0'; el.style.top = '0'; el.style.margin = -half + 'px 0 0 ' + -(num(o.width, el.offsetWidth || size) / 2) + 'px'; }
|
|
635
|
+
var pose = function (t) {
|
|
636
|
+
var u = t - at, s = path.at(u), k = clamp01(u / path.end);
|
|
637
|
+
// Squash only while it touches (wider and flatter, its bottom on the floor), less at each softer landing; stretch along the fall at speed.
|
|
638
|
+
var sq = s.contact * squash * (u <= path.contacts[0] + 0.02 ? 1 : Math.pow(path.restitution, path.contacts.filter(function (c) { return c <= u + 0.02; }).length - 1));
|
|
639
|
+
var st = (1 - s.contact) * stretch * Math.min(1, Math.abs(s.v) / vmax);
|
|
640
|
+
var sy = (1 - sq) * (1 + st), sx = 1 / sy;
|
|
641
|
+
return { x: mix(from[0], toX, ease(o.travel || 'linear')(k)), y: floor - half - s.y * drop + (half * (1 - sy)) * (s.contact > 0 ? 1 : 0), scaleX: sx, scaleY: sy, rotate: o.spin ? num(o.spin, 0) * k : 0, height: s.y };
|
|
642
|
+
};
|
|
643
|
+
var ghosts = [], shadow = null, n = Math.max(0, Math.round(num(o.trail, 0))), gap = num(o.trailGap, 0.035), i;
|
|
644
|
+
for (i = 0; i < n; i++) ghosts.push(ghostOf(el));
|
|
645
|
+
if (o.shadow) shadow = make('div', 'position:absolute;left:0;top:0;width:' + size * 1.1 + 'px;height:' + size * 0.22 + 'px;margin:' + -(size * 0.11) + 'px 0 0 ' + -(size * 0.55) + 'px;border-radius:50%;background:' + (typeof o.shadow === 'string' ? o.shadow : 'rgba(0,0,0,0.45)') + ';', el.parentNode);
|
|
646
|
+
if (shadow) el.parentNode.insertBefore(shadow, ghosts[0] || el);
|
|
647
|
+
on(function (t) {
|
|
648
|
+
var p = pose(t);
|
|
649
|
+
put(el, key, p);
|
|
650
|
+
ghosts.forEach(function (g, j) {
|
|
651
|
+
var q = pose(t - (j + 1) * gap), moving = Math.abs(p.y - q.y) + Math.abs(p.x - q.x) > 1;
|
|
652
|
+
put(g, key, { x: q.x, y: q.y, scaleX: q.scaleX, scaleY: q.scaleY, opacity: moving ? 0.35 * (1 - j / n) : 0 });
|
|
653
|
+
});
|
|
654
|
+
// The shadow is small and dark under a ball on the floor, wide and faint under one high up.
|
|
655
|
+
if (shadow) put(shadow, key, { x: p.x, y: floor, scale: mix(1, 1.9, clamp01(p.height)), opacity: mix(1, 0.25, clamp01(p.height)), blur: mix(1.5, 10, clamp01(p.height)) });
|
|
656
|
+
});
|
|
657
|
+
});
|
|
658
|
+
return { at: at, end: at + path.end, contacts: path.contacts.map(function (c) { return r3(at + c); }),
|
|
659
|
+
cues: declare(o, 'bounce', path.contacts.map(function (c, k2) { return [at + c, 'impact', Math.max(0.15, Math.pow(path.restitution, k2))]; })) };
|
|
660
|
+
};
|
|
661
|
+
/**
|
|
662
|
+
* Ghost copies behind anything that moves: `pose(seconds)` returns what put() takes, and the element and its copies
|
|
663
|
+
* are set from it at the frame's time and at earlier times. M.trail('#dot', pose, { copies: 5, gap: 0.03 }).
|
|
664
|
+
*/
|
|
665
|
+
var trail = function (target, pose, o) {
|
|
666
|
+
o = o || {};
|
|
667
|
+
var el = one(target), n = Math.max(1, Math.round(num(o.copies, 4))), gap = num(o.gap, 0.035), key = newKey('trail'), ghosts = [];
|
|
668
|
+
if (!el) return { cues: [] };
|
|
669
|
+
whenShown(function () { for (var i = 0; i < n; i++) ghosts.push(ghostOf(el)); });
|
|
670
|
+
on(function (t) {
|
|
671
|
+
var p = pose(t);
|
|
672
|
+
put(el, key, p);
|
|
673
|
+
ghosts.forEach(function (g, j) {
|
|
674
|
+
var q = pose(t - (j + 1) * gap), s = {};
|
|
675
|
+
for (var k in q) s[k] = q[k];
|
|
676
|
+
s.opacity = num(q.opacity, 1) * num(o.opacity, 0.4) * (1 - j / n) * (Math.abs(num(q.x, 0) - num(p.x, 0)) + Math.abs(num(q.y, 0) - num(p.y, 0)) > 0.5 ? 1 : 0);
|
|
677
|
+
put(g, key, s);
|
|
678
|
+
});
|
|
679
|
+
});
|
|
680
|
+
return { cues: [] };
|
|
681
|
+
};
|
|
682
|
+
|
|
683
|
+
// ---------------------------------------------------------------------------------------------------------------
|
|
684
|
+
// Particles and light, drawn on a canvas layer
|
|
685
|
+
// ---------------------------------------------------------------------------------------------------------------
|
|
686
|
+
var COLOURS = ['#ffd23f', '#ee4266', '#3bceac', '#540d6e', '#0ead69', '#3a86ff'];
|
|
687
|
+
/**
|
|
688
|
+
* A burst of particles from a point: each flies out, slows, falls a little and fades. M.burst({ at: 1, x: 640, y:
|
|
689
|
+
* 360, count: 28 }). Options: speed (pixels a second), gravity, life (seconds), size, colors, spread (degrees) and
|
|
690
|
+
* angle (the middle of the spread; -90 is up), shape ('dot', 'square', 'line', 'star'), drag, seed, on (the element
|
|
691
|
+
* the layer covers). Cue: pop.
|
|
692
|
+
*/
|
|
693
|
+
var burst = function (o) {
|
|
694
|
+
o = o || {};
|
|
695
|
+
var l = layer(o.on), at = num(o.at, 0), n = Math.round(num(o.count, 24)), life = num(o.life, 0.9), r = rng(num(o.seed, 11));
|
|
696
|
+
var spread = (num(o.spread, 360) * Math.PI) / 180, angle = (num(o.angle, -90) * Math.PI) / 180, colors = o.colors || COLOURS, drag = num(o.drag, 2.2);
|
|
697
|
+
var ps = [];
|
|
698
|
+
for (var i = 0; i < n; i++) {
|
|
699
|
+
var a = angle + (r() - 0.5) * spread, v = num(o.speed, 520) * (0.45 + 0.55 * r());
|
|
700
|
+
ps.push({ vx: Math.cos(a) * v, vy: Math.sin(a) * v, size: num(o.size, 9) * (0.5 + r()), color: colors[i % colors.length], life: life * (0.6 + 0.4 * r()), spin: (r() - 0.5) * 14, turn: r() * 6.28, flip: 2 + r() * 6 });
|
|
701
|
+
}
|
|
702
|
+
var g = num(o.gravity, 700), shape = o.shape || 'dot';
|
|
703
|
+
on(function (t) {
|
|
704
|
+
var u = t - at, c = l.ctx, x0 = num(o.x, l.width / 2), y0 = num(o.y, l.height / 2);
|
|
705
|
+
if (u < 0 || u > life) return;
|
|
706
|
+
ps.forEach(function (p) {
|
|
707
|
+
if (u > p.life) return;
|
|
708
|
+
// Speed decays by drag, so the distance is v (1 - e^(-k u)) / k: fast out, then hanging.
|
|
709
|
+
var d = (1 - Math.exp(-drag * u)) / drag, x = x0 + p.vx * d, y = y0 + p.vy * d + 0.5 * g * u * u, k = u / p.life;
|
|
710
|
+
c.save(); c.translate(x, y); c.rotate(p.turn + p.spin * u); c.globalAlpha = clamp01(1.4 * (1 - k));
|
|
711
|
+
c.fillStyle = p.color; c.strokeStyle = p.color;
|
|
712
|
+
var s = p.size * (shape === 'confetti' ? 1 : 1 - 0.5 * k);
|
|
713
|
+
if (shape === 'square') c.fillRect(-s / 2, -s / 2, s, s);
|
|
714
|
+
else if (shape === 'confetti') { c.scale(1, Math.cos(p.flip * u + p.turn)); c.fillRect(-s / 2, -s / 4, s, s / 2); }
|
|
715
|
+
else if (shape === 'line') { c.rotate(-p.turn - p.spin * u + Math.atan2(p.vy + g * u, p.vx)); c.lineWidth = Math.max(1, s / 4); c.beginPath(); c.moveTo(-s * 1.5, 0); c.lineTo(s * 1.5, 0); c.stroke(); }
|
|
716
|
+
else if (shape === 'star') { c.beginPath(); for (var j = 0; j < 10; j++) { var rr = j % 2 ? s * 0.45 : s, an = (j * Math.PI) / 5; c.lineTo(Math.cos(an) * rr, Math.sin(an) * rr); } c.closePath(); c.fill(); }
|
|
717
|
+
else { c.beginPath(); c.arc(0, 0, s / 2, 0, 6.2832); c.fill(); }
|
|
718
|
+
c.restore();
|
|
719
|
+
});
|
|
720
|
+
});
|
|
721
|
+
return { at: at, end: at + life, cues: declare(o, o.effect || 'burst', o.cues || [[at, 'pop', 0.8]]) };
|
|
722
|
+
};
|
|
723
|
+
/** Confetti: paper that is thrown up in a fan, flutters and falls. Cues: pop, then a shimmer while it falls. */
|
|
724
|
+
var confetti = function (o) {
|
|
725
|
+
o = o || {};
|
|
726
|
+
var at = num(o.at, 0);
|
|
727
|
+
return burst({ at: at, x: o.x, y: o.y, count: num(o.count, 70), speed: num(o.speed, 1100), spread: num(o.spread, 70), angle: num(o.angle, -90), gravity: num(o.gravity, 900), life: num(o.life, 2.2), size: num(o.size, 14),
|
|
728
|
+
colors: o.colors, shape: 'confetti', drag: num(o.drag, 1.8), seed: num(o.seed, 5), on: o.on, effect: 'confetti', cue: o.cue, gain: o.gain, cues: [[at, 'pop', 0.9], [at + 0.25, 'shimmer', 0.4]] });
|
|
729
|
+
};
|
|
730
|
+
/** Sparks: short bright lines thrown from a point in one direction, pulled down. Cue: sparkle. */
|
|
731
|
+
var sparks = function (o) {
|
|
732
|
+
o = o || {};
|
|
733
|
+
var at = num(o.at, 0);
|
|
734
|
+
return burst({ at: at, x: o.x, y: o.y, count: num(o.count, 18), speed: num(o.speed, 760), spread: num(o.spread, 80), angle: num(o.angle, -60), gravity: num(o.gravity, 1500), life: num(o.life, 0.6), size: num(o.size, 10),
|
|
735
|
+
colors: o.colors || ['#fff3b0', '#ffd23f', '#ff9f1c'], shape: 'line', drag: num(o.drag, 3), seed: num(o.seed, 9), on: o.on, effect: 'sparks', cue: o.cue, gain: o.gain, cues: [[at, 'sparkle', 0.6]] });
|
|
736
|
+
};
|
|
737
|
+
/** A ring that opens from a point and thins as it fades: the ground answering a landing. Cue: impact. */
|
|
738
|
+
var shockwave = function (o) {
|
|
739
|
+
o = o || {};
|
|
740
|
+
var l = layer(o.on), at = num(o.at, 0), len = num(o['for'], 0.5), e = ease(o.ease || 'expo.out'), radius = num(o.radius, 260), rings = Math.max(1, Math.round(num(o.rings, 1)));
|
|
741
|
+
on(function (t) {
|
|
742
|
+
for (var i = 0; i < rings; i++) {
|
|
743
|
+
var u = progress(t - i * 0.08, at, len);
|
|
744
|
+
if (u <= 0 || u >= 1) continue;
|
|
745
|
+
var c = l.ctx, p = e(u);
|
|
746
|
+
c.save(); c.globalAlpha = (1 - u) * num(o.opacity, 0.9); c.strokeStyle = o.color || '#ffffff'; c.lineWidth = Math.max(0.5, num(o.width, 14) * (1 - p));
|
|
747
|
+
c.beginPath(); c.ellipse(num(o.x, l.width / 2), num(o.y, l.height / 2), radius * p, radius * p * num(o.flat, 1), 0, 0, 6.2832); c.stroke(); c.restore();
|
|
748
|
+
}
|
|
749
|
+
});
|
|
750
|
+
return { at: at, end: at + len, cues: declare(o, 'shockwave', [[at, 'impact', 0.8]]) };
|
|
751
|
+
};
|
|
752
|
+
/**
|
|
753
|
+
* Rays that turn behind a badge or a prize: a sunburst. It keeps turning for the whole shot (an ambient layer, not
|
|
754
|
+
* an entrance), and can open at `at` over `for` seconds. Cue: shimmer when it opens.
|
|
755
|
+
*/
|
|
756
|
+
var sunburst = function (o) {
|
|
757
|
+
o = o || {};
|
|
758
|
+
var l = layer(o.on, o.under !== false), rays = Math.round(num(o.rays, 16)), at = num(o.at, 0), len = num(o['for'], 0.5), speed = (num(o.speed, 18) * Math.PI) / 180, e = ease(o.ease || 'back.out(1.4)');
|
|
759
|
+
on(function (t) {
|
|
760
|
+
var open = e(progress(t, at, len));
|
|
761
|
+
if (open <= 0) return;
|
|
762
|
+
var c = l.ctx, r = num(o.radius, Math.hypot(l.width, l.height) / 2) * open, inner = num(o.inner, 0), step = 6.2832 / rays;
|
|
763
|
+
c.save(); c.translate(num(o.x, l.width / 2), num(o.y, l.height / 2)); c.rotate(speed * t); c.globalAlpha = num(o.opacity, 0.5) * clamp01(open); c.fillStyle = o.color || '#ffd23f';
|
|
764
|
+
for (var i = 0; i < rays; i++) {
|
|
765
|
+
var a = i * step, w = step * num(o.share, 0.5) / 2;
|
|
766
|
+
c.beginPath(); c.moveTo(Math.cos(a - w * 0.2) * inner, Math.sin(a - w * 0.2) * inner); c.lineTo(Math.cos(a - w) * r, Math.sin(a - w) * r); c.lineTo(Math.cos(a + w) * r, Math.sin(a + w) * r); c.lineTo(Math.cos(a + w * 0.2) * inner, Math.sin(a + w * 0.2) * inner); c.closePath(); c.fill();
|
|
767
|
+
}
|
|
768
|
+
c.restore();
|
|
769
|
+
});
|
|
770
|
+
return { at: at, end: at + len, cues: declare(o, 'sunburst', [[at, 'shimmer', 0.5]]) };
|
|
771
|
+
};
|
|
772
|
+
/** Speed lines: streaks that rush past in one direction while something moves fast. Cue: whoosh. */
|
|
773
|
+
var speedLines = function (o) {
|
|
774
|
+
o = o || {};
|
|
775
|
+
var l = layer(o.on, o.under), at = num(o.at, 0), len = num(o['for'], 0.5), n = Math.round(num(o.count, 26)), seed = num(o.seed, 21), angle = (num(o.angle, 0) * Math.PI) / 180;
|
|
776
|
+
on(function (t) {
|
|
777
|
+
var u = progress(t, at, len);
|
|
778
|
+
if (u <= 0 || u >= 1) return;
|
|
779
|
+
// In and out over a seventh of a second, full strength between: it can run for a whole shot.
|
|
780
|
+
var c = l.ctx, strength = Math.min(1, (t - at) / 0.15, (at + len - t) / 0.15), diag = Math.hypot(l.width, l.height);
|
|
781
|
+
c.save(); c.translate(l.width / 2, l.height / 2); c.rotate(angle); c.strokeStyle = o.color || '#ffffff'; c.lineCap = 'round';
|
|
782
|
+
for (var i = 0; i < n; i++) {
|
|
783
|
+
var y = (hash(i, seed) - 0.5) * diag, w = diag * (0.15 + 0.35 * hash(i, seed + 1)), sp = 1.5 + 2 * hash(i, seed + 2);
|
|
784
|
+
var x = (((hash(i, seed + 3) + u * sp) % 1) - 0.5) * (diag + w);
|
|
785
|
+
c.globalAlpha = strength * (0.25 + 0.5 * hash(i, seed + 4)); c.lineWidth = 1 + 3 * hash(i, seed + 5);
|
|
786
|
+
c.beginPath(); c.moveTo(x - w / 2, y); c.lineTo(x + w / 2, y); c.stroke();
|
|
787
|
+
}
|
|
788
|
+
c.restore();
|
|
789
|
+
});
|
|
790
|
+
return { at: at, end: at + len, cues: declare(o, 'speedLines', [[at, 'whoosh', 0.7]]) };
|
|
791
|
+
};
|
|
792
|
+
/** A full-frame flash for a frame or two (the frame a slam lands on). No cue of its own. */
|
|
793
|
+
var flash = function (o) {
|
|
794
|
+
o = o || {};
|
|
795
|
+
var at = num(o.at, 0), white = make('div', 'position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;opacity:0;background:' + (o.color || '#ffffff') + ';', o.on ? one(o.on) : document.body);
|
|
796
|
+
on(function (t, fps) { var f = (t - at) * fps; white.style.opacity = f >= -0.5 && f < num(o.frames, 2) - 0.5 ? String(num(o.opacity, 0.85) * (f < 0.5 ? 1 : 0.45)) : '0'; });
|
|
797
|
+
return { at: at, end: at + num(o.frames, 2) / 30, cues: [] };
|
|
798
|
+
};
|
|
799
|
+
/**
|
|
800
|
+
* Bars that follow a sound: `envelope` is a list of levels 0..1, `rate` of them a second (the envelope the sound
|
|
801
|
+
* side gives, or one written by hand). Each bar reads the envelope a little apart and is smoothed, so that the row
|
|
802
|
+
* moves like a spectrum. Ambient: no cue.
|
|
803
|
+
*/
|
|
804
|
+
var bars = function (target, envelope, o) {
|
|
805
|
+
o = o || {};
|
|
806
|
+
var host = one(target), n = Math.round(num(o.count, 24)), rate = num(o.rate, 30), seed = num(o.seed, 4), list = [];
|
|
807
|
+
if (!host) return { cues: [] };
|
|
808
|
+
host.style.display = 'flex'; host.style.alignItems = o.align || 'flex-end'; host.style.gap = px(num(o.gap, 4));
|
|
809
|
+
for (var i = 0; i < n; i++) list.push(make('div', 'flex:1;height:100%;transform-origin:' + (o.align === 'center' ? 'center' : 'bottom') + ';border-radius:' + px(num(o.radius, 3)) + ';background:' + (o.color || 'currentColor') + ';', host));
|
|
810
|
+
var level = function (t) { var k = t * rate, a = Math.floor(k); if (!envelope || !envelope.length || a < 0) return 0; var v0 = num(envelope[Math.min(envelope.length - 1, a)], 0), v1 = num(envelope[Math.min(envelope.length - 1, a + 1)], 0); return mix(v0, v1, k - a); };
|
|
811
|
+
on(function (t) {
|
|
812
|
+
list.forEach(function (b, j) {
|
|
813
|
+
var mid = 1 - Math.abs(j - (n - 1) / 2) / (n / 2), v = level(t - hash(j, seed) * 0.06) * (0.45 + 0.55 * mid) * (0.7 + 0.3 * (noise(t * 9 + j * 3.1, seed) * 0.5 + 0.5));
|
|
814
|
+
b.style.transform = 'scaleY(' + r3(Math.max(num(o.floor, 0.04), clamp01(v))) + ')';
|
|
815
|
+
});
|
|
816
|
+
});
|
|
817
|
+
return { cues: [] };
|
|
818
|
+
};
|
|
819
|
+
|
|
820
|
+
// ---------------------------------------------------------------------------------------------------------------
|
|
821
|
+
// Camera and distortion
|
|
822
|
+
// ---------------------------------------------------------------------------------------------------------------
|
|
823
|
+
/** A camera shake that dies away: smooth noise, the same on every render. amount in pixels. Cue: rumble. */
|
|
824
|
+
var shake = function (target, o) {
|
|
825
|
+
o = o || {};
|
|
826
|
+
var el = one(target), at = num(o.at, 0), len = num(o['for'], 0.4), amount = num(o.amount, 12), freq = num(o.frequency, 28), seed = num(o.seed, 13), key = newKey('shake');
|
|
827
|
+
on(function (t) {
|
|
828
|
+
var u = progress(t, at, len), k = u <= 0 || u >= 1 ? 0 : Math.pow(1 - u, num(o.decay, 2)) * amount;
|
|
829
|
+
put(el, key, { x: noise(t * freq, seed) * k, y: noise(t * freq, seed + 7) * k, rotate: noise(t * freq, seed + 19) * k * num(o.rotate, 0.04) });
|
|
830
|
+
});
|
|
831
|
+
return { at: at, end: at + len, cues: declare(o, 'shake', [[at, 'rumble', 0.6]]) };
|
|
832
|
+
};
|
|
833
|
+
/**
|
|
834
|
+
* A glitch: the element is copied twice in red and cyan, moved apart, and slices of it jump sideways, in bursts.
|
|
835
|
+
* amount in pixels. Cue: glitch.
|
|
836
|
+
*/
|
|
837
|
+
var glitch = function (target, o) {
|
|
838
|
+
o = o || {};
|
|
839
|
+
var el = one(target), at = num(o.at, 0), len = num(o['for'], 0.4), amount = num(o.amount, 14), seed = num(o.seed, 17), rate = num(o.rate, 24), key = newKey('glitch');
|
|
840
|
+
if (!el) return { at: at, end: at + len, cues: [] };
|
|
841
|
+
var copies = [];
|
|
842
|
+
whenShown(function () {
|
|
843
|
+
copies = ['#ff2a6d', '#05d9e8'].map(function (colour) {
|
|
844
|
+
var c = ghostOf(el); c.style.position = 'absolute'; c.style.left = el.offsetLeft + 'px'; c.style.top = el.offsetTop + 'px'; c.style.width = el.offsetWidth + 'px'; c.style.margin = '0';
|
|
845
|
+
c.style.color = colour; c.style.mixBlendMode = 'screen'; c.style.display = 'none';
|
|
846
|
+
return c;
|
|
847
|
+
});
|
|
848
|
+
});
|
|
849
|
+
on(function (t) {
|
|
850
|
+
var u = progress(t, at, len), live = u > 0 && u < 1, tick = Math.floor(t * rate), k = live ? (hash(tick, seed) > num(o.calm, 0.35) ? 1 : 0.15) * amount : 0;
|
|
851
|
+
copies.forEach(function (c, i) {
|
|
852
|
+
c.style.display = live && o.rgb !== false ? '' : 'none';
|
|
853
|
+
put(c, key, { x: (i ? 1 : -1) * k * (0.3 + 0.7 * hash(tick, seed + 3 + i)), y: (hash(tick, seed + 9 + i) - 0.5) * k * 0.3, opacity: 0.85 });
|
|
854
|
+
});
|
|
855
|
+
// One slice of the element jumps: a band cut by clip-path, moved sideways.
|
|
856
|
+
var top = hash(tick, seed + 21) * 80, h = 8 + hash(tick, seed + 22) * 22;
|
|
857
|
+
el.style.clipPath = live && k > amount * 0.5 ? 'polygon(0 0,100% 0,100% ' + top + '%,' + (100 + k) + '% ' + top + '%,' + (100 + k) + '% ' + (top + h) + '%,100% ' + (top + h) + '%,100% 100%,0 100%)' : '';
|
|
858
|
+
put(el, key, { x: live ? (hash(tick, seed + 30) - 0.5) * k * 0.5 : 0, skewX: live ? (hash(tick, seed + 31) - 0.5) * k * 0.4 : 0 });
|
|
859
|
+
});
|
|
860
|
+
return { at: at, end: at + len, cues: declare(o, 'glitch', [[at, 'glitch', 0.7]]) };
|
|
861
|
+
};
|
|
862
|
+
/**
|
|
863
|
+
* Layers at different depths under one camera move: a layer of depth 0 does not move, depth 1 moves by the whole
|
|
864
|
+
* amount, depth 2 twice as far (in front). M.parallax([{ el: '#sky', depth: 0.2 }, { el: '#hills', depth: 0.6 }], {
|
|
865
|
+
* to: [-200, 0], zoom: 1.08, for: 4 }). A move over the whole shot is an ambient layer: no cue unless cue is set.
|
|
866
|
+
*/
|
|
867
|
+
var parallax = function (list, o) {
|
|
868
|
+
o = o || {};
|
|
869
|
+
var at = num(o.at, 0), len = num(o['for'], 3), e = ease(o.ease || 'sine.inOut'), from = o.from || [0, 0], to = o.to || [-120, 0], key = newKey('parallax');
|
|
870
|
+
var ls = list.map(function (x) { return { el: one(x.el), depth: num(x.depth, 1) }; });
|
|
871
|
+
on(function (t) {
|
|
872
|
+
var p = e(progress(t, at, len));
|
|
873
|
+
ls.forEach(function (x) { put(x.el, key, { x: mix(from[0], to[0], p) * x.depth, y: mix(from[1], to[1], p) * x.depth, scale: 1 + (mix(num(o.zoomFrom, 1), num(o.zoom, 1), p) - 1) * x.depth }); });
|
|
874
|
+
});
|
|
875
|
+
return { at: at, end: at + len, cues: o.cue ? declare(o, 'parallax', [[at, 'whoosh', 0.4]]) : [] };
|
|
876
|
+
};
|
|
877
|
+
/** A slow drift for a ground or a prop that must not stand dead still: smooth noise, small. Never on a title. Ambient: no cue. */
|
|
878
|
+
var drift = function (target, o) {
|
|
879
|
+
o = o || {};
|
|
880
|
+
var els = all(target), amount = num(o.amount, 8), period = num(o.period, 5), seed = num(o.seed, 23), key = newKey('drift');
|
|
881
|
+
on(function (t) {
|
|
882
|
+
els.forEach(function (el, i) {
|
|
883
|
+
put(el, key, { x: noise(t / period + i * 3.7, seed) * amount, y: noise(t / period + i * 5.3, seed + 5) * amount, rotate: noise(t / period + i * 1.9, seed + 11) * num(o.rotate, 0), scale: 1 + noise(t / period + i, seed + 13) * num(o.scale, 0) });
|
|
884
|
+
});
|
|
885
|
+
});
|
|
886
|
+
return { cues: [] };
|
|
887
|
+
};
|
|
888
|
+
/** A steady turn: degrees a second, for a wheel, a ray, a loader. Ambient: no cue. */
|
|
889
|
+
var spin = function (target, o) {
|
|
890
|
+
o = o || {};
|
|
891
|
+
var els = all(target), key = newKey('spin');
|
|
892
|
+
on(function (t) { els.forEach(function (el, i) { put(el, key, { rotate: num(o.speed, 90) * (t - num(o.at, 0)) * (o.alternate && i % 2 ? -1 : 1) }); }); });
|
|
893
|
+
return { cues: [] };
|
|
894
|
+
};
|
|
895
|
+
|
|
896
|
+
// ---------------------------------------------------------------------------------------------------------------
|
|
897
|
+
// Reveals and surfaces
|
|
898
|
+
// ---------------------------------------------------------------------------------------------------------------
|
|
899
|
+
/**
|
|
900
|
+
* Reveals (or hides, with out: true) an element by a moving edge: kind 'left', 'right', 'up', 'down', 'circle'
|
|
901
|
+
* (from a point, at: [x%, y%]), 'iris' (a circle from the centre), 'diagonal', 'blinds' (count bands). Cue: whoosh.
|
|
902
|
+
*/
|
|
903
|
+
var wipe = function (target, o) {
|
|
904
|
+
o = o || {};
|
|
905
|
+
var els = all(target), at = num(o.at, 0), len = num(o['for'], 0.6), e = ease(o.ease || 'power3.inOut'), kind = o.kind || 'left', n = Math.round(num(o.count, 8)), c = o.centre || [50, 50];
|
|
906
|
+
var shape = function (p) {
|
|
907
|
+
var q = (p * 100).toFixed(2), i, pts;
|
|
908
|
+
if (kind === 'right') return 'inset(0 0 0 ' + (100 - p * 100).toFixed(2) + '%)';
|
|
909
|
+
if (kind === 'up') return 'inset(' + (100 - p * 100).toFixed(2) + '% 0 0 0)';
|
|
910
|
+
if (kind === 'down') return 'inset(0 0 ' + (100 - p * 100).toFixed(2) + '% 0)';
|
|
911
|
+
if (kind === 'circle' || kind === 'iris') return 'circle(' + (p * 150).toFixed(2) + '% at ' + (kind === 'iris' ? 50 : c[0]) + '% ' + (kind === 'iris' ? 50 : c[1]) + '%)';
|
|
912
|
+
if (kind === 'diagonal') return 'polygon(0 0,' + (p * 200).toFixed(2) + '% 0,0 ' + (p * 200).toFixed(2) + '%)';
|
|
913
|
+
if (kind === 'blinds') { pts = []; for (i = 0; i < n; i++) { var y0 = (i * 100) / n, y1 = y0 + (100 / n) * p; pts.push('0 ' + y0 + '%,100% ' + y0 + '%,100% ' + y1 + '%,0 ' + y1 + '%,0 ' + y0 + '%'); } return 'polygon(evenodd,' + pts.join(',') + ')'; }
|
|
914
|
+
return 'inset(0 ' + (100 - Number(q)).toFixed(2) + '% 0 0)';
|
|
915
|
+
};
|
|
916
|
+
on(function (t) {
|
|
917
|
+
var p = e(progress(t, at, len));
|
|
918
|
+
els.forEach(function (el) { el.style.clipPath = shape(o.out ? 1 - p : p); });
|
|
919
|
+
});
|
|
920
|
+
return { at: at, end: at + len, cues: declare(o, 'wipe', [[at, 'whoosh', 0.55]]) };
|
|
921
|
+
};
|
|
922
|
+
/** A band of light that sweeps over an element once (its text or its surface). Cue: shimmer. */
|
|
923
|
+
var shimmer = function (target, o) {
|
|
924
|
+
o = o || {};
|
|
925
|
+
var els = all(target), at = num(o.at, 0), len = num(o['for'], 0.8), e = ease(o.ease || 'power2.inOut'), angle = num(o.angle, 110), width = num(o.width, 18);
|
|
926
|
+
var sheens = [];
|
|
927
|
+
whenShown(function () {
|
|
928
|
+
sheens = els.map(function (el) {
|
|
929
|
+
if (getComputedStyle(el).position === 'static') el.style.position = 'relative';
|
|
930
|
+
el.style.overflow = 'hidden';
|
|
931
|
+
return make('div', 'position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;mix-blend-mode:' + (o.blend || 'screen') + ';', el);
|
|
932
|
+
});
|
|
933
|
+
});
|
|
934
|
+
on(function (t) {
|
|
935
|
+
var u = progress(t, at, len), p = e(u) * (100 + 2 * width) - width, a = u > 0 && u < 1 ? num(o.opacity, 0.7) : 0;
|
|
936
|
+
sheens.forEach(function (s) { s.style.background = 'linear-gradient(' + angle + 'deg, transparent ' + (p - width) + '%, ' + (o.color || 'rgba(255,255,255,' + a + ')') + ' ' + p + '%, transparent ' + (p + width) + '%)'; s.style.opacity = a ? '1' : '0'; });
|
|
937
|
+
});
|
|
938
|
+
return { at: at, end: at + len, cues: declare(o, 'shimmer', [[at + len * 0.3, 'shimmer', 0.45]]) };
|
|
939
|
+
};
|
|
940
|
+
/**
|
|
941
|
+
* Goo: the shapes inside an element melt into one another where they come close (a blur and a hard alpha step, as
|
|
942
|
+
* an SVG filter). Move the shapes with any effect; the joins follow. Returns the filter's id. No cue.
|
|
943
|
+
*/
|
|
944
|
+
var goo = function (target, o) {
|
|
945
|
+
o = o || {};
|
|
946
|
+
var el = one(target), id = 'popost-goo-' + (keyCount++), blurAmount = num(o.blur, 12);
|
|
947
|
+
var svg = make('svg', 'position:absolute;width:0;height:0;', document.body, true);
|
|
948
|
+
svg.innerHTML = '<defs><filter id="' + id + '" x="-20%" y="-20%" width="140%" height="140%" color-interpolation-filters="sRGB"><feGaussianBlur in="SourceGraphic" stdDeviation="' + blurAmount + '" result="b"/>'
|
|
949
|
+
+ '<feColorMatrix in="b" mode="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 ' + num(o.sharp, 22) + ' ' + -num(o.cut, 9) + '" result="g"/>' + (o.keep === false ? '' : '<feComposite in="SourceGraphic" in2="g" operator="atop"/>') + '</filter></defs>';
|
|
950
|
+
if (el) el.style.filter = 'url(#' + id + ')';
|
|
951
|
+
return { id: id, cues: [] };
|
|
952
|
+
};
|
|
953
|
+
/**
|
|
954
|
+
* Motion blur on a canvas by drawing the moments between two frames on top of one another: draw(ctx, seconds) is
|
|
955
|
+
* called `samples` times across the shutter (a share of the frame's time, 0.5 is a film camera's) with the alpha
|
|
956
|
+
* that makes them add up. Use it for a fast mover drawn on a canvas; DOM elements take put(..., { blur }).
|
|
957
|
+
*/
|
|
958
|
+
var motionBlur = function (target, draw, o) {
|
|
959
|
+
o = o || {};
|
|
960
|
+
var canvas = one(target), n = Math.max(1, Math.round(num(o.samples, 8))), shutter = num(o.shutter, 0.5);
|
|
961
|
+
if (!canvas) return { cues: [] };
|
|
962
|
+
var ctx = canvas.getContext('2d'), buffer = document.createElement('canvas');
|
|
963
|
+
buffer.width = canvas.width; buffer.height = canvas.height;
|
|
964
|
+
var bctx = buffer.getContext('2d');
|
|
965
|
+
on(function (t, fps) {
|
|
966
|
+
if (!canvas.width || !canvas.height) return;
|
|
967
|
+
if (buffer.width !== canvas.width || buffer.height !== canvas.height) { buffer.width = canvas.width; buffer.height = canvas.height; }
|
|
968
|
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
969
|
+
for (var i = 0; i < n; i++) {
|
|
970
|
+
bctx.clearRect(0, 0, buffer.width, buffer.height);
|
|
971
|
+
draw(bctx, t - (shutter / fps) * (i / n));
|
|
972
|
+
// Sample i gets 1 / (i + 1): the running mean of all samples drawn so far.
|
|
973
|
+
ctx.globalAlpha = 1 / (i + 1);
|
|
974
|
+
ctx.drawImage(buffer, 0, 0);
|
|
975
|
+
}
|
|
976
|
+
ctx.globalAlpha = 1;
|
|
977
|
+
});
|
|
978
|
+
return { cues: [] };
|
|
979
|
+
};
|
|
980
|
+
|
|
981
|
+
window.popostMotion = {
|
|
982
|
+
version: 1, CUES: CUES, problems: problems,
|
|
983
|
+
clamp: clamp, clamp01: clamp01, mix: mix, progress: progress, rng: rng, hash: hash, noise: noise, noise2: noise2,
|
|
984
|
+
ease: ease, spring: spring, stepped: stepped, bouncePath: bouncePath, offsets: offsets,
|
|
985
|
+
on: on, whenShown: whenShown, cue: cue, cues: function () { return scene.cues.slice(); }, put: put, layer: layer, split: split,
|
|
986
|
+
tween: tween, pop: pop, slam: slam, stagger: stagger, gridReveal: gridReveal, kinetic: kinetic, typeOn: typeOn, scramble: scramble, counter: counter,
|
|
987
|
+
drawOn: drawOn, morph: morph, follow: follow, bounce: bounce, trail: trail,
|
|
988
|
+
burst: burst, confetti: confetti, sparks: sparks, shockwave: shockwave, sunburst: sunburst, speedLines: speedLines, flash: flash, bars: bars,
|
|
989
|
+
shake: shake, glitch: glitch, parallax: parallax, drift: drift, spin: spin, wipe: wipe, shimmer: shimmer, goo: goo, motionBlur: motionBlur
|
|
990
|
+
};
|
|
991
|
+
})();
|