popost 4.6.1 → 4.6.6
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 +16221 -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/motion-blur-streak.html +119 -0
- package/assets/video/examples/object-reveal.html +107 -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/dist/cli.js +35440 -2563
- package/dist/index.js +35143 -2437
- 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.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 +50 -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-run.d.ts +54 -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 +56 -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 +150 -0
- package/dist/types/video/page/css.d.ts +9 -0
- package/dist/types/video/page/dom.d.ts +51 -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/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 +40 -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 +16 -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 +54 -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/encode.d.ts +49 -0
- package/dist/types/video/render/index.d.ts +90 -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 +64 -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/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 +163 -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 +7 -0
- package/dist/types/video/retarget/index.d.ts +248 -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 +41 -0
- package/dist/types/video/retarget/tempo.d.ts +40 -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 +41 -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 +51 -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 +52 -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 +81 -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/create.d.ts +43 -0
- package/dist/types/video/voice/hosted.d.ts +36 -0
- package/dist/types/video/voice/index.d.ts +61 -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 +38 -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 +605 -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 +86 -0
- package/references/video-project.md +63 -0
- package/references/video-replication.md +276 -0
- package/references/video-scenes.md +366 -0
- package/references/video-sfx.md +109 -0
- package/references/video-sound.md +207 -0
- package/references/video-templates.md +177 -0
- package/references/video-tools.md +560 -0
- package/references/video.md +756 -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,2549 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<!--
|
|
3
|
+
Adapted from HyperFrames (https://github.com/heygen-com/hyperframes), registry/blocks/canopy-part-title, commit a8332860c396e9224d42b7ea2a9cc8f42918c961.
|
|
4
|
+
Copyright 2026 HeyGen, Inc. Licensed under the Apache License, Version 2.0; the licence text is in the popost
|
|
5
|
+
Skill's THIRD_PARTY_NOTICES. Changed for the popost Skill (tools/video/port-hyperframes.mjs): its comments removed; its fonts drawn by roles of the Skill's font library, linked from the project (../css/<role>.css); three.js modules replaced by the project's three.js (../lib/three.min.js, r147), set up as later releases are; three.js addons (postprocessing/EffectComposer, shaders/CopyShader, postprocessing/ShaderPass, postprocessing/Pass, postprocessing/MaskPass, postprocessing/RenderPass, postprocessing/BokehPass, shaders/BokehShader) put into the page from three.js r147 (MIT); the runtime's asset address helper reduced to the plain path (the scene's files are beside it); the root composition given the size of its data-width and data-height, as the HyperFrames runtime gives it; the web font stylesheet its script links replaced by an empty one (the fonts of the machine stand in); pictures its script loads replaced by drawn stand-ins that the first frame waits for; its deferred calls (setTimeout) run when the page has loaded, before the first frame; GSAP loaded from the project (../lib/gsap.min.js) instead of a CDN; the 1920x1080 composition scaled into the scene's canvas (parameter "fit"); HyperFrames variables declared as parameters; its root-level clips laid out as HyperFrames lays them out; its clips shown and hidden from the scene's time; sound cues derived from its tweens.
|
|
6
|
+
-->
|
|
7
|
+
<html
|
|
8
|
+
lang="en"
|
|
9
|
+
data-composition-variables='[{"id":"headline1","type":"string","label":"Headline 1","default":"Understory"},{"id":"headline2","type":"string","label":"Headline 2","default":"Move slowly"},{"id":"font","type":"string","label":"Headline font","default":"Helvetica"},{"id":"fontWeight","type":"number","label":"Font weight","default":900,"min":100,"max":900,"step":100},{"id":"fontSize","type":"number","label":"Font size (1 = auto-fit)","default":1,"min":0.3,"max":2,"step":0.01},{"id":"letterSpacing","type":"number","label":"Letter spacing (em)","default":0.01,"min":-0.2,"max":1,"step":0.01},{"id":"background","type":"color","label":"Background","default":"#020805"},{"id":"leafCount","type":"number","label":"Leaves per sweep","default":170,"min":40,"max":320,"step":1},{"id":"stayCount","type":"number","label":"Leaves left behind","default":5,"min":0,"max":20,"step":1},{"id":"sweepSpeed","type":"number","label":"Sweep speed","default":1,"min":0.3,"max":3,"step":0.05},{"id":"retainedBreeze","type":"number","label":"Retained leaf breeze","default":1,"min":0,"max":2,"step":0.05}]'
|
|
10
|
+
>
|
|
11
|
+
<head>
|
|
12
|
+
<script>
|
|
13
|
+
/* popost: deferred calls (setTimeout) run in order when the page has loaded, before the first frame. */
|
|
14
|
+
(function () {
|
|
15
|
+
var queue = [], n = 0, done = false;
|
|
16
|
+
var flush = function () { for (var k = 0; queue.length && k < 100000; k++) { var c = queue.shift(); if (!c.cancelled) c.f.apply(null, c.args); } };
|
|
17
|
+
window.__popostLater = function (f, ms) { var c = { f: typeof f === 'function' ? f : function () {}, args: Array.prototype.slice.call(arguments, 2), id: ++n }; queue.push(c); if (done) flush(); return c.id; };
|
|
18
|
+
window.__popostCancel = function (id) { queue.forEach(function (c) { if (c.id === id) c.cancelled = true; }); };
|
|
19
|
+
window.addEventListener('load', function () { done = true; flush(); });
|
|
20
|
+
})();
|
|
21
|
+
</script>
|
|
22
|
+
<script>
|
|
23
|
+
/* popost: pictures a script loads are held in the page, so the first frame waits for them. */
|
|
24
|
+
(function () {
|
|
25
|
+
var d = Object.getOwnPropertyDescriptor(HTMLImageElement.prototype, 'src'), holder;
|
|
26
|
+
Object.defineProperty(HTMLImageElement.prototype, 'src', { configurable: true, enumerable: true, get: d.get, set: function (v) {
|
|
27
|
+
d.set.call(this, v);
|
|
28
|
+
if (this.isConnected || !document.body) return;
|
|
29
|
+
holder = holder || document.body.appendChild(Object.assign(document.createElement('div'), { hidden: true, id: 'popost-held' }));
|
|
30
|
+
holder.appendChild(this);
|
|
31
|
+
} });
|
|
32
|
+
})();
|
|
33
|
+
</script>
|
|
34
|
+
<meta charset="UTF-8" />
|
|
35
|
+
<meta name="viewport" content="width=1920, height=1080" />
|
|
36
|
+
<title>canopy-part-title</title>
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
<script src="../lib/gsap.min.js"></script>
|
|
41
|
+
<style>
|
|
42
|
+
* {
|
|
43
|
+
margin: 0;
|
|
44
|
+
padding: 0;
|
|
45
|
+
box-sizing: border-box;
|
|
46
|
+
}
|
|
47
|
+
html,
|
|
48
|
+
body {
|
|
49
|
+
margin: 0;
|
|
50
|
+
width: 1920px;
|
|
51
|
+
height: 1080px;
|
|
52
|
+
overflow: hidden;
|
|
53
|
+
background: #020805;
|
|
54
|
+
}
|
|
55
|
+
#cpt-root {
|
|
56
|
+
position: relative;
|
|
57
|
+
width: 1920px;
|
|
58
|
+
height: 1080px;
|
|
59
|
+
overflow: hidden;
|
|
60
|
+
}
|
|
61
|
+
#cpt-scene {
|
|
62
|
+
position: absolute;
|
|
63
|
+
inset: 0;
|
|
64
|
+
}
|
|
65
|
+
/* Full-frame background paint on a child, never on the composition root.
|
|
66
|
+
Plain flat colour — driven by the `background` variable, no gradients. */
|
|
67
|
+
#cpt-bg {
|
|
68
|
+
position: absolute;
|
|
69
|
+
inset: 0;
|
|
70
|
+
background: #020805;
|
|
71
|
+
}
|
|
72
|
+
#cpt-canvas {
|
|
73
|
+
position: absolute;
|
|
74
|
+
inset: 0;
|
|
75
|
+
width: 100%;
|
|
76
|
+
height: 100%;
|
|
77
|
+
display: block;
|
|
78
|
+
}
|
|
79
|
+
#cpt-fontload {
|
|
80
|
+
position: absolute;
|
|
81
|
+
opacity: 0;
|
|
82
|
+
pointer-events: none;
|
|
83
|
+
font-family: Gelasio, Georgia, serif;
|
|
84
|
+
}
|
|
85
|
+
</style>
|
|
86
|
+
<link rel="stylesheet" href="../css/latin-lora.css" />
|
|
87
|
+
<style id="popost-fonts">
|
|
88
|
+
@font-face {
|
|
89
|
+
font-family: "Gelasio";
|
|
90
|
+
size-adjust: 103.1%;
|
|
91
|
+
font-style: normal;
|
|
92
|
+
font-display: swap;
|
|
93
|
+
font-weight: 400 700;
|
|
94
|
+
src: url("../fonts/latin-lora/lora-latin-ext-wght-normal.woff2") format('woff2-variations');
|
|
95
|
+
unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
|
|
96
|
+
}
|
|
97
|
+
@font-face {
|
|
98
|
+
font-family: "Gelasio";
|
|
99
|
+
size-adjust: 103.1%;
|
|
100
|
+
font-style: normal;
|
|
101
|
+
font-display: swap;
|
|
102
|
+
font-weight: 400 700;
|
|
103
|
+
src: url("../fonts/latin-lora/lora-latin-wght-normal.woff2") format('woff2-variations');
|
|
104
|
+
unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
|
|
105
|
+
}
|
|
106
|
+
@font-face {
|
|
107
|
+
font-family: "Gelasio";
|
|
108
|
+
size-adjust: 103.1%;
|
|
109
|
+
font-style: italic;
|
|
110
|
+
font-display: swap;
|
|
111
|
+
font-weight: 400 700;
|
|
112
|
+
src: url("../fonts/latin-lora/lora-latin-ext-wght-italic.woff2") format('woff2-variations');
|
|
113
|
+
unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
|
|
114
|
+
}
|
|
115
|
+
@font-face {
|
|
116
|
+
font-family: "Gelasio";
|
|
117
|
+
size-adjust: 103.1%;
|
|
118
|
+
font-style: italic;
|
|
119
|
+
font-display: swap;
|
|
120
|
+
font-weight: 400 700;
|
|
121
|
+
src: url("../fonts/latin-lora/lora-latin-wght-italic.woff2") format('woff2-variations');
|
|
122
|
+
unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
|
|
123
|
+
}
|
|
124
|
+
</style>
|
|
125
|
+
<script>
|
|
126
|
+
/* popost: a font of the font library loads once the project has its role (popost video scene font); until then, a
|
|
127
|
+
load the page waits for still resolves and the text falls back to the machine's fonts. */
|
|
128
|
+
(function () {
|
|
129
|
+
var set = document.fonts, load = set.load.bind(set), faceLoad = FontFace.prototype.load;
|
|
130
|
+
set.load = function () { return load.apply(null, arguments).catch(function () { return []; }); };
|
|
131
|
+
FontFace.prototype.load = function () { var face = this; return faceLoad.call(face).catch(function () { return face; }); };
|
|
132
|
+
})();
|
|
133
|
+
</script>
|
|
134
|
+
<script src="../lib/three.min.js"></script>
|
|
135
|
+
<script>
|
|
136
|
+
/* popost: three.js r147 set up as later releases are by default (sRGB output, colour management, physical lights). */
|
|
137
|
+
(function () {
|
|
138
|
+
if (!window.THREE || THREE.__popostCompat) return;
|
|
139
|
+
THREE.__popostCompat = true;
|
|
140
|
+
THREE.SRGBColorSpace = THREE.SRGBColorSpace || 'srgb';
|
|
141
|
+
THREE.LinearSRGBColorSpace = THREE.LinearSRGBColorSpace || 'srgb-linear';
|
|
142
|
+
THREE.NoColorSpace = THREE.NoColorSpace || '';
|
|
143
|
+
if (THREE.ColorManagement) THREE.ColorManagement.legacyMode = false;
|
|
144
|
+
var R = THREE.WebGLRenderer;
|
|
145
|
+
THREE.WebGLRenderer = function (p) { R.call(this, Object.assign({ preserveDrawingBuffer: true }, p || {})); this.outputEncoding = THREE.sRGBEncoding; this.physicallyCorrectLights = true; };
|
|
146
|
+
THREE.WebGLRenderer.prototype = R.prototype;
|
|
147
|
+
Object.defineProperty(R.prototype, 'outputColorSpace', { configurable: true, get: function () { return this.outputEncoding === THREE.sRGBEncoding ? 'srgb' : 'srgb-linear'; }, set: function (v) { this.outputEncoding = v === 'srgb' ? THREE.sRGBEncoding : THREE.LinearEncoding; } });
|
|
148
|
+
Object.defineProperty(THREE.Texture.prototype, 'colorSpace', { configurable: true, get: function () { return this.encoding === THREE.sRGBEncoding ? 'srgb' : ''; }, set: function (v) { this.encoding = v === 'srgb' ? THREE.sRGBEncoding : THREE.LinearEncoding; } });
|
|
149
|
+
R.prototype.compileAsync = R.prototype.compileAsync || function (scene, camera) { this.compile(scene, camera); return Promise.resolve(); };
|
|
150
|
+
/* the texture coordinates of later releases' shader chunks (vMapUv, ...), for code that onBeforeCompile adds */
|
|
151
|
+
THREE.ShaderChunk.common = ['Map', 'AlphaMap', 'NormalMap', 'BumpMap', 'RoughnessMap', 'MetalnessMap', 'EmissiveMap', 'SpecularMap', 'ClearcoatMap', 'ClearcoatNormalMap', 'ClearcoatRoughnessMap', 'SheenColorMap', 'SheenRoughnessMap', 'TransmissionMap', 'ThicknessMap', 'DisplacementMap'].map(function (k) { return '#define v' + k + 'Uv vUv\n'; }).join('') + '#define vAoMapUv vUv2\n#define vLightMapUv vUv2\n' + THREE.ShaderChunk.common;
|
|
152
|
+
/* scene.environmentIntensity (later releases) as every material's envMapIntensity */
|
|
153
|
+
var render = R.prototype.render;
|
|
154
|
+
R.prototype.render = function (scene, camera) {
|
|
155
|
+
if (scene && typeof scene.environmentIntensity === 'number') scene.traverse(function (o) { [].concat(o.material || []).forEach(function (m) { if ('envMapIntensity' in m) m.envMapIntensity = scene.environmentIntensity; }); });
|
|
156
|
+
return render.apply(this, arguments);
|
|
157
|
+
};
|
|
158
|
+
/* point and spot lights fall off with the square of the distance (decay 2), as later releases default to */
|
|
159
|
+
var P = THREE.PointLight, S = THREE.SpotLight;
|
|
160
|
+
THREE.PointLight = function (color, intensity, distance, decay) { return new P(color, intensity, distance, decay === undefined ? 2 : decay); };
|
|
161
|
+
THREE.PointLight.prototype = P.prototype;
|
|
162
|
+
THREE.SpotLight = function (color, intensity, distance, angle, penumbra, decay) { return new S(color, intensity, distance, angle, penumbra, decay === undefined ? 2 : decay); };
|
|
163
|
+
THREE.SpotLight.prototype = S.prototype;
|
|
164
|
+
})();
|
|
165
|
+
</script>
|
|
166
|
+
<style id="popost-fit">
|
|
167
|
+
html, body { margin: 0 !important; width: 1280px; height: 720px; overflow: hidden !important; }
|
|
168
|
+
:where(html, body) { background: #000000; }
|
|
169
|
+
#popost-stage { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; overflow: hidden; }
|
|
170
|
+
</style>
|
|
171
|
+
<script type="application/json" id="popost-params">
|
|
172
|
+
{
|
|
173
|
+
"about": "Leaves sweep through the frame and part to reveal the headline.",
|
|
174
|
+
"class": "text",
|
|
175
|
+
"tags": [
|
|
176
|
+
"3d-motion",
|
|
177
|
+
"title-card",
|
|
178
|
+
"leaves",
|
|
179
|
+
"organic",
|
|
180
|
+
"depth-of-field",
|
|
181
|
+
"two-headlines",
|
|
182
|
+
"sweep"
|
|
183
|
+
],
|
|
184
|
+
"placeholders": "Gelasio drawn in Lora; web fonts are replaced by the fonts of the machine; 2 pictures its script loads drawn as stand-ins",
|
|
185
|
+
"seconds": 12,
|
|
186
|
+
"params": [
|
|
187
|
+
{
|
|
188
|
+
"name": "fit",
|
|
189
|
+
"type": "choice",
|
|
190
|
+
"default": "contain",
|
|
191
|
+
"options": [
|
|
192
|
+
"contain",
|
|
193
|
+
"cover"
|
|
194
|
+
],
|
|
195
|
+
"what": "how the 1920x1080 composition is fitted into the canvas: whole with bars, or filling it and cropped"
|
|
196
|
+
}
|
|
197
|
+
],
|
|
198
|
+
"values": {}
|
|
199
|
+
}
|
|
200
|
+
</script>
|
|
201
|
+
<script>
|
|
202
|
+
/* popost: the scene's parameters stand in for HyperFrames variables; random numbers are seeded; the composition is
|
|
203
|
+
scaled into the canvas; clips are shown and hidden from the scene's time. */
|
|
204
|
+
(function () {
|
|
205
|
+
var block = document.getElementById('popost-params');
|
|
206
|
+
var values = block ? (JSON.parse(block.textContent).values || {}) : {};
|
|
207
|
+
var vars = {};
|
|
208
|
+
Object.keys(values).forEach(function (k) { if (k !== 'fit') vars[k] = values[k] === 'true' ? true : values[k] === 'false' ? false : values[k]; });
|
|
209
|
+
window.__hyperframes = { getVariables: function () { return vars; } };
|
|
210
|
+
var seed = 20240229;
|
|
211
|
+
window.__popostRandom = function () { seed = (seed + 0x6d2b79f5) >>> 0; var t = seed; t = Math.imul(t ^ (t >>> 15), t | 1); t ^= t + Math.imul(t ^ (t >>> 7), t | 61); return ((t ^ (t >>> 14)) >>> 0) / 4294967296; };
|
|
212
|
+
// HyperFrames variables as CSS custom properties (runtime/getVariables.ts, compositionLoader.ts). A mounted
|
|
213
|
+
// composition's host lists its variables (data-popost-variables, written by the port): before the composition's
|
|
214
|
+
// scripts run it gets those no rule gives it yet (an inherited value counts), and after them the rest; a value given
|
|
215
|
+
// by a parameter always wins.
|
|
216
|
+
var cssName = function (id) { return '--' + (String(id).toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '') || 'node'); };
|
|
217
|
+
var givenId = function (n) { return Object.keys(values).filter(function (id) { return id !== 'fit' && cssName(id) === n; })[0]; };
|
|
218
|
+
var hostVars = function (h, early) {
|
|
219
|
+
(h.getAttribute('data-popost-variables') || '').split(';').forEach(function (d) {
|
|
220
|
+
var i = d.indexOf(':'), n = d.slice(0, i).trim(), k = givenId(n);
|
|
221
|
+
if (i < 0 || !n) return;
|
|
222
|
+
if (k !== undefined) h.style.setProperty(n, String(vars[k]));
|
|
223
|
+
else if (!(h.style.getPropertyValue(n) || (early ? getComputedStyle(h).getPropertyValue(n) : '')).trim()) h.style.setProperty(n, d.slice(i + 1).trim());
|
|
224
|
+
});
|
|
225
|
+
};
|
|
226
|
+
// Root-level clips laid out as HyperFrames lays them out (runtime/init.ts, applyCompositionSizing and applyClipLayout):
|
|
227
|
+
// its root composition (one marked data-root="true", else the first element with a data-composition-id, which is the
|
|
228
|
+
// page's <html> when that has one) gets its declared size, a position and overflow hidden; each child of it with a
|
|
229
|
+
// data-start is placed absolute unless it is absolute or fixed already, and given its declared size, or 100% where it
|
|
230
|
+
// measures 0. A composition box deeper in the page keeps the position its page gives it.
|
|
231
|
+
var layout = function () {
|
|
232
|
+
var hroot = document.querySelector('[data-composition-id][data-root="true"]') || document.querySelector('[data-composition-id]');
|
|
233
|
+
if (!hroot) return;
|
|
234
|
+
var px = function (v) { var n = parseFloat(v); return isFinite(n) && n > 0 ? n + 'px' : null; };
|
|
235
|
+
var rw = px(hroot.getAttribute('data-width')), rh = px(hroot.getAttribute('data-height'));
|
|
236
|
+
if (rw) { hroot.style.width = rw; hroot.style.setProperty('--comp-width', rw); }
|
|
237
|
+
if (rh) { hroot.style.height = rh; hroot.style.setProperty('--comp-height', rh); }
|
|
238
|
+
if (!hroot.style.position) hroot.style.position = 'relative';
|
|
239
|
+
hroot.style.overflow = 'hidden';
|
|
240
|
+
Array.prototype.forEach.call(hroot.children, function (el) {
|
|
241
|
+
if (/^(SCRIPT|STYLE|LINK|META)$/.test(el.tagName) || !el.hasAttribute('data-start')) return;
|
|
242
|
+
var none = el.style.getPropertyValue('display') === 'none', priority = el.style.getPropertyPriority('display');
|
|
243
|
+
if (none) el.style.removeProperty('display');
|
|
244
|
+
var cs = getComputedStyle(el);
|
|
245
|
+
if (cs.position !== 'absolute' && cs.position !== 'fixed') el.style.position = 'absolute';
|
|
246
|
+
if (el.tagName !== 'AUDIO') {
|
|
247
|
+
var byFile = /^(IMG|VIDEO)$/.test(el.tagName), fw = px(el.getAttribute('data-width')), fh = px(el.getAttribute('data-height'));
|
|
248
|
+
if (fw) { if (!el.style.width && (cs.width === '0px' || cs.width === 'auto')) el.style.width = fw; } else if (!byFile && !el.style.width && cs.width === '0px') el.style.width = '100%';
|
|
249
|
+
if (fh) { if (!el.style.height && (cs.height === '0px' || cs.height === 'auto')) el.style.height = fh; } else if (!byFile && !el.style.height && cs.height === '0px') el.style.height = '100%';
|
|
250
|
+
}
|
|
251
|
+
if (none) el.style.setProperty('display', 'none', priority);
|
|
252
|
+
});
|
|
253
|
+
};
|
|
254
|
+
// HyperFrames loads a mounted composition after it has laid out the page, so its scripts see the host placed: each
|
|
255
|
+
// script of a mounted composition calls this first (the port puts the call there).
|
|
256
|
+
window.__popostMount = function (script) {
|
|
257
|
+
var h = script && script.closest ? script.closest('[data-popost-host]') : null;
|
|
258
|
+
if (!h || h.__popostMounted) return;
|
|
259
|
+
h.__popostMounted = true;
|
|
260
|
+
layout();
|
|
261
|
+
hostVars(h, true);
|
|
262
|
+
};
|
|
263
|
+
window.__popostFit = function () {
|
|
264
|
+
// The canvas, from the size this file declares: a scene of a later shot loads in a layer that is not displayed, where the page measures 0.
|
|
265
|
+
var size = /width: (\d+)px; height: (\d+)px;/.exec(document.getElementById('popost-fit').textContent);
|
|
266
|
+
var W = 1920, H = 1080, s = document.getElementById('popost-stage'), cw = Number(size[1]), ch = Number(size[2]);
|
|
267
|
+
var k = (values.fit === 'cover' ? Math.max : Math.min)(cw / W, ch / H);
|
|
268
|
+
s.style.transform = 'translate(' + (cw - W * k) / 2 + 'px,' + (ch - H * k) / 2 + 'px) scale(' + k + ')';
|
|
269
|
+
// The page's own declared variables on its root element (runtime/getVariables.ts, injectCompositionCssVariables):
|
|
270
|
+
// each default where no rule defines its property, a value given by a parameter always.
|
|
271
|
+
var de = document.documentElement, declared = [];
|
|
272
|
+
try { declared = JSON.parse(de.getAttribute('data-composition-variables') || '[]'); } catch (e) {}
|
|
273
|
+
declared.forEach(function (d) {
|
|
274
|
+
var n = cssName(d.id), given = Object.prototype.hasOwnProperty.call(values, d.id), v = given ? vars[d.id] : d.default;
|
|
275
|
+
if (!((typeof v === 'string' && v !== '') || typeof v === 'number')) return;
|
|
276
|
+
if (!given && (de.style.getPropertyValue(n) || getComputedStyle(de).getPropertyValue(n)).trim()) return;
|
|
277
|
+
de.style.setProperty(n, String(v));
|
|
278
|
+
});
|
|
279
|
+
Array.prototype.forEach.call(document.querySelectorAll('[data-popost-host]'), function (h) { hostVars(h, false); });
|
|
280
|
+
layout();
|
|
281
|
+
// Timed elements as HyperFrames has them (runtime/clipTree.ts, clipWindow.ts): every element with a data-start but the
|
|
282
|
+
// root composition, from its start plus the starts of the compositions it sits in, for its data-duration (a
|
|
283
|
+
// composition without one: its timeline's length); one that runs to the end of the root keeps its last frame.
|
|
284
|
+
var root = s.querySelector('[data-composition-id]');
|
|
285
|
+
var clips = Array.prototype.slice.call(s.querySelectorAll('[data-start]')).filter(function (c) { return (root ? c !== root : c.parentNode !== s) && !/^(SCRIPT|STYLE|LINK|META|TEMPLATE|NOSCRIPT)$/.test(c.tagName) && isFinite(parseFloat(c.getAttribute('data-start'))); });
|
|
286
|
+
var windows = clips.map(function (c) {
|
|
287
|
+
var a = parseFloat(c.getAttribute('data-start')), d = parseFloat(c.getAttribute('data-duration')), id = c.getAttribute('data-composition-id');
|
|
288
|
+
for (var p = c.parentElement; p && p !== s; p = p.parentElement) if (p !== root && p.hasAttribute('data-composition-id') && isFinite(parseFloat(p.getAttribute('data-start')))) a += parseFloat(p.getAttribute('data-start'));
|
|
289
|
+
var tl = !(d > 0) && id && window.__timelines && window.__timelines[id];
|
|
290
|
+
return [a, d > 0 ? d : tl && tl.duration ? tl.duration() : Infinity];
|
|
291
|
+
});
|
|
292
|
+
var rootLength = parseFloat(root && root.getAttribute('data-duration'));
|
|
293
|
+
// A mounted composition that starts later in its host runs on its own time.
|
|
294
|
+
[].forEach(function (m) {
|
|
295
|
+
var tl = window.__timelines && window.__timelines[m.id];
|
|
296
|
+
if (tl) window.__timelines[m.id] = { pause: function () { tl.pause(); }, seek: function (t) { tl.seek(Math.max(0, t - m.start)); }, duration: function () { return tl.duration() + m.start; } };
|
|
297
|
+
});
|
|
298
|
+
var scene = (window.__popostScene = window.__popostScene || {}), before = scene.render;
|
|
299
|
+
scene.render = function (seconds, fps) {
|
|
300
|
+
if (before) before(seconds, fps);
|
|
301
|
+
// A page that draws on the HyperFrames seek event gets it for every frame; what it waits for resolves before the frame is taken.
|
|
302
|
+
window.dispatchEvent(new CustomEvent('hf-seek', { detail: { time: seconds, waitUntil: function () {} } }));
|
|
303
|
+
for (var i = 0; i < clips.length; i++) {
|
|
304
|
+
var a = windows[i][0], end = a + windows[i][1];
|
|
305
|
+
clips[i].style.visibility = seconds >= a - 1e-6 && (seconds < end - 1e-6 || end >= rootLength - 1e-6) ? 'visible' : 'hidden';
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
};
|
|
309
|
+
})();
|
|
310
|
+
</script>
|
|
311
|
+
<script type="application/json" id="popost-cues">[{"at":0.567,"cue":"tick","gain":0.3}]</script>
|
|
312
|
+
</head>
|
|
313
|
+
<body>
|
|
314
|
+
<div id="popost-stage">
|
|
315
|
+
<div
|
|
316
|
+
data-hf-id="hf-idkp"
|
|
317
|
+
id="cpt-root"
|
|
318
|
+
data-composition-id="canopy-part-title"
|
|
319
|
+
data-start="0"
|
|
320
|
+
data-duration="12"
|
|
321
|
+
data-width="1920"
|
|
322
|
+
data-height="1080"
|
|
323
|
+
style="width: 1920px; height: 1080px;">
|
|
324
|
+
<section
|
|
325
|
+
data-hf-id="hf-wrn4"
|
|
326
|
+
id="cpt-scene"
|
|
327
|
+
class="clip"
|
|
328
|
+
data-start="0"
|
|
329
|
+
data-duration="12"
|
|
330
|
+
data-track-index="1"
|
|
331
|
+
>
|
|
332
|
+
<div
|
|
333
|
+
style="font-family: "Alan Sans", ui-sans-serif, system-ui, sans-serif"
|
|
334
|
+
data-hf-id="hf-bank"
|
|
335
|
+
id="cpt-bg"
|
|
336
|
+
></div>
|
|
337
|
+
</section>
|
|
338
|
+
<div data-hf-id="hf-p1fl" id="cpt-fontload" aria-hidden="true">
|
|
339
|
+
<span data-hf-id="hf-grhl" style="font-weight: 500">Aa</span
|
|
340
|
+
><span data-hf-id="hf-7bxm" style="font-weight: 600">Aa</span>
|
|
341
|
+
</div>
|
|
342
|
+
</div>
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
<script>
|
|
346
|
+
(function () {
|
|
347
|
+
"use strict";
|
|
348
|
+
window.__timelines = window.__timelines || {};
|
|
349
|
+
/* Studio's variables parser fails on any composition with a <canvas>
|
|
350
|
+
in its MARKUP — created at runtime instead (identical for render). */
|
|
351
|
+
(function () {
|
|
352
|
+
var c = document.createElement("canvas");
|
|
353
|
+
c.id = "cpt-canvas";
|
|
354
|
+
c.width = 1920;
|
|
355
|
+
c.height = 1080;
|
|
356
|
+
document.getElementById("cpt-scene").appendChild(c);
|
|
357
|
+
})();
|
|
358
|
+
|
|
359
|
+
// getVariables carries the declared defaults, standalone and mounted.
|
|
360
|
+
var V = {};
|
|
361
|
+
try {
|
|
362
|
+
if (window.__hyperframes && window.__hyperframes.getVariables)
|
|
363
|
+
V = window.__hyperframes.getVariables() || {};
|
|
364
|
+
} catch (e) {
|
|
365
|
+
/* corrupt declarations must not blank the composition */
|
|
366
|
+
}
|
|
367
|
+
var LEAF_COUNT = Math.max(40, Math.min(320, Number(V.leafCount) || 170));
|
|
368
|
+
var STAY_COUNT = Math.max(
|
|
369
|
+
0,
|
|
370
|
+
Math.min(
|
|
371
|
+
20,
|
|
372
|
+
Math.round(
|
|
373
|
+
V.stayCount === undefined || !isFinite(Number(V.stayCount)) ? 5 : Number(V.stayCount),
|
|
374
|
+
),
|
|
375
|
+
),
|
|
376
|
+
);
|
|
377
|
+
var SPEED = Math.max(0.3, Math.min(3, Number(V.sweepSpeed) || 1));
|
|
378
|
+
var DUR = 12;
|
|
379
|
+
|
|
380
|
+
function mulberry32(seed) {
|
|
381
|
+
return function () {
|
|
382
|
+
seed |= 0;
|
|
383
|
+
seed = (seed + 0x6d2b79f5) | 0;
|
|
384
|
+
var t = Math.imul(seed ^ (seed >>> 15), 1 | seed);
|
|
385
|
+
t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;
|
|
386
|
+
return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/* V1's opening sweep plus a separate depth-lift batch. Each batch has
|
|
391
|
+
exactly stayCount leaves reserved for edge rest slots. The lift
|
|
392
|
+
carries the opening's remaining edge leaves past the camera. */
|
|
393
|
+
var rand = mulberry32(0x6a756e67);
|
|
394
|
+
var TEXT_HALF_W = 8.2,
|
|
395
|
+
TEXT_HALF_H = 2.0;
|
|
396
|
+
|
|
397
|
+
function buildBatch(batchIndex) {
|
|
398
|
+
var out = [];
|
|
399
|
+
for (var i = 0; i < LEAF_COUNT; i++) {
|
|
400
|
+
var kindRoll = rand();
|
|
401
|
+
var kind =
|
|
402
|
+
kindRoll < 0.22
|
|
403
|
+
? "monstera"
|
|
404
|
+
: kindRoll < 0.42
|
|
405
|
+
? "alocasia"
|
|
406
|
+
: kindRoll < 0.68
|
|
407
|
+
? "lance"
|
|
408
|
+
: kindRoll < 0.89
|
|
409
|
+
? "calathea"
|
|
410
|
+
: "fern";
|
|
411
|
+
/* Stayers are chosen AFTER the batch is built (exactly stayCount of
|
|
412
|
+
them, scattered) — here every leaf just gets wind-seed rest values
|
|
413
|
+
and a LOW flight band: in front of the text plane but pushed away
|
|
414
|
+
from the camera so the depth of field leaves most leaves sharp. */
|
|
415
|
+
var stayer = false;
|
|
416
|
+
var y0 = (rand() * 2 - 1) * 3.6 - 0.5;
|
|
417
|
+
var restX = (rand() * 2 - 1) * 9.2;
|
|
418
|
+
var restY = y0;
|
|
419
|
+
var restRZ = rand() * Math.PI * 2;
|
|
420
|
+
out.push({
|
|
421
|
+
batch: batchIndex,
|
|
422
|
+
kind: kind,
|
|
423
|
+
stayer: stayer,
|
|
424
|
+
z: -4.6 + rand() * 3.0,
|
|
425
|
+
xStart: -12.5 - rand() * 5.5,
|
|
426
|
+
xEnd: 12.5 + rand() * 5.0,
|
|
427
|
+
restX: restX,
|
|
428
|
+
restY: restY,
|
|
429
|
+
restRZ: restRZ,
|
|
430
|
+
y0: y0,
|
|
431
|
+
delay: rand() * 0.5,
|
|
432
|
+
delay2: 0, // filled for batch-1 stayers below
|
|
433
|
+
bobAmp: 0.3 + rand() * 0.65,
|
|
434
|
+
bobN: 1.1 + rand() * 1.6,
|
|
435
|
+
spin: (rand() < 0.5 ? -1 : 1) * (1.6 + rand() * 3.0),
|
|
436
|
+
phase: rand() * Math.PI * 2,
|
|
437
|
+
rotation: rand() * Math.PI * 2,
|
|
438
|
+
tiltX: (rand() - 0.5) * 0.42,
|
|
439
|
+
tiltY: (rand() - 0.5) * 0.58,
|
|
440
|
+
widthMul: 0.83 + rand() * 0.34,
|
|
441
|
+
lengthMul: 0.86 + rand() * 0.25,
|
|
442
|
+
scale: (0.62 + rand() * 0.85) * 0.56 * 1.9,
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
return out;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
/* Exactly STAY_COUNT leaves per batch stay behind, scattered at seeded
|
|
449
|
+
random positions anywhere in frame EXCEPT the headline band — never
|
|
450
|
+
lined up along the top and bottom. */
|
|
451
|
+
function pickStayers(batch) {
|
|
452
|
+
var placed = 0,
|
|
453
|
+
guard = 0;
|
|
454
|
+
while (placed < STAY_COUNT && guard++ < 600) {
|
|
455
|
+
var idx = Math.floor(rand() * batch.length) % batch.length;
|
|
456
|
+
var sp = batch[idx];
|
|
457
|
+
if (sp.stayer) continue;
|
|
458
|
+
var rx,
|
|
459
|
+
ry,
|
|
460
|
+
tries = 0;
|
|
461
|
+
do {
|
|
462
|
+
rx = (rand() * 2 - 1) * 8.6;
|
|
463
|
+
ry = (rand() * 2 - 1) * 4.3;
|
|
464
|
+
tries++;
|
|
465
|
+
} while (
|
|
466
|
+
tries < 30 &&
|
|
467
|
+
Math.abs(ry) < TEXT_HALF_H + 0.7 &&
|
|
468
|
+
Math.abs(rx) < TEXT_HALF_W + 0.8
|
|
469
|
+
);
|
|
470
|
+
sp.stayer = true;
|
|
471
|
+
sp.restX = rx;
|
|
472
|
+
sp.restY = ry;
|
|
473
|
+
if (Math.abs(rx) > TEXT_HALF_W + 0.8 && Math.abs(ry) < TEXT_HALF_H + 1.4) {
|
|
474
|
+
sp.restRZ = ((rx > 0 ? -1 : 1) * Math.PI) / 2 + (rand() - 0.5) * 0.7;
|
|
475
|
+
} else if (ry >= 0) {
|
|
476
|
+
sp.restRZ = (rand() - 0.5) * 0.8;
|
|
477
|
+
} else {
|
|
478
|
+
sp.restRZ = Math.PI + (rand() - 0.5) * 0.8;
|
|
479
|
+
}
|
|
480
|
+
placed++;
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
var batch1 = buildBatch(1);
|
|
485
|
+
var batch2 = buildBatch(2);
|
|
486
|
+
pickStayers(batch1);
|
|
487
|
+
pickStayers(batch2);
|
|
488
|
+
// Sweep-away order for batch-1 stayers: left-most leave first.
|
|
489
|
+
batch1.forEach(function (s) {
|
|
490
|
+
s.delay2 = ((s.restX + 16) / 32) * 0.5 + rand() * 0.14;
|
|
491
|
+
});
|
|
492
|
+
// Independent seed: V1's opening geometry/seed sequence is unchanged.
|
|
493
|
+
var liftRand = mulberry32(0x6c696674);
|
|
494
|
+
batch2.forEach(function (s, i) {
|
|
495
|
+
s.liftX = (liftRand() * 2 - 1) * 7.8;
|
|
496
|
+
s.liftY = -5.2 + liftRand() * 5.8;
|
|
497
|
+
s.liftZ = -7 + liftRand() * 4.9;
|
|
498
|
+
s.liftDelay = liftRand() * 0.28;
|
|
499
|
+
s.depthResponse = Math.max(0.25, Math.min(1, (s.liftZ + 7) / 14 + 0.55));
|
|
500
|
+
// Keep final foliage outside the headline, including its full leaf extent.
|
|
501
|
+
if (s.stayer) {
|
|
502
|
+
var a = i * 2.399963;
|
|
503
|
+
s.restX = Math.sin(a) * 8.5;
|
|
504
|
+
s.restY = (i % 2 ? 1 : -1) * 5.5;
|
|
505
|
+
s.restRZ = i % 2 ? 0 : Math.PI;
|
|
506
|
+
}
|
|
507
|
+
});
|
|
508
|
+
window.__cptBatches = [batch1, batch2];
|
|
509
|
+
|
|
510
|
+
var DUST_COUNT = 800;
|
|
511
|
+
var dustHome = new Array(DUST_COUNT * 3);
|
|
512
|
+
var dustSeeds = new Array(DUST_COUNT);
|
|
513
|
+
for (var d = 0; d < DUST_COUNT; d++) {
|
|
514
|
+
dustHome[d * 3] = (rand() * 2 - 1) * 10;
|
|
515
|
+
dustHome[d * 3 + 1] = (rand() * 2 - 1) * 6;
|
|
516
|
+
dustHome[d * 3 + 2] = rand() * 12 - 5;
|
|
517
|
+
dustSeeds[d] = rand();
|
|
518
|
+
}
|
|
519
|
+
window.__cptDust = { home: dustHome, seeds: dustSeeds };
|
|
520
|
+
|
|
521
|
+
// Separate per-leaf seeds leave the approved sweep/lift layout untouched.
|
|
522
|
+
// Different periods and phases avoid a shared rocking or looping beat.
|
|
523
|
+
[batch1, batch2].forEach(function (batch, batchIndex) {
|
|
524
|
+
batch.forEach(function (s, i) {
|
|
525
|
+
if (!s.stayer) return;
|
|
526
|
+
var breezeRand = mulberry32(0x62726565 ^ ((batchIndex + 1) * 104729 + i * 7919));
|
|
527
|
+
s.breeze = {
|
|
528
|
+
phase: breezeRand() * Math.PI * 2,
|
|
529
|
+
phase2: breezeRand() * Math.PI * 2,
|
|
530
|
+
phase3: breezeRand() * Math.PI * 2,
|
|
531
|
+
rate: 0.55 + breezeRand() * 0.45,
|
|
532
|
+
driftX: 0.22 + breezeRand() * 0.24,
|
|
533
|
+
driftY: 0.28 + breezeRand() * 0.28,
|
|
534
|
+
driftZ: 0.35 + breezeRand() * 0.45,
|
|
535
|
+
depth: (breezeRand() - 0.5) * 1.3,
|
|
536
|
+
tiltX: 0.07 + breezeRand() * 0.1,
|
|
537
|
+
tiltY: 0.1 + breezeRand() * 0.14,
|
|
538
|
+
roll: 0.12 + breezeRand() * 0.14,
|
|
539
|
+
turn: (breezeRand() < 0.5 ? -1 : 1) * (0.012 + breezeRand() * 0.022),
|
|
540
|
+
arrival: breezeRand() * 0.16,
|
|
541
|
+
};
|
|
542
|
+
});
|
|
543
|
+
});
|
|
544
|
+
|
|
545
|
+
/* Masters tweened by the timeline; all per-leaf motion is a closed-form
|
|
546
|
+
function of these plus each leaf's seeded constants. */
|
|
547
|
+
var state = { sw1: 0, sw2: 0 };
|
|
548
|
+
window.__cptState = state;
|
|
549
|
+
|
|
550
|
+
// Keep the existing speed parameter; finite holds absorb the slack.
|
|
551
|
+
var d1 = Math.max(1.2, Math.min(6.0, 3.2 / SPEED));
|
|
552
|
+
var s2 = Math.max(0.4 + d1 + 0.9, 5.2);
|
|
553
|
+
var d2 = Math.max(1.2, Math.min(3.2 / SPEED, DUR - s2 - 1.8));
|
|
554
|
+
window.__cptWindows = { d1: d1, s2: s2, d2: d2 };
|
|
555
|
+
|
|
556
|
+
var tl = gsap.timeline({ paused: true });
|
|
557
|
+
tl.addLabel("opening", 0)
|
|
558
|
+
.addLabel("headline-1", 0.4 + d1)
|
|
559
|
+
.addLabel("canopy-lift", s2)
|
|
560
|
+
.addLabel("headline-2", s2 + d2)
|
|
561
|
+
.addLabel("final-hold", 10.5);
|
|
562
|
+
tl.fromTo(
|
|
563
|
+
"#cpt-scene",
|
|
564
|
+
{ opacity: 0 },
|
|
565
|
+
{ opacity: 1, duration: 0.35, ease: "power1.out" },
|
|
566
|
+
0.05,
|
|
567
|
+
);
|
|
568
|
+
// Imperceptible 1.5px drift on the bg plate (same colour as the body
|
|
569
|
+
// behind it) so the layout sweep sees DOM geometry advance under seek.
|
|
570
|
+
tl.fromTo("#cpt-bg", { y: 0 }, { y: 1.5, duration: 12, ease: "none" }, 0);
|
|
571
|
+
tl.to(state, { sw1: 1, duration: d1, ease: "none" }, 0.4);
|
|
572
|
+
tl.to(state, { sw2: 1, duration: d2, ease: "none" }, s2);
|
|
573
|
+
tl.to(state, { sw2: 1, duration: 0.01 }, DUR - 0.01); // pin timeline length to DUR
|
|
574
|
+
|
|
575
|
+
tl.eventCallback("onUpdate", function () {
|
|
576
|
+
if (window.__cptRender) window.__cptRender(tl.time());
|
|
577
|
+
});
|
|
578
|
+
|
|
579
|
+
window.__timelines["canopy-part-title"] = tl;
|
|
580
|
+
})();
|
|
581
|
+
</script>
|
|
582
|
+
|
|
583
|
+
<script>
|
|
584
|
+
( function () {
|
|
585
|
+
|
|
586
|
+
/**
|
|
587
|
+
* Full-screen textured quad shader
|
|
588
|
+
*/
|
|
589
|
+
|
|
590
|
+
const CopyShader = {
|
|
591
|
+
uniforms: {
|
|
592
|
+
'tDiffuse': {
|
|
593
|
+
value: null
|
|
594
|
+
},
|
|
595
|
+
'opacity': {
|
|
596
|
+
value: 1.0
|
|
597
|
+
}
|
|
598
|
+
},
|
|
599
|
+
vertexShader: /* glsl */`
|
|
600
|
+
|
|
601
|
+
varying vec2 vUv;
|
|
602
|
+
|
|
603
|
+
void main() {
|
|
604
|
+
|
|
605
|
+
vUv = uv;
|
|
606
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
607
|
+
|
|
608
|
+
}`,
|
|
609
|
+
fragmentShader: /* glsl */`
|
|
610
|
+
|
|
611
|
+
uniform float opacity;
|
|
612
|
+
|
|
613
|
+
uniform sampler2D tDiffuse;
|
|
614
|
+
|
|
615
|
+
varying vec2 vUv;
|
|
616
|
+
|
|
617
|
+
void main() {
|
|
618
|
+
|
|
619
|
+
gl_FragColor = texture2D( tDiffuse, vUv );
|
|
620
|
+
gl_FragColor.a *= opacity;
|
|
621
|
+
|
|
622
|
+
|
|
623
|
+
}`
|
|
624
|
+
};
|
|
625
|
+
|
|
626
|
+
THREE.CopyShader = CopyShader;
|
|
627
|
+
|
|
628
|
+
} )();
|
|
629
|
+
|
|
630
|
+
</script><script>
|
|
631
|
+
( function () {
|
|
632
|
+
|
|
633
|
+
class Pass {
|
|
634
|
+
|
|
635
|
+
constructor() {
|
|
636
|
+
|
|
637
|
+
// if set to true, the pass is processed by the composer
|
|
638
|
+
this.enabled = true;
|
|
639
|
+
|
|
640
|
+
// if set to true, the pass indicates to swap read and write buffer after rendering
|
|
641
|
+
this.needsSwap = true;
|
|
642
|
+
|
|
643
|
+
// if set to true, the pass clears its buffer before rendering
|
|
644
|
+
this.clear = false;
|
|
645
|
+
|
|
646
|
+
// if set to true, the result of the pass is rendered to screen. This is set automatically by EffectComposer.
|
|
647
|
+
this.renderToScreen = false;
|
|
648
|
+
|
|
649
|
+
}
|
|
650
|
+
setSize() {}
|
|
651
|
+
render() {
|
|
652
|
+
|
|
653
|
+
console.error( 'THREE.Pass: .render() must be implemented in derived pass.' );
|
|
654
|
+
|
|
655
|
+
}
|
|
656
|
+
dispose() {}
|
|
657
|
+
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
// Helper for passes that need to fill the viewport with a single quad.
|
|
661
|
+
|
|
662
|
+
const _camera = new THREE.OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );
|
|
663
|
+
|
|
664
|
+
// https://github.com/mrdoob/three.js/pull/21358
|
|
665
|
+
|
|
666
|
+
const _geometry = new THREE.BufferGeometry();
|
|
667
|
+
_geometry.setAttribute( 'position', new THREE.Float32BufferAttribute( [ - 1, 3, 0, - 1, - 1, 0, 3, - 1, 0 ], 3 ) );
|
|
668
|
+
_geometry.setAttribute( 'uv', new THREE.Float32BufferAttribute( [ 0, 2, 0, 0, 2, 0 ], 2 ) );
|
|
669
|
+
class FullScreenQuad {
|
|
670
|
+
|
|
671
|
+
constructor( material ) {
|
|
672
|
+
|
|
673
|
+
this._mesh = new THREE.Mesh( _geometry, material );
|
|
674
|
+
|
|
675
|
+
}
|
|
676
|
+
dispose() {
|
|
677
|
+
|
|
678
|
+
this._mesh.geometry.dispose();
|
|
679
|
+
|
|
680
|
+
}
|
|
681
|
+
render( renderer ) {
|
|
682
|
+
|
|
683
|
+
renderer.render( this._mesh, _camera );
|
|
684
|
+
|
|
685
|
+
}
|
|
686
|
+
get material() {
|
|
687
|
+
|
|
688
|
+
return this._mesh.material;
|
|
689
|
+
|
|
690
|
+
}
|
|
691
|
+
set material( value ) {
|
|
692
|
+
|
|
693
|
+
this._mesh.material = value;
|
|
694
|
+
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
THREE.FullScreenQuad = FullScreenQuad;
|
|
700
|
+
THREE.Pass = Pass;
|
|
701
|
+
|
|
702
|
+
} )();
|
|
703
|
+
|
|
704
|
+
</script><script>
|
|
705
|
+
( function () {
|
|
706
|
+
|
|
707
|
+
class ShaderPass extends THREE.Pass {
|
|
708
|
+
|
|
709
|
+
constructor( shader, textureID ) {
|
|
710
|
+
|
|
711
|
+
super();
|
|
712
|
+
this.textureID = textureID !== undefined ? textureID : 'tDiffuse';
|
|
713
|
+
if ( shader instanceof THREE.ShaderMaterial ) {
|
|
714
|
+
|
|
715
|
+
this.uniforms = shader.uniforms;
|
|
716
|
+
this.material = shader;
|
|
717
|
+
|
|
718
|
+
} else if ( shader ) {
|
|
719
|
+
|
|
720
|
+
this.uniforms = THREE.UniformsUtils.clone( shader.uniforms );
|
|
721
|
+
this.material = new THREE.ShaderMaterial( {
|
|
722
|
+
defines: Object.assign( {}, shader.defines ),
|
|
723
|
+
uniforms: this.uniforms,
|
|
724
|
+
vertexShader: shader.vertexShader,
|
|
725
|
+
fragmentShader: shader.fragmentShader
|
|
726
|
+
} );
|
|
727
|
+
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
this.fsQuad = new THREE.FullScreenQuad( this.material );
|
|
731
|
+
|
|
732
|
+
}
|
|
733
|
+
render( renderer, writeBuffer, readBuffer /*, deltaTime, maskActive */ ) {
|
|
734
|
+
|
|
735
|
+
if ( this.uniforms[ this.textureID ] ) {
|
|
736
|
+
|
|
737
|
+
this.uniforms[ this.textureID ].value = readBuffer.texture;
|
|
738
|
+
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
this.fsQuad.material = this.material;
|
|
742
|
+
if ( this.renderToScreen ) {
|
|
743
|
+
|
|
744
|
+
renderer.setRenderTarget( null );
|
|
745
|
+
this.fsQuad.render( renderer );
|
|
746
|
+
|
|
747
|
+
} else {
|
|
748
|
+
|
|
749
|
+
renderer.setRenderTarget( writeBuffer );
|
|
750
|
+
// TODO: Avoid using autoClear properties, see https://github.com/mrdoob/three.js/pull/15571#issuecomment-465669600
|
|
751
|
+
if ( this.clear ) renderer.clear( renderer.autoClearColor, renderer.autoClearDepth, renderer.autoClearStencil );
|
|
752
|
+
this.fsQuad.render( renderer );
|
|
753
|
+
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
}
|
|
757
|
+
dispose() {
|
|
758
|
+
|
|
759
|
+
this.material.dispose();
|
|
760
|
+
this.fsQuad.dispose();
|
|
761
|
+
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
THREE.ShaderPass = ShaderPass;
|
|
767
|
+
|
|
768
|
+
} )();
|
|
769
|
+
|
|
770
|
+
</script><script>
|
|
771
|
+
( function () {
|
|
772
|
+
|
|
773
|
+
class MaskPass extends THREE.Pass {
|
|
774
|
+
|
|
775
|
+
constructor( scene, camera ) {
|
|
776
|
+
|
|
777
|
+
super();
|
|
778
|
+
this.scene = scene;
|
|
779
|
+
this.camera = camera;
|
|
780
|
+
this.clear = true;
|
|
781
|
+
this.needsSwap = false;
|
|
782
|
+
this.inverse = false;
|
|
783
|
+
|
|
784
|
+
}
|
|
785
|
+
render( renderer, writeBuffer, readBuffer /*, deltaTime, maskActive */ ) {
|
|
786
|
+
|
|
787
|
+
const context = renderer.getContext();
|
|
788
|
+
const state = renderer.state;
|
|
789
|
+
|
|
790
|
+
// don't update color or depth
|
|
791
|
+
|
|
792
|
+
state.buffers.color.setMask( false );
|
|
793
|
+
state.buffers.depth.setMask( false );
|
|
794
|
+
|
|
795
|
+
// lock buffers
|
|
796
|
+
|
|
797
|
+
state.buffers.color.setLocked( true );
|
|
798
|
+
state.buffers.depth.setLocked( true );
|
|
799
|
+
|
|
800
|
+
// set up stencil
|
|
801
|
+
|
|
802
|
+
let writeValue, clearValue;
|
|
803
|
+
if ( this.inverse ) {
|
|
804
|
+
|
|
805
|
+
writeValue = 0;
|
|
806
|
+
clearValue = 1;
|
|
807
|
+
|
|
808
|
+
} else {
|
|
809
|
+
|
|
810
|
+
writeValue = 1;
|
|
811
|
+
clearValue = 0;
|
|
812
|
+
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
state.buffers.stencil.setTest( true );
|
|
816
|
+
state.buffers.stencil.setOp( context.REPLACE, context.REPLACE, context.REPLACE );
|
|
817
|
+
state.buffers.stencil.setFunc( context.ALWAYS, writeValue, 0xffffffff );
|
|
818
|
+
state.buffers.stencil.setClear( clearValue );
|
|
819
|
+
state.buffers.stencil.setLocked( true );
|
|
820
|
+
|
|
821
|
+
// draw into the stencil buffer
|
|
822
|
+
|
|
823
|
+
renderer.setRenderTarget( readBuffer );
|
|
824
|
+
if ( this.clear ) renderer.clear();
|
|
825
|
+
renderer.render( this.scene, this.camera );
|
|
826
|
+
renderer.setRenderTarget( writeBuffer );
|
|
827
|
+
if ( this.clear ) renderer.clear();
|
|
828
|
+
renderer.render( this.scene, this.camera );
|
|
829
|
+
|
|
830
|
+
// unlock color and depth buffer for subsequent rendering
|
|
831
|
+
|
|
832
|
+
state.buffers.color.setLocked( false );
|
|
833
|
+
state.buffers.depth.setLocked( false );
|
|
834
|
+
|
|
835
|
+
// only render where stencil is set to 1
|
|
836
|
+
|
|
837
|
+
state.buffers.stencil.setLocked( false );
|
|
838
|
+
state.buffers.stencil.setFunc( context.EQUAL, 1, 0xffffffff ); // draw if == 1
|
|
839
|
+
state.buffers.stencil.setOp( context.KEEP, context.KEEP, context.KEEP );
|
|
840
|
+
state.buffers.stencil.setLocked( true );
|
|
841
|
+
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
}
|
|
845
|
+
class ClearMaskPass extends THREE.Pass {
|
|
846
|
+
|
|
847
|
+
constructor() {
|
|
848
|
+
|
|
849
|
+
super();
|
|
850
|
+
this.needsSwap = false;
|
|
851
|
+
|
|
852
|
+
}
|
|
853
|
+
render( renderer /*, writeBuffer, readBuffer, deltaTime, maskActive */ ) {
|
|
854
|
+
|
|
855
|
+
renderer.state.buffers.stencil.setLocked( false );
|
|
856
|
+
renderer.state.buffers.stencil.setTest( false );
|
|
857
|
+
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
THREE.ClearMaskPass = ClearMaskPass;
|
|
863
|
+
THREE.MaskPass = MaskPass;
|
|
864
|
+
|
|
865
|
+
} )();
|
|
866
|
+
|
|
867
|
+
</script><script>
|
|
868
|
+
( function () {
|
|
869
|
+
|
|
870
|
+
class EffectComposer {
|
|
871
|
+
|
|
872
|
+
constructor( renderer, renderTarget ) {
|
|
873
|
+
|
|
874
|
+
this.renderer = renderer;
|
|
875
|
+
if ( renderTarget === undefined ) {
|
|
876
|
+
|
|
877
|
+
const size = renderer.getSize( new THREE.Vector2() );
|
|
878
|
+
this._pixelRatio = renderer.getPixelRatio();
|
|
879
|
+
this._width = size.width;
|
|
880
|
+
this._height = size.height;
|
|
881
|
+
renderTarget = new THREE.WebGLRenderTarget( this._width * this._pixelRatio, this._height * this._pixelRatio );
|
|
882
|
+
renderTarget.texture.name = 'EffectComposer.rt1';
|
|
883
|
+
|
|
884
|
+
} else {
|
|
885
|
+
|
|
886
|
+
this._pixelRatio = 1;
|
|
887
|
+
this._width = renderTarget.width;
|
|
888
|
+
this._height = renderTarget.height;
|
|
889
|
+
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
this.renderTarget1 = renderTarget;
|
|
893
|
+
this.renderTarget2 = renderTarget.clone();
|
|
894
|
+
this.renderTarget2.texture.name = 'EffectComposer.rt2';
|
|
895
|
+
this.writeBuffer = this.renderTarget1;
|
|
896
|
+
this.readBuffer = this.renderTarget2;
|
|
897
|
+
this.renderToScreen = true;
|
|
898
|
+
this.passes = [];
|
|
899
|
+
|
|
900
|
+
// dependencies
|
|
901
|
+
|
|
902
|
+
if ( THREE.CopyShader === undefined ) {
|
|
903
|
+
|
|
904
|
+
console.error( 'THREE.EffectComposer relies on THREE.CopyShader' );
|
|
905
|
+
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
if ( THREE.ShaderPass === undefined ) {
|
|
909
|
+
|
|
910
|
+
console.error( 'THREE.EffectComposer relies on THREE.ShaderPass' );
|
|
911
|
+
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
this.copyPass = new THREE.ShaderPass( THREE.CopyShader );
|
|
915
|
+
this.clock = new THREE.Clock();
|
|
916
|
+
|
|
917
|
+
}
|
|
918
|
+
swapBuffers() {
|
|
919
|
+
|
|
920
|
+
const tmp = this.readBuffer;
|
|
921
|
+
this.readBuffer = this.writeBuffer;
|
|
922
|
+
this.writeBuffer = tmp;
|
|
923
|
+
|
|
924
|
+
}
|
|
925
|
+
addPass( pass ) {
|
|
926
|
+
|
|
927
|
+
this.passes.push( pass );
|
|
928
|
+
pass.setSize( this._width * this._pixelRatio, this._height * this._pixelRatio );
|
|
929
|
+
|
|
930
|
+
}
|
|
931
|
+
insertPass( pass, index ) {
|
|
932
|
+
|
|
933
|
+
this.passes.splice( index, 0, pass );
|
|
934
|
+
pass.setSize( this._width * this._pixelRatio, this._height * this._pixelRatio );
|
|
935
|
+
|
|
936
|
+
}
|
|
937
|
+
removePass( pass ) {
|
|
938
|
+
|
|
939
|
+
const index = this.passes.indexOf( pass );
|
|
940
|
+
if ( index !== - 1 ) {
|
|
941
|
+
|
|
942
|
+
this.passes.splice( index, 1 );
|
|
943
|
+
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
}
|
|
947
|
+
isLastEnabledPass( passIndex ) {
|
|
948
|
+
|
|
949
|
+
for ( let i = passIndex + 1; i < this.passes.length; i ++ ) {
|
|
950
|
+
|
|
951
|
+
if ( this.passes[ i ].enabled ) {
|
|
952
|
+
|
|
953
|
+
return false;
|
|
954
|
+
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
return true;
|
|
960
|
+
|
|
961
|
+
}
|
|
962
|
+
render( deltaTime ) {
|
|
963
|
+
|
|
964
|
+
// deltaTime value is in seconds
|
|
965
|
+
|
|
966
|
+
if ( deltaTime === undefined ) {
|
|
967
|
+
|
|
968
|
+
deltaTime = this.clock.getDelta();
|
|
969
|
+
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
const currentRenderTarget = this.renderer.getRenderTarget();
|
|
973
|
+
let maskActive = false;
|
|
974
|
+
for ( let i = 0, il = this.passes.length; i < il; i ++ ) {
|
|
975
|
+
|
|
976
|
+
const pass = this.passes[ i ];
|
|
977
|
+
if ( pass.enabled === false ) continue;
|
|
978
|
+
pass.renderToScreen = this.renderToScreen && this.isLastEnabledPass( i );
|
|
979
|
+
pass.render( this.renderer, this.writeBuffer, this.readBuffer, deltaTime, maskActive );
|
|
980
|
+
if ( pass.needsSwap ) {
|
|
981
|
+
|
|
982
|
+
if ( maskActive ) {
|
|
983
|
+
|
|
984
|
+
const context = this.renderer.getContext();
|
|
985
|
+
const stencil = this.renderer.state.buffers.stencil;
|
|
986
|
+
|
|
987
|
+
//context.stencilFunc( context.NOTEQUAL, 1, 0xffffffff );
|
|
988
|
+
stencil.setFunc( context.NOTEQUAL, 1, 0xffffffff );
|
|
989
|
+
this.copyPass.render( this.renderer, this.writeBuffer, this.readBuffer, deltaTime );
|
|
990
|
+
|
|
991
|
+
//context.stencilFunc( context.EQUAL, 1, 0xffffffff );
|
|
992
|
+
stencil.setFunc( context.EQUAL, 1, 0xffffffff );
|
|
993
|
+
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
this.swapBuffers();
|
|
997
|
+
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
if ( THREE.MaskPass !== undefined ) {
|
|
1001
|
+
|
|
1002
|
+
if ( pass instanceof THREE.MaskPass ) {
|
|
1003
|
+
|
|
1004
|
+
maskActive = true;
|
|
1005
|
+
|
|
1006
|
+
} else if ( pass instanceof THREE.ClearMaskPass ) {
|
|
1007
|
+
|
|
1008
|
+
maskActive = false;
|
|
1009
|
+
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
this.renderer.setRenderTarget( currentRenderTarget );
|
|
1017
|
+
|
|
1018
|
+
}
|
|
1019
|
+
reset( renderTarget ) {
|
|
1020
|
+
|
|
1021
|
+
if ( renderTarget === undefined ) {
|
|
1022
|
+
|
|
1023
|
+
const size = this.renderer.getSize( new THREE.Vector2() );
|
|
1024
|
+
this._pixelRatio = this.renderer.getPixelRatio();
|
|
1025
|
+
this._width = size.width;
|
|
1026
|
+
this._height = size.height;
|
|
1027
|
+
renderTarget = this.renderTarget1.clone();
|
|
1028
|
+
renderTarget.setSize( this._width * this._pixelRatio, this._height * this._pixelRatio );
|
|
1029
|
+
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
this.renderTarget1.dispose();
|
|
1033
|
+
this.renderTarget2.dispose();
|
|
1034
|
+
this.renderTarget1 = renderTarget;
|
|
1035
|
+
this.renderTarget2 = renderTarget.clone();
|
|
1036
|
+
this.writeBuffer = this.renderTarget1;
|
|
1037
|
+
this.readBuffer = this.renderTarget2;
|
|
1038
|
+
|
|
1039
|
+
}
|
|
1040
|
+
setSize( width, height ) {
|
|
1041
|
+
|
|
1042
|
+
this._width = width;
|
|
1043
|
+
this._height = height;
|
|
1044
|
+
const effectiveWidth = this._width * this._pixelRatio;
|
|
1045
|
+
const effectiveHeight = this._height * this._pixelRatio;
|
|
1046
|
+
this.renderTarget1.setSize( effectiveWidth, effectiveHeight );
|
|
1047
|
+
this.renderTarget2.setSize( effectiveWidth, effectiveHeight );
|
|
1048
|
+
for ( let i = 0; i < this.passes.length; i ++ ) {
|
|
1049
|
+
|
|
1050
|
+
this.passes[ i ].setSize( effectiveWidth, effectiveHeight );
|
|
1051
|
+
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
}
|
|
1055
|
+
setPixelRatio( pixelRatio ) {
|
|
1056
|
+
|
|
1057
|
+
this._pixelRatio = pixelRatio;
|
|
1058
|
+
this.setSize( this._width, this._height );
|
|
1059
|
+
|
|
1060
|
+
}
|
|
1061
|
+
dispose() {
|
|
1062
|
+
|
|
1063
|
+
this.renderTarget1.dispose();
|
|
1064
|
+
this.renderTarget2.dispose();
|
|
1065
|
+
this.copyPass.dispose();
|
|
1066
|
+
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
}
|
|
1070
|
+
class Pass {
|
|
1071
|
+
|
|
1072
|
+
constructor() {
|
|
1073
|
+
|
|
1074
|
+
// if set to true, the pass is processed by the composer
|
|
1075
|
+
this.enabled = true;
|
|
1076
|
+
|
|
1077
|
+
// if set to true, the pass indicates to swap read and write buffer after rendering
|
|
1078
|
+
this.needsSwap = true;
|
|
1079
|
+
|
|
1080
|
+
// if set to true, the pass clears its buffer before rendering
|
|
1081
|
+
this.clear = false;
|
|
1082
|
+
|
|
1083
|
+
// if set to true, the result of the pass is rendered to screen. This is set automatically by EffectComposer.
|
|
1084
|
+
this.renderToScreen = false;
|
|
1085
|
+
|
|
1086
|
+
}
|
|
1087
|
+
setSize() {}
|
|
1088
|
+
render() {
|
|
1089
|
+
|
|
1090
|
+
console.error( 'THREE.Pass: .render() must be implemented in derived pass.' );
|
|
1091
|
+
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
// Helper for passes that need to fill the viewport with a single quad.
|
|
1097
|
+
|
|
1098
|
+
const _camera = new THREE.OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );
|
|
1099
|
+
|
|
1100
|
+
// https://github.com/mrdoob/three.js/pull/21358
|
|
1101
|
+
|
|
1102
|
+
const _geometry = new THREE.BufferGeometry();
|
|
1103
|
+
_geometry.setAttribute( 'position', new THREE.Float32BufferAttribute( [ - 1, 3, 0, - 1, - 1, 0, 3, - 1, 0 ], 3 ) );
|
|
1104
|
+
_geometry.setAttribute( 'uv', new THREE.Float32BufferAttribute( [ 0, 2, 0, 0, 2, 0 ], 2 ) );
|
|
1105
|
+
class FullScreenQuad {
|
|
1106
|
+
|
|
1107
|
+
constructor( material ) {
|
|
1108
|
+
|
|
1109
|
+
this._mesh = new THREE.Mesh( _geometry, material );
|
|
1110
|
+
|
|
1111
|
+
}
|
|
1112
|
+
dispose() {
|
|
1113
|
+
|
|
1114
|
+
this._mesh.geometry.dispose();
|
|
1115
|
+
|
|
1116
|
+
}
|
|
1117
|
+
render( renderer ) {
|
|
1118
|
+
|
|
1119
|
+
renderer.render( this._mesh, _camera );
|
|
1120
|
+
|
|
1121
|
+
}
|
|
1122
|
+
get material() {
|
|
1123
|
+
|
|
1124
|
+
return this._mesh.material;
|
|
1125
|
+
|
|
1126
|
+
}
|
|
1127
|
+
set material( value ) {
|
|
1128
|
+
|
|
1129
|
+
this._mesh.material = value;
|
|
1130
|
+
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
THREE.EffectComposer = EffectComposer;
|
|
1136
|
+
THREE.FullScreenQuad = FullScreenQuad;
|
|
1137
|
+
THREE.Pass = Pass;
|
|
1138
|
+
|
|
1139
|
+
} )();
|
|
1140
|
+
|
|
1141
|
+
</script><script>
|
|
1142
|
+
( function () {
|
|
1143
|
+
|
|
1144
|
+
class RenderPass extends THREE.Pass {
|
|
1145
|
+
|
|
1146
|
+
constructor( scene, camera, overrideMaterial, clearColor, clearAlpha ) {
|
|
1147
|
+
|
|
1148
|
+
super();
|
|
1149
|
+
this.scene = scene;
|
|
1150
|
+
this.camera = camera;
|
|
1151
|
+
this.overrideMaterial = overrideMaterial;
|
|
1152
|
+
this.clearColor = clearColor;
|
|
1153
|
+
this.clearAlpha = clearAlpha !== undefined ? clearAlpha : 0;
|
|
1154
|
+
this.clear = true;
|
|
1155
|
+
this.clearDepth = false;
|
|
1156
|
+
this.needsSwap = false;
|
|
1157
|
+
this._oldClearColor = new THREE.Color();
|
|
1158
|
+
|
|
1159
|
+
}
|
|
1160
|
+
render( renderer, writeBuffer, readBuffer /*, deltaTime, maskActive */ ) {
|
|
1161
|
+
|
|
1162
|
+
const oldAutoClear = renderer.autoClear;
|
|
1163
|
+
renderer.autoClear = false;
|
|
1164
|
+
let oldClearAlpha, oldOverrideMaterial;
|
|
1165
|
+
if ( this.overrideMaterial !== undefined ) {
|
|
1166
|
+
|
|
1167
|
+
oldOverrideMaterial = this.scene.overrideMaterial;
|
|
1168
|
+
this.scene.overrideMaterial = this.overrideMaterial;
|
|
1169
|
+
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
if ( this.clearColor ) {
|
|
1173
|
+
|
|
1174
|
+
renderer.getClearColor( this._oldClearColor );
|
|
1175
|
+
oldClearAlpha = renderer.getClearAlpha();
|
|
1176
|
+
renderer.setClearColor( this.clearColor, this.clearAlpha );
|
|
1177
|
+
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
if ( this.clearDepth ) {
|
|
1181
|
+
|
|
1182
|
+
renderer.clearDepth();
|
|
1183
|
+
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
renderer.setRenderTarget( this.renderToScreen ? null : readBuffer );
|
|
1187
|
+
|
|
1188
|
+
// TODO: Avoid using autoClear properties, see https://github.com/mrdoob/three.js/pull/15571#issuecomment-465669600
|
|
1189
|
+
if ( this.clear ) renderer.clear( renderer.autoClearColor, renderer.autoClearDepth, renderer.autoClearStencil );
|
|
1190
|
+
renderer.render( this.scene, this.camera );
|
|
1191
|
+
if ( this.clearColor ) {
|
|
1192
|
+
|
|
1193
|
+
renderer.setClearColor( this._oldClearColor, oldClearAlpha );
|
|
1194
|
+
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
if ( this.overrideMaterial !== undefined ) {
|
|
1198
|
+
|
|
1199
|
+
this.scene.overrideMaterial = oldOverrideMaterial;
|
|
1200
|
+
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
renderer.autoClear = oldAutoClear;
|
|
1204
|
+
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
THREE.RenderPass = RenderPass;
|
|
1210
|
+
|
|
1211
|
+
} )();
|
|
1212
|
+
|
|
1213
|
+
</script><script>
|
|
1214
|
+
( function () {
|
|
1215
|
+
|
|
1216
|
+
/**
|
|
1217
|
+
* Depth-of-field shader with bokeh
|
|
1218
|
+
* ported from GLSL shader by Martins Upitis
|
|
1219
|
+
* http://artmartinsh.blogspot.com/2010/02/glsl-lens-blur-filter-with-bokeh.html
|
|
1220
|
+
*/
|
|
1221
|
+
|
|
1222
|
+
const BokehShader = {
|
|
1223
|
+
defines: {
|
|
1224
|
+
'DEPTH_PACKING': 1,
|
|
1225
|
+
'PERSPECTIVE_CAMERA': 1
|
|
1226
|
+
},
|
|
1227
|
+
uniforms: {
|
|
1228
|
+
'tColor': {
|
|
1229
|
+
value: null
|
|
1230
|
+
},
|
|
1231
|
+
'tDepth': {
|
|
1232
|
+
value: null
|
|
1233
|
+
},
|
|
1234
|
+
'focus': {
|
|
1235
|
+
value: 1.0
|
|
1236
|
+
},
|
|
1237
|
+
'aspect': {
|
|
1238
|
+
value: 1.0
|
|
1239
|
+
},
|
|
1240
|
+
'aperture': {
|
|
1241
|
+
value: 0.025
|
|
1242
|
+
},
|
|
1243
|
+
'maxblur': {
|
|
1244
|
+
value: 0.01
|
|
1245
|
+
},
|
|
1246
|
+
'nearClip': {
|
|
1247
|
+
value: 1.0
|
|
1248
|
+
},
|
|
1249
|
+
'farClip': {
|
|
1250
|
+
value: 1000.0
|
|
1251
|
+
}
|
|
1252
|
+
},
|
|
1253
|
+
vertexShader: /* glsl */`
|
|
1254
|
+
|
|
1255
|
+
varying vec2 vUv;
|
|
1256
|
+
|
|
1257
|
+
void main() {
|
|
1258
|
+
|
|
1259
|
+
vUv = uv;
|
|
1260
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
1261
|
+
|
|
1262
|
+
}`,
|
|
1263
|
+
fragmentShader: /* glsl */`
|
|
1264
|
+
|
|
1265
|
+
#include <common>
|
|
1266
|
+
|
|
1267
|
+
varying vec2 vUv;
|
|
1268
|
+
|
|
1269
|
+
uniform sampler2D tColor;
|
|
1270
|
+
uniform sampler2D tDepth;
|
|
1271
|
+
|
|
1272
|
+
uniform float maxblur; // max blur amount
|
|
1273
|
+
uniform float aperture; // aperture - bigger values for shallower depth of field
|
|
1274
|
+
|
|
1275
|
+
uniform float nearClip;
|
|
1276
|
+
uniform float farClip;
|
|
1277
|
+
|
|
1278
|
+
uniform float focus;
|
|
1279
|
+
uniform float aspect;
|
|
1280
|
+
|
|
1281
|
+
#include <packing>
|
|
1282
|
+
|
|
1283
|
+
float getDepth( const in vec2 screenPosition ) {
|
|
1284
|
+
#if DEPTH_PACKING == 1
|
|
1285
|
+
return unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );
|
|
1286
|
+
#else
|
|
1287
|
+
return texture2D( tDepth, screenPosition ).x;
|
|
1288
|
+
#endif
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
float getViewZ( const in float depth ) {
|
|
1292
|
+
#if PERSPECTIVE_CAMERA == 1
|
|
1293
|
+
return perspectiveDepthToViewZ( depth, nearClip, farClip );
|
|
1294
|
+
#else
|
|
1295
|
+
return orthographicDepthToViewZ( depth, nearClip, farClip );
|
|
1296
|
+
#endif
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
|
|
1300
|
+
void main() {
|
|
1301
|
+
|
|
1302
|
+
vec2 aspectcorrect = vec2( 1.0, aspect );
|
|
1303
|
+
|
|
1304
|
+
float viewZ = getViewZ( getDepth( vUv ) );
|
|
1305
|
+
|
|
1306
|
+
float factor = ( focus + viewZ ); // viewZ is <= 0, so this is a difference equation
|
|
1307
|
+
|
|
1308
|
+
vec2 dofblur = vec2 ( clamp( factor * aperture, -maxblur, maxblur ) );
|
|
1309
|
+
|
|
1310
|
+
vec2 dofblur9 = dofblur * 0.9;
|
|
1311
|
+
vec2 dofblur7 = dofblur * 0.7;
|
|
1312
|
+
vec2 dofblur4 = dofblur * 0.4;
|
|
1313
|
+
|
|
1314
|
+
vec4 col = vec4( 0.0 );
|
|
1315
|
+
|
|
1316
|
+
col += texture2D( tColor, vUv.xy );
|
|
1317
|
+
col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur );
|
|
1318
|
+
col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur );
|
|
1319
|
+
col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur );
|
|
1320
|
+
col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur );
|
|
1321
|
+
col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur );
|
|
1322
|
+
col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur );
|
|
1323
|
+
col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur );
|
|
1324
|
+
col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur );
|
|
1325
|
+
col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur );
|
|
1326
|
+
col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur );
|
|
1327
|
+
col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur );
|
|
1328
|
+
col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur );
|
|
1329
|
+
col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur );
|
|
1330
|
+
col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur );
|
|
1331
|
+
col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur );
|
|
1332
|
+
col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur );
|
|
1333
|
+
|
|
1334
|
+
col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur9 );
|
|
1335
|
+
col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur9 );
|
|
1336
|
+
col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur9 );
|
|
1337
|
+
col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur9 );
|
|
1338
|
+
col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur9 );
|
|
1339
|
+
col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur9 );
|
|
1340
|
+
col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur9 );
|
|
1341
|
+
col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur9 );
|
|
1342
|
+
|
|
1343
|
+
col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur7 );
|
|
1344
|
+
col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur7 );
|
|
1345
|
+
col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur7 );
|
|
1346
|
+
col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur7 );
|
|
1347
|
+
col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur7 );
|
|
1348
|
+
col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur7 );
|
|
1349
|
+
col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur7 );
|
|
1350
|
+
col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur7 );
|
|
1351
|
+
|
|
1352
|
+
col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur4 );
|
|
1353
|
+
col += texture2D( tColor, vUv.xy + ( vec2( 0.4, 0.0 ) * aspectcorrect ) * dofblur4 );
|
|
1354
|
+
col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur4 );
|
|
1355
|
+
col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur4 );
|
|
1356
|
+
col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur4 );
|
|
1357
|
+
col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur4 );
|
|
1358
|
+
col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur4 );
|
|
1359
|
+
col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur4 );
|
|
1360
|
+
|
|
1361
|
+
gl_FragColor = col / 41.0;
|
|
1362
|
+
gl_FragColor.a = 1.0;
|
|
1363
|
+
|
|
1364
|
+
}`
|
|
1365
|
+
};
|
|
1366
|
+
|
|
1367
|
+
THREE.BokehShader = BokehShader;
|
|
1368
|
+
|
|
1369
|
+
} )();
|
|
1370
|
+
|
|
1371
|
+
</script><script>
|
|
1372
|
+
( function () {
|
|
1373
|
+
|
|
1374
|
+
/**
|
|
1375
|
+
* Depth-of-field post-process with bokeh shader
|
|
1376
|
+
*/
|
|
1377
|
+
|
|
1378
|
+
class BokehPass extends THREE.Pass {
|
|
1379
|
+
|
|
1380
|
+
constructor( scene, camera, params ) {
|
|
1381
|
+
|
|
1382
|
+
super();
|
|
1383
|
+
this.scene = scene;
|
|
1384
|
+
this.camera = camera;
|
|
1385
|
+
const focus = params.focus !== undefined ? params.focus : 1.0;
|
|
1386
|
+
const aspect = params.aspect !== undefined ? params.aspect : camera.aspect;
|
|
1387
|
+
const aperture = params.aperture !== undefined ? params.aperture : 0.025;
|
|
1388
|
+
const maxblur = params.maxblur !== undefined ? params.maxblur : 1.0;
|
|
1389
|
+
|
|
1390
|
+
// render targets
|
|
1391
|
+
|
|
1392
|
+
this.renderTargetDepth = new THREE.WebGLRenderTarget( 1, 1, {
|
|
1393
|
+
// will be resized later
|
|
1394
|
+
minFilter: THREE.NearestFilter,
|
|
1395
|
+
magFilter: THREE.NearestFilter
|
|
1396
|
+
} );
|
|
1397
|
+
this.renderTargetDepth.texture.name = 'BokehPass.depth';
|
|
1398
|
+
|
|
1399
|
+
// depth material
|
|
1400
|
+
|
|
1401
|
+
this.materialDepth = new THREE.MeshDepthMaterial();
|
|
1402
|
+
this.materialDepth.depthPacking = THREE.RGBADepthPacking;
|
|
1403
|
+
this.materialDepth.blending = THREE.NoBlending;
|
|
1404
|
+
|
|
1405
|
+
// bokeh material
|
|
1406
|
+
|
|
1407
|
+
if ( THREE.BokehShader === undefined ) {
|
|
1408
|
+
|
|
1409
|
+
console.error( 'THREE.BokehPass relies on THREE.BokehShader' );
|
|
1410
|
+
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
const bokehShader = THREE.BokehShader;
|
|
1414
|
+
const bokehUniforms = THREE.UniformsUtils.clone( bokehShader.uniforms );
|
|
1415
|
+
bokehUniforms[ 'tDepth' ].value = this.renderTargetDepth.texture;
|
|
1416
|
+
bokehUniforms[ 'focus' ].value = focus;
|
|
1417
|
+
bokehUniforms[ 'aspect' ].value = aspect;
|
|
1418
|
+
bokehUniforms[ 'aperture' ].value = aperture;
|
|
1419
|
+
bokehUniforms[ 'maxblur' ].value = maxblur;
|
|
1420
|
+
bokehUniforms[ 'nearClip' ].value = camera.near;
|
|
1421
|
+
bokehUniforms[ 'farClip' ].value = camera.far;
|
|
1422
|
+
this.materialBokeh = new THREE.ShaderMaterial( {
|
|
1423
|
+
defines: Object.assign( {}, bokehShader.defines ),
|
|
1424
|
+
uniforms: bokehUniforms,
|
|
1425
|
+
vertexShader: bokehShader.vertexShader,
|
|
1426
|
+
fragmentShader: bokehShader.fragmentShader
|
|
1427
|
+
} );
|
|
1428
|
+
this.uniforms = bokehUniforms;
|
|
1429
|
+
this.needsSwap = false;
|
|
1430
|
+
this.fsQuad = new THREE.FullScreenQuad( this.materialBokeh );
|
|
1431
|
+
this._oldClearColor = new THREE.Color();
|
|
1432
|
+
|
|
1433
|
+
}
|
|
1434
|
+
render( renderer, writeBuffer, readBuffer /*, deltaTime, maskActive*/ ) {
|
|
1435
|
+
|
|
1436
|
+
// Render depth into texture
|
|
1437
|
+
|
|
1438
|
+
this.scene.overrideMaterial = this.materialDepth;
|
|
1439
|
+
renderer.getClearColor( this._oldClearColor );
|
|
1440
|
+
const oldClearAlpha = renderer.getClearAlpha();
|
|
1441
|
+
const oldAutoClear = renderer.autoClear;
|
|
1442
|
+
renderer.autoClear = false;
|
|
1443
|
+
renderer.setClearColor( 0xffffff );
|
|
1444
|
+
renderer.setClearAlpha( 1.0 );
|
|
1445
|
+
renderer.setRenderTarget( this.renderTargetDepth );
|
|
1446
|
+
renderer.clear();
|
|
1447
|
+
renderer.render( this.scene, this.camera );
|
|
1448
|
+
|
|
1449
|
+
// Render bokeh composite
|
|
1450
|
+
|
|
1451
|
+
this.uniforms[ 'tColor' ].value = readBuffer.texture;
|
|
1452
|
+
this.uniforms[ 'nearClip' ].value = this.camera.near;
|
|
1453
|
+
this.uniforms[ 'farClip' ].value = this.camera.far;
|
|
1454
|
+
if ( this.renderToScreen ) {
|
|
1455
|
+
|
|
1456
|
+
renderer.setRenderTarget( null );
|
|
1457
|
+
this.fsQuad.render( renderer );
|
|
1458
|
+
|
|
1459
|
+
} else {
|
|
1460
|
+
|
|
1461
|
+
renderer.setRenderTarget( writeBuffer );
|
|
1462
|
+
renderer.clear();
|
|
1463
|
+
this.fsQuad.render( renderer );
|
|
1464
|
+
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
this.scene.overrideMaterial = null;
|
|
1468
|
+
renderer.setClearColor( this._oldClearColor );
|
|
1469
|
+
renderer.setClearAlpha( oldClearAlpha );
|
|
1470
|
+
renderer.autoClear = oldAutoClear;
|
|
1471
|
+
|
|
1472
|
+
}
|
|
1473
|
+
setSize( width, height ) {
|
|
1474
|
+
|
|
1475
|
+
this.renderTargetDepth.setSize( width, height );
|
|
1476
|
+
|
|
1477
|
+
}
|
|
1478
|
+
dispose() {
|
|
1479
|
+
|
|
1480
|
+
this.renderTargetDepth.dispose();
|
|
1481
|
+
this.materialDepth.dispose();
|
|
1482
|
+
this.materialBokeh.dispose();
|
|
1483
|
+
this.fsQuad.dispose();
|
|
1484
|
+
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1489
|
+
THREE.BokehPass = BokehPass;
|
|
1490
|
+
|
|
1491
|
+
} )();
|
|
1492
|
+
|
|
1493
|
+
</script><script>
|
|
1494
|
+
(async function () {
|
|
1495
|
+
|
|
1496
|
+
var EffectComposer = THREE.EffectComposer;
|
|
1497
|
+
var RenderPass = THREE.RenderPass;
|
|
1498
|
+
var BokehPass = THREE.BokehPass;
|
|
1499
|
+
|
|
1500
|
+
const W = 1920,
|
|
1501
|
+
H = 1080,
|
|
1502
|
+
DUR = 12;
|
|
1503
|
+
// Bare __hyperframes is this composition's own in a module; getVariables carries the defaults.
|
|
1504
|
+
let V = {};
|
|
1505
|
+
try {
|
|
1506
|
+
if (typeof __hyperframes !== "undefined" && __hyperframes.getVariables)
|
|
1507
|
+
V = __hyperframes.getVariables() || {};
|
|
1508
|
+
} catch (e) {
|
|
1509
|
+
/* corrupt declarations must not blank the composition */
|
|
1510
|
+
}
|
|
1511
|
+
const HEADLINE1 = String(V.headline1 ?? "Understory");
|
|
1512
|
+
const HEADLINE2 = String(V.headline2 ?? "Move slowly");
|
|
1513
|
+
/* Headline typography is a PARAMETER — never a Design-panel edit. Any
|
|
1514
|
+
Google Fonts family name works; falls back through Gelasio/serif
|
|
1515
|
+
while (or if never) loading. */
|
|
1516
|
+
const FONT = (String(V.font || "Helvetica").trim() || "Helvetica").replace(/["']/g, "");
|
|
1517
|
+
const FONT_WEIGHT = Math.max(
|
|
1518
|
+
100,
|
|
1519
|
+
Math.min(
|
|
1520
|
+
900,
|
|
1521
|
+
Math.round(
|
|
1522
|
+
isFinite(Number(V.fontWeight)) && Number(V.fontWeight) ? Number(V.fontWeight) : 900,
|
|
1523
|
+
),
|
|
1524
|
+
),
|
|
1525
|
+
);
|
|
1526
|
+
/* fontSize is a multiplier on the auto-fitted size (0.3-2); letterSpacing
|
|
1527
|
+
is in em (fraction of the font size, may be negative). */
|
|
1528
|
+
const FONT_SIZE = Math.max(
|
|
1529
|
+
0.3,
|
|
1530
|
+
Math.min(
|
|
1531
|
+
2,
|
|
1532
|
+
isFinite(Number(V.fontSize)) && Number(V.fontSize) > 0 ? Number(V.fontSize) : 1,
|
|
1533
|
+
),
|
|
1534
|
+
);
|
|
1535
|
+
const LETTER_SP = Math.max(
|
|
1536
|
+
-0.2,
|
|
1537
|
+
Math.min(1, isFinite(Number(V.letterSpacing)) ? Number(V.letterSpacing) : 0.01),
|
|
1538
|
+
);
|
|
1539
|
+
const FONT_STACK = '"' + FONT + '", Gelasio, Georgia, serif';
|
|
1540
|
+
if (!/^(Helvetica|Arial|Gelasio|Georgia|serif|sans-serif|monospace)$/i.test(FONT)) {
|
|
1541
|
+
const fl = document.createElement("link");
|
|
1542
|
+
fl.rel = "stylesheet";
|
|
1543
|
+
fl.href =
|
|
1544
|
+
"data:text/css," +
|
|
1545
|
+
encodeURIComponent(FONT).replace(/%20/g, "+") +
|
|
1546
|
+
":wght@" +
|
|
1547
|
+
FONT_WEIGHT +
|
|
1548
|
+
"&display=swap";
|
|
1549
|
+
document.head.appendChild(fl);
|
|
1550
|
+
}
|
|
1551
|
+
const BG = String(V.background || "#020805");
|
|
1552
|
+
const RETAINED_BREEZE = Math.max(
|
|
1553
|
+
0,
|
|
1554
|
+
Math.min(2, Number.isFinite(Number(V.retainedBreeze)) ? Number(V.retainedBreeze) : 1),
|
|
1555
|
+
);
|
|
1556
|
+
const state = window.__cptState;
|
|
1557
|
+
|
|
1558
|
+
// Fixed experiment parameters (the source's tuned defaults), baked in.
|
|
1559
|
+
const WIND_SPEED = 1.06;
|
|
1560
|
+
const WIND_STRENGTH = 2.5;
|
|
1561
|
+
const TURBULENCE = 0.8;
|
|
1562
|
+
const TEXT_Z = -5.0;
|
|
1563
|
+
const BACKDROP_Z = -7.5;
|
|
1564
|
+
const CAM_DIST = 13.6;
|
|
1565
|
+
|
|
1566
|
+
const clamp = THREE.MathUtils.clamp;
|
|
1567
|
+
const smoothstep = (a, b, x) => {
|
|
1568
|
+
const t = clamp((x - a) / (b - a), 0, 1);
|
|
1569
|
+
return t * t * (3 - 2 * t);
|
|
1570
|
+
};
|
|
1571
|
+
function hash2(x, y, seed) {
|
|
1572
|
+
let n = Math.imul(x + seed * 1013, 374761393) + Math.imul(y - seed * 79, 668265263);
|
|
1573
|
+
n = n ^ (n >>> 13);
|
|
1574
|
+
n = Math.imul(n, 1274126177);
|
|
1575
|
+
return ((n ^ (n >>> 16)) >>> 0) / 4294967295;
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
document.getElementById("cpt-bg").style.background = BG;
|
|
1579
|
+
document.body.style.background = BG;
|
|
1580
|
+
|
|
1581
|
+
const renderer = new THREE.WebGLRenderer({
|
|
1582
|
+
canvas: document.getElementById("cpt-canvas"),
|
|
1583
|
+
antialias: true,
|
|
1584
|
+
powerPreference: "high-performance",
|
|
1585
|
+
alpha: false,
|
|
1586
|
+
});
|
|
1587
|
+
renderer.setSize(W, H, false);
|
|
1588
|
+
renderer.setPixelRatio(Math.min(window.devicePixelRatio || 1, 2));
|
|
1589
|
+
renderer.outputColorSpace = THREE.SRGBColorSpace;
|
|
1590
|
+
renderer.toneMapping = THREE.ACESFilmicToneMapping;
|
|
1591
|
+
renderer.toneMappingExposure = 1.8;
|
|
1592
|
+
renderer.shadowMap.enabled = true;
|
|
1593
|
+
renderer.shadowMap.type = THREE.PCFShadowMap;
|
|
1594
|
+
|
|
1595
|
+
const scene = new THREE.Scene();
|
|
1596
|
+
const bgColor = new THREE.Color(BG);
|
|
1597
|
+
scene.background = bgColor.clone();
|
|
1598
|
+
scene.fog = new THREE.FogExp2(bgColor.clone(), 0.008);
|
|
1599
|
+
|
|
1600
|
+
const camera = new THREE.PerspectiveCamera(41, W / H, 0.1, 40);
|
|
1601
|
+
camera.position.set(0, 0.15, 12.1);
|
|
1602
|
+
camera.lookAt(0, 0, -1.5);
|
|
1603
|
+
|
|
1604
|
+
const composer = new EffectComposer(renderer);
|
|
1605
|
+
composer.setSize(W, H);
|
|
1606
|
+
// Copy only colour; retain the scene depth for the sharp headline pass.
|
|
1607
|
+
composer.copyPass.material.depthTest = false;
|
|
1608
|
+
composer.copyPass.material.depthWrite = false;
|
|
1609
|
+
composer.addPass(new RenderPass(scene, camera));
|
|
1610
|
+
const bokehPass = new BokehPass(scene, camera, {
|
|
1611
|
+
focus: 16.4,
|
|
1612
|
+
aperture: 0.0016,
|
|
1613
|
+
maxblur: 0.0055,
|
|
1614
|
+
});
|
|
1615
|
+
composer.addPass(bokehPass);
|
|
1616
|
+
|
|
1617
|
+
const hemi = new THREE.HemisphereLight(0x9fc09b, 0x061009, 2);
|
|
1618
|
+
scene.add(hemi);
|
|
1619
|
+
const sun = new THREE.DirectionalLight(new THREE.Color("#ece5ff"), 8.5);
|
|
1620
|
+
sun.position.set(-13.3, 8.5, 9);
|
|
1621
|
+
sun.target.position.set(0, -1, -3);
|
|
1622
|
+
sun.castShadow = true;
|
|
1623
|
+
sun.shadow.mapSize.set(2048, 2048);
|
|
1624
|
+
sun.shadow.camera.left = -20;
|
|
1625
|
+
sun.shadow.camera.right = 20;
|
|
1626
|
+
sun.shadow.camera.top = 20 * 0.73;
|
|
1627
|
+
sun.shadow.camera.bottom = -20 * 0.73;
|
|
1628
|
+
sun.shadow.camera.near = 0.5;
|
|
1629
|
+
sun.shadow.camera.far = 28;
|
|
1630
|
+
sun.shadow.bias = 0.00105;
|
|
1631
|
+
sun.shadow.normalBias = 0.0525;
|
|
1632
|
+
sun.shadow.radius = 2.5;
|
|
1633
|
+
scene.add(sun, sun.target);
|
|
1634
|
+
const fill = new THREE.DirectionalLight(new THREE.Color("#00bd03"), 9.55);
|
|
1635
|
+
fill.position.set(-11.8, 4.2, 5.2);
|
|
1636
|
+
fill.target.position.set(0.7, 1, -2);
|
|
1637
|
+
scene.add(fill, fill.target);
|
|
1638
|
+
|
|
1639
|
+
/* Plain flat backdrop in the variable colour (unlit so it stays flat), with a
|
|
1640
|
+
shadow-only catcher just in front for leaf contact shadows. */
|
|
1641
|
+
const wall = new THREE.Mesh(
|
|
1642
|
+
new THREE.PlaneGeometry(68, 44),
|
|
1643
|
+
new THREE.MeshBasicMaterial({ color: bgColor.clone(), fog: false }),
|
|
1644
|
+
);
|
|
1645
|
+
wall.position.z = BACKDROP_Z;
|
|
1646
|
+
scene.add(wall);
|
|
1647
|
+
const catcher = new THREE.Mesh(
|
|
1648
|
+
new THREE.PlaneGeometry(68, 44),
|
|
1649
|
+
new THREE.ShadowMaterial({ opacity: 0.28 }),
|
|
1650
|
+
);
|
|
1651
|
+
catcher.position.z = BACKDROP_Z + 0.05;
|
|
1652
|
+
catcher.receiveShadow = true;
|
|
1653
|
+
scene.add(catcher);
|
|
1654
|
+
|
|
1655
|
+
// ---- Procedural leaf species textures (ported verbatim from the experiment).
|
|
1656
|
+
const palettes = {
|
|
1657
|
+
monstera: [
|
|
1658
|
+
[22, 77, 46],
|
|
1659
|
+
[79, 128, 70],
|
|
1660
|
+
[170, 184, 104],
|
|
1661
|
+
],
|
|
1662
|
+
alocasia: [
|
|
1663
|
+
[18, 55, 43],
|
|
1664
|
+
[57, 104, 73],
|
|
1665
|
+
[190, 206, 149],
|
|
1666
|
+
],
|
|
1667
|
+
lance: [
|
|
1668
|
+
[15, 74, 42],
|
|
1669
|
+
[53, 126, 65],
|
|
1670
|
+
[145, 172, 84],
|
|
1671
|
+
],
|
|
1672
|
+
calathea: [
|
|
1673
|
+
[32, 58, 39],
|
|
1674
|
+
[82, 117, 72],
|
|
1675
|
+
[195, 178, 126],
|
|
1676
|
+
],
|
|
1677
|
+
fern: [
|
|
1678
|
+
[20, 73, 39],
|
|
1679
|
+
[64, 126, 65],
|
|
1680
|
+
[158, 176, 88],
|
|
1681
|
+
],
|
|
1682
|
+
};
|
|
1683
|
+
|
|
1684
|
+
function leafWidth(kind, y) {
|
|
1685
|
+
const s = Math.max(0, Math.sin(Math.PI * y));
|
|
1686
|
+
if (kind === "lance" || kind === "fern") return Math.pow(s, 1.28) * (0.66 + y * 0.12);
|
|
1687
|
+
if (kind === "alocasia") return Math.pow(s, 0.62) * (0.88 + 0.16 * (1 - y));
|
|
1688
|
+
if (kind === "calathea") return Math.pow(s, 0.82) * 0.78;
|
|
1689
|
+
return Math.pow(s, 0.55) * (0.82 + 0.15 * y);
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1692
|
+
function makeLeafTexture(kind, seed) {
|
|
1693
|
+
const w = 384,
|
|
1694
|
+
h = 768;
|
|
1695
|
+
const colorCanvas = document.createElement("canvas");
|
|
1696
|
+
const bumpCanvas = document.createElement("canvas");
|
|
1697
|
+
colorCanvas.width = bumpCanvas.width = w;
|
|
1698
|
+
colorCanvas.height = bumpCanvas.height = h;
|
|
1699
|
+
const colorCtx = colorCanvas.getContext("2d");
|
|
1700
|
+
const bumpCtx = bumpCanvas.getContext("2d");
|
|
1701
|
+
const colorImage = colorCtx.createImageData(w, h);
|
|
1702
|
+
const bumpImage = bumpCtx.createImageData(w, h);
|
|
1703
|
+
const p = palettes[kind];
|
|
1704
|
+
|
|
1705
|
+
for (let py = 0; py < h; py++) {
|
|
1706
|
+
const y = py / (h - 1);
|
|
1707
|
+
const width = leafWidth(kind, y);
|
|
1708
|
+
for (let px = 0; px < w; px++) {
|
|
1709
|
+
const x = (px / (w - 1) - 0.5) * 2;
|
|
1710
|
+
const nx = Math.abs(x) / Math.max(0.001, width);
|
|
1711
|
+
let signed = 1 - nx;
|
|
1712
|
+
let inside = signed > -0.015 && y > 0.008 && y < 0.996;
|
|
1713
|
+
|
|
1714
|
+
if (inside && kind === "monstera") {
|
|
1715
|
+
const ax = Math.abs(x);
|
|
1716
|
+
const side = x < 0 ? -1 : 1;
|
|
1717
|
+
for (let k = 0; k < 6; k++) {
|
|
1718
|
+
const jitter = (hash2(k, seed, 44) - 0.5) * 0.034;
|
|
1719
|
+
const root = 0.205 + k * 0.083 + jitter;
|
|
1720
|
+
const inner = 0.23 + k * 0.022 + (hash2(k, seed, 51) - 0.5) * 0.026;
|
|
1721
|
+
const curve =
|
|
1722
|
+
root + (ax - inner) * (0.14 + k * 0.012) + Math.sin((ax + k) * 13.0) * 0.008;
|
|
1723
|
+
const slotWidth =
|
|
1724
|
+
(0.009 + k * 0.0018) * smoothstep(inner, Math.max(inner + 0.11, width), ax);
|
|
1725
|
+
if (ax > inner && Math.abs(y - curve) < slotWidth && ax < width * 1.025)
|
|
1726
|
+
inside = false;
|
|
1727
|
+
if (k < 4) {
|
|
1728
|
+
const cx = side * (0.225 + k * 0.052 + (hash2(k, seed, 61) - 0.5) * 0.025);
|
|
1729
|
+
const cy = 0.31 + k * 0.105 + (hash2(k, seed, 71) - 0.5) * 0.025;
|
|
1730
|
+
const rx = 0.026 + k * 0.003;
|
|
1731
|
+
const ry = 0.038 + k * 0.005;
|
|
1732
|
+
const skewY = y - cy - (x - cx) * side * 0.26;
|
|
1733
|
+
const hole = (x - cx) ** 2 / (rx * rx) + skewY ** 2 / (ry * ry) < 1;
|
|
1734
|
+
if (hole) inside = false;
|
|
1735
|
+
}
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
if (inside && kind === "alocasia" && y < 0.105) {
|
|
1739
|
+
const notch = Math.abs(x) < 0.15 * (1 - y / 0.105);
|
|
1740
|
+
if (notch) inside = false;
|
|
1741
|
+
}
|
|
1742
|
+
|
|
1743
|
+
const i = (py * w + px) * 4;
|
|
1744
|
+
if (!inside) {
|
|
1745
|
+
colorImage.data[i + 3] = 0;
|
|
1746
|
+
bumpImage.data[i] = bumpImage.data[i + 1] = bumpImage.data[i + 2] = 112;
|
|
1747
|
+
bumpImage.data[i + 3] = 255;
|
|
1748
|
+
continue;
|
|
1749
|
+
}
|
|
1750
|
+
|
|
1751
|
+
const n0 = hash2(px >> 2, py >> 2, seed);
|
|
1752
|
+
const n1 = hash2(px >> 4, py >> 4, seed + 17);
|
|
1753
|
+
const middle = Math.exp(-Math.abs(x) * (kind === "lance" ? 28 : 35));
|
|
1754
|
+
const veinFreq = kind === "lance" ? 12 : 8.5;
|
|
1755
|
+
const ribWave = Math.abs(((y * veinFreq + Math.abs(x) * 1.85) % 1) - 0.5);
|
|
1756
|
+
const sideVein = Math.exp(-ribWave * 46) * smoothstep(0.04, 0.82, Math.abs(x));
|
|
1757
|
+
const edge = smoothstep(0, 0.16, signed);
|
|
1758
|
+
const stripe =
|
|
1759
|
+
kind === "calathea" ? 0.5 + 0.5 * Math.cos(y * 58 + Math.abs(x) * 10) : 0;
|
|
1760
|
+
const mottling = (n0 - 0.5) * 0.16 + (n1 - 0.5) * 0.12 + stripe * 0.08;
|
|
1761
|
+
const light = clamp(
|
|
1762
|
+
0.42 + y * 0.12 + mottling + middle * 0.34 + sideVein * 0.16 - (1 - edge) * 0.27,
|
|
1763
|
+
0,
|
|
1764
|
+
1,
|
|
1765
|
+
);
|
|
1766
|
+
const dry = hash2(px >> 3, py >> 3, seed + 90) > 0.978 ? 0.16 : 0;
|
|
1767
|
+
|
|
1768
|
+
const c0 = p[0],
|
|
1769
|
+
c1 = p[1],
|
|
1770
|
+
c2 = p[2];
|
|
1771
|
+
const t = smoothstep(0.08, 0.9, light);
|
|
1772
|
+
const hi = smoothstep(0.56, 1, t);
|
|
1773
|
+
for (let ch = 0; ch < 3; ch++) {
|
|
1774
|
+
const low = c0[ch] + (c1[ch] - c0[ch]) * t;
|
|
1775
|
+
const val =
|
|
1776
|
+
low + (c2[ch] - low) * hi * 0.58 + dry * (ch === 0 ? 56 : ch === 1 ? 35 : 10);
|
|
1777
|
+
colorImage.data[i + ch] = clamp(val, 0, 255);
|
|
1778
|
+
}
|
|
1779
|
+
colorImage.data[i + 3] = clamp(edge * 390, 0, 255);
|
|
1780
|
+
|
|
1781
|
+
const bump = clamp(
|
|
1782
|
+
112 + (n0 - 0.5) * 22 + middle * 100 + sideVein * 52 - (1 - edge) * 18,
|
|
1783
|
+
0,
|
|
1784
|
+
255,
|
|
1785
|
+
);
|
|
1786
|
+
bumpImage.data[i] = bumpImage.data[i + 1] = bumpImage.data[i + 2] = bump;
|
|
1787
|
+
bumpImage.data[i + 3] = 255;
|
|
1788
|
+
}
|
|
1789
|
+
}
|
|
1790
|
+
|
|
1791
|
+
colorCtx.putImageData(colorImage, 0, 0);
|
|
1792
|
+
bumpCtx.putImageData(bumpImage, 0, 0);
|
|
1793
|
+
const map = new THREE.CanvasTexture(colorCanvas);
|
|
1794
|
+
map.colorSpace = THREE.SRGBColorSpace;
|
|
1795
|
+
map.anisotropy = Math.min(8, renderer.capabilities.getMaxAnisotropy());
|
|
1796
|
+
const bump = new THREE.CanvasTexture(bumpCanvas);
|
|
1797
|
+
bump.anisotropy = map.anisotropy;
|
|
1798
|
+
return { map, bump };
|
|
1799
|
+
}
|
|
1800
|
+
|
|
1801
|
+
// Beside this file when mounted; a runtime without assetUrl keeps the plain path.
|
|
1802
|
+
const assetUrl = (path) =>
|
|
1803
|
+
path;
|
|
1804
|
+
const textureLoader = new THREE.TextureLoader();
|
|
1805
|
+
const [photoSurface, photoNormal] = await Promise.all([
|
|
1806
|
+
textureLoader.loadAsync(assetUrl("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%221280%22%20height%3D%22720%22%20viewBox%3D%220%200%201280%20720%22%20preserveAspectRatio%3D%22xMidYMid%20slice%22%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22g%22%20x2%3D%221%22%20y2%3D%221%22%3E%3Cstop%20offset%3D%220%22%20stop-color%3D%22%233d5a80%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%2398c1d9%22%2F%3E%3C%2FlinearGradient%3E%3Cpattern%20id%3D%22s%22%20width%3D%2296%22%20height%3D%2296%22%20patternUnits%3D%22userSpaceOnUse%22%20patternTransform%3D%22rotate%2845%29%22%3E%3Crect%20width%3D%2248%22%20height%3D%2296%22%20fill%3D%22%23fff%22%20fill-opacity%3D%22.14%22%2F%3E%3C%2Fpattern%3E%3C%2Fdefs%3E%3Crect%20width%3D%221280%22%20height%3D%22720%22%20fill%3D%22url%28%23g%29%22%2F%3E%3Crect%20width%3D%221280%22%20height%3D%22720%22%20fill%3D%22url%28%23s%29%22%2F%3E%3Ccircle%20cx%3D%22640%22%20cy%3D%22360%22%20r%3D%22210%22%20fill%3D%22none%22%20stroke%3D%22%23fff%22%20stroke-opacity%3D%22.55%22%20stroke-width%3D%2228%22%2F%3E%3Ctext%20x%3D%22640%22%20y%3D%22440%22%20font-family%3D%22Arial%2C%20Helvetica%2C%20sans-serif%22%20font-size%3D%22240%22%20font-weight%3D%22700%22%20text-anchor%3D%22middle%22%20fill%3D%22%23fff%22%20fill-opacity%3D%22.9%22%3EA%3C%2Ftext%3E%3C%2Fsvg%3E")),
|
|
1807
|
+
textureLoader.loadAsync(assetUrl("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%221280%22%20height%3D%22720%22%20viewBox%3D%220%200%201280%20720%22%20preserveAspectRatio%3D%22xMidYMid%20slice%22%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22g%22%20x2%3D%221%22%20y2%3D%221%22%3E%3Cstop%20offset%3D%220%22%20stop-color%3D%22%239c4f2e%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23f2b880%22%2F%3E%3C%2FlinearGradient%3E%3Cpattern%20id%3D%22s%22%20width%3D%2296%22%20height%3D%2296%22%20patternUnits%3D%22userSpaceOnUse%22%20patternTransform%3D%22rotate%2845%29%22%3E%3Crect%20width%3D%2248%22%20height%3D%2296%22%20fill%3D%22%23fff%22%20fill-opacity%3D%22.14%22%2F%3E%3C%2Fpattern%3E%3C%2Fdefs%3E%3Crect%20width%3D%221280%22%20height%3D%22720%22%20fill%3D%22url%28%23g%29%22%2F%3E%3Crect%20width%3D%221280%22%20height%3D%22720%22%20fill%3D%22url%28%23s%29%22%2F%3E%3Ccircle%20cx%3D%22640%22%20cy%3D%22360%22%20r%3D%22210%22%20fill%3D%22none%22%20stroke%3D%22%23fff%22%20stroke-opacity%3D%22.55%22%20stroke-width%3D%2228%22%2F%3E%3Ctext%20x%3D%22640%22%20y%3D%22440%22%20font-family%3D%22Arial%2C%20Helvetica%2C%20sans-serif%22%20font-size%3D%22240%22%20font-weight%3D%22700%22%20text-anchor%3D%22middle%22%20fill%3D%22%23fff%22%20fill-opacity%3D%22.9%22%3EB%3C%2Ftext%3E%3C%2Fsvg%3E")),
|
|
1808
|
+
]);
|
|
1809
|
+
photoSurface.colorSpace = THREE.SRGBColorSpace;
|
|
1810
|
+
photoSurface.wrapS = photoSurface.wrapT = THREE.RepeatWrapping;
|
|
1811
|
+
photoSurface.repeat.set(2.4, 4.8);
|
|
1812
|
+
photoNormal.wrapS = photoNormal.wrapT = THREE.RepeatWrapping;
|
|
1813
|
+
photoNormal.repeat.set(2.4, 4.8);
|
|
1814
|
+
|
|
1815
|
+
const kinds = ["monstera", "alocasia", "lance", "calathea", "fern"];
|
|
1816
|
+
const textureSets = Object.fromEntries(
|
|
1817
|
+
kinds.map((kind, i) => [kind, makeLeafTexture(kind, i * 31 + 7)]),
|
|
1818
|
+
);
|
|
1819
|
+
const materials = {};
|
|
1820
|
+
const shaderMaterials = [];
|
|
1821
|
+
|
|
1822
|
+
for (const [index, kind] of kinds.entries()) {
|
|
1823
|
+
const tex = textureSets[kind];
|
|
1824
|
+
const material = new THREE.MeshPhysicalMaterial({
|
|
1825
|
+
map: tex.map,
|
|
1826
|
+
bumpMap: tex.bump,
|
|
1827
|
+
bumpScale: (kind === "monstera" ? 0.065 : 0.045) * 2.5,
|
|
1828
|
+
normalMap: photoNormal,
|
|
1829
|
+
normalScale: new THREE.Vector2(0.35, 0.35),
|
|
1830
|
+
alphaTest: 0.42,
|
|
1831
|
+
side: THREE.DoubleSide,
|
|
1832
|
+
roughness: 0.5626,
|
|
1833
|
+
metalness: 0,
|
|
1834
|
+
clearcoat: 0.5256,
|
|
1835
|
+
clearcoatRoughness: 0.4274,
|
|
1836
|
+
thickness: 0,
|
|
1837
|
+
transmission: 0.015,
|
|
1838
|
+
sheen: 0.24,
|
|
1839
|
+
sheenColor: new THREE.Color(kind === "calathea" ? 0xc6a68d : 0x7da06a),
|
|
1840
|
+
sheenRoughness: 0.8,
|
|
1841
|
+
emissive: new THREE.Color(0x06140a),
|
|
1842
|
+
emissiveIntensity: 0.18,
|
|
1843
|
+
shadowSide: THREE.DoubleSide,
|
|
1844
|
+
});
|
|
1845
|
+
// Transmission and ordinary passes can compile separate shader variants.
|
|
1846
|
+
// All variants share one time uniform, including a late first compilation.
|
|
1847
|
+
material.userData.timeUniform = { value: 0 };
|
|
1848
|
+
material.onBeforeCompile = (shader) => {
|
|
1849
|
+
shader.uniforms.uTime = material.userData.timeUniform;
|
|
1850
|
+
shader.uniforms.uWindStrength = { value: WIND_STRENGTH };
|
|
1851
|
+
shader.uniforms.uTurbulence = { value: TURBULENCE };
|
|
1852
|
+
shader.uniforms.uShapeNoise = { value: 2.5 };
|
|
1853
|
+
shader.uniforms.uTextureNoise = { value: 2 };
|
|
1854
|
+
shader.uniforms.uPhotoTexture = { value: 1.5 };
|
|
1855
|
+
shader.uniforms.uPhotoSurface = { value: photoSurface };
|
|
1856
|
+
shader.vertexShader = shader.vertexShader
|
|
1857
|
+
.replace(
|
|
1858
|
+
"#include <common>",
|
|
1859
|
+
`#include <common>
|
|
1860
|
+
uniform float uTime;
|
|
1861
|
+
uniform float uWindStrength;
|
|
1862
|
+
uniform float uTurbulence;
|
|
1863
|
+
uniform float uShapeNoise;
|
|
1864
|
+
`,
|
|
1865
|
+
)
|
|
1866
|
+
.replace(
|
|
1867
|
+
"#include <begin_vertex>",
|
|
1868
|
+
`
|
|
1869
|
+
vec3 transformed = vec3(position);
|
|
1870
|
+
float root = pow(uv.y, 1.28);
|
|
1871
|
+
float worldPhase = dot(modelMatrix[3].xyz, vec3(0.71, 1.13, 0.43)) + ${index.toFixed(1)};
|
|
1872
|
+
vec2 worldXY = modelMatrix[3].xy;
|
|
1873
|
+
float gustCell = sin(uTime * 0.23 + worldXY.x * 0.42 + sin(worldXY.y * 0.37 + uTime * 0.11));
|
|
1874
|
+
float localGust = pow(max(0.0, gustCell), 3.6);
|
|
1875
|
+
float breath = sin(uTime * 0.46 + worldPhase) * 0.20 + sin(uTime * 1.17 + worldPhase * 1.7) * 0.07 + localGust * 0.62;
|
|
1876
|
+
float flutter = (sin(uTime * 2.7 + uv.y * 8.0 + worldPhase * 2.2) * 0.012 + localGust * sin(uv.y * 11.0 + worldPhase) * 0.038) * uTurbulence;
|
|
1877
|
+
float edgeNoise = sin(uv.y * 31.0 + worldPhase * 4.1) * pow(abs(uv.x - 0.5) * 2.0, 2.4) * 0.022 * uShapeNoise;
|
|
1878
|
+
transformed.x += (breath * 0.075 * uWindStrength + flutter + edgeNoise) * root;
|
|
1879
|
+
transformed.z += breath * 0.12 * root * uWindStrength + flutter * root * 0.8 + edgeNoise;
|
|
1880
|
+
transformed.z += (1.0 - pow(abs(uv.x - 0.5) * 2.0, 1.65)) * 0.075;
|
|
1881
|
+
`,
|
|
1882
|
+
);
|
|
1883
|
+
shader.fragmentShader = shader.fragmentShader
|
|
1884
|
+
.replace(
|
|
1885
|
+
"#include <common>",
|
|
1886
|
+
`#include <common>
|
|
1887
|
+
uniform float uTextureNoise;
|
|
1888
|
+
uniform float uPhotoTexture;
|
|
1889
|
+
uniform sampler2D uPhotoSurface;`,
|
|
1890
|
+
)
|
|
1891
|
+
.replace(
|
|
1892
|
+
"#include <map_fragment>",
|
|
1893
|
+
`#include <map_fragment>
|
|
1894
|
+
float leafNoise = fract(sin(dot(vMapUv * vec2(311.7, 917.3), vec2(12.9898, 78.233))) * 43758.5453);
|
|
1895
|
+
diffuseColor.rgb *= 1.0 + (leafNoise - 0.5) * 0.18 * uTextureNoise;
|
|
1896
|
+
vec3 photographedSurface = texture2D(uPhotoSurface, vMapUv * vec2(2.4, 4.8)).rgb;
|
|
1897
|
+
diffuseColor.rgb *= mix(vec3(1.0), photographedSurface * 1.24, clamp(uPhotoTexture, 0.0, 1.0) * 0.26);
|
|
1898
|
+
`,
|
|
1899
|
+
);
|
|
1900
|
+
material.userData.shader = shader;
|
|
1901
|
+
};
|
|
1902
|
+
material.customProgramCacheKey = () => `cpt-leaf-wind-photo-v6-${index}`;
|
|
1903
|
+
materials[kind] = material;
|
|
1904
|
+
shaderMaterials.push(material);
|
|
1905
|
+
}
|
|
1906
|
+
|
|
1907
|
+
const geometryCache = new Map();
|
|
1908
|
+
function leafGeometry(width, length) {
|
|
1909
|
+
const key = `${width.toFixed(2)}-${length.toFixed(2)}`;
|
|
1910
|
+
if (geometryCache.has(key)) return geometryCache.get(key);
|
|
1911
|
+
const geo = new THREE.PlaneGeometry(width, length, 12, 22);
|
|
1912
|
+
geo.translate(0, length * 0.5, 0);
|
|
1913
|
+
const position = geo.attributes.position;
|
|
1914
|
+
const uv = geo.attributes.uv;
|
|
1915
|
+
for (let i = 0; i < position.count; i++) {
|
|
1916
|
+
const across = position.getX(i) / (width * 0.5);
|
|
1917
|
+
const along = uv.getY(i);
|
|
1918
|
+
const arch = (1 - Math.pow(Math.abs(across), 1.62)) * Math.sin(Math.PI * along);
|
|
1919
|
+
const twist = across * (along - 0.22);
|
|
1920
|
+
const edgeRipple =
|
|
1921
|
+
Math.sin(along * Math.PI * 5.4 + across * 2.1) * Math.pow(Math.abs(across), 2.2);
|
|
1922
|
+
position.setZ(
|
|
1923
|
+
i,
|
|
1924
|
+
arch * length * 0.052 + twist * length * 0.038 + edgeRipple * length * 0.012,
|
|
1925
|
+
);
|
|
1926
|
+
}
|
|
1927
|
+
position.needsUpdate = true;
|
|
1928
|
+
geo.computeVertexNormals();
|
|
1929
|
+
geometryCache.set(key, geo);
|
|
1930
|
+
return geo;
|
|
1931
|
+
}
|
|
1932
|
+
|
|
1933
|
+
const DIMS = {
|
|
1934
|
+
monstera: [2.05, 2.7],
|
|
1935
|
+
alocasia: [1.92, 2.85],
|
|
1936
|
+
lance: [0.68, 3.45],
|
|
1937
|
+
calathea: [1.36, 3.05],
|
|
1938
|
+
fern: [0.46, 1.5],
|
|
1939
|
+
};
|
|
1940
|
+
const leaves = [];
|
|
1941
|
+
for (const batch of window.__cptBatches) {
|
|
1942
|
+
for (const spec of batch) {
|
|
1943
|
+
const dims = DIMS[spec.kind];
|
|
1944
|
+
if (spec.batch === 2) {
|
|
1945
|
+
// Start the entire leaf below the camera frustum, including its
|
|
1946
|
+
// tip, wind deformation and the small camera orbit. Its identity
|
|
1947
|
+
// persists: the lift carries it into view rather than spawning it.
|
|
1948
|
+
const reach =
|
|
1949
|
+
Math.hypot(dims[0] * spec.widthMul * 0.5, dims[1] * spec.lengthMul) * spec.scale;
|
|
1950
|
+
spec.liftStartY =
|
|
1951
|
+
-Math.tan(THREE.MathUtils.degToRad(camera.fov * 0.5)) * (CAM_DIST - spec.liftZ) -
|
|
1952
|
+
reach -
|
|
1953
|
+
2;
|
|
1954
|
+
}
|
|
1955
|
+
const group = new THREE.Group();
|
|
1956
|
+
const mesh = new THREE.Mesh(
|
|
1957
|
+
leafGeometry(dims[0] * spec.widthMul, dims[1] * spec.lengthMul),
|
|
1958
|
+
materials[spec.kind],
|
|
1959
|
+
);
|
|
1960
|
+
mesh.castShadow = true;
|
|
1961
|
+
mesh.receiveShadow = spec.z < 4.8;
|
|
1962
|
+
group.add(mesh);
|
|
1963
|
+
group.visible = false;
|
|
1964
|
+
group.position.set(spec.xStart, spec.y0, spec.z);
|
|
1965
|
+
group.scale.setScalar(spec.scale);
|
|
1966
|
+
group.rotation.set(spec.tiltX, spec.tiltY, spec.rotation);
|
|
1967
|
+
scene.add(group);
|
|
1968
|
+
leaves.push({ group, spec });
|
|
1969
|
+
}
|
|
1970
|
+
}
|
|
1971
|
+
|
|
1972
|
+
/* ---- The headlines live IN the scene, behind the leaf band, so foliage
|
|
1973
|
+
genuinely occludes them. Reveal is a wipe uniform that tracks the sweep's
|
|
1974
|
+
trailing edge — the visible edge always sits under the dense part of the
|
|
1975
|
+
band, so the type reads as uncovered by the passing leaves, never faded. */
|
|
1976
|
+
function headlineTexture(text) {
|
|
1977
|
+
// Enough source detail for the headline at both 1x and 2x output density.
|
|
1978
|
+
const c = document.createElement("canvas");
|
|
1979
|
+
c.width = 4096;
|
|
1980
|
+
c.height = 1024;
|
|
1981
|
+
const g = c.getContext("2d");
|
|
1982
|
+
g.clearRect(0, 0, c.width, c.height);
|
|
1983
|
+
g.textAlign = "center";
|
|
1984
|
+
g.textBaseline = "middle";
|
|
1985
|
+
let size = 380;
|
|
1986
|
+
const applyFont = () => {
|
|
1987
|
+
g.font = `${FONT_WEIGHT} ${size}px ${FONT_STACK}`;
|
|
1988
|
+
g.letterSpacing = `${Math.round(size * LETTER_SP)}px`;
|
|
1989
|
+
};
|
|
1990
|
+
applyFont();
|
|
1991
|
+
let tw = g.measureText(text).width;
|
|
1992
|
+
if (tw > 3760) {
|
|
1993
|
+
size = Math.floor((size * 3760) / tw);
|
|
1994
|
+
applyFont();
|
|
1995
|
+
}
|
|
1996
|
+
/* User size multiplier rides on top of the auto-fit. */
|
|
1997
|
+
size = Math.round(size * FONT_SIZE);
|
|
1998
|
+
applyFont();
|
|
1999
|
+
g.shadowColor = "rgba(0,0,0,0.5)";
|
|
2000
|
+
g.shadowBlur = 30;
|
|
2001
|
+
g.shadowOffsetY = 8;
|
|
2002
|
+
g.fillStyle = "#e4eedb";
|
|
2003
|
+
g.fillText(text, c.width / 2 + Math.round(size * LETTER_SP * 0.5), c.height / 2 + 16);
|
|
2004
|
+
const t = new THREE.CanvasTexture(c);
|
|
2005
|
+
t.colorSpace = THREE.SRGBColorSpace;
|
|
2006
|
+
t.anisotropy = 16;
|
|
2007
|
+
return t;
|
|
2008
|
+
}
|
|
2009
|
+
|
|
2010
|
+
function headlinePlane(text, second = false) {
|
|
2011
|
+
const mat = new THREE.MeshBasicMaterial({
|
|
2012
|
+
map: headlineTexture(text),
|
|
2013
|
+
transparent: true,
|
|
2014
|
+
toneMapped: false,
|
|
2015
|
+
fog: false,
|
|
2016
|
+
depthWrite: false,
|
|
2017
|
+
});
|
|
2018
|
+
const uniforms = { uIn: { value: -0.05 }, uOut: { value: -0.05 }, uLift: { value: -0.05 } };
|
|
2019
|
+
mat.onBeforeCompile = (shader) => {
|
|
2020
|
+
shader.uniforms.uIn = uniforms.uIn;
|
|
2021
|
+
shader.uniforms.uOut = uniforms.uOut;
|
|
2022
|
+
shader.uniforms.uLift = uniforms.uLift;
|
|
2023
|
+
shader.fragmentShader = shader.fragmentShader
|
|
2024
|
+
.replace(
|
|
2025
|
+
"#include <common>",
|
|
2026
|
+
"#include <common>\nuniform float uIn;\nuniform float uOut;\nuniform float uLift;",
|
|
2027
|
+
)
|
|
2028
|
+
.replace(
|
|
2029
|
+
"#include <map_fragment>",
|
|
2030
|
+
`#include <map_fragment>
|
|
2031
|
+
float eIn = uIn + sin(vMapUv.y * 43.0) * 0.012;
|
|
2032
|
+
float eOut = uOut + sin(vMapUv.y * 37.0 + 2.0) * 0.012;
|
|
2033
|
+
float vis = smoothstep(eIn + 0.02, eIn - 0.02, vMapUv.x) * smoothstep(eOut - 0.02, eOut + 0.02, vMapUv.x);
|
|
2034
|
+
float lifted = smoothstep(uLift - 0.08, uLift + 0.08, vMapUv.y);
|
|
2035
|
+
diffuseColor.a *= vis * ${second ? "(1.0 - lifted)" : "lifted"};`,
|
|
2036
|
+
);
|
|
2037
|
+
};
|
|
2038
|
+
mat.customProgramCacheKey = () => "cpt-headline-lift-" + second;
|
|
2039
|
+
const mesh = new THREE.Mesh(new THREE.PlaneGeometry(16.4, 4.1), mat);
|
|
2040
|
+
mesh.position.set(0, 0.15, TEXT_Z);
|
|
2041
|
+
mesh.renderOrder = 2;
|
|
2042
|
+
// Exclude type from the bokeh colour/depth passes. Its alpha edges must
|
|
2043
|
+
// not be blurred using the discontinuous text/backdrop depth samples.
|
|
2044
|
+
mesh.layers.set(1);
|
|
2045
|
+
scene.add(mesh);
|
|
2046
|
+
return {
|
|
2047
|
+
mesh,
|
|
2048
|
+
mat,
|
|
2049
|
+
uniforms,
|
|
2050
|
+
retex: (t2) => {
|
|
2051
|
+
const previous = mat.map;
|
|
2052
|
+
mat.map = headlineTexture(t2);
|
|
2053
|
+
previous.dispose();
|
|
2054
|
+
mat.needsUpdate = true;
|
|
2055
|
+
},
|
|
2056
|
+
};
|
|
2057
|
+
}
|
|
2058
|
+
|
|
2059
|
+
const plane1 = headlinePlane(HEADLINE1);
|
|
2060
|
+
const plane2 = headlinePlane(HEADLINE2, true);
|
|
2061
|
+
|
|
2062
|
+
// ---- Glow motes (drift is a pure function of seed and t).
|
|
2063
|
+
const DUST_COUNT = 800;
|
|
2064
|
+
const dustHome = Float32Array.from(window.__cptDust.home);
|
|
2065
|
+
const dustSeeds = Float32Array.from(window.__cptDust.seeds);
|
|
2066
|
+
const dustPositions = dustHome.slice();
|
|
2067
|
+
const dustGeo = new THREE.BufferGeometry();
|
|
2068
|
+
dustGeo.setAttribute("position", new THREE.BufferAttribute(dustPositions, 3));
|
|
2069
|
+
dustGeo.setAttribute("seed", new THREE.BufferAttribute(dustSeeds, 1));
|
|
2070
|
+
const moteCanvas = document.createElement("canvas");
|
|
2071
|
+
moteCanvas.width = moteCanvas.height = 64;
|
|
2072
|
+
const moteCtx = moteCanvas.getContext("2d");
|
|
2073
|
+
const moteGradient = moteCtx.createRadialGradient(32, 32, 0, 32, 32, 31);
|
|
2074
|
+
moteGradient.addColorStop(0, "rgba(255,255,232,1)");
|
|
2075
|
+
moteGradient.addColorStop(0.16, "rgba(224,255,202,.92)");
|
|
2076
|
+
moteGradient.addColorStop(0.5, "rgba(180,228,160,.28)");
|
|
2077
|
+
moteGradient.addColorStop(1, "rgba(140,205,125,0)");
|
|
2078
|
+
moteCtx.fillStyle = moteGradient;
|
|
2079
|
+
moteCtx.fillRect(0, 0, 64, 64);
|
|
2080
|
+
const moteSprite = new THREE.CanvasTexture(moteCanvas);
|
|
2081
|
+
moteSprite.colorSpace = THREE.SRGBColorSpace;
|
|
2082
|
+
const dustMat = new THREE.PointsMaterial({
|
|
2083
|
+
color: new THREE.Color("#daf9b4"),
|
|
2084
|
+
map: moteSprite,
|
|
2085
|
+
size: 0.1,
|
|
2086
|
+
transparent: true,
|
|
2087
|
+
opacity: 0.55,
|
|
2088
|
+
depthWrite: false,
|
|
2089
|
+
blending: THREE.AdditiveBlending,
|
|
2090
|
+
});
|
|
2091
|
+
const dust = new THREE.Points(dustGeo, dustMat);
|
|
2092
|
+
scene.add(dust);
|
|
2093
|
+
|
|
2094
|
+
// BokehPass depth prepass with alpha-aware materials (ported from the experiment).
|
|
2095
|
+
const dofDepthMaterials = new Map();
|
|
2096
|
+
function depthMaterialFor(source) {
|
|
2097
|
+
const key = source.uuid;
|
|
2098
|
+
if (dofDepthMaterials.has(key)) return dofDepthMaterials.get(key);
|
|
2099
|
+
const depth = new THREE.MeshDepthMaterial({
|
|
2100
|
+
depthPacking: THREE.RGBADepthPacking,
|
|
2101
|
+
map: source.map || null,
|
|
2102
|
+
alphaTest: source.alphaTest || 0.5,
|
|
2103
|
+
side: source.side,
|
|
2104
|
+
depthTest: true,
|
|
2105
|
+
depthWrite: true,
|
|
2106
|
+
});
|
|
2107
|
+
dofDepthMaterials.set(key, depth);
|
|
2108
|
+
return depth;
|
|
2109
|
+
}
|
|
2110
|
+
bokehPass.render = function (activeRenderer, writeBuffer, readBuffer) {
|
|
2111
|
+
const swapped = [];
|
|
2112
|
+
const dustVisible = dust.visible;
|
|
2113
|
+
dust.visible = false;
|
|
2114
|
+
this.scene.traverse((object) => {
|
|
2115
|
+
if (!object.isMesh) return;
|
|
2116
|
+
swapped.push([object, object.material]);
|
|
2117
|
+
object.material = depthMaterialFor(object.material);
|
|
2118
|
+
});
|
|
2119
|
+
try {
|
|
2120
|
+
activeRenderer.setRenderTarget(this.renderTargetDepth);
|
|
2121
|
+
activeRenderer.clear();
|
|
2122
|
+
activeRenderer.render(this.scene, this.camera);
|
|
2123
|
+
} finally {
|
|
2124
|
+
for (const [object, material] of swapped) object.material = material;
|
|
2125
|
+
dust.visible = dustVisible;
|
|
2126
|
+
}
|
|
2127
|
+
this.uniforms.tColor.value = readBuffer.texture;
|
|
2128
|
+
this.uniforms.tDepth.value = this.renderTargetDepth.texture;
|
|
2129
|
+
activeRenderer.setRenderTarget(writeBuffer);
|
|
2130
|
+
if (this.clear) activeRenderer.clear();
|
|
2131
|
+
this.fsQuad.render(activeRenderer);
|
|
2132
|
+
|
|
2133
|
+
// Bring the blurred foliage back without clearing the ORIGINAL colour
|
|
2134
|
+
// pass's depth. That depth includes the leaves' alpha cutouts and wind
|
|
2135
|
+
// deformation, so the unblurred headline still sits behind the canopy.
|
|
2136
|
+
const copy = composer.copyPass;
|
|
2137
|
+
copy.renderToScreen = false;
|
|
2138
|
+
const background = scene.background;
|
|
2139
|
+
const autoClear = activeRenderer.autoClear;
|
|
2140
|
+
const layers = camera.layers.mask;
|
|
2141
|
+
const shadowAutoUpdate = activeRenderer.shadowMap.autoUpdate;
|
|
2142
|
+
try {
|
|
2143
|
+
scene.background = null;
|
|
2144
|
+
activeRenderer.autoClear = false;
|
|
2145
|
+
activeRenderer.shadowMap.autoUpdate = false;
|
|
2146
|
+
copy.render(activeRenderer, readBuffer, writeBuffer);
|
|
2147
|
+
camera.layers.set(1);
|
|
2148
|
+
activeRenderer.render(scene, camera);
|
|
2149
|
+
} finally {
|
|
2150
|
+
scene.background = background;
|
|
2151
|
+
activeRenderer.autoClear = autoClear;
|
|
2152
|
+
activeRenderer.shadowMap.autoUpdate = shadowAutoUpdate;
|
|
2153
|
+
camera.layers.mask = layers;
|
|
2154
|
+
}
|
|
2155
|
+
// Keep the existing colour pipeline for both foliage and typography.
|
|
2156
|
+
copy.renderToScreen = this.renderToScreen;
|
|
2157
|
+
copy.render(activeRenderer, writeBuffer, readBuffer);
|
|
2158
|
+
};
|
|
2159
|
+
|
|
2160
|
+
const cameraTarget = new THREE.Vector3(0, 0, -1.5);
|
|
2161
|
+
const cameraOffset = new THREE.Vector3();
|
|
2162
|
+
const cameraOrbit = new THREE.Euler(0, 0, 0, "YXZ");
|
|
2163
|
+
const degToRad = THREE.MathUtils.degToRad;
|
|
2164
|
+
const DJ = 0.5;
|
|
2165
|
+
|
|
2166
|
+
function motionClock(t) {
|
|
2167
|
+
const end = window.__cptWindows.s2 + window.__cptWindows.d2;
|
|
2168
|
+
const duration = Math.max(0.1, 10.5 - end);
|
|
2169
|
+
const p = clamp((t - end) / duration, 0, 1);
|
|
2170
|
+
return t <= end ? t : end + duration * (p - (p * p) / 2);
|
|
2171
|
+
}
|
|
2172
|
+
|
|
2173
|
+
function openingWind(spec, t) {
|
|
2174
|
+
const wt = motionClock(t) * WIND_SPEED;
|
|
2175
|
+
const gust = Math.sin(wt * 0.23 + spec.restX * 0.42 + Math.sin(spec.y0 * 0.37 + wt * 0.11));
|
|
2176
|
+
const sway =
|
|
2177
|
+
(Math.sin(wt * 0.46 + spec.phase) * 0.011 +
|
|
2178
|
+
Math.sin(wt * 0.58 + spec.y0 * 0.74) * 0.007 +
|
|
2179
|
+
Math.max(0, gust) ** 3.6 * 0.03) *
|
|
2180
|
+
WIND_STRENGTH;
|
|
2181
|
+
return [sway, Math.sin(wt * 0.31 + spec.phase) * 0.02];
|
|
2182
|
+
}
|
|
2183
|
+
|
|
2184
|
+
// Sample the authored incoming path, including its actual rotation/wind.
|
|
2185
|
+
// Only retained leaves use this path; the passing leaf wall stays intact.
|
|
2186
|
+
function retainedSweepPose(s, t) {
|
|
2187
|
+
const w = window.__cptWindows;
|
|
2188
|
+
if (s.batch === 2) {
|
|
2189
|
+
const p = clamp(clamp((t - w.s2) / w.d2, 0, 1) * 1.28 - s.liftDelay, 0, 1);
|
|
2190
|
+
const lift = smoothstep(0, 0.58, p),
|
|
2191
|
+
seat = smoothstep(0.38, 1, p);
|
|
2192
|
+
return [
|
|
2193
|
+
THREE.MathUtils.lerp(s.liftX, s.restX, seat),
|
|
2194
|
+
THREE.MathUtils.lerp(s.liftY, s.restY, seat) -
|
|
2195
|
+
(s.liftY - s.liftStartY) * (1 - smoothstep(0, 0.42, p)),
|
|
2196
|
+
THREE.MathUtils.lerp(s.liftZ, s.z, lift),
|
|
2197
|
+
s.tiltX + seat * 3.6 * Math.sin(s.phase),
|
|
2198
|
+
s.tiltY + seat * 3.6 * Math.cos(s.phase * 1.7),
|
|
2199
|
+
THREE.MathUtils.lerp(s.rotation, s.restRZ, seat),
|
|
2200
|
+
];
|
|
2201
|
+
}
|
|
2202
|
+
const p = clamp(clamp((t - 0.4) / w.d1, 0, 1) * 1.5 - s.delay, 0, 1);
|
|
2203
|
+
const pe = 1 - Math.pow(1 - p, 3);
|
|
2204
|
+
const rz = s.rotation + pe * s.spin * 0.55;
|
|
2205
|
+
const turn =
|
|
2206
|
+
((((s.restRZ - rz + Math.PI) % (2 * Math.PI)) + 2 * Math.PI) % (2 * Math.PI)) - Math.PI;
|
|
2207
|
+
const [wind, roll] = openingWind(s, t);
|
|
2208
|
+
return [
|
|
2209
|
+
s.xStart + (s.restX - s.xStart) * pe,
|
|
2210
|
+
s.y0 +
|
|
2211
|
+
(s.restY - s.y0) * pe +
|
|
2212
|
+
Math.sin(pe * Math.PI * 1.4 + s.phase) * s.bobAmp * (1 - pe) * 0.8 +
|
|
2213
|
+
wind * 0.14,
|
|
2214
|
+
s.z,
|
|
2215
|
+
s.tiltX + wind,
|
|
2216
|
+
s.tiltY + wind * 0.65,
|
|
2217
|
+
rz + turn * smoothstep(0.55, 1, pe) + roll,
|
|
2218
|
+
];
|
|
2219
|
+
}
|
|
2220
|
+
|
|
2221
|
+
function retainedIdlePose(spec, t, handoff) {
|
|
2222
|
+
const b = spec.breeze,
|
|
2223
|
+
age = t - handoff.start,
|
|
2224
|
+
a = age * b.rate;
|
|
2225
|
+
const pose = handoff.center.slice();
|
|
2226
|
+
if (spec.batch === 1) {
|
|
2227
|
+
const [wind, roll] = openingWind(spec, t);
|
|
2228
|
+
pose[1] += wind * 0.14;
|
|
2229
|
+
pose[3] += wind;
|
|
2230
|
+
pose[4] += wind * 0.65;
|
|
2231
|
+
pose[5] += roll;
|
|
2232
|
+
}
|
|
2233
|
+
const floatX = Math.sin(a + b.phase) * 0.72 + Math.sin(a * 0.613 + b.phase2) * 0.28;
|
|
2234
|
+
const floatY = Math.sin(a * 0.79 + b.phase2) * 0.76 + Math.sin(a * 1.137 + b.phase3) * 0.24;
|
|
2235
|
+
const floatZ = Math.sin(a * 0.53 + b.phase3);
|
|
2236
|
+
const offsets = [
|
|
2237
|
+
b.driftX * floatX,
|
|
2238
|
+
b.driftY * floatY,
|
|
2239
|
+
b.depth + b.driftZ * floatZ,
|
|
2240
|
+
b.tiltX * Math.sin(a * 0.67 + b.phase2),
|
|
2241
|
+
b.tiltY * Math.sin(a * 0.47 + b.phase3),
|
|
2242
|
+
b.roll * floatX + b.turn * age,
|
|
2243
|
+
];
|
|
2244
|
+
return pose.map((v, i) => v + RETAINED_BREEZE * offsets[i]);
|
|
2245
|
+
}
|
|
2246
|
+
|
|
2247
|
+
// Join while each leaf still has momentum, before its old stop point.
|
|
2248
|
+
// Quintic Hermite correction matches position, velocity AND acceleration
|
|
2249
|
+
// at both ends. The moving breeze target is present throughout settling;
|
|
2250
|
+
// there is no idle timer, zero-velocity rest, or later amplitude fade-in.
|
|
2251
|
+
for (const { spec: s } of leaves) {
|
|
2252
|
+
if (!s.stayer) continue;
|
|
2253
|
+
const w = window.__cptWindows,
|
|
2254
|
+
first = s.batch === 1;
|
|
2255
|
+
const rate = first ? 1.5 / w.d1 : 1.28 / w.d2;
|
|
2256
|
+
const progress = (first ? 0.64 : 0.78) + s.breeze.arrival * 0.12;
|
|
2257
|
+
const start = (first ? 0.4 : w.s2) + (progress + (first ? s.delay : s.liftDelay)) / rate;
|
|
2258
|
+
const end = first ? 0.4 + w.d1 : w.s2 + w.d2;
|
|
2259
|
+
const center = retainedSweepPose(s, end);
|
|
2260
|
+
const incoming = retainedSweepPose(s, start);
|
|
2261
|
+
if (first) {
|
|
2262
|
+
const [wind, roll] = openingWind(s, end);
|
|
2263
|
+
center[1] -= wind * 0.14;
|
|
2264
|
+
center[3] -= wind;
|
|
2265
|
+
center[4] -= wind * 0.65;
|
|
2266
|
+
center[5] -= roll;
|
|
2267
|
+
}
|
|
2268
|
+
for (let i = 3; i < 6; i++)
|
|
2269
|
+
center[i] += Math.round((incoming[i] - center[i]) / (2 * Math.PI)) * 2 * Math.PI;
|
|
2270
|
+
const h = (s.handoff = { start, duration: (first ? 0.52 : 0.48) / rate, center });
|
|
2271
|
+
const dt = 0.001;
|
|
2272
|
+
const delta = (time) =>
|
|
2273
|
+
retainedSweepPose(s, time).map((v, i) => v - retainedIdlePose(s, time, h)[i]);
|
|
2274
|
+
const a = delta(start - dt),
|
|
2275
|
+
b = delta(start),
|
|
2276
|
+
c = delta(start + dt);
|
|
2277
|
+
h.correction = b.map((v, i) => [
|
|
2278
|
+
v,
|
|
2279
|
+
(c[i] - a[i]) / (2 * dt),
|
|
2280
|
+
(c[i] - 2 * v + a[i]) / (dt * dt),
|
|
2281
|
+
]);
|
|
2282
|
+
}
|
|
2283
|
+
|
|
2284
|
+
function applyRetainedMotion(group, spec, t) {
|
|
2285
|
+
const h = spec.handoff;
|
|
2286
|
+
if (!h || !group.visible) return;
|
|
2287
|
+
if (t < h.start) {
|
|
2288
|
+
// Use the same unrounded clock on both sides of the handoff; GSAP's
|
|
2289
|
+
// rounded scalar writes must not introduce a tiny boundary jump.
|
|
2290
|
+
const incoming = retainedSweepPose(spec, t);
|
|
2291
|
+
group.position.set(incoming[0], incoming[1], incoming[2]);
|
|
2292
|
+
group.rotation.set(incoming[3], incoming[4], incoming[5]);
|
|
2293
|
+
return;
|
|
2294
|
+
}
|
|
2295
|
+
const pose = retainedIdlePose(spec, t, h);
|
|
2296
|
+
const u = clamp((t - h.start) / h.duration, 0, 1);
|
|
2297
|
+
const u2 = u * u,
|
|
2298
|
+
u3 = u2 * u,
|
|
2299
|
+
u4 = u3 * u,
|
|
2300
|
+
u5 = u4 * u;
|
|
2301
|
+
const p = 1 - 10 * u3 + 15 * u4 - 6 * u5;
|
|
2302
|
+
const v = u - 6 * u3 + 8 * u4 - 3 * u5;
|
|
2303
|
+
const a = (u2 - 3 * u3 + 3 * u4 - u5) / 2;
|
|
2304
|
+
for (let i = 0; i < 6; i++) {
|
|
2305
|
+
const c = h.correction[i];
|
|
2306
|
+
pose[i] += c[0] * p + c[1] * h.duration * v + c[2] * h.duration * h.duration * a;
|
|
2307
|
+
}
|
|
2308
|
+
if (spec.batch === 1) {
|
|
2309
|
+
// Carry the current floating pose into takeoff, never pull it back
|
|
2310
|
+
// to a rest slot. Quintic lift starts with zero added speed/acceleration.
|
|
2311
|
+
const m = clamp((t - window.__cptWindows.s2) / window.__cptWindows.d2, 0, 1);
|
|
2312
|
+
const q = clamp(m * 1.5 - spec.delay2 * 0.4, 0, 1);
|
|
2313
|
+
const lift = q * q * q * (10 + q * (-15 + 6 * q));
|
|
2314
|
+
pose[1] += lift * 6;
|
|
2315
|
+
pose[2] += lift * 34;
|
|
2316
|
+
pose[5] += lift * spec.spin * 0.55;
|
|
2317
|
+
}
|
|
2318
|
+
group.position.set(pose[0], pose[1], pose[2]);
|
|
2319
|
+
group.rotation.set(pose[3], pose[4], pose[5]);
|
|
2320
|
+
}
|
|
2321
|
+
|
|
2322
|
+
let disposed = false;
|
|
2323
|
+
function renderAt(t) {
|
|
2324
|
+
if (disposed) return;
|
|
2325
|
+
t = clamp(t, 0, DUR);
|
|
2326
|
+
const settleTime = window.__cptWindows.s2 + window.__cptWindows.d2;
|
|
2327
|
+
const settleDuration = Math.max(0.1, 10.5 - settleTime);
|
|
2328
|
+
const settleProgress = clamp((t - settleTime) / settleDuration, 0, 1);
|
|
2329
|
+
const motionTime =
|
|
2330
|
+
t <= settleTime
|
|
2331
|
+
? t
|
|
2332
|
+
: settleTime +
|
|
2333
|
+
settleDuration * (settleProgress - (settleProgress * settleProgress) / 2);
|
|
2334
|
+
const wt = motionTime * WIND_SPEED;
|
|
2335
|
+
const m1 = state.sw1;
|
|
2336
|
+
const m2 = state.sw2;
|
|
2337
|
+
|
|
2338
|
+
for (const { group, spec } of leaves) {
|
|
2339
|
+
// Depth lift: emerge from the backdrop, cross the type plane,
|
|
2340
|
+
// rise through the focal range, then pass the camera (source exitDistance=34).
|
|
2341
|
+
// No lateral sweep, frame history, pointer force, or accumulated physics.
|
|
2342
|
+
if (spec.batch === 2) {
|
|
2343
|
+
const p = clamp(m2 * 1.28 - spec.liftDelay, 0, 1);
|
|
2344
|
+
// At p=0 it is already below frame; at p=1 passers are behind
|
|
2345
|
+
// the camera. No visibility/opacity switch at either boundary.
|
|
2346
|
+
group.visible = true;
|
|
2347
|
+
const entry = smoothstep(0, 0.42, p);
|
|
2348
|
+
const lift = smoothstep(0, 0.58, p);
|
|
2349
|
+
const exit = smoothstep(0.38, 1, p);
|
|
2350
|
+
const seat = smoothstep(0.38, 1, p);
|
|
2351
|
+
const z = spec.stayer
|
|
2352
|
+
? THREE.MathUtils.lerp(spec.liftZ, spec.z, lift)
|
|
2353
|
+
: spec.liftZ + lift * 8 * spec.depthResponse + exit * 34;
|
|
2354
|
+
const orbit = exit * 1.15;
|
|
2355
|
+
const x = spec.stayer
|
|
2356
|
+
? THREE.MathUtils.lerp(spec.liftX, spec.restX, seat)
|
|
2357
|
+
: spec.liftX + Math.cos(spec.phase + p * 1.3) * orbit;
|
|
2358
|
+
const liftedY = spec.stayer
|
|
2359
|
+
? THREE.MathUtils.lerp(spec.liftY, spec.restY, seat)
|
|
2360
|
+
: spec.liftY + lift * 2.2 + exit * 3.8;
|
|
2361
|
+
const y = liftedY - (spec.liftY - spec.liftStartY) * (1 - entry);
|
|
2362
|
+
group.position.set(x, y, z);
|
|
2363
|
+
group.rotation.set(
|
|
2364
|
+
spec.tiltX + exit * 3.6 * Math.sin(spec.phase),
|
|
2365
|
+
spec.tiltY + exit * 3.6 * Math.cos(spec.phase * 1.7),
|
|
2366
|
+
spec.stayer
|
|
2367
|
+
? THREE.MathUtils.lerp(spec.rotation, spec.restRZ, seat)
|
|
2368
|
+
: spec.rotation + exit * 3.6 * 0.55,
|
|
2369
|
+
);
|
|
2370
|
+
continue;
|
|
2371
|
+
}
|
|
2372
|
+
const m = spec.batch === 1 ? m1 : m2;
|
|
2373
|
+
const p = clamp(m * (1 + DJ) - spec.delay, 0, 1);
|
|
2374
|
+
if (p <= 0.0005) {
|
|
2375
|
+
group.visible = false;
|
|
2376
|
+
continue;
|
|
2377
|
+
}
|
|
2378
|
+
group.visible = true;
|
|
2379
|
+
|
|
2380
|
+
// Analytic wind sway, always applied (scaled up once settled).
|
|
2381
|
+
const gustCell = Math.sin(
|
|
2382
|
+
wt * 0.23 + spec.restX * 0.42 + Math.sin(spec.y0 * 0.37 + wt * 0.11),
|
|
2383
|
+
);
|
|
2384
|
+
const localGust = Math.max(0, gustCell) ** 3.6;
|
|
2385
|
+
const slowWind =
|
|
2386
|
+
(Math.sin(wt * 0.46 + spec.phase) * 0.011 +
|
|
2387
|
+
Math.sin(wt * 0.58 + spec.y0 * 0.74) * 0.007 +
|
|
2388
|
+
localGust * 0.03) *
|
|
2389
|
+
WIND_STRENGTH;
|
|
2390
|
+
|
|
2391
|
+
let x,
|
|
2392
|
+
y,
|
|
2393
|
+
rz,
|
|
2394
|
+
z = spec.z;
|
|
2395
|
+
if (!spec.stayer) {
|
|
2396
|
+
const pe = p * p * (3 - 2 * p);
|
|
2397
|
+
x = spec.xStart + (spec.xEnd - spec.xStart) * pe;
|
|
2398
|
+
y = spec.y0 + Math.sin(pe * Math.PI * spec.bobN + spec.phase) * spec.bobAmp;
|
|
2399
|
+
rz = spec.rotation + pe * spec.spin;
|
|
2400
|
+
} else {
|
|
2401
|
+
const pe = 1 - Math.pow(1 - p, 3);
|
|
2402
|
+
x = spec.xStart + (spec.restX - spec.xStart) * pe;
|
|
2403
|
+
y =
|
|
2404
|
+
spec.y0 +
|
|
2405
|
+
(spec.restY - spec.y0) * pe +
|
|
2406
|
+
Math.sin(pe * Math.PI * 1.4 + spec.phase) * spec.bobAmp * (1 - pe) * 0.8;
|
|
2407
|
+
const travelRz = spec.rotation + pe * spec.spin * 0.55;
|
|
2408
|
+
const seat = smoothstep(0.55, 1, pe);
|
|
2409
|
+
const dRz =
|
|
2410
|
+
((((spec.restRZ - travelRz + Math.PI) % (2 * Math.PI)) + 2 * Math.PI) %
|
|
2411
|
+
(2 * Math.PI)) -
|
|
2412
|
+
Math.PI;
|
|
2413
|
+
rz = travelRz + dRz * seat;
|
|
2414
|
+
if (spec.batch === 1 && m2 > 0) {
|
|
2415
|
+
// Existing edge leaves join the same upward depth current.
|
|
2416
|
+
const q = clamp(m2 * 1.5 - spec.delay2 * 0.4, 0, 1);
|
|
2417
|
+
const qe = smoothstep(0, 1, q);
|
|
2418
|
+
z += qe * 34;
|
|
2419
|
+
y += qe * 6;
|
|
2420
|
+
rz += qe * spec.spin * 0.55;
|
|
2421
|
+
}
|
|
2422
|
+
}
|
|
2423
|
+
|
|
2424
|
+
group.position.set(x, y + slowWind * 0.14, z);
|
|
2425
|
+
group.rotation.set(
|
|
2426
|
+
spec.tiltX + slowWind,
|
|
2427
|
+
spec.tiltY + slowWind * 0.65,
|
|
2428
|
+
rz + Math.sin(wt * 0.31 + spec.phase) * 0.02,
|
|
2429
|
+
);
|
|
2430
|
+
}
|
|
2431
|
+
|
|
2432
|
+
// The background/camera can settle while retained leaves keep breathing
|
|
2433
|
+
// through the final hold. Use absolute t, never accumulated frame deltas.
|
|
2434
|
+
for (const { group, spec } of leaves) applyRetainedMotion(group, spec, t);
|
|
2435
|
+
|
|
2436
|
+
/* Reveal wipes, derived from the sweep masters. Tuned so the visible wipe
|
|
2437
|
+
edge stays inside the dense part of the leaf band (verified visually). */
|
|
2438
|
+
plane1.uniforms.uIn.value = clamp((m1 - 0.3) / 0.52, 0, 1) * 1.1 - 0.05;
|
|
2439
|
+
plane1.uniforms.uOut.value = -0.05;
|
|
2440
|
+
plane2.uniforms.uIn.value = 1.05;
|
|
2441
|
+
plane1.uniforms.uLift.value = smoothstep(0.25, 0.43, m2) * 1.3 - 0.15;
|
|
2442
|
+
plane2.uniforms.uLift.value = smoothstep(0.4, 0.62, m2) * 1.3 - 0.15;
|
|
2443
|
+
// Source experiment DOF at lift peak; return to V1's crisp hold.
|
|
2444
|
+
const lens = smoothstep(0.05, 0.28, m2) * (1 - smoothstep(0.72, 1, m2));
|
|
2445
|
+
bokehPass.uniforms.aperture.value = 0.0016 + lens * 0.0005;
|
|
2446
|
+
bokehPass.uniforms.maxblur.value = 0.0055 + lens * 0.0035;
|
|
2447
|
+
plane2.uniforms.uOut.value = -0.05;
|
|
2448
|
+
|
|
2449
|
+
for (const material of shaderMaterials) {
|
|
2450
|
+
material.userData.timeUniform.value = wt;
|
|
2451
|
+
}
|
|
2452
|
+
|
|
2453
|
+
for (let i = 0; i < DUST_COUNT; i++) {
|
|
2454
|
+
const o = i * 3;
|
|
2455
|
+
const s = dustSeeds[i];
|
|
2456
|
+
dustPositions[o] = dustHome[o] + Math.sin(wt * 0.19 + s * 18) * 0.36;
|
|
2457
|
+
dustPositions[o + 1] = dustHome[o + 1] + Math.cos(wt * 0.14 + s * 27) * 0.38;
|
|
2458
|
+
dustPositions[o + 2] = dustHome[o + 2] + Math.sin(wt * 0.11 + s * 41) * 0.4;
|
|
2459
|
+
}
|
|
2460
|
+
dustGeo.attributes.position.needsUpdate = true;
|
|
2461
|
+
|
|
2462
|
+
const swayX = Math.sin(motionTime * 0.31) * 0.6 + Math.sin(motionTime * 0.127 + 2.1) * 0.5;
|
|
2463
|
+
const swayY = Math.sin(motionTime * 0.083 + 1.7) * 0.7;
|
|
2464
|
+
cameraOrbit.set(degToRad(-swayY), degToRad(swayX), 0, "YXZ");
|
|
2465
|
+
cameraOffset.set(0, 0.15, CAM_DIST).applyEuler(cameraOrbit);
|
|
2466
|
+
camera.position.copy(cameraTarget).add(cameraOffset);
|
|
2467
|
+
camera.lookAt(cameraTarget);
|
|
2468
|
+
dust.rotation.x = degToRad(-swayY) * 0.6;
|
|
2469
|
+
dust.rotation.y = degToRad(swayX) * 0.6;
|
|
2470
|
+
|
|
2471
|
+
composer.render();
|
|
2472
|
+
}
|
|
2473
|
+
|
|
2474
|
+
function onSeek(event) {
|
|
2475
|
+
const time = clamp(Number(event.detail?.time) || 0, 0, DUR);
|
|
2476
|
+
const timeline = window.__timelines["canopy-part-title"];
|
|
2477
|
+
timeline.totalTime(time, true);
|
|
2478
|
+
renderAt(time);
|
|
2479
|
+
}
|
|
2480
|
+
window.addEventListener("hf-seek", onSeek);
|
|
2481
|
+
window.__cptInstance = {
|
|
2482
|
+
dispose() {
|
|
2483
|
+
if (disposed) return;
|
|
2484
|
+
disposed = true;
|
|
2485
|
+
window.removeEventListener("hf-seek", onSeek);
|
|
2486
|
+
const resources = new Set();
|
|
2487
|
+
scene.traverse((object) => {
|
|
2488
|
+
if (object.geometry) resources.add(object.geometry);
|
|
2489
|
+
for (const mat of [object.material].flat().filter(Boolean)) {
|
|
2490
|
+
resources.add(mat);
|
|
2491
|
+
for (const value of Object.values(mat)) if (value?.isTexture) resources.add(value);
|
|
2492
|
+
}
|
|
2493
|
+
});
|
|
2494
|
+
for (const mat of dofDepthMaterials.values()) resources.add(mat);
|
|
2495
|
+
for (const resource of resources) resource.dispose();
|
|
2496
|
+
bokehPass.dispose();
|
|
2497
|
+
composer.dispose();
|
|
2498
|
+
renderer.dispose();
|
|
2499
|
+
renderer.forceContextLoss();
|
|
2500
|
+
window.__cptRender = null;
|
|
2501
|
+
},
|
|
2502
|
+
};
|
|
2503
|
+
window.__cptRender = renderAt;
|
|
2504
|
+
|
|
2505
|
+
const tl = window.__timelines["canopy-part-title"];
|
|
2506
|
+
// Compile every leaf material before the first time sample. Hidden leaves
|
|
2507
|
+
// otherwise compile on their first visible seek with uTime=0, making that
|
|
2508
|
+
// frame differ from a later seek to the same time.
|
|
2509
|
+
for (const { group } of leaves) group.visible = true;
|
|
2510
|
+
renderer.compile(scene, camera);
|
|
2511
|
+
renderAt(0);
|
|
2512
|
+
renderAt(window.__hfThreeTime ?? (tl ? tl.time() : 0));
|
|
2513
|
+
/* Draw across the timeline and flush the GPU before ready, so shader links
|
|
2514
|
+
and texture uploads land in the readiness gate, not the first visible frames. */
|
|
2515
|
+
async function warmGpu() {
|
|
2516
|
+
const dur = tl ? tl.duration() : 0;
|
|
2517
|
+
for (const f of [0.25, 0.5, 0.75]) {
|
|
2518
|
+
await new Promise((resolve) => window.__popostLater(resolve, 0));
|
|
2519
|
+
renderAt(dur * f);
|
|
2520
|
+
}
|
|
2521
|
+
renderAt(tl ? tl.time() : 0);
|
|
2522
|
+
renderer.getContext().finish();
|
|
2523
|
+
}
|
|
2524
|
+
window.__hf = window.__hf || {};
|
|
2525
|
+
window.__hf.buildReady = window.__hf.buildReady || {};
|
|
2526
|
+
if (document.fonts && document.fonts.ready) {
|
|
2527
|
+
window.__cptReady = Promise.all([
|
|
2528
|
+
document.fonts.load(`${FONT_WEIGHT} 100px "${FONT}"`).catch(() => {}),
|
|
2529
|
+
document.fonts.ready,
|
|
2530
|
+
])
|
|
2531
|
+
.then(() => {
|
|
2532
|
+
if (disposed) return;
|
|
2533
|
+
plane1.retex(HEADLINE1);
|
|
2534
|
+
plane2.retex(HEADLINE2);
|
|
2535
|
+
renderAt(tl ? tl.time() : 0);
|
|
2536
|
+
return warmGpu();
|
|
2537
|
+
})
|
|
2538
|
+
.catch(() => {});
|
|
2539
|
+
window.__hf.buildReady["canopy-part-title"] = window.__cptReady;
|
|
2540
|
+
} else {
|
|
2541
|
+
window.__hf.buildReady["canopy-part-title"] = warmGpu();
|
|
2542
|
+
}
|
|
2543
|
+
|
|
2544
|
+
})();
|
|
2545
|
+
</script>
|
|
2546
|
+
</div>
|
|
2547
|
+
<script>window.__popostFit();</script>
|
|
2548
|
+
</body>
|
|
2549
|
+
</html>
|