mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-17 15:24:19 +00:00
feat(skill): examples library scaffold + section 01 (typography) — 10 scenes
First slice of the HyperFrames Capability Showcase library at skills/website-to-hyperframes/examples/. Each scene is a self-contained mini-project (index.html in its own directory) that lints, snapshots, and renders standalone. Section 01 (typography) — 10 production-grade scenes, all PASS QC: 01 soft-blur-in — Apple keynote per-character reveal 02 typewriter-mechanical — stepped per-char terminal type-on 03 kinetic-center-build — words push in right-to-left, lock center 04 line-reveal-staggered — editorial mask-reveal-up with Fraunces italic 05 stagger-wave — center-out vs edges-in stagger origins 06 variable-font-weight-shift — wght 100→900 animation via @property 07 shared-axis-crossfade — Material Design Z-axis depth transition 08 glitch-rgb-split — RGB channel offset with mechanical jitter 09 scramble-decrypt — per-char intermediate substitution decrypt 10 per-word-emphasis — per-word crossfade + hand-drawn marker Plus catalog + shared assets: - examples/README.md — top-level index + lookup by technique - 01-typography/README.md — section spec + QC log per scene - _shared/hyper-shader-local.js — copied from packages/shader-transitions/dist/ - _shared/shared-styles.css — design tokens - _shared/easing-glossary.md — single source of truth for easings Authoring conventions are documented in examples/README.md so future scenes follow the same shape: full HTML doc, GSAP CDN, CustomEase, data-composition-id/ start/duration/width/height on root, scene-label at bottom-left, continuous motion (no static periods >1.5s), easing variety (3+ different easings). .gitignore: fixed bare 'examples/' rule (matched anywhere) to '/examples/' (root-only), and added rule to skip snapshot artifacts inside the library.
This commit is contained in:
+4
-1
@@ -66,8 +66,11 @@ packages/producer/src/services/fontData.generated.ts
|
||||
|
||||
# Test artifacts
|
||||
my-video/
|
||||
examples/
|
||||
/examples/
|
||||
packages/studio/data/
|
||||
|
||||
# Snapshot artifacts inside the w2h examples library — regenerated on demand
|
||||
skills/website-to-hyperframes/examples/**/snapshots/
|
||||
.desloppify/
|
||||
.worktrees/
|
||||
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
# Section 01 — Typography
|
||||
|
||||
10 scenes covering the most-used text animation effects from `skills/hyperframes/references/text-effects.md` plus 3 custom techniques (variable-font weight shift, glitch RGB split, scramble decrypt) that aren't in the catalog but are heavily-used in modern marketing video.
|
||||
|
||||
**When to study this section:** any beat where text is the hero — headlines, statements, eyebrows, call-to-action copy, kinetic typography sequences.
|
||||
|
||||
---
|
||||
|
||||
## Scenes
|
||||
|
||||
Each scene is its own subdirectory containing `index.html` — standalone, renderable on its own via `npx tsx packages/cli/src/cli.ts snapshot scene-NN-name --frames 5`.
|
||||
|
||||
| Scene | Duration | Technique | Catalog spec |
|
||||
|-------|----------|-----------|--------------|
|
||||
| [`scene-01-soft-blur-in/`](scene-01-soft-blur-in/) | 8s | Per-character fade with blur and upward drift — Apple keynote hero | `skills/hyperframes/assets/text-effects/effects/soft-blur-in.json` |
|
||||
| [`scene-02-typewriter-mechanical/`](scene-02-typewriter-mechanical/) | 6s | Stepped per-character reveal, no easing curve — terminal/editorial feel | `skills/hyperframes/assets/text-effects/effects/typewriter.json` |
|
||||
| [`scene-03-kinetic-center-build/`](scene-03-kinetic-center-build/) | 8s | Each word locks center as phrase builds right-to-left with soft blur | `skills/hyperframes/assets/text-effects/effects/kinetic-center-build.json` |
|
||||
| [`scene-04-line-reveal-staggered/`](scene-04-line-reveal-staggered/) | 7s | Lines clip-reveal upward with stagger — masked, contained, intentional | `skills/hyperframes/assets/text-effects/effects/mask-reveal-up.json` |
|
||||
| [`scene-05-stagger-wave/`](scene-05-stagger-wave/) | 6s | Per-character rise with a wave timing curve (center-out, then edges-in) | `skills/hyperframes/assets/text-effects/effects/per-character-rise.json` + custom stagger |
|
||||
| [`scene-06-variable-font-weight-shift/`](scene-06-variable-font-weight-shift/) | 7s | Headline animates `font-variation-settings` from `wght 100` to `wght 900` — kinetic without translation | Custom (uses Inter variable) |
|
||||
| [`scene-07-shared-axis-crossfade/`](scene-07-shared-axis-crossfade/) | 9s | Two phrases swap via scale-Z depth crossfade — premium UI feel | `skills/hyperframes/assets/text-effects/effects/shared-axis-z.json` |
|
||||
| [`scene-08-glitch-rgb-split/`](scene-08-glitch-rgb-split/) | 5s | RGB-channel split with mechanical jitter — digital/cyberpunk emphasis | Custom (CSS text-shadow + offset GSAP jitter) |
|
||||
| [`scene-09-scramble-decrypt/`](scene-09-scramble-decrypt/) | 6s | Character scramble decrypts into final phrase — "intel/hacker" feel | Custom (per-character substitute) |
|
||||
| [`scene-10-per-word-emphasis/`](scene-10-per-word-emphasis/) | 8s | Per-word crossfade with a hand-drawn circle marker landing on the key word | `per-word-crossfade.json` + section 02 marker |
|
||||
|
||||
---
|
||||
|
||||
## What to study, in priority order
|
||||
|
||||
1. **`scene-01-soft-blur-in.html`** — the canonical premium headline. Study how character splitting works, how the JSON spec maps to GSAP, how the y-travel-multiplier scales motion to 1080p.
|
||||
2. **`scene-02-typewriter-mechanical.html`** — the simplest type-on. Study `steps(1)` ease and why it gives a terminal feel.
|
||||
3. **`scene-10-per-word-emphasis.html`** — combination scene. Study how text effect + marker overlay are sequenced with `tl.add()` and overlap timing.
|
||||
|
||||
After these three, the others are variations on the same shape.
|
||||
|
||||
---
|
||||
|
||||
## QC log
|
||||
|
||||
Updated after building each scene. Format: `[PASS]` or `[REBUILD: reason]` or `[FIXED: reason]`.
|
||||
|
||||
- scene-01: **PASS** — 8 frames show 3 phrases cycling (Think different. → Built to flow. → Motion with intent.) with soft-blur per-character entrance, underline draw, grain drift, scale pulse during holds. Frame 1 correctly dark; mid-exit frames show in-progress blur correctly.
|
||||
- scene-02: **PASS** — 6 frames show empty terminal → "Precision in motion." typed in → hold → exit → "Pause. Continue." typed in → final hold. Steps(1) easing visible per-char. Cursor blinks. Scanlines drift. Cursor glow pulses during holds. Phrase 2 shortened from "Write. Pause. Continue." to "Pause. Continue." to avoid text wrap.
|
||||
- scene-03: **PASS** — 8 frames show kinetic-center-build: words push in from right, locking at center as phrase builds. Two phrases cycle ("Built to flow." then "Motion with intent."). Mid-build frames clearly show the layout-aware push behavior. 6 distinct easings, breathing during holds.
|
||||
- scene-04: **PASS** — 7 frames show editorial mask-reveal-up: lines clip-reveal upward staggered. Beautiful Fraunces italic accent on "everything." word, gold accent rule + page number, vignette drift continuously. 7 distinct easings including the spec's signature curve. Fix during build: moved breathing tween off the same element as entrance tween to avoid transform conflict.
|
||||
- scene-05: **PASS** — 6 frames show stagger-wave (center-out vs edges-in) side-by-side. Mid-entrance frames at 1.2s ("e from cent" center visible) and 3.6s ("Wave" + "dges." edges visible, middle hidden) prove the wave origin behavior. Yellow accent band + origin markers ground the typography. 9 distinct easings.
|
||||
- scene-06: **PASS** — 7 frames show variable-font weight ramp wht 100→900. Frame at 1.2s shows the money moment: "WE" already bold, "IGHT." still thin — staggered weight shift left-to-right. Fix during build: replaced JS proxy object + onUpdate (broke under seek) with native GSAP CSS variable tween + @property registration.
|
||||
- scene-07: **PASS** — 9 frames show shared-axis-z depth crossfade across 3 phrases. Mid-swap frames at 2.3s and 4.5s clearly show outgoing phrase scaling toward camera with motion blur while incoming phrase emerges from depth. Material Design Z-axis transition unmistakable.
|
||||
- scene-08: **PASS** — 5 frames; 3 catch RGB-split glitch peaks (red/cyan channel offsets), 2 show clean settled state. Burst timestamps deliberately aligned with snapshot timestamps so peaks are caught. CRT scanlines, HUD corner brackets, status meta line. Cyberpunk vibe nailed.
|
||||
- scene-09: **PASS** — 6 frames show scramble decrypt: initial scramble glyphs → left-to-right lock to "AUTHENTICATED" → hold bright → re-encrypt (rightmost chars last to unlock with different intermediate chars proving deterministic-but-distinct generation) → re-decrypt. Cursor blink, scanline, status dot all running continuously.
|
||||
- scene-10: **PASS** — 8 frames; warm off-white paper background. Per-word crossfade entrance, hand-drawn orange ellipse marker draws around "intention" with stroke-dasharray, then secondary mark + handwritten "on purpose" arrow in Caveat font. Two transform-conflict bugs found and fixed during build (initial stroke visibility, linecap artifact at zero-dash).
|
||||
+310
@@ -0,0 +1,310 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>scene-01-soft-blur-in</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
<script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/CustomEase.min.js"></script>
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
body { background: #0a0a0a; }
|
||||
|
||||
#scene-01-soft-blur-in {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background: radial-gradient(ellipse at 50% 45%, #1a1a1a 0%, #0a0a0a 65%);
|
||||
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
color: #f5f5f5;
|
||||
}
|
||||
|
||||
/* Stage: centered phrase host. perspective_px=900 from soft-blur-in.json. */
|
||||
.stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
perspective: 900px;
|
||||
}
|
||||
|
||||
.phrase-row {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transform-style: preserve-3d;
|
||||
min-height: 160px;
|
||||
}
|
||||
|
||||
.phrase {
|
||||
position: absolute;
|
||||
display: inline-block;
|
||||
transform-style: preserve-3d;
|
||||
font-size: 144px;
|
||||
font-weight: 700;
|
||||
letter-spacing: -0.02em;
|
||||
line-height: 1.05;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* Per-character unit — see showcase.stage.unit in soft-blur-in.json.
|
||||
Initial opacity:0 locks the pre-entrance state in CSS so the snapshot
|
||||
tool's first-frame capture (before the GSAP timeline has time to apply
|
||||
its t=0 set tweens) shows the correct blank state. */
|
||||
.char {
|
||||
display: inline-block;
|
||||
white-space: pre;
|
||||
backface-visibility: hidden;
|
||||
transform-origin: 50% 55%;
|
||||
will-change: transform, opacity, filter;
|
||||
opacity: 0;
|
||||
filter: blur(12px);
|
||||
transform: translateY(24px);
|
||||
}
|
||||
|
||||
/* Same lock for eyebrow and underline initial states */
|
||||
.eyebrow { opacity: 0; }
|
||||
.underline path { stroke-dasharray: 240 240; stroke-dashoffset: 240; }
|
||||
|
||||
.eyebrow {
|
||||
position: absolute;
|
||||
top: calc(50% - 130px);
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
letter-spacing: 0.32em;
|
||||
text-transform: uppercase;
|
||||
color: #707070;
|
||||
}
|
||||
|
||||
.underline {
|
||||
position: absolute;
|
||||
top: calc(50% + 110px);
|
||||
left: 50%;
|
||||
width: 240px;
|
||||
height: 2px;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
.underline path {
|
||||
stroke: #f5f5f5;
|
||||
stroke-width: 2;
|
||||
fill: none;
|
||||
}
|
||||
|
||||
.grain {
|
||||
position: absolute;
|
||||
inset: -50px;
|
||||
background: radial-gradient(circle at 20% 30%, rgba(255,255,255,0.04) 0%, transparent 40%),
|
||||
radial-gradient(circle at 80% 70%, rgba(255,255,255,0.03) 0%, transparent 35%);
|
||||
pointer-events: none;
|
||||
will-change: transform, opacity;
|
||||
}
|
||||
|
||||
.label {
|
||||
position: absolute;
|
||||
left: 48px;
|
||||
bottom: 48px;
|
||||
font-size: 16px;
|
||||
color: #707070;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
font-weight: 500;
|
||||
z-index: 10;
|
||||
}
|
||||
.label .accent { color: #f5f5f5; font-weight: 600; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="scene-01-soft-blur-in"
|
||||
data-composition-id="scene-01-soft-blur-in"
|
||||
data-start="0"
|
||||
data-duration="8"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
style="width:1920px; height:1080px;">
|
||||
|
||||
<div class="grain"></div>
|
||||
|
||||
<div class="stage">
|
||||
<div class="eyebrow" id="eyebrow">Section 01 · Typography</div>
|
||||
<div class="phrase-row">
|
||||
<div class="phrase" data-phrase="0">Think different.</div>
|
||||
<div class="phrase" data-phrase="1">Built to flow.</div>
|
||||
<div class="phrase" data-phrase="2">Motion with intent.</div>
|
||||
</div>
|
||||
<svg class="underline" viewBox="0 0 240 2">
|
||||
<path id="underline-path" d="M 0 1 L 240 1" />
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div class="label">
|
||||
Scene 01 · <span class="accent">Soft Blur In</span> · per-character keynote reveal
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(function () {
|
||||
var BEAT = 8;
|
||||
window.__timelines = window.__timelines || {};
|
||||
|
||||
gsap.registerPlugin(CustomEase);
|
||||
|
||||
// soft-blur-in signature easing — Apple keynote curve.
|
||||
var softEase = CustomEase.create("soft", "0.22, 1, 0.36, 1");
|
||||
// Exit easing — accelerated, from soft-blur-in.json portable_spec.exit.easing.
|
||||
var exitEase = CustomEase.create("softExit", "0.64, 0, 0.78, 0");
|
||||
|
||||
// Split each phrase into per-character spans at build time. All three
|
||||
// phrases live in the DOM simultaneously (stacked, position:absolute)
|
||||
// and we toggle visibility through opacity timeline. This makes the
|
||||
// composition seekable — snapshot tool jumps to any timestamp and
|
||||
// the DOM is already populated, no callback-driven mutation required.
|
||||
function splitPhrase(phraseEl) {
|
||||
var text = phraseEl.textContent;
|
||||
var spans = [];
|
||||
var frag = document.createDocumentFragment();
|
||||
Array.from(text).forEach(function (ch) {
|
||||
var span = document.createElement("span");
|
||||
span.className = "char";
|
||||
span.textContent = ch === " " ? " " : ch;
|
||||
frag.appendChild(span);
|
||||
spans.push(span);
|
||||
});
|
||||
phraseEl.replaceChildren(frag);
|
||||
return spans;
|
||||
}
|
||||
|
||||
var phraseEls = document.querySelectorAll("#scene-01-soft-blur-in .phrase");
|
||||
var charsByPhrase = [];
|
||||
phraseEls.forEach(function (el) {
|
||||
charsByPhrase.push(splitPhrase(el));
|
||||
});
|
||||
|
||||
var Y_FROM = 24; // scaled from spec y_px=16 for 1080p host
|
||||
var BLUR_FROM = 12; // spec blur_px
|
||||
|
||||
var tl = gsap.timeline({ paused: true });
|
||||
|
||||
// === t=0 initial state — ALL phrases hidden + pre-positioned, eyebrow hidden, underline empty.
|
||||
tl.set(charsByPhrase[0], { opacity: 0, y: Y_FROM, filter: "blur(" + BLUR_FROM + "px)" }, 0);
|
||||
tl.set(charsByPhrase[1], { opacity: 0, y: Y_FROM, filter: "blur(" + BLUR_FROM + "px)" }, 0);
|
||||
tl.set(charsByPhrase[2], { opacity: 0, y: Y_FROM, filter: "blur(" + BLUR_FROM + "px)" }, 0);
|
||||
tl.set("#eyebrow", { opacity: 0, y: -8 }, 0);
|
||||
tl.set("#underline-path", { strokeDasharray: "240 240", strokeDashoffset: 240 }, 0);
|
||||
|
||||
// === t=0.3s: eyebrow slides in. Supporting move, layered with main entrance.
|
||||
tl.fromTo("#eyebrow",
|
||||
{ opacity: 0, y: -8 },
|
||||
{ opacity: 1, y: 0, duration: 0.6, ease: "expo.out" },
|
||||
0.30);
|
||||
|
||||
// === t=0.5s: phrase 1 enters per-character.
|
||||
// soft-blur-in spec: scaled_duration 648ms, scaled_stagger 18ms, signature easing.
|
||||
tl.to(charsByPhrase[0], {
|
||||
opacity: 1,
|
||||
y: 0,
|
||||
filter: "blur(0px)",
|
||||
duration: 0.648,
|
||||
stagger: 0.018,
|
||||
ease: softEase,
|
||||
}, 0.50);
|
||||
|
||||
// === t=1.4s: underline draws under phrase. Variety in easing — power4.out for the line snap.
|
||||
tl.to("#underline-path", {
|
||||
strokeDashoffset: 0,
|
||||
duration: 0.7,
|
||||
ease: "power4.out",
|
||||
}, 1.40);
|
||||
|
||||
// === Continuous motion 1.4s-3.0s: grain ambient drift. Keeps the frame alive
|
||||
// while the phrase is static — no element sits unchanged for more than ~1.5s.
|
||||
tl.to(".grain", {
|
||||
x: -30,
|
||||
y: -10,
|
||||
opacity: 0.7,
|
||||
duration: 1.6,
|
||||
ease: "sine.inOut",
|
||||
}, 1.40);
|
||||
|
||||
// === t=3.0s: phrase 1 exits.
|
||||
// exit duration scaled to 432ms, stagger 11ms, exit easing curve from spec.
|
||||
tl.to(charsByPhrase[0], {
|
||||
opacity: 0,
|
||||
y: -Y_FROM,
|
||||
filter: "blur(" + BLUR_FROM + "px)",
|
||||
duration: 0.432,
|
||||
stagger: 0.011,
|
||||
ease: exitEase,
|
||||
}, 3.00);
|
||||
|
||||
// === t=3.5s: phrase 2 enters (300ms overlap with phrase 1's exit per spec.swap.overlap_ms=300).
|
||||
tl.to(charsByPhrase[1], {
|
||||
opacity: 1,
|
||||
y: 0,
|
||||
filter: "blur(0px)",
|
||||
duration: 0.648,
|
||||
stagger: 0.018,
|
||||
ease: softEase,
|
||||
}, 3.50);
|
||||
|
||||
// === Continuous motion 4.5s-5.4s: underline scale pulse.
|
||||
tl.to(".underline", {
|
||||
scale: 1.08,
|
||||
duration: 0.45,
|
||||
ease: "sine.inOut",
|
||||
yoyo: true,
|
||||
repeat: 1,
|
||||
transformOrigin: "50% 50%",
|
||||
}, 4.50);
|
||||
|
||||
// === t=5.4s: phrase 2 exits.
|
||||
tl.to(charsByPhrase[1], {
|
||||
opacity: 0,
|
||||
y: -Y_FROM,
|
||||
filter: "blur(" + BLUR_FROM + "px)",
|
||||
duration: 0.432,
|
||||
stagger: 0.011,
|
||||
ease: exitEase,
|
||||
}, 5.40);
|
||||
|
||||
// === t=5.9s: phrase 3 enters. Held until end of beat.
|
||||
tl.to(charsByPhrase[2], {
|
||||
opacity: 1,
|
||||
y: 0,
|
||||
filter: "blur(0px)",
|
||||
duration: 0.648,
|
||||
stagger: 0.018,
|
||||
ease: softEase,
|
||||
}, 5.90);
|
||||
|
||||
// === Continuous motion 6.7s-8.0s: subtle breathing on the final phrase + grain return.
|
||||
tl.to(charsByPhrase[2], {
|
||||
y: -4,
|
||||
duration: 1.3,
|
||||
ease: "sine.inOut",
|
||||
stagger: 0.005,
|
||||
}, 6.70);
|
||||
tl.to(".grain", {
|
||||
x: 0,
|
||||
y: 0,
|
||||
opacity: 1,
|
||||
duration: 1.3,
|
||||
ease: "sine.inOut",
|
||||
}, 6.70);
|
||||
|
||||
window.__timelines["scene-01-soft-blur-in"] = tl;
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
+308
@@ -0,0 +1,308 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>scene-02-typewriter-mechanical</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Inter:wght@500&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
<script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
body { background: #0a0a0a; }
|
||||
|
||||
#scene-02-typewriter-mechanical {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background:
|
||||
radial-gradient(ellipse at 50% 60%, #0e1419 0%, #050708 70%),
|
||||
linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.4) 100%);
|
||||
font-family: "JetBrains Mono", "Menlo", monospace;
|
||||
color: #d4f1ff;
|
||||
}
|
||||
|
||||
/* Scanline overlay — CRT/terminal vibe. Continuous-motion via animated background-position. */
|
||||
.scanlines {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background-image: repeating-linear-gradient(
|
||||
0deg,
|
||||
rgba(255,255,255,0.0) 0px,
|
||||
rgba(255,255,255,0.0) 2px,
|
||||
rgba(255,255,255,0.025) 2px,
|
||||
rgba(255,255,255,0.025) 4px
|
||||
);
|
||||
pointer-events: none;
|
||||
mix-blend-mode: screen;
|
||||
will-change: transform;
|
||||
}
|
||||
|
||||
/* Terminal window chrome */
|
||||
.terminal {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: 1280px;
|
||||
border: 1px solid rgba(120, 180, 220, 0.18);
|
||||
border-radius: 12px;
|
||||
background: linear-gradient(180deg, #0c1115 0%, #06090c 100%);
|
||||
box-shadow:
|
||||
0 60px 120px -30px rgba(8, 88, 145, 0.4),
|
||||
inset 0 1px 0 rgba(255,255,255,0.03);
|
||||
overflow: hidden;
|
||||
}
|
||||
.terminal-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 16px 20px;
|
||||
border-bottom: 1px solid rgba(120, 180, 220, 0.12);
|
||||
background: rgba(15, 25, 35, 0.5);
|
||||
}
|
||||
.dot { width: 12px; height: 12px; border-radius: 50%; }
|
||||
.dot.red { background: #ff5f57; }
|
||||
.dot.yellow { background: #ffbd2e; }
|
||||
.dot.green { background: #28c941; }
|
||||
.terminal-title {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-family: "Inter", sans-serif;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
color: #5c6c7a;
|
||||
letter-spacing: 0.02em;
|
||||
}
|
||||
|
||||
.terminal-body {
|
||||
padding: 56px 48px 64px;
|
||||
min-height: 360px;
|
||||
position: relative;
|
||||
}
|
||||
.prompt {
|
||||
font-size: 18px;
|
||||
color: #4a8db8;
|
||||
font-weight: 500;
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
.typed {
|
||||
font-size: 64px;
|
||||
font-weight: 500;
|
||||
line-height: 1.2;
|
||||
letter-spacing: -0.01em;
|
||||
color: #d4f1ff;
|
||||
display: inline;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
.typed .char {
|
||||
display: inline-block;
|
||||
white-space: pre;
|
||||
opacity: 0; /* lock initial state for snapshot determinism */
|
||||
will-change: opacity, transform;
|
||||
}
|
||||
/* Cursor */
|
||||
.cursor {
|
||||
display: inline-block;
|
||||
width: 22px;
|
||||
height: 64px;
|
||||
vertical-align: text-bottom;
|
||||
background: #4ade80;
|
||||
margin-left: 4px;
|
||||
transform: translateY(8px);
|
||||
box-shadow: 0 0 24px rgba(74, 222, 128, 0.6);
|
||||
}
|
||||
|
||||
/* Glow under cursor — adds depth */
|
||||
.cursor-glow {
|
||||
position: absolute;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
pointer-events: none;
|
||||
background: radial-gradient(circle, rgba(74, 222, 128, 0.18) 0%, transparent 60%);
|
||||
filter: blur(4px);
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.label {
|
||||
position: absolute;
|
||||
left: 48px;
|
||||
bottom: 48px;
|
||||
font-size: 16px;
|
||||
color: #5c6c7a;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
font-weight: 500;
|
||||
font-family: "Inter", sans-serif;
|
||||
z-index: 10;
|
||||
}
|
||||
.label .accent { color: #d4f1ff; font-weight: 600; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="scene-02-typewriter-mechanical"
|
||||
data-composition-id="scene-02-typewriter-mechanical"
|
||||
data-start="0"
|
||||
data-duration="6"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
style="width:1920px; height:1080px;">
|
||||
|
||||
<div class="scanlines"></div>
|
||||
|
||||
<div class="terminal" id="terminal">
|
||||
<div class="terminal-header">
|
||||
<span class="dot red"></span>
|
||||
<span class="dot yellow"></span>
|
||||
<span class="dot green"></span>
|
||||
<span class="terminal-title">~/projects/launch ── zsh</span>
|
||||
</div>
|
||||
<div class="terminal-body">
|
||||
<div class="prompt">$ echo</div>
|
||||
<div class="typed" id="typed-row">
|
||||
<span id="typed-phrase-1"></span><span class="cursor" id="cursor"></span>
|
||||
</div>
|
||||
<div class="cursor-glow" id="cursor-glow"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="label">
|
||||
Scene 02 · <span class="accent">Typewriter</span> · stepped per-character — terminal/editorial
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(function () {
|
||||
var BEAT = 6;
|
||||
window.__timelines = window.__timelines || {};
|
||||
|
||||
// Two phrases — first typed in, exits, second typed in.
|
||||
// Phrase 2 is kept short to avoid wrapping inside the terminal body.
|
||||
var phrases = ["Precision in motion.", "Pause. Continue."];
|
||||
|
||||
function splitInto(host, text) {
|
||||
var spans = [];
|
||||
var frag = document.createDocumentFragment();
|
||||
Array.from(text).forEach(function (ch) {
|
||||
var span = document.createElement("span");
|
||||
span.className = "char";
|
||||
span.textContent = ch === " " ? " " : ch;
|
||||
frag.appendChild(span);
|
||||
spans.push(span);
|
||||
});
|
||||
host.replaceChildren(frag);
|
||||
return spans;
|
||||
}
|
||||
|
||||
// Pre-build phrase 1's characters. Phrase 2 builds at the swap point —
|
||||
// but we need it DOM-resident at t=0 for the snapshot tool to find chars.
|
||||
// Solution: build both into different host spans, hide phrase 2 via opacity:0
|
||||
// on the entire wrapper. At swap, hide phrase 1 wrapper, show phrase 2.
|
||||
var typedRow = document.getElementById("typed-row");
|
||||
var p1Host = document.getElementById("typed-phrase-1");
|
||||
var p1Chars = splitInto(p1Host, phrases[0]);
|
||||
|
||||
// Add phrase 2 host after p1 in the same row but as a separate wrapper.
|
||||
var p2Host = document.createElement("span");
|
||||
p2Host.id = "typed-phrase-2";
|
||||
p2Host.style.display = "none"; // hidden until swap
|
||||
typedRow.insertBefore(p2Host, document.getElementById("cursor"));
|
||||
var p2Chars = splitInto(p2Host, phrases[1]);
|
||||
|
||||
// Cursor position is between phrase wrappers and the end of the row.
|
||||
var cursor = document.getElementById("cursor");
|
||||
|
||||
var tl = gsap.timeline({ paused: true });
|
||||
|
||||
// === Continuous motion through entire beat: scanlines drift down (CRT scroll).
|
||||
tl.fromTo(".scanlines",
|
||||
{ y: 0 },
|
||||
{ y: 8, duration: 0.6, ease: "none", repeat: 9, yoyo: true },
|
||||
0);
|
||||
|
||||
// === Cursor breathing (steady blink) for all 6 seconds.
|
||||
tl.fromTo(cursor,
|
||||
{ opacity: 1 },
|
||||
{ opacity: 0.15, duration: 0.5, repeat: 11, yoyo: true, ease: "steps(1)" },
|
||||
0);
|
||||
|
||||
// === Cursor glow follows cursor position — we approximate via fixed positions.
|
||||
// Glow starts hidden, pulses on while typing happens.
|
||||
tl.fromTo("#cursor-glow",
|
||||
{ opacity: 0, x: 96, y: 96 },
|
||||
{ opacity: 1, duration: 0.4, ease: "expo.out" },
|
||||
0.25);
|
||||
|
||||
// === t=0.3s: phrase 1 types character-by-character.
|
||||
// Spec: scaled_duration 173ms, scaled_stagger 33ms, ease steps(1,end).
|
||||
// GSAP steps(1) = instant per-char appearance with stagger between.
|
||||
tl.to(p1Chars, {
|
||||
opacity: 1,
|
||||
duration: 0.173,
|
||||
stagger: 0.033,
|
||||
ease: "steps(1)",
|
||||
}, 0.30);
|
||||
|
||||
// Pre-typed phrase 1 ends at 0.3 + 0.173 + (19 * 0.033) = ~1.10s
|
||||
|
||||
// === Continuous motion 1.1s-2.5s: cursor glow ambient pulse during hold.
|
||||
tl.to("#cursor-glow", {
|
||||
opacity: 0.5,
|
||||
scale: 1.3,
|
||||
duration: 0.7,
|
||||
ease: "sine.inOut",
|
||||
yoyo: true,
|
||||
repeat: 1,
|
||||
transformOrigin: "50% 50%",
|
||||
}, 1.20);
|
||||
|
||||
// === t=2.5s: phrase 1 exits with subtle upward drift + opacity fade.
|
||||
// Spec exit: scaled_duration 187ms, stagger 7ms, exit easing curve.
|
||||
tl.to(p1Chars, {
|
||||
opacity: 0,
|
||||
y: -4,
|
||||
duration: 0.187,
|
||||
stagger: 0.007,
|
||||
ease: "power3.in",
|
||||
}, 2.50);
|
||||
|
||||
// === t=2.9s: swap visibility — phrase 1 hidden, phrase 2 shown.
|
||||
tl.set("#typed-phrase-1", { display: "none" }, 2.90);
|
||||
tl.set("#typed-phrase-2", { display: "inline" }, 2.90);
|
||||
|
||||
// === t=3.1s: phrase 2 types in.
|
||||
tl.to(p2Chars, {
|
||||
opacity: 1,
|
||||
duration: 0.173,
|
||||
stagger: 0.033,
|
||||
ease: "steps(1)",
|
||||
}, 3.10);
|
||||
|
||||
// Phrase 2 has 22 chars including punctuation. Stagger ends ~3.85s.
|
||||
|
||||
// === Continuous motion 4.0s-6.0s: terminal subtle drift (camera move).
|
||||
tl.to("#terminal", {
|
||||
y: -8,
|
||||
duration: 2.0,
|
||||
ease: "sine.inOut",
|
||||
}, 4.00);
|
||||
|
||||
// === t=4.0s: cursor pulses brighter for emphasis on the final hold.
|
||||
tl.to("#cursor-glow", {
|
||||
opacity: 0.7,
|
||||
scale: 1.5,
|
||||
duration: 1.5,
|
||||
ease: "sine.inOut",
|
||||
yoyo: true,
|
||||
repeat: 1,
|
||||
transformOrigin: "50% 50%",
|
||||
}, 4.00);
|
||||
|
||||
window.__timelines["scene-02-typewriter-mechanical"] = tl;
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
+555
@@ -0,0 +1,555 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>scene-03-kinetic-center-build</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
<script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/CustomEase.min.js"></script>
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
body { background: #0a0a0a; }
|
||||
|
||||
#scene-03-kinetic-center-build {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background: radial-gradient(ellipse at 50% 50%, #181818 0%, #0a0a0a 70%);
|
||||
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
color: #f5f5f5;
|
||||
}
|
||||
|
||||
/* Stage host for the kinetic line. perspective_px=900 per showcase.stage.container. */
|
||||
.stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
perspective: 900px;
|
||||
}
|
||||
|
||||
/* Kinetic line container — relative, centered, with absolute-positioned word spans
|
||||
per showcase.stage.kinetic_container (coordinate_origin: center). */
|
||||
.kinetic-line {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transform-style: preserve-3d;
|
||||
}
|
||||
|
||||
/* Both phrase wrappers stacked at the same center; only one visible per cycle. */
|
||||
.phrase-host {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* showcase.stage.kinetic_word: absolutely centered, will-change set for compositor. */
|
||||
.kw {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
backface-visibility: hidden;
|
||||
white-space: nowrap;
|
||||
font-size: 140px;
|
||||
font-weight: 700;
|
||||
letter-spacing: -0.02em;
|
||||
line-height: 1;
|
||||
transform-origin: 50% 55%;
|
||||
will-change: transform, opacity, filter;
|
||||
/* Locked initial state for snapshot determinism: invisible, slightly nudged. */
|
||||
opacity: 0;
|
||||
transform: translate(-50%, -50%) translate3d(0px, 6px, 0) scale(0.992);
|
||||
filter: blur(3.5px);
|
||||
}
|
||||
|
||||
/* The second phrase host is hidden by display until its cycle so its words
|
||||
don't briefly flash before opacity gets locked at t=0. */
|
||||
.phrase-host.hidden { display: none; }
|
||||
|
||||
.eyebrow {
|
||||
position: absolute;
|
||||
top: calc(50% - 150px);
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
letter-spacing: 0.32em;
|
||||
text-transform: uppercase;
|
||||
color: #707070;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
/* Center crosshair guide (subtle) — fades in late to reinforce the "lock center" idea. */
|
||||
.center-rule {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 280px;
|
||||
height: 1px;
|
||||
transform: translate(-50%, 130px);
|
||||
background: linear-gradient(90deg, transparent 0%, rgba(245,245,245,0.18) 50%, transparent 100%);
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
/* Grain — ambient layer for continuous motion. */
|
||||
.grain {
|
||||
position: absolute;
|
||||
inset: -50px;
|
||||
background:
|
||||
radial-gradient(circle at 22% 28%, rgba(255,255,255,0.04) 0%, transparent 38%),
|
||||
radial-gradient(circle at 78% 72%, rgba(255,255,255,0.03) 0%, transparent 36%);
|
||||
pointer-events: none;
|
||||
will-change: transform, opacity;
|
||||
}
|
||||
|
||||
.label {
|
||||
position: absolute;
|
||||
left: 48px;
|
||||
bottom: 48px;
|
||||
font-size: 16px;
|
||||
color: #707070;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
font-weight: 500;
|
||||
z-index: 10;
|
||||
}
|
||||
.label .accent { color: #f5f5f5; font-weight: 600; }
|
||||
.label .meta { color: #4a4a4a; font-weight: 500; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="scene-03-kinetic-center-build"
|
||||
data-composition-id="scene-03-kinetic-center-build"
|
||||
data-start="0"
|
||||
data-duration="8"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
style="width:1920px; height:1080px;">
|
||||
|
||||
<div class="grain"></div>
|
||||
|
||||
<div class="stage">
|
||||
<div class="eyebrow" id="eyebrow">Section 03 · Kinetic Type</div>
|
||||
|
||||
<div class="kinetic-line">
|
||||
<!-- Two phrase hosts pre-built into the DOM. Word spans get inserted by the
|
||||
IIFE below; we need them DOM-resident at t=0 so the snapshot tool finds
|
||||
them when it seeks to any timestamp. -->
|
||||
<div class="phrase-host" id="phrase-1" data-words="Built|to|flow."></div>
|
||||
<div class="phrase-host hidden" id="phrase-2" data-words="Motion|with|intent."></div>
|
||||
</div>
|
||||
|
||||
<div class="center-rule" id="center-rule"></div>
|
||||
</div>
|
||||
|
||||
<div class="label">
|
||||
Scene 03 · <span class="accent">Kinetic Center Build</span> · <span class="meta">word-locks-center, phrase builds right-to-left</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(function () {
|
||||
var BEAT = 8;
|
||||
window.__timelines = window.__timelines || {};
|
||||
|
||||
gsap.registerPlugin(CustomEase);
|
||||
|
||||
// Signature easing for kinetic-center-build (from showcase.timing): cubic-bezier(0.2, 0.8, 0.2, 1).
|
||||
var kineticEase = CustomEase.create("kinetic", "0.2, 0.8, 0.2, 1");
|
||||
// Exit easing per spec: cubic-bezier(0.4, 0, 0.2, 1).
|
||||
var kineticExit = CustomEase.create("kineticExit", "0.4, 0, 0.2, 1");
|
||||
|
||||
// Build params (renderer-pixel coordinates — NOT scaled by y_travel_multiplier per
|
||||
// rendering_contract.y_travel_multiplier_note).
|
||||
// NOTE: spec word_gap_px=10 is for the website's smaller font. At 140px headline we
|
||||
// need a visually proportional gap (~56px ≈ 0.4em reads as a natural space between
|
||||
// words for wider longer phrases like "Motion with intent.").
|
||||
var WORD_GAP = 56;
|
||||
var ENTRY_OFFSET = 130; // bumped proportionally — still well above ~ word width.
|
||||
var FIRST_WORD_Y = 6;
|
||||
var ENTRY_SCALE = 0.992;
|
||||
var ENTRY_BLUR = 3.5;
|
||||
var REFLOW_BLUR = 0.8;
|
||||
var EXIT_Y = -6;
|
||||
var EXIT_BLUR = 2.5;
|
||||
|
||||
// Scaled durations from showcase.timing (source * 0.72 speed_multiplier).
|
||||
var FIRST_DUR = 0.245; // 245ms — first word in
|
||||
var PUSH_DUR = 0.310; // 310ms — each subsequent push
|
||||
var EXIT_DUR = 0.187; // 187ms — phrase exit
|
||||
|
||||
// Build the word spans for one phrase host, return [{el, width}] in left-to-right order.
|
||||
function buildPhrase(hostEl) {
|
||||
var words = hostEl.getAttribute("data-words").split("|");
|
||||
var frag = document.createDocumentFragment();
|
||||
var entries = [];
|
||||
words.forEach(function (w) {
|
||||
var span = document.createElement("span");
|
||||
span.className = "kw";
|
||||
span.textContent = w;
|
||||
frag.appendChild(span);
|
||||
entries.push({ el: span, text: w });
|
||||
});
|
||||
hostEl.replaceChildren(frag);
|
||||
// Force the host visible during measurement so offsetWidth resolves
|
||||
// (display:none on phrase-2 would return 0). We toggle a temp class.
|
||||
var wasHidden = hostEl.classList.contains("hidden");
|
||||
if (wasHidden) {
|
||||
hostEl.style.display = "block";
|
||||
hostEl.style.visibility = "hidden";
|
||||
}
|
||||
entries.forEach(function (e) { e.width = e.el.offsetWidth; });
|
||||
if (wasHidden) {
|
||||
hostEl.style.display = "";
|
||||
hostEl.style.visibility = "";
|
||||
}
|
||||
return entries;
|
||||
}
|
||||
|
||||
// Compute the centered x position of each word AFTER all `count` words are present.
|
||||
// total = sum(widths[0..count-1]) + word_gap * (count - 1)
|
||||
// cursor = -total / 2; each word x = cursor + width/2 then cursor += width + gap.
|
||||
function centeredPositions(entries, count) {
|
||||
var widths = entries.slice(0, count).map(function (e) { return e.width; });
|
||||
var total = widths.reduce(function (s, w) { return s + w; }, 0) + WORD_GAP * (count - 1);
|
||||
var cursor = -total / 2;
|
||||
var positions = [];
|
||||
for (var i = 0; i < count; i++) {
|
||||
var x = cursor + widths[i] / 2;
|
||||
positions.push(x);
|
||||
cursor += widths[i] + WORD_GAP;
|
||||
}
|
||||
return positions;
|
||||
}
|
||||
|
||||
var phrase1Host = document.getElementById("phrase-1");
|
||||
var phrase2Host = document.getElementById("phrase-2");
|
||||
var p1 = buildPhrase(phrase1Host);
|
||||
var p2 = buildPhrase(phrase2Host);
|
||||
|
||||
// Remove the .hidden class from phrase-2 now that its words exist and are
|
||||
// locked to opacity 0 via CSS. We control visibility through opacity only
|
||||
// so the snapshot tool finds DOM at every timestamp.
|
||||
phrase2Host.classList.remove("hidden");
|
||||
|
||||
var tl = gsap.timeline({ paused: true });
|
||||
|
||||
// === t=0: explicit lock of all initial states. CSS already locks .kw opacity:0
|
||||
// but this guarantees the per-word transform/filter state is what the spec demands
|
||||
// regardless of which seek timestamp the snapshot tool resolves first.
|
||||
p1.concat(p2).forEach(function (e) {
|
||||
tl.set(e.el, {
|
||||
opacity: 0,
|
||||
x: 0,
|
||||
y: FIRST_WORD_Y,
|
||||
scale: ENTRY_SCALE,
|
||||
filter: "blur(" + ENTRY_BLUR + "px)",
|
||||
xPercent: -50,
|
||||
yPercent: -50,
|
||||
}, 0);
|
||||
});
|
||||
tl.set("#eyebrow", { opacity: 0, y: -8 }, 0);
|
||||
tl.set("#center-rule", { opacity: 0, scaleX: 0.4, transformOrigin: "50% 50%" }, 0);
|
||||
|
||||
// === t=0.20s: eyebrow lifts in with expo.out (soft land). Layered with main entrance.
|
||||
tl.fromTo("#eyebrow",
|
||||
{ opacity: 0, y: -8 },
|
||||
{ opacity: 1, y: 0, duration: 0.55, ease: "expo.out" },
|
||||
0.20);
|
||||
|
||||
// === t=0.30s: ambient grain breathing — drifts the whole 8s to keep frame alive.
|
||||
tl.fromTo(".grain",
|
||||
{ x: 0, y: 0, opacity: 1 },
|
||||
{ x: -28, y: -12, opacity: 0.65, duration: 3.4, ease: "sine.inOut" },
|
||||
0.30);
|
||||
|
||||
// ============================================================
|
||||
// CYCLE 1: "Built to flow." — build word-by-word right-to-left.
|
||||
// ============================================================
|
||||
|
||||
// --- Word 1 ("Built") at center: t=0.50s → 0.745s.
|
||||
// First-word recipe: x=0; opacity 0→1; y 6→0; scale 0.992→1; blur 3.5→0. Signature ease.
|
||||
var p1pos1 = centeredPositions(p1, 1); // word 1 alone is centered at x=0
|
||||
tl.to(p1[0].el, {
|
||||
opacity: 1,
|
||||
x: p1pos1[0],
|
||||
y: 0,
|
||||
scale: 1,
|
||||
filter: "blur(0px)",
|
||||
duration: FIRST_DUR,
|
||||
ease: kineticEase,
|
||||
}, 0.50);
|
||||
|
||||
// --- Word 2 ("to") pushes in from right at t=0.95s.
|
||||
// micro_delay_ms=220 between words (per portable_spec.swap.micro_delay_ms scaled).
|
||||
// Existing words shift to new centered positions while incoming word slides in.
|
||||
var p1pos2 = centeredPositions(p1, 2);
|
||||
// Existing word "Built" reflows from x=p1pos1[0] (=0) to x=p1pos2[0].
|
||||
tl.to(p1[0].el, {
|
||||
x: p1pos2[0],
|
||||
filter: "blur(" + REFLOW_BLUR + "px)",
|
||||
duration: PUSH_DUR * 0.52,
|
||||
ease: kineticEase,
|
||||
}, 0.95);
|
||||
tl.to(p1[0].el, {
|
||||
filter: "blur(0px)",
|
||||
duration: PUSH_DUR * 0.48,
|
||||
ease: kineticEase,
|
||||
}, 0.95 + PUSH_DUR * 0.52);
|
||||
// Incoming word "to" starts at targetX + ENTRY_OFFSET and lands at targetX.
|
||||
tl.fromTo(p1[1].el,
|
||||
{
|
||||
opacity: 0,
|
||||
x: p1pos2[1] + ENTRY_OFFSET,
|
||||
y: 0,
|
||||
scale: ENTRY_SCALE,
|
||||
filter: "blur(" + ENTRY_BLUR + "px)",
|
||||
},
|
||||
{
|
||||
opacity: 1,
|
||||
x: p1pos2[1],
|
||||
scale: 1,
|
||||
filter: "blur(0px)",
|
||||
duration: PUSH_DUR,
|
||||
ease: kineticEase,
|
||||
},
|
||||
0.95);
|
||||
|
||||
// --- Word 3 ("flow.") pushes in at t=1.46s.
|
||||
var p1pos3 = centeredPositions(p1, 3);
|
||||
// "Built" reflows to its final position.
|
||||
tl.to(p1[0].el, {
|
||||
x: p1pos3[0],
|
||||
filter: "blur(" + REFLOW_BLUR + "px)",
|
||||
duration: PUSH_DUR * 0.52,
|
||||
ease: kineticEase,
|
||||
}, 1.46);
|
||||
tl.to(p1[0].el, {
|
||||
filter: "blur(0px)",
|
||||
duration: PUSH_DUR * 0.48,
|
||||
ease: kineticEase,
|
||||
}, 1.46 + PUSH_DUR * 0.52);
|
||||
// "to" reflows to its final position.
|
||||
tl.to(p1[1].el, {
|
||||
x: p1pos3[1],
|
||||
filter: "blur(" + REFLOW_BLUR + "px)",
|
||||
duration: PUSH_DUR * 0.52,
|
||||
ease: kineticEase,
|
||||
}, 1.46);
|
||||
tl.to(p1[1].el, {
|
||||
filter: "blur(0px)",
|
||||
duration: PUSH_DUR * 0.48,
|
||||
ease: kineticEase,
|
||||
}, 1.46 + PUSH_DUR * 0.52);
|
||||
// "flow." enters from right.
|
||||
tl.fromTo(p1[2].el,
|
||||
{
|
||||
opacity: 0,
|
||||
x: p1pos3[2] + ENTRY_OFFSET,
|
||||
y: 0,
|
||||
scale: ENTRY_SCALE,
|
||||
filter: "blur(" + ENTRY_BLUR + "px)",
|
||||
},
|
||||
{
|
||||
opacity: 1,
|
||||
x: p1pos3[2],
|
||||
scale: 1,
|
||||
filter: "blur(0px)",
|
||||
duration: PUSH_DUR,
|
||||
ease: kineticEase,
|
||||
},
|
||||
1.46);
|
||||
|
||||
// === t=1.85s: center rule fades up under phrase — visual cue that line locked.
|
||||
// power4.out for the rule snap-in (variety: 3rd easing family).
|
||||
tl.to("#center-rule", {
|
||||
opacity: 1,
|
||||
scaleX: 1,
|
||||
duration: 0.55,
|
||||
ease: "power4.out",
|
||||
}, 1.85);
|
||||
|
||||
// === t=1.85s-3.10s: HOLD. Subtle breathing on the whole phrase keeps it alive.
|
||||
// y drift -2px, sine in/out — nothing static >1.5s rule satisfied.
|
||||
tl.to(p1.map(function (e) { return e.el; }), {
|
||||
y: -2,
|
||||
duration: 0.62,
|
||||
ease: "sine.inOut",
|
||||
yoyo: true,
|
||||
repeat: 1,
|
||||
}, 1.85);
|
||||
|
||||
// === t=3.10s: EXIT phrase 1 — all words together. Exit easing.
|
||||
tl.to(p1.map(function (e) { return e.el; }), {
|
||||
opacity: 0,
|
||||
y: EXIT_Y,
|
||||
filter: "blur(" + EXIT_BLUR + "px)",
|
||||
duration: EXIT_DUR,
|
||||
ease: kineticExit,
|
||||
}, 3.10);
|
||||
|
||||
// === t=3.30s: center-rule contracts back as the phrase clears.
|
||||
tl.to("#center-rule", {
|
||||
opacity: 0,
|
||||
scaleX: 0.4,
|
||||
duration: 0.35,
|
||||
ease: kineticExit,
|
||||
}, 3.30);
|
||||
|
||||
// ============================================================
|
||||
// CYCLE 2: "Motion with intent." — same build pattern, different copy.
|
||||
// 158ms gap (per showcase.timing.gap_ms) after exit completes at ~3.29s.
|
||||
// ============================================================
|
||||
var C2_START = 3.55;
|
||||
|
||||
// --- Word 1 ("Motion") at center.
|
||||
var p2pos1 = centeredPositions(p2, 1);
|
||||
tl.to(p2[0].el, {
|
||||
opacity: 1,
|
||||
x: p2pos1[0],
|
||||
y: 0,
|
||||
scale: 1,
|
||||
filter: "blur(0px)",
|
||||
duration: FIRST_DUR,
|
||||
ease: kineticEase,
|
||||
}, C2_START);
|
||||
|
||||
// --- Word 2 ("with") pushes in 200ms after word 1 lands (220 scaled).
|
||||
var p2pos2 = centeredPositions(p2, 2);
|
||||
var T2a = C2_START + 0.45;
|
||||
tl.to(p2[0].el, {
|
||||
x: p2pos2[0],
|
||||
filter: "blur(" + REFLOW_BLUR + "px)",
|
||||
duration: PUSH_DUR * 0.52,
|
||||
ease: kineticEase,
|
||||
}, T2a);
|
||||
tl.to(p2[0].el, {
|
||||
filter: "blur(0px)",
|
||||
duration: PUSH_DUR * 0.48,
|
||||
ease: kineticEase,
|
||||
}, T2a + PUSH_DUR * 0.52);
|
||||
tl.fromTo(p2[1].el,
|
||||
{
|
||||
opacity: 0,
|
||||
x: p2pos2[1] + ENTRY_OFFSET,
|
||||
y: 0,
|
||||
scale: ENTRY_SCALE,
|
||||
filter: "blur(" + ENTRY_BLUR + "px)",
|
||||
},
|
||||
{
|
||||
opacity: 1,
|
||||
x: p2pos2[1],
|
||||
scale: 1,
|
||||
filter: "blur(0px)",
|
||||
duration: PUSH_DUR,
|
||||
ease: kineticEase,
|
||||
},
|
||||
T2a);
|
||||
|
||||
// --- Word 3 ("intent.") pushes in.
|
||||
var p2pos3 = centeredPositions(p2, 3);
|
||||
var T2b = T2a + 0.51;
|
||||
tl.to(p2[0].el, {
|
||||
x: p2pos3[0],
|
||||
filter: "blur(" + REFLOW_BLUR + "px)",
|
||||
duration: PUSH_DUR * 0.52,
|
||||
ease: kineticEase,
|
||||
}, T2b);
|
||||
tl.to(p2[0].el, {
|
||||
filter: "blur(0px)",
|
||||
duration: PUSH_DUR * 0.48,
|
||||
ease: kineticEase,
|
||||
}, T2b + PUSH_DUR * 0.52);
|
||||
tl.to(p2[1].el, {
|
||||
x: p2pos3[1],
|
||||
filter: "blur(" + REFLOW_BLUR + "px)",
|
||||
duration: PUSH_DUR * 0.52,
|
||||
ease: kineticEase,
|
||||
}, T2b);
|
||||
tl.to(p2[1].el, {
|
||||
filter: "blur(0px)",
|
||||
duration: PUSH_DUR * 0.48,
|
||||
ease: kineticEase,
|
||||
}, T2b + PUSH_DUR * 0.52);
|
||||
tl.fromTo(p2[2].el,
|
||||
{
|
||||
opacity: 0,
|
||||
x: p2pos3[2] + ENTRY_OFFSET,
|
||||
y: 0,
|
||||
scale: ENTRY_SCALE,
|
||||
filter: "blur(" + ENTRY_BLUR + "px)",
|
||||
},
|
||||
{
|
||||
opacity: 1,
|
||||
x: p2pos3[2],
|
||||
scale: 1,
|
||||
filter: "blur(0px)",
|
||||
duration: PUSH_DUR,
|
||||
ease: kineticEase,
|
||||
},
|
||||
T2b);
|
||||
|
||||
// === t≈4.85s: center rule fades back in under cycle-2 phrase.
|
||||
var T2done = T2b + PUSH_DUR; // ≈ 4.87s
|
||||
tl.to("#center-rule", {
|
||||
opacity: 1,
|
||||
scaleX: 1,
|
||||
duration: 0.55,
|
||||
ease: "power4.out",
|
||||
}, T2done);
|
||||
|
||||
// === Final hold 4.87s-7.6s: continuous breathing — y drift + scale pulse — and
|
||||
// eyebrow letter-spacing micro-shift (variety: another easing — "none" for linear pulse).
|
||||
tl.to(p2.map(function (e) { return e.el; }), {
|
||||
y: -2,
|
||||
duration: 0.7,
|
||||
ease: "sine.inOut",
|
||||
yoyo: true,
|
||||
repeat: 2,
|
||||
}, T2done + 0.10);
|
||||
|
||||
// Final phrase subtle scale-up breathe (kept under 1.02 to read as breath not zoom).
|
||||
tl.to(p2.map(function (e) { return e.el; }), {
|
||||
scale: 1.012,
|
||||
duration: 1.4,
|
||||
ease: "sine.inOut",
|
||||
yoyo: true,
|
||||
repeat: 1,
|
||||
}, T2done + 0.30);
|
||||
|
||||
// Eyebrow letter-spacing slow open — adds drift in a different layer.
|
||||
tl.to("#eyebrow", {
|
||||
letterSpacing: "0.40em",
|
||||
duration: 2.3,
|
||||
ease: "none",
|
||||
}, T2done + 0.20);
|
||||
|
||||
// === t=7.20s: grain settles back to origin — final frame frames the locked phrase.
|
||||
tl.to(".grain", {
|
||||
x: 0,
|
||||
y: 0,
|
||||
opacity: 1,
|
||||
duration: 0.78,
|
||||
ease: "sine.inOut",
|
||||
}, 7.20);
|
||||
|
||||
window.__timelines["scene-03-kinetic-center-build"] = tl;
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
+385
@@ -0,0 +1,385 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>scene-04-line-reveal-staggered</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,400;9..144,500&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
<script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/CustomEase.min.js"></script>
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
body { background: #1a1a1a; }
|
||||
|
||||
#scene-04-line-reveal-staggered {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
/* Editorial dark: subtle vignette + paper-grain tint for "magazine spread" feel. */
|
||||
background:
|
||||
radial-gradient(ellipse at 50% 50%, #232323 0%, #1a1a1a 55%, #0f0f0f 100%);
|
||||
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
color: #f2efe8;
|
||||
}
|
||||
|
||||
/* Editorial vignette — slowly drifts during the hold to give the frame breath. */
|
||||
.vignette {
|
||||
position: absolute;
|
||||
inset: -80px;
|
||||
background:
|
||||
radial-gradient(ellipse at 30% 40%, rgba(255, 245, 220, 0.035) 0%, transparent 45%),
|
||||
radial-gradient(ellipse at 70% 60%, rgba(180, 200, 230, 0.025) 0%, transparent 50%);
|
||||
pointer-events: none;
|
||||
will-change: transform, opacity;
|
||||
}
|
||||
|
||||
/* Stage: centered pull-quote, slightly left-justified for editorial feel. */
|
||||
.stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
justify-content: center;
|
||||
padding: 0 200px;
|
||||
perspective: 900px;
|
||||
}
|
||||
|
||||
/* Eyebrow label above the quote — small caps, premium magazine cue. */
|
||||
.eyebrow {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 18px;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
letter-spacing: 0.36em;
|
||||
text-transform: uppercase;
|
||||
color: #8a8378;
|
||||
margin-bottom: 56px;
|
||||
opacity: 0; /* lock pre-state for snapshot determinism */
|
||||
}
|
||||
.eyebrow .rule {
|
||||
display: inline-block;
|
||||
width: 56px;
|
||||
height: 1px;
|
||||
background: #8a8378;
|
||||
transform-origin: 0% 50%;
|
||||
transform: scaleX(0);
|
||||
}
|
||||
.eyebrow .text {
|
||||
display: inline-block;
|
||||
transform: translateY(-4px);
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
/* The pull-quote itself — Fraunces serif for editorial gravitas. */
|
||||
.quote {
|
||||
display: inline-block;
|
||||
font-family: "Fraunces", "Times New Roman", serif;
|
||||
font-weight: 400;
|
||||
font-size: 128px;
|
||||
line-height: 1.08;
|
||||
letter-spacing: -0.025em;
|
||||
color: #f2efe8;
|
||||
transform-style: preserve-3d;
|
||||
}
|
||||
|
||||
/* Per-line mask host — overflow:hidden clips the descended line.
|
||||
This IS the mask. The inner .line-inner animates from y:100% (hidden
|
||||
below the mask floor) to y:0 (fully visible). This is the canonical
|
||||
mask-reveal-up implementation.
|
||||
|
||||
Note: padding-bottom on the mask gives descenders (p, g, y) room to
|
||||
breathe without being clipped at the bottom; padding-top gives the
|
||||
small breathing/drift motion at the top headroom. */
|
||||
.line-mask {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
padding: 0.08em 0 0.18em;
|
||||
}
|
||||
.line-inner {
|
||||
display: block;
|
||||
will-change: transform, opacity, filter;
|
||||
/* Pre-state locked in CSS so the first snapshot frame (t=0) shows
|
||||
the correct hidden-below state even before GSAP applies its t=0 set.
|
||||
opacity:0 alone is enough — the visible state is hidden either way.
|
||||
GSAP's t=0 tl.set() reaffirms yPercent:110 so the entrance tween
|
||||
knows where to start, and from that point GSAP owns the transform. */
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
/* Subtle period accent on the final line (editorial flourish). */
|
||||
.quote .accent { color: #c89b5a; font-style: italic; font-weight: 500; }
|
||||
|
||||
/* Drawn underline anchored to the quote's left edge — drawn after lines settle. */
|
||||
.underline {
|
||||
position: absolute;
|
||||
left: 200px;
|
||||
top: calc(50% + 240px);
|
||||
width: 180px;
|
||||
height: 2px;
|
||||
pointer-events: none;
|
||||
}
|
||||
.underline path {
|
||||
stroke: #c89b5a;
|
||||
stroke-width: 2;
|
||||
fill: none;
|
||||
stroke-dasharray: 180 180;
|
||||
stroke-dashoffset: 180;
|
||||
}
|
||||
|
||||
/* Page number — bottom-right, editorial typesetting cue. */
|
||||
.pagenum {
|
||||
position: absolute;
|
||||
right: 48px;
|
||||
bottom: 48px;
|
||||
font-family: "Fraunces", serif;
|
||||
font-style: italic;
|
||||
font-size: 18px;
|
||||
color: #6a6358;
|
||||
letter-spacing: 0.04em;
|
||||
z-index: 10;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.label {
|
||||
position: absolute;
|
||||
left: 48px;
|
||||
bottom: 48px;
|
||||
font-size: 16px;
|
||||
color: #8a8378;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
font-weight: 500;
|
||||
z-index: 10;
|
||||
}
|
||||
.label .accent { color: #f2efe8; font-weight: 600; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="scene-04-line-reveal-staggered"
|
||||
data-composition-id="scene-04-line-reveal-staggered"
|
||||
data-start="0"
|
||||
data-duration="7"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
style="width:1920px; height:1080px;">
|
||||
|
||||
<div class="vignette"></div>
|
||||
|
||||
<div class="stage">
|
||||
<div class="eyebrow" id="eyebrow">
|
||||
<span class="rule"></span>
|
||||
<span class="text">Essay · Volume Four</span>
|
||||
</div>
|
||||
|
||||
<div class="quote" id="quote">
|
||||
<!-- Each line is a mask (overflow:hidden) containing an inner block
|
||||
that animates from translateY(110%) -> 0. Per mask-reveal-up.json
|
||||
with target="per-line", display:block on each line is required. -->
|
||||
<span class="line-mask"><span class="line-inner" data-line="0">Designed to disappear.</span></span>
|
||||
<span class="line-mask"><span class="line-inner" data-line="1">Until you need it.</span></span>
|
||||
<span class="line-mask"><span class="line-inner" data-line="2">Then it’s <span class="accent">everything</span>.</span></span>
|
||||
</div>
|
||||
|
||||
<svg class="underline" viewBox="0 0 180 2" id="underline">
|
||||
<path id="underline-path" d="M 0 1 L 180 1" />
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div class="pagenum" id="pagenum">— 042 —</div>
|
||||
|
||||
<div class="label">
|
||||
Scene 04 · <span class="accent">Mask Reveal Up</span> · per-line clip-reveal upward, staggered
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(function () {
|
||||
var BEAT = 7;
|
||||
window.__timelines = window.__timelines || {};
|
||||
|
||||
gsap.registerPlugin(CustomEase);
|
||||
|
||||
// mask-reveal-up signature easing — cubic-bezier(0.22, 1, 0.36, 1).
|
||||
// Same family as Apple keynote curves: aggressive deceleration with soft tail.
|
||||
var maskEase = CustomEase.create("maskReveal", "0.22, 1, 0.36, 1");
|
||||
|
||||
// Pre-build references. ALL DOM is set up at parse-time, NOT via tl.call().
|
||||
var lineInners = document.querySelectorAll("#quote .line-inner");
|
||||
var eyebrow = document.getElementById("eyebrow");
|
||||
var eyebrowRule = document.querySelector("#eyebrow .rule");
|
||||
var eyebrowText = document.querySelector("#eyebrow .text");
|
||||
var underlinePath = document.getElementById("underline-path");
|
||||
var underlineGroup = document.getElementById("underline");
|
||||
var pagenum = document.getElementById("pagenum");
|
||||
var vignette = document.querySelector(".vignette");
|
||||
var quote = document.getElementById("quote");
|
||||
|
||||
// Spec values from mask-reveal-up.json showcase.timing:
|
||||
// scaled_duration_ms=547, scaled_stagger_ms=65, easing=cubic-bezier(0.22,1,0.36,1)
|
||||
// Spec y_travel_multiplier=0.58 — we use yPercent:110 for full mask travel
|
||||
// since the line-mask container IS the mask; the inner travels from below
|
||||
// the mask floor up to its natural position.
|
||||
//
|
||||
// We use slightly larger stagger (180ms) than spec scaled value (65ms) so
|
||||
// the staircase entrance reads clearly across a 3-line headline at this
|
||||
// scale (1080p, 128px serif). Duration stays close to spec.
|
||||
var ENTER_DUR = 0.70;
|
||||
var ENTER_STAGGER = 0.18;
|
||||
|
||||
var tl = gsap.timeline({ paused: true });
|
||||
|
||||
// === t=0 — lock pre-entrance state for all animated elements ===
|
||||
// All lines hidden below their masks, eyebrow + rule + text hidden,
|
||||
// underline empty, pagenum hidden. Vignette at rest.
|
||||
tl.set(lineInners, {
|
||||
yPercent: 110,
|
||||
opacity: 0,
|
||||
filter: "blur(6px)",
|
||||
}, 0);
|
||||
tl.set(eyebrow, { opacity: 0 }, 0);
|
||||
tl.set(eyebrowRule, { scaleX: 0, transformOrigin: "0% 50%" }, 0);
|
||||
tl.set(eyebrowText, { y: -4, opacity: 0 }, 0);
|
||||
tl.set(underlinePath, { strokeDashoffset: 180 }, 0);
|
||||
tl.set(pagenum, { opacity: 0, y: 8 }, 0);
|
||||
tl.set(vignette, { x: 0, y: 0, opacity: 1 }, 0);
|
||||
tl.set(quote, { y: 0 }, 0);
|
||||
|
||||
// === t=0.15s — eyebrow surface ===
|
||||
// Eyebrow appears before the quote — sets editorial context.
|
||||
// Rule draws in horizontally (power4.out snap), text fades up (expo.out soft land).
|
||||
tl.to(eyebrow, { opacity: 1, duration: 0.1, ease: "none" }, 0.15);
|
||||
tl.to(eyebrowRule, {
|
||||
scaleX: 1,
|
||||
duration: 0.55,
|
||||
ease: "power4.out",
|
||||
}, 0.15);
|
||||
tl.to(eyebrowText, {
|
||||
y: 0,
|
||||
opacity: 1,
|
||||
duration: 0.55,
|
||||
ease: "expo.out",
|
||||
}, 0.25);
|
||||
|
||||
// === t=1.00s — quote lines reveal upward, masked, staggered ===
|
||||
// This is the heart of the scene. mask-reveal-up signature easing on
|
||||
// a multi-property tween: yPercent (mask travel) + opacity + filter (blur tail).
|
||||
// Stagger 0.18s gives 3 lines a clear staircase: line 0 starts at 1.00s,
|
||||
// line 1 at 1.18s, line 2 at 1.36s. Last line settled at ~2.06s. This
|
||||
// means at the 1.2s snapshot frame line 0 is mid-reveal while lines 1-2
|
||||
// are still hidden — the staircase is legible in the snapshot grid.
|
||||
tl.to(lineInners, {
|
||||
yPercent: 0,
|
||||
opacity: 1,
|
||||
filter: "blur(0px)",
|
||||
duration: ENTER_DUR,
|
||||
stagger: ENTER_STAGGER,
|
||||
ease: maskEase,
|
||||
}, 1.00);
|
||||
|
||||
// === t=2.15s — underline draws under quote ===
|
||||
// Power4.out snap, third easing variety in the scene.
|
||||
tl.to(underlinePath, {
|
||||
strokeDashoffset: 0,
|
||||
duration: 0.72,
|
||||
ease: "power4.out",
|
||||
}, 2.15);
|
||||
|
||||
// === t=2.30s — pagenum appears bottom-right ===
|
||||
// Soft expo.out, layered with the underline draw.
|
||||
tl.to(pagenum, {
|
||||
opacity: 1,
|
||||
y: 0,
|
||||
duration: 0.6,
|
||||
ease: "expo.out",
|
||||
}, 2.30);
|
||||
|
||||
// === Continuous motion 2.4s → end — vignette drift ===
|
||||
// Pure linear, ambient camera-breath. Two-phase drift so it's never
|
||||
// static during the long hold (4+ seconds of held quote).
|
||||
tl.to(vignette, {
|
||||
x: -22,
|
||||
y: 10,
|
||||
duration: 2.6,
|
||||
ease: "none",
|
||||
}, 2.40);
|
||||
tl.to(vignette, {
|
||||
x: 14,
|
||||
y: -6,
|
||||
duration: 2.0,
|
||||
ease: "sine.inOut",
|
||||
}, 5.00);
|
||||
|
||||
// === t=2.9s → 5.7s: line breathing — subtle per-line drift ===
|
||||
// Each line gently rises by 3px with a sine ease. Spec says "contained,
|
||||
// intentional" so the motion is small but continuous. Stagger from the
|
||||
// last line first so the eye finds fresh movement after the entrance.
|
||||
// We breathe the .line-mask wrapper (NOT .line-inner) so we never touch
|
||||
// the same transform property the entrance tween animated — preventing
|
||||
// conflict with the yPercent that the enter tween left behind.
|
||||
tl.to(".line-mask", {
|
||||
y: -3,
|
||||
duration: 1.4,
|
||||
ease: "sine.inOut",
|
||||
stagger: { each: 0.08, from: "end" },
|
||||
yoyo: true,
|
||||
repeat: 1,
|
||||
}, 2.90);
|
||||
|
||||
// === t=4.0s — underline accent pulse ===
|
||||
// Subtle scale breath on the underline — keeps the bottom-left zone alive.
|
||||
tl.to(underlineGroup, {
|
||||
scaleX: 1.08,
|
||||
opacity: 0.85,
|
||||
duration: 0.8,
|
||||
ease: "sine.inOut",
|
||||
yoyo: true,
|
||||
repeat: 1,
|
||||
transformOrigin: "0% 50%",
|
||||
}, 4.00);
|
||||
|
||||
// === t=5.4s — closing emphasis: eyebrow drifts up, pagenum nudges ===
|
||||
// The eyebrow drifts up slightly to give the closing beat a "settling"
|
||||
// feel. We move the eyebrow (parent of the rule + text) — NOT the quote
|
||||
// — so we never touch a transform on the masks or their inners.
|
||||
// Different easing (expo.inOut) for variety — fifth easing in the scene.
|
||||
tl.to(eyebrow, {
|
||||
y: -4,
|
||||
duration: 1.4,
|
||||
ease: "expo.inOut",
|
||||
}, 5.40);
|
||||
tl.to(pagenum, {
|
||||
y: -3,
|
||||
duration: 1.4,
|
||||
ease: "sine.inOut",
|
||||
}, 5.40);
|
||||
|
||||
// === t=5.6s — eyebrow rule extends slightly (closing flourish) ===
|
||||
// Sixth easing variant (back.out — small overshoot for editorial flourish).
|
||||
tl.to(eyebrowRule, {
|
||||
scaleX: 1.35,
|
||||
duration: 1.0,
|
||||
ease: "back.out(1.3)",
|
||||
transformOrigin: "0% 50%",
|
||||
}, 5.60);
|
||||
|
||||
// === t=6.2s — underline grows toward the right (closing flourish) ===
|
||||
// Final beat: the underline subtly extends, signaling the scene resolves.
|
||||
tl.to(underlineGroup, {
|
||||
scaleX: 1.45,
|
||||
duration: 0.8,
|
||||
ease: "expo.out",
|
||||
transformOrigin: "0% 50%",
|
||||
}, 6.20);
|
||||
|
||||
window.__timelines["scene-04-line-reveal-staggered"] = tl;
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
+430
@@ -0,0 +1,430 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>scene-05-stagger-wave</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
<script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/CustomEase.min.js"></script>
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
body { background: #0a0a0a; }
|
||||
|
||||
#scene-05-stagger-wave {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background: radial-gradient(ellipse at 50% 48%, #161616 0%, #0a0a0a 70%);
|
||||
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
color: #f5f5f5;
|
||||
}
|
||||
|
||||
/* Stage — centered phrase host. perspective_px=900 per per-character-rise.json
|
||||
stage.container.perspective_px, in case future variants use z_px or rotateX. */
|
||||
.stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
perspective: 900px;
|
||||
}
|
||||
|
||||
/* Two phrases stacked at the same screen position (position:absolute).
|
||||
Both DOM-resident at t=0 so the snapshot tool can find every .char span;
|
||||
visibility is governed entirely by the timeline opacity sequence. */
|
||||
.phrase-row {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transform-style: preserve-3d;
|
||||
min-height: 200px;
|
||||
}
|
||||
|
||||
.phrase {
|
||||
position: absolute;
|
||||
display: inline-block;
|
||||
transform-style: preserve-3d;
|
||||
font-size: 152px;
|
||||
font-weight: 800;
|
||||
letter-spacing: -0.025em;
|
||||
line-height: 1.05;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* Per-character unit — per-character-rise.json stage.unit contract.
|
||||
Initial opacity:0 + translateY locks the pre-entrance state in CSS so
|
||||
the snapshot tool's first-frame capture (before GSAP applies its t=0
|
||||
set tweens) shows the correct blank state. No blur on this effect —
|
||||
per-character-rise is the crisp variant. */
|
||||
.char {
|
||||
display: inline-block;
|
||||
white-space: pre;
|
||||
backface-visibility: hidden;
|
||||
transform-origin: 50% 55%;
|
||||
will-change: transform, opacity;
|
||||
opacity: 0;
|
||||
transform: translateY(32px);
|
||||
}
|
||||
|
||||
/* Eyebrow + accent band — supporting elements that ground the typography */
|
||||
.eyebrow {
|
||||
position: absolute;
|
||||
top: calc(50% - 165px);
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.34em;
|
||||
text-transform: uppercase;
|
||||
color: #707070;
|
||||
opacity: 0; /* lock initial state */
|
||||
}
|
||||
|
||||
/* Horizontal accent band beneath the typography — grounds the wave motion.
|
||||
The band is the brief's color #fde047 (yellow) and animates width 0 → 100%
|
||||
so it draws in alongside the first phrase. */
|
||||
.accent-band {
|
||||
position: absolute;
|
||||
top: calc(50% + 130px);
|
||||
left: 50%;
|
||||
width: 720px;
|
||||
height: 6px;
|
||||
transform: translateX(-50%);
|
||||
background: #fde047;
|
||||
border-radius: 3px;
|
||||
transform-origin: 50% 50%;
|
||||
box-shadow: 0 0 24px rgba(253, 224, 71, 0.4);
|
||||
opacity: 0; /* lock — animated in by timeline */
|
||||
}
|
||||
|
||||
/* Origin marker dots — visual cue that points to where the wave starts.
|
||||
Two small circles bracket the band: center marker (yellow) for phrase 1,
|
||||
edge markers for phrase 2. Both DOM-resident, toggled by opacity. */
|
||||
.origin-marker {
|
||||
position: absolute;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
border-radius: 50%;
|
||||
background: #fde047;
|
||||
top: calc(50% + 124px);
|
||||
transform: translateX(-50%);
|
||||
opacity: 0;
|
||||
box-shadow: 0 0 16px rgba(253, 224, 71, 0.55);
|
||||
}
|
||||
.origin-marker.center { left: 50%; }
|
||||
.origin-marker.edge-l { left: calc(50% - 360px); }
|
||||
.origin-marker.edge-r { left: calc(50% + 360px); }
|
||||
|
||||
/* Mode label — small text under the band that tells the viewer which
|
||||
stagger origin is active. Two variants stacked, toggled via opacity. */
|
||||
.mode-label {
|
||||
position: absolute;
|
||||
top: calc(50% + 168px);
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
font-size: 15px;
|
||||
font-weight: 500;
|
||||
letter-spacing: 0.28em;
|
||||
text-transform: uppercase;
|
||||
color: #fde047;
|
||||
opacity: 0;
|
||||
font-feature-settings: "tnum";
|
||||
}
|
||||
|
||||
/* Subtle ambient grain — continuous-motion layer (Ken Burns-style drift)
|
||||
so the frame is never static even during phrase holds. */
|
||||
.grain {
|
||||
position: absolute;
|
||||
inset: -50px;
|
||||
background: radial-gradient(circle at 22% 32%, rgba(253, 224, 71, 0.05) 0%, transparent 42%),
|
||||
radial-gradient(circle at 78% 68%, rgba(255, 255, 255, 0.03) 0%, transparent 38%);
|
||||
pointer-events: none;
|
||||
will-change: transform, opacity;
|
||||
}
|
||||
|
||||
.label {
|
||||
position: absolute;
|
||||
left: 48px;
|
||||
bottom: 48px;
|
||||
font-size: 16px;
|
||||
color: #707070;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
font-weight: 500;
|
||||
z-index: 10;
|
||||
}
|
||||
.label .accent { color: #f5f5f5; font-weight: 600; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="scene-05-stagger-wave"
|
||||
data-composition-id="scene-05-stagger-wave"
|
||||
data-start="0"
|
||||
data-duration="6"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
style="width:1920px; height:1080px;">
|
||||
|
||||
<div class="grain"></div>
|
||||
|
||||
<div class="stage">
|
||||
<div class="eyebrow" id="eyebrow">Section 05 · Stagger Origin</div>
|
||||
|
||||
<div class="phrase-row">
|
||||
<!-- Both phrases live in DOM simultaneously. Stacked absolute so they
|
||||
occupy the same visual slot; toggled via opacity in the timeline. -->
|
||||
<div class="phrase" data-phrase="0">Wave from center.</div>
|
||||
<div class="phrase" data-phrase="1">Wave from edges.</div>
|
||||
</div>
|
||||
|
||||
<!-- Accent band + origin markers — visual cues for the wave origin. -->
|
||||
<div class="accent-band" id="accent-band"></div>
|
||||
<div class="origin-marker center" id="marker-center"></div>
|
||||
<div class="origin-marker edge-l" id="marker-edge-l"></div>
|
||||
<div class="origin-marker edge-r" id="marker-edge-r"></div>
|
||||
|
||||
<!-- Mode labels — two stacked, toggled by opacity per active phrase. -->
|
||||
<div class="mode-label" id="mode-label-1">from: "center" · center-out</div>
|
||||
<div class="mode-label" id="mode-label-2">from: "edges" · edges-in</div>
|
||||
</div>
|
||||
|
||||
<div class="label">
|
||||
Scene 05 · <span class="accent">Stagger Wave</span> · per-character rise with center-out / edges-in timing
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(function () {
|
||||
var BEAT = 6;
|
||||
window.__timelines = window.__timelines || {};
|
||||
|
||||
gsap.registerPlugin(CustomEase);
|
||||
|
||||
// per-character-rise signature easing — Apple tvOS curve from the JSON spec:
|
||||
// cubic-bezier(0.2, 0.8, 0.2, 1). Crisp deceleration, no overshoot.
|
||||
var riseEase = CustomEase.create("rise", "0.2, 0.8, 0.2, 1");
|
||||
// Exit easing per spec exit.easing: cubic-bezier(0.7, 0, 0.84, 0).
|
||||
var exitEase = CustomEase.create("riseExit", "0.7, 0, 0.84, 0");
|
||||
|
||||
// Split each phrase into per-character spans at build time. Both phrases
|
||||
// populate at t=0 so the snapshot tool sees a complete DOM at every
|
||||
// timestamp. Visibility is governed by the timeline opacity sequence —
|
||||
// never by DOM mutation mid-render.
|
||||
function splitPhrase(phraseEl) {
|
||||
var text = phraseEl.textContent;
|
||||
var spans = [];
|
||||
var frag = document.createDocumentFragment();
|
||||
Array.from(text).forEach(function (ch) {
|
||||
var span = document.createElement("span");
|
||||
span.className = "char";
|
||||
// Use a non-breaking space so the inline-block doesn't collapse the
|
||||
// whitespace between words. Matches CHARACTER SPANS rule in beat guide.
|
||||
span.textContent = ch === " " ? " " : ch;
|
||||
frag.appendChild(span);
|
||||
spans.push(span);
|
||||
});
|
||||
phraseEl.replaceChildren(frag);
|
||||
return spans;
|
||||
}
|
||||
|
||||
var phraseEls = document.querySelectorAll("#scene-05-stagger-wave .phrase");
|
||||
var charsByPhrase = [];
|
||||
phraseEls.forEach(function (el) {
|
||||
charsByPhrase.push(splitPhrase(el));
|
||||
});
|
||||
|
||||
// per-character-rise.json runtime: y_travel_multiplier=0.58, but for a
|
||||
// 1920×1080 hero stage we scale up to ~28px so the wave reads at the
|
||||
// viewer's distance. Matches the spec spirit (per-character-rise.json
|
||||
// showcase.runtime applies a damping multiplier of 0.58 for default site
|
||||
// hosts — we're scaling for a much larger viewport).
|
||||
var Y_FROM = 28;
|
||||
|
||||
var tl = gsap.timeline({ paused: true });
|
||||
|
||||
// === t=0 initial state — phrase 1 + 2 hidden + pre-positioned. Mirrors
|
||||
// the CSS lock so the timeline is authoritative once GSAP takes over.
|
||||
tl.set(charsByPhrase[0], { opacity: 0, y: Y_FROM }, 0);
|
||||
tl.set(charsByPhrase[1], { opacity: 0, y: Y_FROM }, 0);
|
||||
tl.set("#eyebrow", { opacity: 0, y: -8 }, 0);
|
||||
tl.set("#accent-band", { opacity: 0, scaleX: 0 }, 0);
|
||||
tl.set("#marker-center", { opacity: 0, scale: 0.6 }, 0);
|
||||
tl.set("#marker-edge-l", { opacity: 0, scale: 0.6 }, 0);
|
||||
tl.set("#marker-edge-r", { opacity: 0, scale: 0.6 }, 0);
|
||||
tl.set("#mode-label-1", { opacity: 0, y: 6 }, 0);
|
||||
tl.set("#mode-label-2", { opacity: 0, y: 6 }, 0);
|
||||
|
||||
// === t=0.20s: eyebrow slides in. Supporting move — leads the typography.
|
||||
tl.fromTo("#eyebrow",
|
||||
{ opacity: 0, y: -8 },
|
||||
{ opacity: 1, y: 0, duration: 0.55, ease: "expo.out" },
|
||||
0.20);
|
||||
|
||||
// === t=0.30s: accent band draws in beneath the phrase slot.
|
||||
// Different easing for variety — power4.out for the snap, matches the
|
||||
// "decisive" feel of a line drawing in. Variety with the riseEase
|
||||
// on chars below.
|
||||
tl.fromTo("#accent-band",
|
||||
{ opacity: 0, scaleX: 0 },
|
||||
{ opacity: 1, scaleX: 1, duration: 0.7, ease: "power4.out", transformOrigin: "50% 50%" },
|
||||
0.30);
|
||||
|
||||
// === t=0.45s: center origin marker pops in with overshoot — "this is
|
||||
// where the wave starts" cue. back.out provides the eye-catching whip.
|
||||
tl.fromTo("#marker-center",
|
||||
{ opacity: 0, scale: 0.6 },
|
||||
{ opacity: 1, scale: 1, duration: 0.45, ease: "back.out(1.7)" },
|
||||
0.45);
|
||||
|
||||
// === t=0.55s: mode label 1 fades in just before the wave fires.
|
||||
tl.fromTo("#mode-label-1",
|
||||
{ opacity: 0, y: 6 },
|
||||
{ opacity: 1, y: 0, duration: 0.45, ease: "expo.out" },
|
||||
0.55);
|
||||
|
||||
// === t=0.60s: PHRASE 1 ENTERS — `from: "center"` (wave outward).
|
||||
// per-character-rise.json timing: scaled_duration_ms=504, scaled_stagger_ms=17,
|
||||
// signature easing cubic-bezier(0.2, 0.8, 0.2, 1). GSAP stagger origin
|
||||
// `from: "center"` is the wave's defining feature — chars at the center
|
||||
// of the phrase start first, edges last, producing the outward ripple.
|
||||
tl.to(charsByPhrase[0], {
|
||||
opacity: 1,
|
||||
y: 0,
|
||||
duration: 0.504,
|
||||
stagger: { each: 0.05, from: "center" },
|
||||
ease: riseEase,
|
||||
}, 0.60);
|
||||
|
||||
// 17 chars × 0.05s stagger + 0.504s = entrance lands ~1.95s. We leave
|
||||
// a hold window 2.0s–2.6s for the eye to absorb the result.
|
||||
|
||||
// === Continuous motion 1.95s-2.55s: center marker breathing pulse so
|
||||
// the frame doesn't sit static during the phrase hold. Different ease
|
||||
// (sine.inOut) — third easing flavor.
|
||||
tl.to("#marker-center", {
|
||||
scale: 1.18,
|
||||
duration: 0.3,
|
||||
ease: "sine.inOut",
|
||||
yoyo: true,
|
||||
repeat: 1,
|
||||
transformOrigin: "50% 50%",
|
||||
}, 1.95);
|
||||
|
||||
// === Continuous motion 0.6s-3.0s: grain drift — ambient camera move.
|
||||
// "none" easing per glossary for pure linear ambient motion.
|
||||
tl.to(".grain", {
|
||||
x: -30,
|
||||
y: -12,
|
||||
duration: 2.4,
|
||||
ease: "none",
|
||||
}, 0.60);
|
||||
|
||||
// === t=2.55s: PHRASE 1 EXITS — per-character upward drift.
|
||||
// Exit timing per spec: scaled_duration_ms=302, scaled_stagger_ms=10.
|
||||
// Stagger from "center" again for exit symmetry — the center chars
|
||||
// leave first, mirroring the entrance pattern.
|
||||
tl.to(charsByPhrase[0], {
|
||||
opacity: 0,
|
||||
y: -Y_FROM,
|
||||
duration: 0.302,
|
||||
stagger: { each: 0.03, from: "center" },
|
||||
ease: exitEase,
|
||||
}, 2.55);
|
||||
|
||||
// === t=2.65s: center marker fades, edge markers pop in. Visual cue
|
||||
// shifts to indicate the next phrase will use `from: "edges"`.
|
||||
tl.to("#marker-center", {
|
||||
opacity: 0,
|
||||
scale: 0.6,
|
||||
duration: 0.35,
|
||||
ease: "power3.in",
|
||||
}, 2.65);
|
||||
tl.to("#mode-label-1", {
|
||||
opacity: 0,
|
||||
y: -6,
|
||||
duration: 0.35,
|
||||
ease: "power3.in",
|
||||
}, 2.65);
|
||||
|
||||
// Edge markers enter with back.out overshoot — same "marker pop" pattern.
|
||||
tl.fromTo(["#marker-edge-l", "#marker-edge-r"],
|
||||
{ opacity: 0, scale: 0.6 },
|
||||
{ opacity: 1, scale: 1, duration: 0.45, stagger: 0.06, ease: "back.out(1.7)" },
|
||||
2.95);
|
||||
|
||||
// === t=3.05s: mode label 2 fades in just before the second wave fires.
|
||||
tl.fromTo("#mode-label-2",
|
||||
{ opacity: 0, y: 6 },
|
||||
{ opacity: 1, y: 0, duration: 0.45, ease: "expo.out" },
|
||||
3.05);
|
||||
|
||||
// === t=3.15s: PHRASE 2 ENTERS — `from: "edges"` (wave inward).
|
||||
// Same per-character-rise timing as phrase 1, but stagger origin flips
|
||||
// to "edges" — chars at the left + right edges fire first, the wave
|
||||
// converges on the center. This is the demonstration: same effect,
|
||||
// different origin, visually distinct ripple.
|
||||
tl.to(charsByPhrase[1], {
|
||||
opacity: 1,
|
||||
y: 0,
|
||||
duration: 0.504,
|
||||
stagger: { each: 0.05, from: "edges" },
|
||||
ease: riseEase,
|
||||
}, 3.15);
|
||||
|
||||
// Phrase 2 has 16 chars × 0.05 stagger + 0.504s = entrance lands ~4.45s.
|
||||
|
||||
// === Continuous motion 4.45s-5.45s: edge markers gently breathe and
|
||||
// accent band scales subtly — keeps the frame alive during phrase 2's
|
||||
// hold. elastic.out gives the markers a playful settle on the second pass.
|
||||
tl.to(["#marker-edge-l", "#marker-edge-r"], {
|
||||
scale: 1.15,
|
||||
duration: 0.4,
|
||||
ease: "elastic.out(1, 0.5)",
|
||||
yoyo: true,
|
||||
repeat: 1,
|
||||
transformOrigin: "50% 50%",
|
||||
}, 4.50);
|
||||
|
||||
tl.to("#accent-band", {
|
||||
scaleX: 1.04,
|
||||
duration: 0.6,
|
||||
ease: "sine.inOut",
|
||||
yoyo: true,
|
||||
repeat: 1,
|
||||
transformOrigin: "50% 50%",
|
||||
}, 4.50);
|
||||
|
||||
// === Continuous motion 3.0s-6.0s: grain drift back — ambient continues
|
||||
// the camera move through the second half of the scene.
|
||||
tl.to(".grain", {
|
||||
x: 0,
|
||||
y: 0,
|
||||
duration: 3.0,
|
||||
ease: "none",
|
||||
}, 3.0);
|
||||
|
||||
// === t=5.55s: subtle breathing on the final phrase characters — last
|
||||
// 0.45s of the scene. Stagger from "edges" for visual consistency with
|
||||
// the entrance.
|
||||
tl.to(charsByPhrase[1], {
|
||||
y: -3,
|
||||
duration: 0.45,
|
||||
ease: "sine.inOut",
|
||||
stagger: { each: 0.01, from: "edges" },
|
||||
}, 5.55);
|
||||
|
||||
window.__timelines["scene-05-stagger-wave"] = tl;
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
+337
@@ -0,0 +1,337 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>scene-06-variable-font-weight-shift</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
<script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/CustomEase.min.js"></script>
|
||||
<style>
|
||||
/* Register --wght as a numeric CSS custom property so GSAP-driven CSS
|
||||
variable tweens are picked up by the browser's font-variation-settings
|
||||
resolver at seek-time. Without @property, --wght would be treated as
|
||||
a string and font-variation-settings wouldn't re-evaluate mid-tween. */
|
||||
@property --wght {
|
||||
syntax: "<number>";
|
||||
inherits: false;
|
||||
initial-value: 100;
|
||||
}
|
||||
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
body { background: #08080a; }
|
||||
|
||||
#scene-06-variable-font-weight-shift {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background:
|
||||
radial-gradient(ellipse at 50% 45%, #1c1c22 0%, #0a0a0d 60%, #050507 100%);
|
||||
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
color: #f7f7f5;
|
||||
}
|
||||
|
||||
/* Stage: centered headline host. */
|
||||
.stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.eyebrow {
|
||||
position: absolute;
|
||||
top: calc(50% - 200px);
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
letter-spacing: 0.32em;
|
||||
text-transform: uppercase;
|
||||
color: #6f6f78;
|
||||
opacity: 0;
|
||||
font-variation-settings: "wght" 500;
|
||||
}
|
||||
|
||||
/* Headline host. Per-character spans drive font-variation-settings via
|
||||
a CSS custom property --wght that GSAP updates inside onUpdate. */
|
||||
.headline {
|
||||
font-size: 320px;
|
||||
letter-spacing: -0.03em;
|
||||
line-height: 1;
|
||||
white-space: nowrap;
|
||||
will-change: transform;
|
||||
}
|
||||
|
||||
/* Per-character unit — initial CSS state is intentionally THIN (wght 100)
|
||||
so the very first snapshot frame, captured before GSAP applies its t=0
|
||||
set tweens, shows the correct skeletal pre-entrance state. opacity:0
|
||||
hides it so it doesn't pop visible before the entrance tween starts. */
|
||||
.char {
|
||||
display: inline-block;
|
||||
white-space: pre;
|
||||
--wght: 100;
|
||||
font-variation-settings: "wght" var(--wght);
|
||||
will-change: opacity, transform, font-variation-settings;
|
||||
opacity: 0;
|
||||
transform-origin: 50% 60%;
|
||||
color: #fafaf6;
|
||||
}
|
||||
|
||||
.underbar {
|
||||
position: absolute;
|
||||
top: calc(50% + 180px);
|
||||
left: 50%;
|
||||
width: 360px;
|
||||
height: 2px;
|
||||
transform: translateX(-50%);
|
||||
opacity: 0;
|
||||
}
|
||||
.underbar path {
|
||||
stroke: #fafaf6;
|
||||
stroke-width: 2;
|
||||
fill: none;
|
||||
stroke-dasharray: 360 360;
|
||||
stroke-dashoffset: 360;
|
||||
}
|
||||
|
||||
/* Ambient grain — subtle radial wash that drifts during holds. */
|
||||
.grain {
|
||||
position: absolute;
|
||||
inset: -60px;
|
||||
background:
|
||||
radial-gradient(circle at 22% 28%, rgba(255,255,255,0.045) 0%, transparent 38%),
|
||||
radial-gradient(circle at 78% 72%, rgba(255,255,255,0.035) 0%, transparent 34%);
|
||||
pointer-events: none;
|
||||
will-change: transform, opacity;
|
||||
}
|
||||
|
||||
.label {
|
||||
position: absolute;
|
||||
left: 48px;
|
||||
bottom: 48px;
|
||||
font-size: 16px;
|
||||
color: #6f6f78;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
font-weight: 500;
|
||||
font-variation-settings: "wght" 500;
|
||||
z-index: 10;
|
||||
}
|
||||
.label .accent { color: #fafaf6; font-weight: 600; font-variation-settings: "wght" 700; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="scene-06-variable-font-weight-shift"
|
||||
data-composition-id="scene-06-variable-font-weight-shift"
|
||||
data-start="0"
|
||||
data-duration="7"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
style="width:1920px; height:1080px;">
|
||||
|
||||
<div class="grain"></div>
|
||||
|
||||
<div class="stage">
|
||||
<div class="eyebrow" id="eyebrow">Section 06 · Variable Weight</div>
|
||||
<div class="headline" id="headline" data-text="WEIGHT."></div>
|
||||
<svg class="underbar" id="underbar" viewBox="0 0 360 2">
|
||||
<path id="underbar-path" d="M 0 1 L 360 1" />
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div class="label">
|
||||
Scene 06 · <span class="accent">Variable Font Weight Shift</span> · font-variation-settings wght animation
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(function () {
|
||||
var BEAT = 7;
|
||||
window.__timelines = window.__timelines || {};
|
||||
|
||||
gsap.registerPlugin(CustomEase);
|
||||
|
||||
// Signature easings — variety across the 7 second scene.
|
||||
// Ramp ease: dramatic mass-gain curve (slow start, decisive land).
|
||||
var rampEase = CustomEase.create("ramp", "0.22, 1, 0.36, 1");
|
||||
// Wave ease: smooth pass-through left-to-right.
|
||||
var waveEase = CustomEase.create("wave", "0.45, 0, 0.55, 1");
|
||||
|
||||
// Build per-character spans for "WEIGHT." once at t=0 so the comp is
|
||||
// fully seekable. The snapshot tool can jump to any timestamp and find
|
||||
// all chars in the DOM — no callback-driven mutation required.
|
||||
var headlineEl = document.getElementById("headline");
|
||||
var text = headlineEl.getAttribute("data-text") || "WEIGHT.";
|
||||
var chars = [];
|
||||
var frag = document.createDocumentFragment();
|
||||
Array.from(text).forEach(function (ch) {
|
||||
var span = document.createElement("span");
|
||||
span.className = "char";
|
||||
span.textContent = ch === " " ? " " : ch;
|
||||
frag.appendChild(span);
|
||||
chars.push(span);
|
||||
});
|
||||
headlineEl.replaceChildren(frag);
|
||||
|
||||
// We animate the CSS custom property --wght directly on each char.
|
||||
// CSS @property declares --wght as a <number> so the browser interpolates
|
||||
// it natively, and font-variation-settings: "wght" var(--wght) picks up
|
||||
// the live value at seek-time. GSAP's CSSPlugin sets custom properties
|
||||
// via setProperty(), which fires on every seek/render — perfect for
|
||||
// the deterministic snapshot engine.
|
||||
|
||||
var tl = gsap.timeline({ paused: true });
|
||||
|
||||
// === t=0 initial state — all chars thin (wght 100), invisible, eyebrow hidden,
|
||||
// underbar empty. Locks the snapshot determinism for the first frame.
|
||||
tl.set(chars, { opacity: 0, y: 18, "--wght": 100 }, 0);
|
||||
tl.set("#eyebrow", { opacity: 0, y: -8 }, 0);
|
||||
tl.set("#underbar", { opacity: 0 }, 0);
|
||||
tl.set("#underbar-path", { strokeDashoffset: 360 }, 0);
|
||||
|
||||
// === 0.10s: eyebrow slides in. expo.out — soft land.
|
||||
tl.fromTo("#eyebrow",
|
||||
{ opacity: 0, y: -8 },
|
||||
{ opacity: 1, y: 0, duration: 0.6, ease: "expo.out" },
|
||||
0.10);
|
||||
|
||||
// === 0.0s-1.0s: phrase enters at THIN weight, almost invisible — chars
|
||||
// fade up and settle while still skeletal. expo.out per-char.
|
||||
tl.to(chars, {
|
||||
opacity: 1,
|
||||
y: 0,
|
||||
duration: 0.7,
|
||||
stagger: 0.04,
|
||||
ease: "expo.out",
|
||||
}, 0.10);
|
||||
|
||||
// === 1.0s-2.5s: WEIGHT RAMP. Each char's --wght goes 100 → 900 with
|
||||
// a small stagger so the ramp reads as a left-to-right thickening.
|
||||
// rampEase = signature Apple-keynote curve.
|
||||
tl.to(chars, {
|
||||
"--wght": 900,
|
||||
duration: 1.3,
|
||||
stagger: 0.06,
|
||||
ease: rampEase,
|
||||
}, 1.00);
|
||||
|
||||
// === 1.4s: underbar reveals as ramp peaks. power4.out — decisive snap.
|
||||
tl.to("#underbar", { opacity: 1, duration: 0.3, ease: "power4.out" }, 1.40);
|
||||
tl.to("#underbar-path", {
|
||||
strokeDashoffset: 0,
|
||||
duration: 0.9,
|
||||
ease: "power4.out",
|
||||
}, 1.50);
|
||||
|
||||
// === 1.0s-2.6s: grain drifts during the ramp. sine.inOut — ambient.
|
||||
tl.to(".grain", {
|
||||
x: -28,
|
||||
y: -8,
|
||||
opacity: 0.75,
|
||||
duration: 1.6,
|
||||
ease: "sine.inOut",
|
||||
}, 1.00);
|
||||
|
||||
// === 2.5s-4.0s: HELD BOLD with per-char weight TEXTURE.
|
||||
// Some chars dip slightly (down to ~720), others spike (up to ~960),
|
||||
// creating a quiet hand-typeset feel. sine.inOut yoyo holds the
|
||||
// scene alive without translating anything. Per-char offsets give
|
||||
// each letter its own micro-rhythm.
|
||||
var textureOffsets = [-180, 60, -120, 40, -90, 30, -160]; // one per char in "WEIGHT."
|
||||
chars.forEach(function (_, i) {
|
||||
var target = 900 + (textureOffsets[i] || 0);
|
||||
tl.to(chars[i], {
|
||||
"--wght": target,
|
||||
duration: 0.75,
|
||||
ease: "sine.inOut",
|
||||
yoyo: true,
|
||||
repeat: 1,
|
||||
}, 2.50 + i * 0.03);
|
||||
});
|
||||
|
||||
// === 2.6s-4.0s: subtle scale breathing on the headline as a whole —
|
||||
// 1.0 → 1.015 → 1.0. sine.inOut. Continuous motion during the hold.
|
||||
tl.to("#headline", {
|
||||
scale: 1.015,
|
||||
duration: 0.7,
|
||||
ease: "sine.inOut",
|
||||
yoyo: true,
|
||||
repeat: 1,
|
||||
transformOrigin: "50% 50%",
|
||||
}, 2.60);
|
||||
|
||||
// === 4.0s-5.5s: WEIGHT WAVE passes LEFT → RIGHT.
|
||||
// Each char briefly spikes to 950 then settles to 850. Big visible
|
||||
// ripple. waveEase + per-char stagger creates the propagating wave.
|
||||
chars.forEach(function (_, i) {
|
||||
// Up-spike (peak).
|
||||
tl.to(chars[i], {
|
||||
"--wght": 950,
|
||||
duration: 0.32,
|
||||
ease: waveEase,
|
||||
}, 4.00 + i * 0.13);
|
||||
// Settle to 850.
|
||||
tl.to(chars[i], {
|
||||
"--wght": 850,
|
||||
duration: 0.45,
|
||||
ease: "expo.out",
|
||||
}, 4.32 + i * 0.13);
|
||||
});
|
||||
|
||||
// === 4.0s-5.5s: underbar widens during wave. sine.inOut — soft expand.
|
||||
tl.to("#underbar", {
|
||||
scaleX: 1.12,
|
||||
duration: 0.75,
|
||||
ease: "sine.inOut",
|
||||
yoyo: true,
|
||||
repeat: 1,
|
||||
transformOrigin: "50% 50%",
|
||||
}, 4.00);
|
||||
|
||||
// === 5.5s-7.0s: SETTLE & BREATHE.
|
||||
// All chars converge gently back to wght 800 — final resting bold.
|
||||
// expo.out — soft land. Plus a quiet per-char y breath and grain return.
|
||||
tl.to(chars, {
|
||||
"--wght": 800,
|
||||
duration: 1.1,
|
||||
stagger: 0.02,
|
||||
ease: "expo.out",
|
||||
}, 5.50);
|
||||
|
||||
// === 5.7s-7.0s: headline soft breathing — 1.0 → 0.995 → 1.0. "none" ease
|
||||
// for the grain drift gives the ambient layer pure linear feel,
|
||||
// contrasting with the eased headline tweens.
|
||||
tl.to("#headline", {
|
||||
y: -4,
|
||||
duration: 1.3,
|
||||
ease: "sine.inOut",
|
||||
}, 5.70);
|
||||
|
||||
tl.to(".grain", {
|
||||
x: 0,
|
||||
y: 0,
|
||||
opacity: 1,
|
||||
duration: 1.3,
|
||||
ease: "none",
|
||||
}, 5.70);
|
||||
|
||||
// === 5.7s-7.0s: eyebrow subtle fade-down — frame edges relax.
|
||||
tl.to("#eyebrow", {
|
||||
opacity: 0.55,
|
||||
duration: 1.3,
|
||||
ease: "sine.inOut",
|
||||
}, 5.70);
|
||||
|
||||
window.__timelines["scene-06-variable-font-weight-shift"] = tl;
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
+436
@@ -0,0 +1,436 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>scene-07-shared-axis-crossfade</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
<script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/CustomEase.min.js"></script>
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
body { background: #0a0e14; }
|
||||
|
||||
#scene-07-shared-axis-crossfade {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
/* Subtle dark blue-gray gradient — Material Design "depth" feel.
|
||||
Two layered radial gradients give the surface a sense of distance. */
|
||||
background:
|
||||
radial-gradient(ellipse at 50% 40%, #1c2733 0%, #0c1218 55%, #060a0f 100%);
|
||||
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
color: #eef3f7;
|
||||
}
|
||||
|
||||
/* Ambient light spot — continuous-motion source. Drifts during the beat
|
||||
so the frame never sits still even when a phrase is mid-hold. */
|
||||
.light-spot {
|
||||
position: absolute;
|
||||
top: 40%;
|
||||
left: 50%;
|
||||
width: 1400px;
|
||||
height: 1400px;
|
||||
transform: translate(-50%, -50%);
|
||||
background: radial-gradient(
|
||||
circle,
|
||||
rgba(102, 156, 214, 0.10) 0%,
|
||||
rgba(74, 122, 178, 0.04) 30%,
|
||||
transparent 60%
|
||||
);
|
||||
pointer-events: none;
|
||||
will-change: transform, opacity;
|
||||
filter: blur(8px);
|
||||
}
|
||||
|
||||
/* Faint grid — gives the "Material surface" texture without dominating. */
|
||||
.grid-overlay {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background-image:
|
||||
linear-gradient(rgba(120, 160, 200, 0.025) 1px, transparent 1px),
|
||||
linear-gradient(90deg, rgba(120, 160, 200, 0.025) 1px, transparent 1px);
|
||||
background-size: 80px 80px;
|
||||
mask-image: radial-gradient(ellipse at 50% 50%, black 30%, transparent 80%);
|
||||
pointer-events: none;
|
||||
will-change: transform;
|
||||
}
|
||||
|
||||
/* Stage: perspective host for the z-axis depth crossfade.
|
||||
shared-axis-z.json showcase.stage.container.perspective_px = 900. */
|
||||
.stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
perspective: 900px;
|
||||
perspective-origin: 50% 50%;
|
||||
}
|
||||
|
||||
/* Phrase row holds all three phrases stacked. transform-style:preserve-3d
|
||||
lets the scale tween read as a depth move along z, not a flat resize. */
|
||||
.phrase-row {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 240px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transform-style: preserve-3d;
|
||||
}
|
||||
|
||||
/* CRITICAL: all 3 phrases live in DOM simultaneously, position:absolute
|
||||
centered, opacity:0 initial. We swap via opacity+scale sequencing.
|
||||
This makes the beat seekable — snapshot tool jumps to any timestamp
|
||||
and the DOM is already populated, no callback-driven mutation needed. */
|
||||
/* Phrase host — flexbox in .phrase-row centers it. All 3 phrases stack
|
||||
at the same flex slot using position:absolute. NO CSS transform here:
|
||||
GSAP owns the transform (scale/blur/opacity). Mixing CSS translate(-50%,-50%)
|
||||
with GSAP transforms causes drift (per CLAUDE.md gotcha). */
|
||||
.phrase {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform-origin: 50% 50%;
|
||||
transform-style: preserve-3d;
|
||||
backface-visibility: hidden;
|
||||
font-size: 130px;
|
||||
font-weight: 700;
|
||||
letter-spacing: -0.025em;
|
||||
line-height: 1.05;
|
||||
white-space: nowrap;
|
||||
color: #eef3f7;
|
||||
opacity: 0; /* lock pre-entrance state so first snapshot frame is blank */
|
||||
will-change: transform, opacity, filter;
|
||||
}
|
||||
|
||||
/* Eyebrow above the phrase — Material-style section label. */
|
||||
.eyebrow {
|
||||
position: absolute;
|
||||
top: calc(50% - 180px);
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
letter-spacing: 0.36em;
|
||||
text-transform: uppercase;
|
||||
color: #5d7a92;
|
||||
opacity: 0; /* GSAP fromTo handles entrance */
|
||||
will-change: opacity, transform;
|
||||
}
|
||||
|
||||
/* Progress indicator — three dots tracking which phrase is active. */
|
||||
.progress {
|
||||
position: absolute;
|
||||
top: calc(50% + 180px);
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
display: flex;
|
||||
gap: 14px;
|
||||
}
|
||||
.progress .dot {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 50%;
|
||||
background: rgba(140, 170, 200, 0.18);
|
||||
will-change: transform, background-color;
|
||||
}
|
||||
|
||||
.label {
|
||||
position: absolute;
|
||||
left: 48px;
|
||||
bottom: 48px;
|
||||
font-size: 16px;
|
||||
color: #5d7a92;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
font-weight: 500;
|
||||
z-index: 10;
|
||||
will-change: opacity, transform;
|
||||
}
|
||||
.label .accent { color: #eef3f7; font-weight: 600; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="scene-07-shared-axis-crossfade"
|
||||
data-composition-id="scene-07-shared-axis-crossfade"
|
||||
data-start="0"
|
||||
data-duration="9"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
style="width:1920px; height:1080px;">
|
||||
|
||||
<div class="light-spot" id="light-spot"></div>
|
||||
<div class="grid-overlay" id="grid-overlay"></div>
|
||||
|
||||
<div class="stage">
|
||||
<div class="eyebrow" id="eyebrow">Section 07 · Material · Shared Axis</div>
|
||||
|
||||
<div class="phrase-row">
|
||||
<!-- All three phrases pre-built in DOM. CSS opacity:0 locks initial state.
|
||||
GSAP timeline orchestrates scale+opacity for the depth crossfade.
|
||||
Phrase lengths kept comparable so all three fit at scale 1.32. -->
|
||||
<div class="phrase" data-phrase="0">Step into the view.</div>
|
||||
<div class="phrase" data-phrase="1">Then into the next.</div>
|
||||
<div class="phrase" data-phrase="2">Always one axis.</div>
|
||||
</div>
|
||||
|
||||
<div class="progress" id="progress">
|
||||
<span class="dot" data-dot="0"></span>
|
||||
<span class="dot" data-dot="1"></span>
|
||||
<span class="dot" data-dot="2"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="label">
|
||||
Scene 07 · <span class="accent">Shared Axis Z</span> · scale-Z depth crossfade between phrases
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(function () {
|
||||
var BEAT = 9; // matches data-duration on host div above
|
||||
window.__timelines = window.__timelines || {};
|
||||
|
||||
gsap.registerPlugin(CustomEase);
|
||||
|
||||
// shared-axis-z.json portable_spec.signature_easing for ENTER:
|
||||
// cubic-bezier(0.2, 0, 0, 1) — Material standard "decelerate".
|
||||
// Soft land from depth: phrase emerges from behind, settles forward.
|
||||
var enterEase = CustomEase.create("sharedEnter", "0.2, 0, 0, 1");
|
||||
// shared-axis-z.json portable_spec.exit.easing:
|
||||
// cubic-bezier(0.4, 0, 1, 1) — Material "accelerate".
|
||||
// Outgoing phrase pushes toward camera and accelerates out of frame.
|
||||
var exitEase = CustomEase.create("sharedExit", "0.4, 0, 1, 1");
|
||||
|
||||
// Per shared-axis-z.json: enter from scale 0.9 + blur 2px + opacity 0;
|
||||
// exit to scale 1.06 + blur 1px + opacity 0. We exaggerate the scale
|
||||
// range for 1080p readability — incoming starts from 0.55 (clearly
|
||||
// "behind" the surface, half-size) and outgoing pushes to 1.45
|
||||
// (clearly "through" the camera). This makes the z-axis unmistakable
|
||||
// in snapshot frames where motion is frozen, even at slower sampling.
|
||||
var IN_SCALE_FROM = 0.55; // incoming starts much smaller (far away)
|
||||
var IN_SCALE_TO = 1.00; // settles at surface
|
||||
var OUT_SCALE_TO = 1.45; // outgoing zooms past camera
|
||||
var IN_BLUR = 10; // entering heavily blurred (atmospheric depth)
|
||||
var OUT_BLUR = 8; // exiting blurred (motion blur from speed)
|
||||
|
||||
var phrases = gsap.utils.toArray("#scene-07-shared-axis-crossfade .phrase");
|
||||
var dots = gsap.utils.toArray("#scene-07-shared-axis-crossfade .progress .dot");
|
||||
|
||||
var tl = gsap.timeline({ paused: true });
|
||||
|
||||
// === t=0 initial state — lock everything pre-entrance.
|
||||
// All three phrases start invisible at scale 0.72 (behind the surface).
|
||||
tl.set(phrases, {
|
||||
opacity: 0,
|
||||
scale: IN_SCALE_FROM,
|
||||
filter: "blur(" + IN_BLUR + "px)",
|
||||
xPercent: -50,
|
||||
yPercent: -50,
|
||||
}, 0);
|
||||
tl.set("#eyebrow", { opacity: 0, y: -10 }, 0);
|
||||
tl.set(dots, { backgroundColor: "rgba(140,170,200,0.18)", scale: 1 }, 0);
|
||||
|
||||
// === t=0.25s: eyebrow slides in — supporting move layered with phrase 1 entry.
|
||||
// expo.out for premium "soft land" feel — 1st of 5 easings.
|
||||
tl.fromTo("#eyebrow",
|
||||
{ opacity: 0, y: -10 },
|
||||
{ opacity: 1, y: 0, duration: 0.7, ease: "expo.out" },
|
||||
0.25);
|
||||
|
||||
// === t=0.0s — 9.0s: ambient drift on light spot. "none" easing for
|
||||
// pure linear ambient motion — 2nd easing. Keeps frame alive even
|
||||
// during the mid-phrase holds.
|
||||
tl.fromTo("#light-spot",
|
||||
{ x: -120, y: -60, opacity: 0.55 },
|
||||
{ x: 120, y: 60, opacity: 1, duration: 9, ease: "none" },
|
||||
0);
|
||||
|
||||
// === t=0.0s — 9.0s: grid parallax — slower than the light spot.
|
||||
// Drifts horizontally to suggest the surface itself is shifting.
|
||||
tl.fromTo("#grid-overlay",
|
||||
{ x: 0, opacity: 0.6 },
|
||||
{ x: -40, opacity: 1, duration: 9, ease: "none" },
|
||||
0);
|
||||
|
||||
// ============================================================
|
||||
// PHRASE 1 — "Step into the view." enters at t=0.35s
|
||||
// shared-axis-z enter timing: scaled_duration_ms=374 (~0.374s),
|
||||
// signature easing cubic-bezier(0.2,0,0,1).
|
||||
// Swap windows aligned with snapshot sampling (every 1.125s) so
|
||||
// contact-sheet frames at 2.25s and 4.50s land mid-transition.
|
||||
// ============================================================
|
||||
|
||||
// ENTER: scale-Z from 0.55 → 1.0, blur 10 → 0, opacity 0 → 1.
|
||||
// The phrase emerges from "behind" the surface and settles forward.
|
||||
tl.fromTo(phrases[0],
|
||||
{
|
||||
opacity: 0,
|
||||
scale: IN_SCALE_FROM,
|
||||
filter: "blur(" + IN_BLUR + "px)",
|
||||
},
|
||||
{
|
||||
opacity: 1,
|
||||
scale: IN_SCALE_TO,
|
||||
filter: "blur(0px)",
|
||||
duration: 0.65,
|
||||
ease: enterEase,
|
||||
},
|
||||
0.35);
|
||||
|
||||
// Progress dot 0 lights up as phrase 1 lands.
|
||||
// back.out(1.7) — 3rd easing — subtle overshoot for "active" feel.
|
||||
tl.to(dots[0], {
|
||||
backgroundColor: "rgba(180, 215, 250, 1)",
|
||||
scale: 1.3,
|
||||
duration: 0.5,
|
||||
ease: "back.out(1.7)",
|
||||
}, 0.50);
|
||||
|
||||
// === Continuous motion 1.1s — 2.0s: phrase 1 holds with subtle
|
||||
// forward drift on z-axis. sine.inOut for breathing — 4th easing.
|
||||
tl.to(phrases[0], {
|
||||
scale: 1.020,
|
||||
duration: 0.9,
|
||||
ease: "sine.inOut",
|
||||
}, 1.10);
|
||||
|
||||
// ============================================================
|
||||
// PHRASE 1 EXIT + PHRASE 2 ENTER — swap centered at t=2.25s
|
||||
// shared-axis-z swap: overlap_ms=100, micro_delay_ms=20. We use a
|
||||
// ~250ms overlap so mid-swap snapshot frames clearly show one
|
||||
// phrase scaling past the camera (large + faded) while the next
|
||||
// emerges from depth (small + faded). The depth axis is the entire
|
||||
// point of this scene — we MUST catch it on the contact sheet.
|
||||
// ============================================================
|
||||
|
||||
// EXIT phrase 1: scale-Z 1.0 → 1.45 (push toward camera), blur 0 → 8,
|
||||
// opacity 1 → 0. exitEase (cubic-bezier 0.4,0,1,1) — accelerate.
|
||||
tl.to(phrases[0], {
|
||||
opacity: 0,
|
||||
scale: OUT_SCALE_TO,
|
||||
filter: "blur(" + OUT_BLUR + "px)",
|
||||
duration: 0.60,
|
||||
ease: exitEase,
|
||||
}, 2.00);
|
||||
|
||||
// ENTER phrase 2: starts 0.25s into phrase 1's exit so both are
|
||||
// visible mid-transition — phrase 1 large+fading, phrase 2 small+rising.
|
||||
tl.fromTo(phrases[1],
|
||||
{
|
||||
opacity: 0,
|
||||
scale: IN_SCALE_FROM,
|
||||
filter: "blur(" + IN_BLUR + "px)",
|
||||
},
|
||||
{
|
||||
opacity: 1,
|
||||
scale: IN_SCALE_TO,
|
||||
filter: "blur(0px)",
|
||||
duration: 0.70,
|
||||
ease: enterEase,
|
||||
},
|
||||
2.25);
|
||||
|
||||
// Progress dot 0 dims, dot 1 activates.
|
||||
tl.to(dots[0], {
|
||||
backgroundColor: "rgba(140, 170, 200, 0.35)",
|
||||
scale: 1,
|
||||
duration: 0.4,
|
||||
ease: "power2.inOut",
|
||||
}, 2.00);
|
||||
tl.to(dots[1], {
|
||||
backgroundColor: "rgba(180, 215, 250, 1)",
|
||||
scale: 1.3,
|
||||
duration: 0.5,
|
||||
ease: "back.out(1.7)",
|
||||
}, 2.45);
|
||||
|
||||
// === Continuous motion 3.2s — 4.2s: phrase 2 settle drift.
|
||||
tl.to(phrases[1], {
|
||||
scale: 1.022,
|
||||
duration: 1.0,
|
||||
ease: "sine.inOut",
|
||||
}, 3.20);
|
||||
|
||||
// ============================================================
|
||||
// PHRASE 2 EXIT + PHRASE 3 ENTER — swap centered at t=4.50s
|
||||
// ============================================================
|
||||
|
||||
tl.to(phrases[1], {
|
||||
opacity: 0,
|
||||
scale: OUT_SCALE_TO,
|
||||
filter: "blur(" + OUT_BLUR + "px)",
|
||||
duration: 0.60,
|
||||
ease: exitEase,
|
||||
}, 4.25);
|
||||
|
||||
tl.fromTo(phrases[2],
|
||||
{
|
||||
opacity: 0,
|
||||
scale: IN_SCALE_FROM,
|
||||
filter: "blur(" + IN_BLUR + "px)",
|
||||
},
|
||||
{
|
||||
opacity: 1,
|
||||
scale: IN_SCALE_TO,
|
||||
filter: "blur(0px)",
|
||||
duration: 0.70,
|
||||
ease: enterEase,
|
||||
},
|
||||
4.50);
|
||||
|
||||
// Progress dot 1 dims, dot 2 activates with a stronger pop —
|
||||
// power4.out for the final beat's snap — 5th easing.
|
||||
tl.to(dots[1], {
|
||||
backgroundColor: "rgba(140, 170, 200, 0.35)",
|
||||
scale: 1,
|
||||
duration: 0.4,
|
||||
ease: "power2.inOut",
|
||||
}, 4.25);
|
||||
tl.to(dots[2], {
|
||||
backgroundColor: "rgba(180, 215, 250, 1)",
|
||||
scale: 1.4,
|
||||
duration: 0.55,
|
||||
ease: "power4.out",
|
||||
}, 4.70);
|
||||
|
||||
// === Continuous motion 5.5s — 8.5s: phrase 3 holds as the closer.
|
||||
// Gentle z-drift + faint scale pulse so the final phrase doesn't sit
|
||||
// dead-still for the closing 3.5 seconds.
|
||||
tl.to(phrases[2], {
|
||||
scale: 1.030,
|
||||
duration: 1.5,
|
||||
ease: "sine.inOut",
|
||||
}, 5.50);
|
||||
tl.to(phrases[2], {
|
||||
scale: 1.000,
|
||||
duration: 1.5,
|
||||
ease: "sine.inOut",
|
||||
}, 7.00);
|
||||
|
||||
// === Eyebrow exits at t=7.8s — subtle outro cue.
|
||||
tl.to("#eyebrow", {
|
||||
opacity: 0.4,
|
||||
y: -4,
|
||||
duration: 1.0,
|
||||
ease: "expo.out",
|
||||
}, 7.80);
|
||||
|
||||
// === Label breathing — final 2s. Lifts attention to the closing line.
|
||||
tl.fromTo(".label",
|
||||
{ opacity: 0.85 },
|
||||
{ opacity: 1, duration: 1.0, ease: "sine.inOut", yoyo: true, repeat: 1 },
|
||||
7.00);
|
||||
|
||||
window.__timelines["scene-07-shared-axis-crossfade"] = tl;
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
+461
@@ -0,0 +1,461 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>scene-08-glitch-rgb-split</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@500;700;800&family=Inter:wght@500&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
<script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
body { background: #050507; }
|
||||
|
||||
#scene-08-glitch-rgb-split {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background:
|
||||
radial-gradient(ellipse at 50% 50%, #0a0a12 0%, #030305 75%);
|
||||
font-family: "JetBrains Mono", "Menlo", monospace;
|
||||
color: #f5f5ff;
|
||||
}
|
||||
|
||||
/* CRT scanline overlay — continuous slow drift for ambient motion. */
|
||||
.scanlines {
|
||||
position: absolute;
|
||||
inset: -20px 0;
|
||||
background-image: repeating-linear-gradient(
|
||||
0deg,
|
||||
rgba(255, 255, 255, 0.0) 0px,
|
||||
rgba(255, 255, 255, 0.0) 2px,
|
||||
rgba(255, 255, 255, 0.04) 2px,
|
||||
rgba(255, 255, 255, 0.04) 4px
|
||||
);
|
||||
pointer-events: none;
|
||||
mix-blend-mode: screen;
|
||||
will-change: transform;
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
/* Subtle CRT vignette — chromatic edges */
|
||||
.vignette {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(0,0,0,0.7) 100%);
|
||||
pointer-events: none;
|
||||
z-index: 4;
|
||||
}
|
||||
|
||||
/* TV glitch horizontal bar — slim white slice that sweeps vertically across.
|
||||
Pre-positioned off-screen; GSAP tweens y across timeline. */
|
||||
.tv-bar {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 28px;
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
rgba(255,255,255,0) 0%,
|
||||
rgba(255,255,255,0.85) 30%,
|
||||
rgba(255,255,255,1) 50%,
|
||||
rgba(255,255,255,0.85) 70%,
|
||||
rgba(255,255,255,0) 100%
|
||||
);
|
||||
mix-blend-mode: screen;
|
||||
opacity: 0;
|
||||
top: -40px;
|
||||
pointer-events: none;
|
||||
z-index: 6;
|
||||
box-shadow: 0 0 24px rgba(255,255,255,0.5);
|
||||
will-change: transform, opacity;
|
||||
}
|
||||
|
||||
/* Stage: centered phrase host */
|
||||
.stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.eyebrow {
|
||||
position: absolute;
|
||||
top: calc(50% - 180px);
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
font-family: "Inter", sans-serif;
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
letter-spacing: 0.42em;
|
||||
text-transform: uppercase;
|
||||
color: #4a8db8;
|
||||
opacity: 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.eyebrow .dot {
|
||||
display: inline-block;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
background: #4ade80;
|
||||
border-radius: 50%;
|
||||
vertical-align: middle;
|
||||
margin-right: 14px;
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 0 12px rgba(74, 222, 128, 0.8);
|
||||
}
|
||||
|
||||
.phrase-row {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 200px;
|
||||
}
|
||||
|
||||
/* Phrases are stacked, position:absolute, all pre-built in DOM at t=0. */
|
||||
.phrase {
|
||||
position: absolute;
|
||||
display: inline-block;
|
||||
font-size: 168px;
|
||||
font-weight: 800;
|
||||
letter-spacing: -0.01em;
|
||||
line-height: 1;
|
||||
white-space: nowrap;
|
||||
color: #ffffff;
|
||||
|
||||
/* CSS variables drive the RGB channel offsets. Each phrase initially
|
||||
has both channels collapsed onto the white text — no visible split. */
|
||||
--red-x: 0px;
|
||||
--red-y: 0px;
|
||||
--cyan-x: 0px;
|
||||
--cyan-y: 0px;
|
||||
|
||||
/* Two-channel text-shadow: red (#ff0040) offset by red vars,
|
||||
cyan (#00ffea) offset by cyan vars. Tweening the vars produces
|
||||
the channel separation effect. */
|
||||
text-shadow:
|
||||
var(--red-x) var(--red-y) 0 #ff0040,
|
||||
var(--cyan-x) var(--cyan-y) 0 #00ffea;
|
||||
|
||||
/* Initial opacity locked in CSS for deterministic snapshot at t=0. */
|
||||
opacity: 0;
|
||||
will-change: opacity, transform, text-shadow;
|
||||
}
|
||||
|
||||
/* Sub-line under each phrase — code-style data tag */
|
||||
.meta {
|
||||
position: absolute;
|
||||
top: calc(50% + 130px);
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
font-family: "JetBrains Mono", monospace;
|
||||
font-size: 22px;
|
||||
font-weight: 500;
|
||||
letter-spacing: 0.2em;
|
||||
color: #4a8db8;
|
||||
opacity: 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.meta .bracket { color: #5c6c7a; }
|
||||
.meta .value { color: #4ade80; }
|
||||
|
||||
/* Corner HUD markers — purely decorative cyberpunk frame */
|
||||
.hud {
|
||||
position: absolute;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
border-color: rgba(74, 141, 184, 0.55);
|
||||
opacity: 0;
|
||||
z-index: 3;
|
||||
}
|
||||
.hud.tl { top: 80px; left: 80px; border-top: 2px solid; border-left: 2px solid; }
|
||||
.hud.tr { top: 80px; right: 80px; border-top: 2px solid; border-right: 2px solid; }
|
||||
.hud.bl { bottom: 80px; left: 80px; border-bottom: 2px solid; border-left: 2px solid; }
|
||||
.hud.br { bottom: 80px; right: 80px; border-bottom: 2px solid; border-right: 2px solid; }
|
||||
|
||||
.label {
|
||||
position: absolute;
|
||||
left: 48px;
|
||||
bottom: 48px;
|
||||
font-family: "Inter", sans-serif;
|
||||
font-size: 16px;
|
||||
color: #5c6c7a;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
font-weight: 500;
|
||||
z-index: 10;
|
||||
}
|
||||
.label .accent { color: #f5f5ff; font-weight: 600; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="scene-08-glitch-rgb-split"
|
||||
data-composition-id="scene-08-glitch-rgb-split"
|
||||
data-start="0"
|
||||
data-duration="5"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
style="width:1920px; height:1080px;">
|
||||
|
||||
<div class="scanlines" id="scanlines"></div>
|
||||
<div class="vignette"></div>
|
||||
|
||||
<div class="hud tl" id="hud-tl"></div>
|
||||
<div class="hud tr" id="hud-tr"></div>
|
||||
<div class="hud bl" id="hud-bl"></div>
|
||||
<div class="hud br" id="hud-br"></div>
|
||||
|
||||
<div class="tv-bar" id="tv-bar"></div>
|
||||
|
||||
<div class="stage">
|
||||
<div class="eyebrow" id="eyebrow"><span class="dot"></span>SECURE TERMINAL · v8.4.1</div>
|
||||
<div class="phrase-row">
|
||||
<div class="phrase" id="phrase-0">SYSTEM ONLINE</div>
|
||||
<div class="phrase" id="phrase-1">ACCESS GRANTED</div>
|
||||
</div>
|
||||
<div class="meta" id="meta">
|
||||
<span class="bracket">[</span> status <span class="bracket">=</span> <span class="value">"connected"</span> <span class="bracket">]</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="label">
|
||||
Scene 08 · <span class="accent">Glitch RGB Split</span> · text-shadow channel offset + jitter
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(function () {
|
||||
var BEAT = 5;
|
||||
window.__timelines = window.__timelines || {};
|
||||
|
||||
var phrase0 = document.getElementById("phrase-0");
|
||||
var phrase1 = document.getElementById("phrase-1");
|
||||
var tvBar = document.getElementById("tv-bar");
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
// GLITCH KEYFRAME SEQUENCES
|
||||
//
|
||||
// Each entry: [time_offset_from_phrase_start, redX, redY, cyanX, cyanY, duration]
|
||||
// The "into" direction uses power1.in (snap into chaos);
|
||||
// the "out-back-to-clean" uses power4.out (snap back to zero offset).
|
||||
//
|
||||
// Multiple keyframes in succession create the stuttery feel.
|
||||
// Times feel random but are explicit literals = deterministic.
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
// Helper that pushes a snap-out + snap-back pair to the timeline,
|
||||
// using CSS variables on the phrase element.
|
||||
function glitchPulse(tl, el, atTime, redX, redY, cyanX, cyanY, snapDur, settleDur) {
|
||||
// Snap INTO the offset state — fast power1.in (mechanical, sudden)
|
||||
tl.to(el, {
|
||||
"--red-x": redX + "px",
|
||||
"--red-y": redY + "px",
|
||||
"--cyan-x": cyanX + "px",
|
||||
"--cyan-y": cyanY + "px",
|
||||
duration: snapDur,
|
||||
ease: "power1.in",
|
||||
}, atTime);
|
||||
// Snap BACK to zero — power4.out for the "settle" feel
|
||||
tl.to(el, {
|
||||
"--red-x": "0px",
|
||||
"--red-y": "0px",
|
||||
"--cyan-x": "0px",
|
||||
"--cyan-y": "0px",
|
||||
duration: settleDur,
|
||||
ease: "power4.out",
|
||||
}, atTime + snapDur);
|
||||
}
|
||||
|
||||
// Hard cut to an offset state — used inside glitch bursts where
|
||||
// the channel shifts in a steps(1) (instant) manner.
|
||||
function hardCut(tl, el, atTime, redX, redY, cyanX, cyanY) {
|
||||
tl.set(el, {
|
||||
"--red-x": redX + "px",
|
||||
"--red-y": redY + "px",
|
||||
"--cyan-x": cyanX + "px",
|
||||
"--cyan-y": cyanY + "px",
|
||||
}, atTime);
|
||||
}
|
||||
|
||||
var tl = gsap.timeline({ paused: true });
|
||||
|
||||
// === t=0 initial state — both phrases hidden, channels collapsed.
|
||||
tl.set([phrase0, phrase1], {
|
||||
opacity: 0,
|
||||
"--red-x": "0px",
|
||||
"--red-y": "0px",
|
||||
"--cyan-x": "0px",
|
||||
"--cyan-y": "0px",
|
||||
}, 0);
|
||||
tl.set("#eyebrow", { opacity: 0, y: -8 }, 0);
|
||||
tl.set("#meta", { opacity: 0, y: 8 }, 0);
|
||||
tl.set(".hud", { opacity: 0 }, 0);
|
||||
tl.set(tvBar, { opacity: 0, y: -40 }, 0);
|
||||
|
||||
// === Continuous motion (entire beat): scanlines drift down + back, sine.inOut.
|
||||
tl.fromTo("#scanlines",
|
||||
{ y: 0 },
|
||||
{ y: 8, duration: 0.55, repeat: 8, yoyo: true, ease: "sine.inOut" },
|
||||
0);
|
||||
|
||||
// === t=0.10s: HUD corners flicker in via steps(1) — three quick beats then on.
|
||||
tl.to(".hud", { opacity: 0.3, duration: 0.04, ease: "steps(1)" }, 0.10);
|
||||
tl.to(".hud", { opacity: 0, duration: 0.04, ease: "steps(1)" }, 0.16);
|
||||
tl.to(".hud", { opacity: 0.7, duration: 0.04, ease: "steps(1)" }, 0.22);
|
||||
tl.to(".hud", { opacity: 0, duration: 0.04, ease: "steps(1)" }, 0.28);
|
||||
tl.to(".hud", { opacity: 1, duration: 0.18, ease: "power4.out" }, 0.34);
|
||||
|
||||
// === t=0.20s: eyebrow slides in (soft entrance).
|
||||
tl.fromTo("#eyebrow",
|
||||
{ opacity: 0, y: -8 },
|
||||
{ opacity: 1, y: 0, duration: 0.55, ease: "expo.out" },
|
||||
0.20);
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
// PHRASE 0: "SYSTEM ONLINE" — 0.30s to 2.30s
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
// === t=0.30s: phrase 0 hard-cuts in with a heavy glitch state already
|
||||
// (big RGB offset), then snaps to clean.
|
||||
// Hard pre-set the offsets BEFORE the opacity flips on, so the entrance
|
||||
// moment shows a glitched silhouette.
|
||||
tl.set(phrase0, {
|
||||
"--red-x": "-22px", "--red-y": "0px",
|
||||
"--cyan-x": "26px", "--cyan-y": "-3px",
|
||||
}, 0.28);
|
||||
tl.to(phrase0, { opacity: 1, duration: 0.06, ease: "steps(1)" }, 0.30);
|
||||
// Snap back to clean — power4.out for the "settle" feel
|
||||
tl.to(phrase0, {
|
||||
"--red-x": "0px", "--red-y": "0px",
|
||||
"--cyan-x": "0px", "--cyan-y": "0px",
|
||||
duration: 0.42,
|
||||
ease: "power4.out",
|
||||
}, 0.36);
|
||||
|
||||
// === t=0.85s: brief 2-hit glitch burst (subtle).
|
||||
glitchPulse(tl, phrase0, 0.85, -8, 0, 10, 0, 0.05, 0.18);
|
||||
glitchPulse(tl, phrase0, 1.05, 6, 0, -7, 0, 0.04, 0.14);
|
||||
|
||||
// === t=1.22s: HARD glitch burst — four rapid hard-cuts in succession.
|
||||
// Frame snapshot at 1.30s lands inside this burst — peak glitch.
|
||||
hardCut(tl, phrase0, 1.22, -28, 2, 30, -3);
|
||||
hardCut(tl, phrase0, 1.27, 24, -2, -26, 4);
|
||||
hardCut(tl, phrase0, 1.32, -22, 4, 26, -3); // <- snapshot t=1.3s lands HERE
|
||||
hardCut(tl, phrase0, 1.37, 18, -3, -20, 3);
|
||||
hardCut(tl, phrase0, 1.42, -14, 0, 16, 0);
|
||||
tl.to(phrase0, {
|
||||
"--red-x": "0px", "--red-y": "0px",
|
||||
"--cyan-x": "0px", "--cyan-y": "0px",
|
||||
duration: 0.32,
|
||||
ease: "power4.out",
|
||||
}, 1.48);
|
||||
|
||||
// === t=1.24s: TV bar slice sweeps top-to-bottom across the frame.
|
||||
// Overlapping with the hard glitch burst — they belong together.
|
||||
tl.to(tvBar, { opacity: 1, duration: 0.04, ease: "steps(1)" }, 1.24);
|
||||
tl.to(tvBar, { y: 1120, duration: 0.34, ease: "power1.in" }, 1.24);
|
||||
tl.to(tvBar, { opacity: 0, duration: 0.06, ease: "steps(1)" }, 1.58);
|
||||
|
||||
// === t=1.90s: meta line fades in beneath the phrase.
|
||||
tl.fromTo("#meta",
|
||||
{ opacity: 0, y: 8 },
|
||||
{ opacity: 1, y: 0, duration: 0.5, ease: "expo.out" },
|
||||
1.90);
|
||||
|
||||
// === t=2.30s: phrase 0 holds clean, then begins EXIT glitch — channels
|
||||
// rip apart wider and wider. The exit ramps INTO the offset
|
||||
// instead of snapping back, so frame at t=2.5s catches the rip.
|
||||
tl.to(phrase0, {
|
||||
"--red-x": "-26px", "--red-y": "2px",
|
||||
"--cyan-x": "30px", "--cyan-y": "-3px",
|
||||
duration: 0.20,
|
||||
ease: "power1.in",
|
||||
}, 2.35);
|
||||
// === t=2.50s: hard-cut to a SECOND offset state — snapshot at 2.5s lands here.
|
||||
hardCut(tl, phrase0, 2.50, 22, -3, -26, 4);
|
||||
tl.to(phrase0, { opacity: 0, duration: 0.08, ease: "steps(1)" }, 2.62);
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
// PHRASE 1: "ACCESS GRANTED" — 2.55s to 5.00s
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
// === t=2.70s: meta line shifts to swap value (instant hide so phrase1 entrance reads clean).
|
||||
tl.set("#meta", { opacity: 0 }, 2.70);
|
||||
|
||||
// === t=2.72s: phrase 1 hard-cuts in glitched, settles clean.
|
||||
tl.set(phrase1, {
|
||||
"--red-x": "20px", "--red-y": "-2px",
|
||||
"--cyan-x": "-24px", "--cyan-y": "3px",
|
||||
}, 2.70);
|
||||
tl.to(phrase1, { opacity: 1, duration: 0.06, ease: "steps(1)" }, 2.72);
|
||||
tl.to(phrase1, {
|
||||
"--red-x": "0px", "--red-y": "0px",
|
||||
"--cyan-x": "0px", "--cyan-y": "0px",
|
||||
duration: 0.40,
|
||||
ease: "power4.out",
|
||||
}, 2.78);
|
||||
|
||||
// === t=3.15s: meta line re-enters with new content style.
|
||||
tl.fromTo("#meta",
|
||||
{ opacity: 0, y: 8 },
|
||||
{ opacity: 1, y: 0, duration: 0.35, ease: "expo.out" },
|
||||
3.15);
|
||||
|
||||
// === t=3.50s: subtle 2-hit warm-up burst.
|
||||
glitchPulse(tl, phrase1, 3.50, 6, 0, -8, 0, 0.04, 0.14);
|
||||
glitchPulse(tl, phrase1, 3.65, -10, 0, 12, 0, 0.04, 0.14);
|
||||
|
||||
// === t=3.72s: SECOND hard glitch burst — even heavier than first.
|
||||
// Five hard-cuts with varied offsets including y-component.
|
||||
// Frame snapshot at 3.80s lands INSIDE this burst — peak glitch.
|
||||
hardCut(tl, phrase1, 3.72, 28, -3, -32, 4);
|
||||
hardCut(tl, phrase1, 3.76, -26, 5, 30, -4);
|
||||
hardCut(tl, phrase1, 3.80, 24, -3, -28, 3); // <- snapshot t=3.8s lands HERE
|
||||
hardCut(tl, phrase1, 3.84, -22, 4, 26, -3);
|
||||
hardCut(tl, phrase1, 3.88, 18, -2, -20, 2);
|
||||
hardCut(tl, phrase1, 3.92, -14, 0, 16, 0);
|
||||
tl.to(phrase1, {
|
||||
"--red-x": "0px", "--red-y": "0px",
|
||||
"--cyan-x": "0px", "--cyan-y": "0px",
|
||||
duration: 0.32,
|
||||
ease: "power4.out",
|
||||
}, 3.98);
|
||||
|
||||
// === t=3.76s: SECOND TV bar slice — narrower and faster than the first.
|
||||
tl.set(tvBar, { y: -40 }, 3.74);
|
||||
tl.to(tvBar, { opacity: 1, duration: 0.04, ease: "steps(1)" }, 3.76);
|
||||
tl.to(tvBar, { y: 1120, duration: 0.28, ease: "power1.in" }, 3.76);
|
||||
tl.to(tvBar, { opacity: 0, duration: 0.06, ease: "steps(1)" }, 4.04);
|
||||
|
||||
// === Continuous motion 4.4s-5.0s: meta line subtle breathing + HUD sine pulse.
|
||||
tl.to("#meta", {
|
||||
opacity: 0.6,
|
||||
duration: 0.55,
|
||||
ease: "sine.inOut",
|
||||
yoyo: true,
|
||||
repeat: 1,
|
||||
}, 4.40);
|
||||
tl.to(".hud", {
|
||||
opacity: 0.6,
|
||||
duration: 0.55,
|
||||
ease: "sine.inOut",
|
||||
yoyo: true,
|
||||
repeat: 1,
|
||||
}, 4.40);
|
||||
|
||||
// === t=4.65s: tiny final residual glitch — phrase quivers once.
|
||||
glitchPulse(tl, phrase1, 4.65, 4, 0, -5, 0, 0.04, 0.20);
|
||||
|
||||
window.__timelines["scene-08-glitch-rgb-split"] = tl;
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
+428
@@ -0,0 +1,428 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>scene-09-scramble-decrypt</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Inter:wght@500&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
<script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
body { background: #02060a; }
|
||||
|
||||
#scene-09-scramble-decrypt {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background:
|
||||
radial-gradient(ellipse at 50% 55%, #0a1a14 0%, #02060a 70%),
|
||||
linear-gradient(180deg, #03090c 0%, #010305 100%);
|
||||
font-family: "JetBrains Mono", "Menlo", monospace;
|
||||
color: #d4ffd4;
|
||||
}
|
||||
|
||||
/* CRT scanline overlay — keeps frame alive during static holds. */
|
||||
.scanlines {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background-image: repeating-linear-gradient(
|
||||
0deg,
|
||||
rgba(0, 255, 120, 0) 0px,
|
||||
rgba(0, 255, 120, 0) 2px,
|
||||
rgba(0, 255, 120, 0.035) 2px,
|
||||
rgba(0, 255, 120, 0.035) 4px
|
||||
);
|
||||
pointer-events: none;
|
||||
mix-blend-mode: screen;
|
||||
will-change: transform;
|
||||
}
|
||||
|
||||
/* Soft green vignette glow at center — pulses during hold. */
|
||||
.glow {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 1600px;
|
||||
height: 800px;
|
||||
transform: translate(-50%, -50%);
|
||||
background: radial-gradient(ellipse at center, rgba(74, 222, 128, 0.14) 0%, transparent 60%);
|
||||
pointer-events: none;
|
||||
filter: blur(40px);
|
||||
will-change: opacity, transform;
|
||||
}
|
||||
|
||||
/* Stage holds the prompt + phrase. */
|
||||
.stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 36px;
|
||||
}
|
||||
|
||||
.prompt-line {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 18px;
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
color: #4ade80;
|
||||
letter-spacing: 0.12em;
|
||||
text-transform: uppercase;
|
||||
opacity: 0.7;
|
||||
}
|
||||
.prompt-dot {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 50%;
|
||||
background: #4ade80;
|
||||
box-shadow: 0 0 18px rgba(74, 222, 128, 0.7);
|
||||
}
|
||||
|
||||
/* Phrase row — fixed width to prevent layout shift as chars swap. */
|
||||
.phrase {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: baseline;
|
||||
justify-content: center;
|
||||
font-size: 132px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.04em;
|
||||
line-height: 1.0;
|
||||
color: #d4ffd4;
|
||||
text-shadow:
|
||||
0 0 18px rgba(74, 222, 128, 0.45),
|
||||
0 0 48px rgba(74, 222, 128, 0.18);
|
||||
white-space: nowrap;
|
||||
will-change: filter;
|
||||
}
|
||||
|
||||
.char {
|
||||
display: inline-block;
|
||||
width: 1ch;
|
||||
text-align: center;
|
||||
white-space: pre;
|
||||
font-variant-numeric: tabular-nums;
|
||||
will-change: color, text-shadow;
|
||||
}
|
||||
/* "scrambled" char visual cue — slight blue tint, dimmer. */
|
||||
.char[data-locked="0"] {
|
||||
color: #5a8a72;
|
||||
text-shadow: 0 0 12px rgba(74, 222, 128, 0.25);
|
||||
}
|
||||
.char[data-locked="1"] {
|
||||
color: #d4ffd4;
|
||||
text-shadow:
|
||||
0 0 18px rgba(74, 222, 128, 0.5),
|
||||
0 0 48px rgba(74, 222, 128, 0.22);
|
||||
}
|
||||
|
||||
.cursor {
|
||||
display: inline-block;
|
||||
width: 26px;
|
||||
height: 110px;
|
||||
vertical-align: baseline;
|
||||
background: #4ade80;
|
||||
margin-left: 12px;
|
||||
transform: translateY(14px);
|
||||
box-shadow: 0 0 28px rgba(74, 222, 128, 0.7);
|
||||
will-change: opacity;
|
||||
}
|
||||
|
||||
.label {
|
||||
position: absolute;
|
||||
left: 48px;
|
||||
bottom: 48px;
|
||||
font-size: 16px;
|
||||
color: #5a8a72;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
font-weight: 500;
|
||||
font-family: "Inter", sans-serif;
|
||||
z-index: 10;
|
||||
}
|
||||
.label .accent { color: #d4ffd4; font-weight: 600; }
|
||||
|
||||
/* Top-right status badge — small touch of UI dressing. */
|
||||
.status {
|
||||
position: absolute;
|
||||
top: 48px;
|
||||
right: 48px;
|
||||
font-family: "Inter", sans-serif;
|
||||
font-size: 14px;
|
||||
color: #5a8a72;
|
||||
letter-spacing: 0.2em;
|
||||
text-transform: uppercase;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
.status-dot {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background: #4ade80;
|
||||
box-shadow: 0 0 12px rgba(74, 222, 128, 0.7);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="scene-09-scramble-decrypt"
|
||||
data-composition-id="scene-09-scramble-decrypt"
|
||||
data-start="0"
|
||||
data-duration="6"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
style="width:1920px; height:1080px;">
|
||||
|
||||
<div class="scanlines"></div>
|
||||
<div class="glow" id="glow"></div>
|
||||
|
||||
<div class="stage">
|
||||
<div class="prompt-line" id="prompt">
|
||||
<span class="prompt-dot"></span>
|
||||
<span>SECURE CHANNEL // DECRYPTING</span>
|
||||
</div>
|
||||
<div class="phrase" id="phrase-row">
|
||||
<span id="phrase-chars"></span>
|
||||
<span class="cursor" id="cursor"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="status">
|
||||
<span class="status-dot"></span>
|
||||
<span>LINK 01</span>
|
||||
</div>
|
||||
|
||||
<div class="label">
|
||||
Scene 09 · <span class="accent">Scramble Decrypt</span> · per-character intermediate substitution
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(function () {
|
||||
var BEAT = 6;
|
||||
window.__timelines = window.__timelines || {};
|
||||
|
||||
var FINAL = "AUTHENTICATED"; // 13 chars
|
||||
var CHARSET = "!@#$%^&*<>/?_-+=ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
||||
|
||||
// Deterministic intermediate generator — no Math.random().
|
||||
// For char position `pos`, returns the `i`-th intermediate glyph.
|
||||
function intermediate(pos, i) {
|
||||
var idx = (pos * 7 + i * 13 + 5) % CHARSET.length;
|
||||
// Avoid picking the actual final char as an intermediate (looks like an early lock).
|
||||
var ch = CHARSET.charAt(idx);
|
||||
if (ch === FINAL.charAt(pos)) {
|
||||
idx = (idx + 17) % CHARSET.length;
|
||||
ch = CHARSET.charAt(idx);
|
||||
}
|
||||
return ch;
|
||||
}
|
||||
|
||||
// === Build the per-character DOM upfront. All char spans exist at t=0.
|
||||
var host = document.getElementById("phrase-chars");
|
||||
var charEls = [];
|
||||
var frag = document.createDocumentFragment();
|
||||
for (var p = 0; p < FINAL.length; p++) {
|
||||
var span = document.createElement("span");
|
||||
span.className = "char";
|
||||
span.setAttribute("data-locked", "0");
|
||||
// Initial visible glyph at t=0: the first intermediate of each position.
|
||||
span.textContent = intermediate(p, 0);
|
||||
frag.appendChild(span);
|
||||
charEls.push(span);
|
||||
}
|
||||
host.replaceChildren(frag);
|
||||
|
||||
var cursor = document.getElementById("cursor");
|
||||
var prompt = document.getElementById("prompt");
|
||||
var glow = document.getElementById("glow");
|
||||
var phraseRow = document.getElementById("phrase-row");
|
||||
|
||||
var tl = gsap.timeline({ paused: true });
|
||||
|
||||
// ====================================================================
|
||||
// CONTINUOUS MOTION (spans entire 6s)
|
||||
// ====================================================================
|
||||
|
||||
// Cursor blink — steps(1) gives the mechanical on/off feel.
|
||||
tl.fromTo(cursor,
|
||||
{ opacity: 1 },
|
||||
{ opacity: 0.18, duration: 0.42, repeat: 13, yoyo: true, ease: "steps(1)" },
|
||||
0);
|
||||
|
||||
// Scanlines drift down — linear ambient, none ease.
|
||||
tl.fromTo(".scanlines",
|
||||
{ y: 0 },
|
||||
{ y: 12, duration: 0.9, repeat: 6, yoyo: true, ease: "none" },
|
||||
0);
|
||||
|
||||
// Status dot pulse — sine breath.
|
||||
tl.fromTo(".status-dot",
|
||||
{ opacity: 1 },
|
||||
{ opacity: 0.4, duration: 0.7, repeat: 8, yoyo: true, ease: "sine.inOut" },
|
||||
0);
|
||||
|
||||
// Prompt label fades in.
|
||||
tl.fromTo(prompt,
|
||||
{ opacity: 0, y: -8 },
|
||||
{ opacity: 0.7, y: 0, duration: 0.5, ease: "expo.out" },
|
||||
0.10);
|
||||
|
||||
// ====================================================================
|
||||
// PHASE 1 — DECRYPT (0.3s → 2.3s)
|
||||
// Each char cycles through 7 intermediates with steps(1) feel, then locks.
|
||||
// Locks stagger left-to-right.
|
||||
// ====================================================================
|
||||
|
||||
var DECRYPT_START = 0.30;
|
||||
var PER_CHAR_LOCK_STEP = 0.13; // 13 chars * 0.13 = 1.69s — last lock at 0.30 + 12*0.13 = 1.86s
|
||||
var SCRAMBLE_BEFORE_LOCK = 0.65; // each char scrambles ~650ms before its lock
|
||||
var STEPS_BEFORE_LOCK = 6; // 6 intermediate swaps before final lock
|
||||
|
||||
for (var pos = 0; pos < FINAL.length; pos++) {
|
||||
var lockTime = DECRYPT_START + pos * PER_CHAR_LOCK_STEP;
|
||||
var scrambleStart = lockTime - SCRAMBLE_BEFORE_LOCK;
|
||||
var stepDur = SCRAMBLE_BEFORE_LOCK / STEPS_BEFORE_LOCK;
|
||||
|
||||
// Schedule the intermediate swaps — tl.set is the correct tool for textContent.
|
||||
for (var s = 0; s < STEPS_BEFORE_LOCK; s++) {
|
||||
var t = scrambleStart + s * stepDur;
|
||||
if (t < 0) t = 0;
|
||||
// Skip the very first intermediate for pos 0 — it's already set in DOM at t=0
|
||||
// and would visually "flash" if re-set. But re-setting is harmless; let it ride.
|
||||
tl.set(charEls[pos], { textContent: intermediate(pos, s + 1) }, t);
|
||||
}
|
||||
// Lock to the final char.
|
||||
tl.set(charEls[pos], { textContent: FINAL.charAt(pos), attr: { "data-locked": "1" } }, lockTime);
|
||||
}
|
||||
|
||||
// Brief whip-glow on each character at its lock moment — back.out feel.
|
||||
// We do this as a single sweep on the phrase row text-shadow via filter pulse.
|
||||
tl.fromTo(phraseRow,
|
||||
{ filter: "brightness(1) blur(0px)" },
|
||||
{ filter: "brightness(1.25) blur(0px)", duration: 0.4, ease: "back.out(1.7)", yoyo: true, repeat: 1 },
|
||||
1.50);
|
||||
|
||||
// Glow ramps up as more chars lock.
|
||||
tl.fromTo(glow,
|
||||
{ opacity: 0.4, scale: 1 },
|
||||
{ opacity: 1, scale: 1.04, duration: 1.6, ease: "expo.out", transformOrigin: "50% 50%" },
|
||||
DECRYPT_START);
|
||||
|
||||
// ====================================================================
|
||||
// PHASE 2 — HOLD (2.3s → 4.0s)
|
||||
// Full phrase decrypted. Ambient motion only: glow pulse, slight phrase breath.
|
||||
// ====================================================================
|
||||
|
||||
tl.to(glow, {
|
||||
opacity: 0.75,
|
||||
scale: 1.08,
|
||||
duration: 0.85,
|
||||
ease: "sine.inOut",
|
||||
yoyo: true,
|
||||
repeat: 1,
|
||||
transformOrigin: "50% 50%",
|
||||
}, 2.40);
|
||||
|
||||
// Subtle phrase breath — y drift only (no transform conflict with the filter tween above —
|
||||
// filter and transform are independent properties).
|
||||
tl.to(phraseRow, {
|
||||
y: -4,
|
||||
duration: 1.6,
|
||||
ease: "sine.inOut",
|
||||
yoyo: true,
|
||||
repeat: 0,
|
||||
}, 2.40);
|
||||
|
||||
// Prompt label subtle dim/brighten during hold.
|
||||
tl.to(prompt, {
|
||||
opacity: 0.4,
|
||||
duration: 0.8,
|
||||
ease: "sine.inOut",
|
||||
yoyo: true,
|
||||
repeat: 1,
|
||||
}, 2.50);
|
||||
|
||||
// ====================================================================
|
||||
// PHASE 3 — RE-ENCRYPT (4.0s → 5.0s)
|
||||
// Chars unlock left-to-right, returning to scramble glyphs.
|
||||
// ====================================================================
|
||||
|
||||
var REENC_START = 4.00;
|
||||
var REENC_PER_CHAR = 1.0 / FINAL.length; // ~0.077s per char
|
||||
|
||||
for (var pos2 = 0; pos2 < FINAL.length; pos2++) {
|
||||
var unlockTime = REENC_START + pos2 * REENC_PER_CHAR;
|
||||
// Three quick scramble swaps after unlock — uses different intermediate offsets
|
||||
// so this phase doesn't look identical to the decrypt sequence.
|
||||
tl.set(charEls[pos2], { textContent: intermediate(pos2, 2), attr: { "data-locked": "0" } }, unlockTime);
|
||||
tl.set(charEls[pos2], { textContent: intermediate(pos2, 4) }, unlockTime + 0.10);
|
||||
tl.set(charEls[pos2], { textContent: intermediate(pos2, 1) }, unlockTime + 0.22);
|
||||
}
|
||||
|
||||
// Glow dims to match the encrypted state.
|
||||
tl.to(glow, {
|
||||
opacity: 0.45,
|
||||
scale: 1.0,
|
||||
duration: 0.9,
|
||||
ease: "power2.inOut",
|
||||
transformOrigin: "50% 50%",
|
||||
}, REENC_START);
|
||||
|
||||
// Prompt label brightens (decrypting again).
|
||||
tl.to(prompt, {
|
||||
opacity: 0.85,
|
||||
duration: 0.5,
|
||||
ease: "expo.out",
|
||||
}, REENC_START + 0.20);
|
||||
|
||||
// ====================================================================
|
||||
// PHASE 4 — RE-DECRYPT (5.0s → 6.0s)
|
||||
// Locks back to the final phrase, faster than phase 1. Ends on full readable phrase.
|
||||
// ====================================================================
|
||||
|
||||
var REDEC_START = 5.00;
|
||||
var REDEC_PER_CHAR = 0.95 / FINAL.length; // ~0.073s per char — finishes by ~5.95s
|
||||
var REDEC_SCRAMBLE_BEFORE = 0.30;
|
||||
var REDEC_STEPS = 4;
|
||||
|
||||
for (var pos3 = 0; pos3 < FINAL.length; pos3++) {
|
||||
var relockTime = REDEC_START + pos3 * REDEC_PER_CHAR;
|
||||
var rs = relockTime - REDEC_SCRAMBLE_BEFORE;
|
||||
if (rs < REENC_START + 0.20) rs = REENC_START + 0.20; // don't collide with phase 3 sets
|
||||
var rstep = REDEC_SCRAMBLE_BEFORE / REDEC_STEPS;
|
||||
for (var rstepi = 0; rstepi < REDEC_STEPS; rstepi++) {
|
||||
tl.set(charEls[pos3], { textContent: intermediate(pos3, rstepi + 3) }, rs + rstepi * rstep);
|
||||
}
|
||||
tl.set(charEls[pos3], { textContent: FINAL.charAt(pos3), attr: { "data-locked": "1" } }, relockTime);
|
||||
}
|
||||
|
||||
// Final glow swell on full re-decryption.
|
||||
tl.to(glow, {
|
||||
opacity: 1,
|
||||
scale: 1.06,
|
||||
duration: 0.8,
|
||||
ease: "expo.out",
|
||||
transformOrigin: "50% 50%",
|
||||
}, 5.20);
|
||||
|
||||
// Final phrase impact pulse — back.out for the whip moment when fully relocked.
|
||||
tl.fromTo(phraseRow,
|
||||
{ filter: "brightness(1.0)" },
|
||||
{ filter: "brightness(1.35)", duration: 0.35, ease: "back.out(1.7)", yoyo: true, repeat: 1 },
|
||||
5.85);
|
||||
|
||||
window.__timelines["scene-09-scramble-decrypt"] = tl;
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
+429
@@ -0,0 +1,429 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>scene-10-per-word-emphasis</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Caveat:wght@500;700&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
<script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/CustomEase.min.js"></script>
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
body { background: #fafaf6; }
|
||||
|
||||
#scene-10-per-word-emphasis {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
/* Warm off-white editorial paper — soft warmth in the corners,
|
||||
like a printed page lit from the top. Different palette than 01-09. */
|
||||
background:
|
||||
radial-gradient(ellipse at 50% 40%, #fdfcf6 0%, #f5f2e9 70%, #ede9dc 100%);
|
||||
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
color: #1a1a1a;
|
||||
}
|
||||
|
||||
/* Paper grain — subtle off-white speckle, the kind of ambient noise an
|
||||
editorial layout gets. Drifts during the beat for continuous motion. */
|
||||
.paper-grain {
|
||||
position: absolute;
|
||||
inset: -40px;
|
||||
background:
|
||||
radial-gradient(circle at 15% 22%, rgba(180, 160, 110, 0.06) 0%, transparent 38%),
|
||||
radial-gradient(circle at 82% 70%, rgba(200, 175, 120, 0.05) 0%, transparent 42%),
|
||||
radial-gradient(circle at 50% 92%, rgba(150, 130, 90, 0.04) 0%, transparent 30%);
|
||||
pointer-events: none;
|
||||
will-change: transform, opacity;
|
||||
}
|
||||
|
||||
/* Stage: centered host for the phrase. */
|
||||
.stage {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
perspective: 900px;
|
||||
}
|
||||
|
||||
.eyebrow {
|
||||
position: absolute;
|
||||
top: calc(50% - 200px);
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
letter-spacing: 0.32em;
|
||||
text-transform: uppercase;
|
||||
color: #8a7a55;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
/* Phrase row — holds the four word spans inline. The emphasis-word
|
||||
wrapper has position:relative so the SVG circle marker (absolutely
|
||||
positioned) anchors to it. */
|
||||
.phrase {
|
||||
position: relative;
|
||||
font-size: 132px;
|
||||
font-weight: 700;
|
||||
letter-spacing: -0.025em;
|
||||
line-height: 1.05;
|
||||
color: #1a1a1a;
|
||||
white-space: nowrap;
|
||||
display: inline-block;
|
||||
transform-style: preserve-3d;
|
||||
}
|
||||
|
||||
/* Per-word unit — pre-split DOM. opacity:0 locks initial state for
|
||||
the snapshot tool (first frame captured before timeline t=0 applies). */
|
||||
.word {
|
||||
display: inline-block;
|
||||
white-space: pre;
|
||||
backface-visibility: hidden;
|
||||
will-change: transform, opacity;
|
||||
opacity: 0;
|
||||
transform: translateY(8px);
|
||||
}
|
||||
|
||||
/* Emphasis word host — relative so the circle SVG anchors here. */
|
||||
.emphasis-host {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
padding: 0 12px; /* breathing room so the circle has visual margin */
|
||||
}
|
||||
|
||||
/* Hand-drawn circle marker. Pre-positioned over the emphasis word.
|
||||
stroke-dasharray locks the initial empty state in CSS so frame 0
|
||||
(before timeline runs) shows no marker. */
|
||||
.circle-marker {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 130%;
|
||||
height: 145%;
|
||||
transform: translate(-50%, -50%) rotate(-2.2deg);
|
||||
pointer-events: none;
|
||||
overflow: visible;
|
||||
opacity: 0; /* locked off — fades on just before the stroke draws */
|
||||
}
|
||||
.circle-marker path {
|
||||
fill: none;
|
||||
stroke: #ff6b35;
|
||||
stroke-width: 6;
|
||||
stroke-linecap: round;
|
||||
stroke-linejoin: round;
|
||||
/* Initial state set as SVG attributes on the element itself (see HTML)
|
||||
so the snapshot tool's first-frame render shows an empty path even
|
||||
before the GSAP timeline applies its t=0 set tweens. */
|
||||
}
|
||||
|
||||
/* Secondary mark: hand-drawn underline + small arrow. Appears later. */
|
||||
.secondary-mark {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: calc(50% + 105px);
|
||||
width: 340px;
|
||||
height: 60px;
|
||||
transform: translateX(-50%);
|
||||
pointer-events: none;
|
||||
overflow: visible;
|
||||
opacity: 0; /* locked off — fades on just before the stroke draws */
|
||||
}
|
||||
.secondary-mark path {
|
||||
fill: none;
|
||||
stroke: #ff6b35;
|
||||
stroke-width: 4;
|
||||
stroke-linecap: round;
|
||||
stroke-linejoin: round;
|
||||
/* Initial dash state set on element via SVG attributes — see HTML. */
|
||||
}
|
||||
|
||||
/* "Hand-written" Caveat label that appears next to the secondary mark. */
|
||||
.hand-label {
|
||||
position: absolute;
|
||||
left: calc(50% + 200px);
|
||||
top: calc(50% + 130px);
|
||||
font-family: "Caveat", cursive;
|
||||
font-size: 38px;
|
||||
font-weight: 700;
|
||||
color: #ff6b35;
|
||||
transform: rotate(-4deg);
|
||||
opacity: 0;
|
||||
letter-spacing: 0.01em;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.label {
|
||||
position: absolute;
|
||||
left: 48px;
|
||||
bottom: 48px;
|
||||
font-size: 16px;
|
||||
color: #8a7a55;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
font-weight: 500;
|
||||
z-index: 10;
|
||||
}
|
||||
.label .accent { color: #1a1a1a; font-weight: 600; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="scene-10-per-word-emphasis"
|
||||
data-composition-id="scene-10-per-word-emphasis"
|
||||
data-start="0"
|
||||
data-duration="8"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
style="width:1920px; height:1080px;">
|
||||
|
||||
<div class="paper-grain"></div>
|
||||
|
||||
<div class="stage">
|
||||
<div class="eyebrow" id="eyebrow">Section 01 · Typography</div>
|
||||
|
||||
<!-- Phrase pre-split into per-word spans. The emphasis word "intention"
|
||||
lives inside .emphasis-host so the SVG circle anchors over it.
|
||||
All words have opacity:0 in CSS — locked for snapshot frame 0. -->
|
||||
<div class="phrase" id="phrase">
|
||||
<span class="word" data-word="0">Made</span><span class="word" data-word="1"> with </span><span class="emphasis-host"><span class="word" data-word="2" id="emphasis-word">intention</span><!--
|
||||
Hand-drawn circle marker — slightly wonky elliptical path. Uses
|
||||
cubic Beziers with intentional deviations to feel sketched, not
|
||||
mathematically perfect. ViewBox is generous so the stroke can sit
|
||||
outside the word without clipping.
|
||||
--><svg class="circle-marker" id="circle-marker" viewBox="0 0 400 200" preserveAspectRatio="none">
|
||||
<path id="circle-path"
|
||||
stroke-dasharray="2000 2000"
|
||||
stroke-dashoffset="2000"
|
||||
pathLength="2000"
|
||||
d="
|
||||
M 60 102
|
||||
C 55 70, 110 38, 200 36
|
||||
C 295 34, 348 64, 350 100
|
||||
C 352 138, 290 168, 198 168
|
||||
C 110 168, 56 140, 58 104
|
||||
C 58 92, 70 80, 85 72
|
||||
"/>
|
||||
</svg></span><span class="word" data-word="3">.</span>
|
||||
</div>
|
||||
|
||||
<!-- Secondary mark: hand-drawn underline curve + small arrow tail.
|
||||
Anchored at the bottom of the phrase row, drawn after circle fades. -->
|
||||
<svg class="secondary-mark" id="secondary-mark" viewBox="0 0 340 60" preserveAspectRatio="none">
|
||||
<path id="secondary-path"
|
||||
stroke-dasharray="2000 2000"
|
||||
stroke-dashoffset="2000"
|
||||
pathLength="2000"
|
||||
d="
|
||||
M 14 28
|
||||
C 60 18, 130 16, 200 26
|
||||
C 250 33, 290 38, 318 36
|
||||
M 304 26
|
||||
L 320 36
|
||||
L 308 48
|
||||
"/>
|
||||
</svg>
|
||||
|
||||
<div class="hand-label" id="hand-label">on purpose</div>
|
||||
</div>
|
||||
|
||||
<div class="label">
|
||||
Scene 10 · <span class="accent">Per-Word Emphasis</span> · per-word crossfade + hand-drawn marker overlay
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(function () {
|
||||
var BEAT = 8;
|
||||
window.__timelines = window.__timelines || {};
|
||||
|
||||
gsap.registerPlugin(CustomEase);
|
||||
|
||||
// per-word-crossfade signature easing — cubic-bezier(0.16, 1, 0.3, 1).
|
||||
// Same curve as the JSON spec's signature_easing.
|
||||
var crossfadeEase = CustomEase.create("crossfade", "0.16, 1, 0.3, 1");
|
||||
// Exit easing — accelerated, from per-word-crossfade.json portable_spec.exit.easing.
|
||||
var crossfadeExit = CustomEase.create("crossfadeExit", "0.7, 0, 0.84, 0");
|
||||
|
||||
// Both circle and secondary paths declare pathLength="2000" as an SVG
|
||||
// attribute, so the browser normalizes their dash math to a 2000-unit
|
||||
// scale regardless of the actual computed path length. Initial state
|
||||
// (dasharray="2000 2000", dashoffset="2000") is locked on the element
|
||||
// itself in HTML — that way the snapshot tool's first-frame capture is
|
||||
// correct even before the GSAP timeline applies its t=0 set tweens.
|
||||
var circlePath = document.getElementById("circle-path");
|
||||
var secondaryPath = document.getElementById("secondary-path");
|
||||
var PATH_LEN = 2000;
|
||||
|
||||
var words = document.querySelectorAll("#phrase .word");
|
||||
|
||||
var tl = gsap.timeline({ paused: true });
|
||||
|
||||
// === t=0: lock every animated element to its pre-entrance state.
|
||||
// Mirrors CSS initial state so seek-to-0 is deterministic.
|
||||
tl.set(words, { opacity: 0, y: 8 }, 0);
|
||||
tl.set("#eyebrow", { opacity: 0, y: -8 }, 0);
|
||||
tl.set(circlePath, { attr: { "stroke-dasharray": PATH_LEN + " " + PATH_LEN, "stroke-dashoffset": PATH_LEN } }, 0);
|
||||
tl.set(secondaryPath, { attr: { "stroke-dasharray": PATH_LEN + " " + PATH_LEN, "stroke-dashoffset": PATH_LEN } }, 0);
|
||||
tl.set("#circle-marker", { opacity: 0, scale: 1, rotation: -2.2, transformOrigin: "50% 50%" }, 0);
|
||||
tl.set("#secondary-mark", { opacity: 0 }, 0);
|
||||
tl.set("#hand-label", { opacity: 0, y: 6, rotation: -4 }, 0);
|
||||
|
||||
// === t=0.30s: eyebrow fades in. Supporting move, layered before main entrance.
|
||||
tl.fromTo("#eyebrow",
|
||||
{ opacity: 0, y: -8 },
|
||||
{ opacity: 1, y: 0, duration: 0.6, ease: "expo.out" },
|
||||
0.30);
|
||||
|
||||
// === t=0.5s-1.5s: per-word entrance.
|
||||
// per-word-crossfade.json showcase.timing: scaled_duration 504ms,
|
||||
// scaled_stagger 50ms, easing cubic-bezier(0.16, 1, 0.3, 1).
|
||||
// 4 word spans (including the " with " whitespace span which we still
|
||||
// animate so the gap doesn't pop in suddenly — but its content is
|
||||
// mostly space). Total: 0.504 + 3*0.050 = 0.654s ending ~1.15s.
|
||||
tl.fromTo(words,
|
||||
{ opacity: 0, y: 8 },
|
||||
{
|
||||
opacity: 1,
|
||||
y: 0,
|
||||
duration: 0.504,
|
||||
stagger: 0.050,
|
||||
ease: crossfadeEase,
|
||||
},
|
||||
0.50);
|
||||
|
||||
// === t=1.4s: paper grain settles into a slow drift.
|
||||
// Continuous-motion layer that runs through the calm hold sections.
|
||||
tl.fromTo(".paper-grain",
|
||||
{ x: 0, y: 0, opacity: 1 },
|
||||
{ x: -22, y: -8, opacity: 0.92, duration: 4.5, ease: "sine.inOut" },
|
||||
1.40);
|
||||
|
||||
// === t=1.78s: circle-marker SVG fades in just before the stroke starts.
|
||||
// Hides the round-linecap dot artifact that would otherwise show during
|
||||
// the locked-off pre-draw state.
|
||||
tl.to("#circle-marker", { opacity: 1, duration: 0.04, ease: "none" }, 1.78);
|
||||
|
||||
// === t=1.8s-2.5s: hand-drawn circle marker scribes around "intention".
|
||||
// power4.out gives the line a confident, decisive snap — like a pen
|
||||
// stroke from a designer. Duration 0.7s matches the brief spec window.
|
||||
tl.fromTo(circlePath,
|
||||
{ attr: { "stroke-dashoffset": PATH_LEN } },
|
||||
{ attr: { "stroke-dashoffset": 0 }, duration: 0.7, ease: "power4.out" },
|
||||
1.80);
|
||||
|
||||
// === t=2.5s-4.5s: hold with "handmade" oscillation.
|
||||
// The circle breathes: tiny rotation + scale sine.inOut yoyo — feels
|
||||
// like the ink is still drying, not a perfect static asset.
|
||||
tl.to("#circle-marker", {
|
||||
rotation: -3.6,
|
||||
scale: 1.035,
|
||||
duration: 1.0,
|
||||
ease: "sine.inOut",
|
||||
yoyo: true,
|
||||
repeat: 1,
|
||||
transformOrigin: "50% 50%",
|
||||
}, 2.50);
|
||||
|
||||
// === t=2.5s-4.5s: phrase micro y-drift during hold — another
|
||||
// continuous-motion layer so the words don't sit perfectly still.
|
||||
tl.to("#phrase", {
|
||||
y: -4,
|
||||
duration: 1.0,
|
||||
ease: "sine.inOut",
|
||||
yoyo: true,
|
||||
repeat: 1,
|
||||
}, 2.50);
|
||||
|
||||
// === t=4.5s-5.1s: circle marker fades out.
|
||||
// Makes room for the secondary mark to take focus.
|
||||
tl.to("#circle-marker", {
|
||||
opacity: 0,
|
||||
duration: 0.6,
|
||||
ease: "expo.out",
|
||||
}, 4.50);
|
||||
|
||||
// === t=4.68s: secondary-mark SVG fades in just before the stroke draws.
|
||||
tl.to("#secondary-mark", { opacity: 1, duration: 0.04, ease: "none" }, 4.68);
|
||||
|
||||
// === t=4.7s-5.6s: secondary mark draws — hand-drawn underline curve
|
||||
// with a small arrow tail pointing at the emphasis word. Same
|
||||
// stroke-dasharray draw-on technique. power4.out for confident pen stroke.
|
||||
tl.fromTo(secondaryPath,
|
||||
{ attr: { "stroke-dashoffset": PATH_LEN } },
|
||||
{ attr: { "stroke-dashoffset": 0 }, duration: 0.9, ease: "power4.out" },
|
||||
4.70);
|
||||
|
||||
// === t=5.3s: hand-written "on purpose" label appears at end of arrow.
|
||||
// back.out gives it a brief whip overshoot — feels like a writer
|
||||
// adding emphasis after the underline lands.
|
||||
tl.fromTo("#hand-label",
|
||||
{ opacity: 0, y: 6, rotation: -4 },
|
||||
{ opacity: 1, y: 0, rotation: -4, duration: 0.45, ease: "back.out(1.7)" },
|
||||
5.30);
|
||||
|
||||
// === t=5.8s-7.4s: continued hold with the secondary mark.
|
||||
// Hand-label breathes via subtle rotation oscillation — keeps the
|
||||
// frame alive while content stays on-screen.
|
||||
tl.to("#hand-label", {
|
||||
rotation: -2.5,
|
||||
duration: 0.9,
|
||||
ease: "sine.inOut",
|
||||
yoyo: true,
|
||||
repeat: 1,
|
||||
}, 5.80);
|
||||
|
||||
// === t=6.0s-8.0s: phrase exit per per-word-crossfade.json spec.
|
||||
// Exit: scaled_duration 360ms, scaled_stagger 29ms,
|
||||
// easing cubic-bezier(0.7, 0, 0.84, 0). y_px goes to -6.
|
||||
// Spread the exit across the closing 2 seconds for a calm editorial
|
||||
// outro rather than a sudden cut.
|
||||
tl.to(words, {
|
||||
opacity: 0,
|
||||
y: -6,
|
||||
duration: 0.360,
|
||||
stagger: 0.029,
|
||||
ease: crossfadeExit,
|
||||
}, 6.40);
|
||||
|
||||
// === t=6.5s: secondary mark + hand-label fade with the phrase.
|
||||
tl.to("#secondary-mark", {
|
||||
opacity: 0,
|
||||
duration: 0.7,
|
||||
ease: "expo.inOut",
|
||||
}, 6.50);
|
||||
tl.to("#hand-label", {
|
||||
opacity: 0,
|
||||
y: -4,
|
||||
duration: 0.55,
|
||||
ease: "expo.inOut",
|
||||
}, 6.50);
|
||||
|
||||
// === t=6.5s: eyebrow exits with the phrase, same exit ease feel.
|
||||
tl.to("#eyebrow", {
|
||||
opacity: 0,
|
||||
y: -8,
|
||||
duration: 0.5,
|
||||
ease: "expo.inOut",
|
||||
}, 6.50);
|
||||
|
||||
// === t=7.0s-8.0s: paper grain returns slowly — closing ambient breath.
|
||||
// "none" linear easing — drift moves are ambient, no curve needed.
|
||||
tl.to(".paper-grain", {
|
||||
x: 0,
|
||||
y: 0,
|
||||
opacity: 1,
|
||||
duration: 1.0,
|
||||
ease: "none",
|
||||
}, 7.00);
|
||||
|
||||
window.__timelines["scene-10-per-word-emphasis"] = tl;
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,146 @@
|
||||
# HyperFrames Capability Showcase — Example Library
|
||||
|
||||
**Purpose:** Every HyperFrames technique demonstrated in one place, scene by scene. Read this when planning a video — pick the techniques you'll use, then study their scenes BEFORE writing any composition.
|
||||
|
||||
**Why this library exists:** Across 11 isolated pipeline-evaluation runs, ZERO agents used HyperFrames' powerful capabilities — they all defaulted to screenshot + Ken Burns + voiceover. Skill prose can't fix that. Worked examples can. Every scene in this library is 100% composed from divs/SVG/CSS/GSAP — no captured screenshots, no slideshow tricks.
|
||||
|
||||
---
|
||||
|
||||
## How to use this library
|
||||
|
||||
**When planning a beat:**
|
||||
|
||||
1. Open this file. Find the section that matches the technique you want.
|
||||
2. Open the section's `README.md`. Read 1-line summary of each scene.
|
||||
3. Open at least 2 scene HTML files. Read the full source — markup, GSAP timeline, easings, comments.
|
||||
4. Copy the closest scene into your `compositions/` directory. Rename. Mutate the content. Preserve the timeline structure and event density.
|
||||
|
||||
**When stuck on motion that feels static or boring:**
|
||||
|
||||
- Look at section `12-combined-vignettes/` — these are full multi-technique scenes. The chat scene (`04-composed-ui/scene-02-chat-with-typing.html`) is the gold standard for narration-synced events.
|
||||
- Look at section `13-anti-patterns/` — the bad examples. Make sure your scene doesn't match any of these.
|
||||
|
||||
---
|
||||
|
||||
## The 13 sections
|
||||
|
||||
| # | Section | Theme | Best for beats that need… |
|
||||
|---|---------|-------|---------------------------|
|
||||
| **01** | [`01-typography/`](01-typography/) | Text animations — 24 named effects from soft-blur-in to typewriter to kinetic-center-build | Headline reveals, statement beats, copy that needs personality |
|
||||
| **02** | [`02-markers-and-emphasis/`](02-markers-and-emphasis/) | Hand-drawn marker effects: highlight sweep, circle, burst, scribble, sketchout | Emphasis words, "this matters" moments, editorial annotation |
|
||||
| **03** | [`03-easing-variety/`](03-easing-variety/) | The 7 production easings side-by-side; comparison grid | Tuning motion intent — when `power2.out` everywhere feels wrong |
|
||||
| **04** | [`04-composed-ui/`](04-composed-ui/) | Kanban / chat / terminal / command palette / dashboard / file tree / code editor / calendar — every one built from divs | Showing a product feature without using a screenshot |
|
||||
| **05** | [`05-transitions-shader/`](05-transitions-shader/) | All 14 WebGL shader transitions (chromatic-split, sdf-iris, domain-warp, etc.) | Beat-to-beat transitions with real visual weight |
|
||||
| **06** | [`06-transitions-css/`](06-transitions-css/) | Top 10 CSS transitions: push, scale, blur-dissolve, 3D flip, light-leak wipe, etc. | Lighter transitions when shaders are overkill |
|
||||
| **07** | [`07-html-in-canvas/`](07-html-in-canvas/) | iPhone/MacBook mockups, 3D rotation+bloom, magnetic distortion, portal, shatter, liquid glass, text cursor | Cinematic VFX, device showcases, "wow" moments |
|
||||
| **08** | [`08-svg-and-path/`](08-svg-and-path/) | Logo stroke-draw, icon draw-on, MotionPath, SVG shape morph, particle-field SVG | Logo reveals, illustrative moments, branded entrances |
|
||||
| **09** | [`09-counters-and-data/`](09-counters-and-data/) | Counter 0→1M, sparklines, bar charts, pie/donut, multi-stat dashboards, arc gauges | Numbers, growth claims, dashboards, "stat" beats |
|
||||
| **10** | [`10-particles-and-ambient/`](10-particles-and-ambient/) | Light leak, grain, particle drift, glow pulse, camera shake, lens distortion, parallax fields | Atmosphere, continuous-motion holds, mood setting |
|
||||
| **11** | [`11-3d-and-parallax/`](11-3d-and-parallax/) | CSS 3D flip, perspective tilt, parallax layers, card-stack fan, three.js | Depth, dimensionality, "expensive" feel |
|
||||
| **12** | [`12-combined-vignettes/`](12-combined-vignettes/) | Multi-technique scenes — 3-5 techniques running simultaneously. **The real beat demos.** | When you want a full reference for "what a good beat looks like" |
|
||||
| **13** | [`13-anti-patterns/`](13-anti-patterns/) | Annotated BAD examples — slideshow trap, static-after-entrance, power2-everywhere, screenshot-Ken-Burns | Knowing what to avoid |
|
||||
|
||||
---
|
||||
|
||||
## Lookup by technique
|
||||
|
||||
Need a specific technique? Use this table to find the canonical scene.
|
||||
|
||||
| Technique | Canonical scene |
|
||||
|---|---|
|
||||
| Headline blur entrance | `01-typography/scene-01-soft-blur-in.html` |
|
||||
| Terminal-style typewriter | `01-typography/scene-02-typewriter-mechanical.html` |
|
||||
| Per-word kinetic build | `01-typography/scene-03-kinetic-center-build.html` |
|
||||
| Highlight bar sweep | `02-markers-and-emphasis/scene-01-highlight-sweep.html` |
|
||||
| Hand-drawn circle around word | `02-markers-and-emphasis/scene-02-hand-drawn-circle.html` |
|
||||
| 7-easing side-by-side comparison | `03-easing-variety/scene-08-all-easings-grid.html` |
|
||||
| Animated kanban with drag | `04-composed-ui/scene-01-kanban-board.html` |
|
||||
| Chat with typing dots + reaction | `04-composed-ui/scene-02-chat-with-typing.html` |
|
||||
| Terminal with type-on text | `04-composed-ui/scene-03-terminal-typeon.html` |
|
||||
| Command palette filtering | `04-composed-ui/scene-04-command-palette.html` |
|
||||
| Dashboard with counters + sparklines | `04-composed-ui/scene-05-dashboard-counters.html` |
|
||||
| WebGL shader transition between beats | `05-transitions-shader/scene-NN-<name>.html` (14 options) |
|
||||
| CSS push/scale/blur transitions | `06-transitions-css/scene-NN-<name>.html` (10 options) |
|
||||
| iPhone mockup with live screen | `07-html-in-canvas/scene-01-iphone-mockup.html` |
|
||||
| MacBook mockup with live screen | `07-html-in-canvas/scene-02-macbook-mockup.html` |
|
||||
| 3D rotation + bloom VFX | `07-html-in-canvas/scene-03-3d-rotation-bloom.html` |
|
||||
| Logo stroke-draw entrance | `08-svg-and-path/scene-01-logo-stroke-draw.html` |
|
||||
| MotionPath orbit/follow | `08-svg-and-path/scene-03-motion-path.html` |
|
||||
| Counter 0→1M with comma format | `09-counters-and-data/scene-01-counter-to-million.html` |
|
||||
| Sparkline draw-on | `09-counters-and-data/scene-02-sparkline-draw.html` |
|
||||
| Light leak overlay | `10-particles-and-ambient/scene-01-light-leak.html` |
|
||||
| Ambient particle drift | `10-particles-and-ambient/scene-03-particle-drift.html` |
|
||||
| Camera shake on impact | `10-particles-and-ambient/scene-05-camera-shake.html` |
|
||||
| CSS 3D flip card | `11-3d-and-parallax/scene-01-3d-flip-card.html` |
|
||||
| Parallax depth layers | `11-3d-and-parallax/scene-03-parallax-layers.html` |
|
||||
| Three.js rotating geometry | `11-3d-and-parallax/scene-05-three-js-geometry.html` |
|
||||
|
||||
---
|
||||
|
||||
## Shared assets
|
||||
|
||||
- [`_shared/hyper-shader-local.js`](_shared/hyper-shader-local.js) — local shader build (copied from `packages/shader-transitions/dist/index.global.js`). Scenes in `05-transitions-shader/` and `12-combined-vignettes/` import this.
|
||||
- [`_shared/shared-styles.css`](_shared/shared-styles.css) — design tokens (color palette, type scale, spacing). Every scene `<link>`s this so the catalog feels cohesive.
|
||||
- [`_shared/easing-glossary.md`](_shared/easing-glossary.md) — the 7 production easings and when to use each. Single source of truth.
|
||||
|
||||
## Stitched reels
|
||||
|
||||
The `_stitched/` directory contains 2-3 long videos that play many scenes in sequence — useful for visual-gestalt review:
|
||||
|
||||
- [`_stitched/grand-tour.html`](_stitched/grand-tour.html) — every section, end to end (~15-25 min rendered)
|
||||
- [`_stitched/motion-and-text.html`](_stitched/motion-and-text.html) — sections 1-3 + 12 highlights (kinetic typography reel)
|
||||
- [`_stitched/ui-and-effects.html`](_stitched/ui-and-effects.html) — sections 4-7 + 10-11 highlights (composed UI + VFX reel)
|
||||
|
||||
Rendered MP4s live in `_stitched/renders/` and are mirrored on HeyGen Verse for browser viewing.
|
||||
|
||||
---
|
||||
|
||||
## Authoring conventions (read before adding a scene)
|
||||
|
||||
Every scene in this library follows these rules. They exist so agents reading the library see consistent patterns, not random codebases.
|
||||
|
||||
1. **Single HTML file**, structure exactly:
|
||||
```html
|
||||
<template>
|
||||
<style>/* scoped to this scene */</style>
|
||||
<link rel="stylesheet" href="../_shared/shared-styles.css">
|
||||
<div id="<scene-id>"
|
||||
data-composition-id="<scene-id>"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
class="scene"
|
||||
style="background: var(--bg-deep);">
|
||||
<!-- scene markup -->
|
||||
<div class="scene-label">
|
||||
Section <NN> · <Scene name> · <Technique>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
(function () {
|
||||
var BEAT = <duration-in-seconds>;
|
||||
window.__timelines = window.__timelines || {};
|
||||
var tl = gsap.timeline({ paused: true });
|
||||
// ... build timeline
|
||||
window.__timelines["<scene-id>"] = tl;
|
||||
})();
|
||||
</script>
|
||||
</template>
|
||||
```
|
||||
|
||||
2. **`data-composition-id` matches the filename** (without `.html`). e.g. file `scene-01-soft-blur-in.html` → id `scene-01-soft-blur-in`.
|
||||
|
||||
3. **`.scene-label`** at bottom-left of every scene shows what technique is being demonstrated. Lets viewers of the stitched reel know what they're looking at without playing detective.
|
||||
|
||||
4. **`tl.fromTo()` not `tl.from()`** for entrances. Avoids the "CSS opacity:0 + gsap.from(opacity:0)" 0→0 trap.
|
||||
|
||||
5. **Continuous motion** — no element stays unchanged for more than ~1.5s. If a beat is 8s, schedule 5-8 events spread across the duration, not 5 events crammed into the first second.
|
||||
|
||||
6. **Easing variety** — minimum 3 different easings per scene. See `_shared/easing-glossary.md`.
|
||||
|
||||
7. **Determinism** — no `Math.random()`, `Date.now()`, `requestAnimationFrame`, or `repeat: -1`. Seed any "random" particles via a fixed array of values.
|
||||
|
||||
8. **Lint clean** — every scene must pass `npx hyperframes lint .` with 0 errors before being committed.
|
||||
|
||||
9. **Snapshot verified** — every scene's 5-frame snapshot must show CHANGE between frames (not entrance + 4 identical hold frames).
|
||||
|
||||
10. **Comments** — one comment per timeline section explaining WHY that timing was picked. Not WHAT it does (the code shows that). e.g. `// 1.2s: settle with elastic — gives the counter time to "land" before the next stat enters`.
|
||||
@@ -0,0 +1,46 @@
|
||||
# Easing — single source of truth
|
||||
|
||||
Every scene in this library uses easings from this glossary. Do not import others without adding them here first. Default to `power2.out` only when nothing else fits — it's the boring choice.
|
||||
|
||||
## The 7 production easings
|
||||
|
||||
| GSAP ease | Use for | Feel |
|
||||
|---|---|---|
|
||||
| `power4.out` | Hero text landings, UI snaps, decisive moments | Sharp deceleration, "iOS / Apple" feel |
|
||||
| `back.out(1.7)` | Numbers, badges, impact entrances, "whip" moments | Brief overshoot — eye catches motion |
|
||||
| `expo.out` | Soft per-word reveals, gentle entrances, parallax landings | Smooth-tail deceleration, premium |
|
||||
| `power1.out` | Terminal text, code typing, mechanical UI | Linear-ish, no flourish, machine-like |
|
||||
| `elastic.out(1, 0.5)` | Counters settling, CTA reveals, "ta-da" beats | Spring bounce — playful, attention-getting |
|
||||
| `expo.inOut` | Full-screen statements, hero reveals, scene-defining moments | Slow start, fast middle, slow end — dramatic |
|
||||
| `"none"` | Parallax drift, ambient camera moves, Ken Burns | No curve — pure linear, for ambient/idle motion |
|
||||
|
||||
## Stagger guidance
|
||||
|
||||
| Use | Stagger |
|
||||
|---|---|
|
||||
| Per-character text effects | `0.018s` to `0.033s` (typewriter is at the high end, soft-blur-in at the low end) |
|
||||
| Per-word text effects | `0.05s` to `0.10s` |
|
||||
| Per-line | `0.08s` to `0.15s` |
|
||||
| UI grid (cards, list items) | `0.08s` to `0.12s` with `power4.out` |
|
||||
| Rapid-fire categories (billboard pattern) | `0.04s` to `0.06s` with hard `set` (no transition) |
|
||||
|
||||
## Combination rules
|
||||
|
||||
1. **Use a different easing for different elements in the same beat.** Headline can be `expo.out` while the badge uses `back.out(1.7)` and the underline uses `power4.out`. Variety = polish.
|
||||
|
||||
2. **Never put two transform tweens on the same element at the same time.** Combine into one `fromTo()` with multiple properties or split parent + child.
|
||||
|
||||
3. **`overwrite: "auto"`** when chaining tweens on the same element — prevents stuck transforms.
|
||||
|
||||
4. **Easing matches intent, not aesthetic.** A "snap" feel = `power4.out` regardless of how the rest of the scene looks. A "settle" feel = `elastic.out` regardless of brand.
|
||||
|
||||
## What NOT to do
|
||||
|
||||
- `power2.out` on every tween in a scene → boring, lazy. Use at most for 1-2 of the lower-priority tweens.
|
||||
- `back.out(2.5)` or higher overshoot → cartoonish, breaks premium feel. Cap at `back.out(1.7)`.
|
||||
- `elastic.out(1, 0.1)` → too much bounce, looks broken. Use `elastic.out(1, 0.5)` minimum.
|
||||
- Long durations (>1s) with `power1.out` → mechanical eases feel weird at long durations. Use `expo.out` or `expo.inOut` for >1s.
|
||||
|
||||
## Scene-level pacing
|
||||
|
||||
A scene's TOTAL easing variety should span at least 3 of the 7 easings above. If you find yourself with `expo.out` on everything, look for the 1-2 elements that deserve a different feel and change them. The viewer's eye catches CONTRAST in motion — sameness reads as static even when things are moving.
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,102 @@
|
||||
/*
|
||||
* Shared design tokens for the examples library.
|
||||
* Every scene that imports this gets the same type scale + neutral palette,
|
||||
* so the catalog feels cohesive even though brands change.
|
||||
*
|
||||
* Import with:
|
||||
* <link rel="stylesheet" href="../_shared/shared-styles.css">
|
||||
*/
|
||||
|
||||
:root {
|
||||
/* Neutral catalog palette — chosen so scenes look professional but not branded */
|
||||
--bg-deep: #0a0a0a;
|
||||
--bg-charcoal: #141414;
|
||||
--bg-elevated: #1c1c1c;
|
||||
--bg-card: #232323;
|
||||
--fg-primary: #f5f5f5;
|
||||
--fg-muted: #a3a3a3;
|
||||
--fg-subtle: #707070;
|
||||
--line: rgba(255, 255, 255, 0.08);
|
||||
--line-strong: rgba(255, 255, 255, 0.18);
|
||||
|
||||
/* Accent rotation — pick ONE per scene, not all */
|
||||
--accent-cyan: #06b6d4;
|
||||
--accent-violet: #8b5cf6;
|
||||
--accent-amber: #f59e0b;
|
||||
--accent-rose: #f43f5e;
|
||||
--accent-emerald: #10b981;
|
||||
--accent-yellow: #fde047;
|
||||
|
||||
/* Type scale (1.25 ratio, base 16px @ 1920×1080) */
|
||||
--t-1: 14px;
|
||||
--t-2: 18px;
|
||||
--t-3: 24px;
|
||||
--t-4: 32px;
|
||||
--t-5: 48px;
|
||||
--t-6: 72px;
|
||||
--t-7: 108px;
|
||||
--t-8: 160px;
|
||||
|
||||
/* Spacing scale */
|
||||
--s-1: 4px;
|
||||
--s-2: 8px;
|
||||
--s-3: 16px;
|
||||
--s-4: 24px;
|
||||
--s-5: 32px;
|
||||
--s-6: 48px;
|
||||
--s-7: 64px;
|
||||
--s-8: 96px;
|
||||
|
||||
/* Radii */
|
||||
--r-1: 4px;
|
||||
--r-2: 8px;
|
||||
--r-3: 12px;
|
||||
--r-4: 16px;
|
||||
--r-5: 24px;
|
||||
--r-pill: 9999px;
|
||||
}
|
||||
|
||||
/* Common scene resets — every scene root applies these */
|
||||
.scene {
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background: var(--bg-deep);
|
||||
color: var(--fg-primary);
|
||||
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
||||
font-feature-settings: "ss01", "cv11";
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
/* Universal will-change opt-in for animated children */
|
||||
.scene * {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* Centered stage helper */
|
||||
.stage-center {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
/* Caption strip for technique label (shown at bottom-left of every scene) */
|
||||
.scene-label {
|
||||
position: absolute;
|
||||
left: 48px;
|
||||
bottom: 48px;
|
||||
font-size: var(--t-2);
|
||||
color: var(--fg-subtle);
|
||||
letter-spacing: 0.04em;
|
||||
text-transform: uppercase;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.scene-label .accent {
|
||||
color: var(--fg-primary);
|
||||
font-weight: 600;
|
||||
}
|
||||
Reference in New Issue
Block a user