|
| 1 | +<!doctype html> |
| 2 | +<html lang="en"> |
| 3 | +<head> |
| 4 | + <meta charset="UTF-8" /> |
| 5 | + <title>scene-01-soft-blur-in</title> |
| 6 | + <link rel="preconnect" href="https://fonts.googleapis.com" /> |
| 7 | + <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> |
| 8 | + <link |
| 9 | + href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap" |
| 10 | + rel="stylesheet" |
| 11 | + /> |
| 12 | + <script src=" https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js" ></script> |
| 13 | + <script src=" https://cdn.jsdelivr.net/npm/[email protected]/dist/CustomEase.min.js" ></script> |
| 14 | + <style> |
| 15 | + * { margin: 0; padding: 0; box-sizing: border-box; } |
| 16 | + body { background: #0a0a0a; } |
| 17 | + |
| 18 | + #scene-01-soft-blur-in { |
| 19 | + position: relative; |
| 20 | + overflow: hidden; |
| 21 | + background: radial-gradient(ellipse at 50% 45%, #1a1a1a 0%, #0a0a0a 65%); |
| 22 | + font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; |
| 23 | + -webkit-font-smoothing: antialiased; |
| 24 | + color: #f5f5f5; |
| 25 | + } |
| 26 | + |
| 27 | + /* Stage: centered phrase host. perspective_px=900 from soft-blur-in.json. */ |
| 28 | + .stage { |
| 29 | + position: absolute; |
| 30 | + inset: 0; |
| 31 | + display: flex; |
| 32 | + flex-direction: column; |
| 33 | + align-items: center; |
| 34 | + justify-content: center; |
| 35 | + perspective: 900px; |
| 36 | + } |
| 37 | + |
| 38 | + .phrase-row { |
| 39 | + position: relative; |
| 40 | + width: 100%; |
| 41 | + display: flex; |
| 42 | + align-items: center; |
| 43 | + justify-content: center; |
| 44 | + transform-style: preserve-3d; |
| 45 | + min-height: 160px; |
| 46 | + } |
| 47 | + |
| 48 | + .phrase { |
| 49 | + position: absolute; |
| 50 | + display: inline-block; |
| 51 | + transform-style: preserve-3d; |
| 52 | + font-size: 144px; |
| 53 | + font-weight: 700; |
| 54 | + letter-spacing: -0.02em; |
| 55 | + line-height: 1.05; |
| 56 | + white-space: nowrap; |
| 57 | + } |
| 58 | + |
| 59 | + /* Per-character unit — see showcase.stage.unit in soft-blur-in.json. |
| 60 | + Initial opacity:0 locks the pre-entrance state in CSS so the snapshot |
| 61 | + tool's first-frame capture (before the GSAP timeline has time to apply |
| 62 | + its t=0 set tweens) shows the correct blank state. */ |
| 63 | + .char { |
| 64 | + display: inline-block; |
| 65 | + white-space: pre; |
| 66 | + backface-visibility: hidden; |
| 67 | + transform-origin: 50% 55%; |
| 68 | + will-change: transform, opacity, filter; |
| 69 | + opacity: 0; |
| 70 | + filter: blur(12px); |
| 71 | + transform: translateY(24px); |
| 72 | + } |
| 73 | + |
| 74 | + /* Same lock for eyebrow and underline initial states */ |
| 75 | + .eyebrow { opacity: 0; } |
| 76 | + .underline path { stroke-dasharray: 240 240; stroke-dashoffset: 240; } |
| 77 | + |
| 78 | + .eyebrow { |
| 79 | + position: absolute; |
| 80 | + top: calc(50% - 130px); |
| 81 | + left: 50%; |
| 82 | + transform: translateX(-50%); |
| 83 | + font-size: 18px; |
| 84 | + font-weight: 500; |
| 85 | + letter-spacing: 0.32em; |
| 86 | + text-transform: uppercase; |
| 87 | + color: #707070; |
| 88 | + } |
| 89 | + |
| 90 | + .underline { |
| 91 | + position: absolute; |
| 92 | + top: calc(50% + 110px); |
| 93 | + left: 50%; |
| 94 | + width: 240px; |
| 95 | + height: 2px; |
| 96 | + transform: translateX(-50%); |
| 97 | + } |
| 98 | + .underline path { |
| 99 | + stroke: #f5f5f5; |
| 100 | + stroke-width: 2; |
| 101 | + fill: none; |
| 102 | + } |
| 103 | + |
| 104 | + .grain { |
| 105 | + position: absolute; |
| 106 | + inset: -50px; |
| 107 | + background: radial-gradient(circle at 20% 30%, rgba(255,255,255,0.04) 0%, transparent 40%), |
| 108 | + radial-gradient(circle at 80% 70%, rgba(255,255,255,0.03) 0%, transparent 35%); |
| 109 | + pointer-events: none; |
| 110 | + will-change: transform, opacity; |
| 111 | + } |
| 112 | + |
| 113 | + .label { |
| 114 | + position: absolute; |
| 115 | + left: 48px; |
| 116 | + bottom: 48px; |
| 117 | + font-size: 16px; |
| 118 | + color: #707070; |
| 119 | + letter-spacing: 0.08em; |
| 120 | + text-transform: uppercase; |
| 121 | + font-weight: 500; |
| 122 | + z-index: 10; |
| 123 | + } |
| 124 | + .label .accent { color: #f5f5f5; font-weight: 600; } |
| 125 | + </style> |
| 126 | +</head> |
| 127 | +<body> |
| 128 | + |
| 129 | + <div id="scene-01-soft-blur-in" |
| 130 | + data-composition-id="scene-01-soft-blur-in" |
| 131 | + data-start="0" |
| 132 | + data-duration="8" |
| 133 | + data-width="1920" |
| 134 | + data-height="1080" |
| 135 | + style="width:1920px; height:1080px;"> |
| 136 | + |
| 137 | + <div class="grain"></div> |
| 138 | + |
| 139 | + <div class="stage"> |
| 140 | + <div class="eyebrow" id="eyebrow">Section 01 · Typography</div> |
| 141 | + <div class="phrase-row"> |
| 142 | + <div class="phrase" data-phrase="0">Think different.</div> |
| 143 | + <div class="phrase" data-phrase="1">Built to flow.</div> |
| 144 | + <div class="phrase" data-phrase="2">Motion with intent.</div> |
| 145 | + </div> |
| 146 | + <svg class="underline" viewBox="0 0 240 2"> |
| 147 | + <path id="underline-path" d="M 0 1 L 240 1" /> |
| 148 | + </svg> |
| 149 | + </div> |
| 150 | + |
| 151 | + <div class="label"> |
| 152 | + Scene 01 · <span class="accent">Soft Blur In</span> · per-character keynote reveal |
| 153 | + </div> |
| 154 | + </div> |
| 155 | + |
| 156 | + <script> |
| 157 | + (function () { |
| 158 | + var BEAT = 8; |
| 159 | + window.__timelines = window.__timelines || {}; |
| 160 | + |
| 161 | + gsap.registerPlugin(CustomEase); |
| 162 | + |
| 163 | + // soft-blur-in signature easing — Apple keynote curve. |
| 164 | + var softEase = CustomEase.create("soft", "0.22, 1, 0.36, 1"); |
| 165 | + // Exit easing — accelerated, from soft-blur-in.json portable_spec.exit.easing. |
| 166 | + var exitEase = CustomEase.create("softExit", "0.64, 0, 0.78, 0"); |
| 167 | + |
| 168 | + // Split each phrase into per-character spans at build time. All three |
| 169 | + // phrases live in the DOM simultaneously (stacked, position:absolute) |
| 170 | + // and we toggle visibility through opacity timeline. This makes the |
| 171 | + // composition seekable — snapshot tool jumps to any timestamp and |
| 172 | + // the DOM is already populated, no callback-driven mutation required. |
| 173 | + function splitPhrase(phraseEl) { |
| 174 | + var text = phraseEl.textContent; |
| 175 | + var spans = []; |
| 176 | + var frag = document.createDocumentFragment(); |
| 177 | + Array.from(text).forEach(function (ch) { |
| 178 | + var span = document.createElement("span"); |
| 179 | + span.className = "char"; |
| 180 | + span.textContent = ch === " " ? " " : ch; |
| 181 | + frag.appendChild(span); |
| 182 | + spans.push(span); |
| 183 | + }); |
| 184 | + phraseEl.replaceChildren(frag); |
| 185 | + return spans; |
| 186 | + } |
| 187 | + |
| 188 | + var phraseEls = document.querySelectorAll("#scene-01-soft-blur-in .phrase"); |
| 189 | + var charsByPhrase = []; |
| 190 | + phraseEls.forEach(function (el) { |
| 191 | + charsByPhrase.push(splitPhrase(el)); |
| 192 | + }); |
| 193 | + |
| 194 | + var Y_FROM = 24; // scaled from spec y_px=16 for 1080p host |
| 195 | + var BLUR_FROM = 12; // spec blur_px |
| 196 | + |
| 197 | + var tl = gsap.timeline({ paused: true }); |
| 198 | + |
| 199 | + // === t=0 initial state — ALL phrases hidden + pre-positioned, eyebrow hidden, underline empty. |
| 200 | + tl.set(charsByPhrase[0], { opacity: 0, y: Y_FROM, filter: "blur(" + BLUR_FROM + "px)" }, 0); |
| 201 | + tl.set(charsByPhrase[1], { opacity: 0, y: Y_FROM, filter: "blur(" + BLUR_FROM + "px)" }, 0); |
| 202 | + tl.set(charsByPhrase[2], { opacity: 0, y: Y_FROM, filter: "blur(" + BLUR_FROM + "px)" }, 0); |
| 203 | + tl.set("#eyebrow", { opacity: 0, y: -8 }, 0); |
| 204 | + tl.set("#underline-path", { strokeDasharray: "240 240", strokeDashoffset: 240 }, 0); |
| 205 | + |
| 206 | + // === t=0.3s: eyebrow slides in. Supporting move, layered with main entrance. |
| 207 | + tl.fromTo("#eyebrow", |
| 208 | + { opacity: 0, y: -8 }, |
| 209 | + { opacity: 1, y: 0, duration: 0.6, ease: "expo.out" }, |
| 210 | + 0.30); |
| 211 | + |
| 212 | + // === t=0.5s: phrase 1 enters per-character. |
| 213 | + // soft-blur-in spec: scaled_duration 648ms, scaled_stagger 18ms, signature easing. |
| 214 | + tl.to(charsByPhrase[0], { |
| 215 | + opacity: 1, |
| 216 | + y: 0, |
| 217 | + filter: "blur(0px)", |
| 218 | + duration: 0.648, |
| 219 | + stagger: 0.018, |
| 220 | + ease: softEase, |
| 221 | + }, 0.50); |
| 222 | + |
| 223 | + // === t=1.4s: underline draws under phrase. Variety in easing — power4.out for the line snap. |
| 224 | + tl.to("#underline-path", { |
| 225 | + strokeDashoffset: 0, |
| 226 | + duration: 0.7, |
| 227 | + ease: "power4.out", |
| 228 | + }, 1.40); |
| 229 | + |
| 230 | + // === Continuous motion 1.4s-3.0s: grain ambient drift. Keeps the frame alive |
| 231 | + // while the phrase is static — no element sits unchanged for more than ~1.5s. |
| 232 | + tl.to(".grain", { |
| 233 | + x: -30, |
| 234 | + y: -10, |
| 235 | + opacity: 0.7, |
| 236 | + duration: 1.6, |
| 237 | + ease: "sine.inOut", |
| 238 | + }, 1.40); |
| 239 | + |
| 240 | + // === t=3.0s: phrase 1 exits. |
| 241 | + // exit duration scaled to 432ms, stagger 11ms, exit easing curve from spec. |
| 242 | + tl.to(charsByPhrase[0], { |
| 243 | + opacity: 0, |
| 244 | + y: -Y_FROM, |
| 245 | + filter: "blur(" + BLUR_FROM + "px)", |
| 246 | + duration: 0.432, |
| 247 | + stagger: 0.011, |
| 248 | + ease: exitEase, |
| 249 | + }, 3.00); |
| 250 | + |
| 251 | + // === t=3.5s: phrase 2 enters (300ms overlap with phrase 1's exit per spec.swap.overlap_ms=300). |
| 252 | + tl.to(charsByPhrase[1], { |
| 253 | + opacity: 1, |
| 254 | + y: 0, |
| 255 | + filter: "blur(0px)", |
| 256 | + duration: 0.648, |
| 257 | + stagger: 0.018, |
| 258 | + ease: softEase, |
| 259 | + }, 3.50); |
| 260 | + |
| 261 | + // === Continuous motion 4.5s-5.4s: underline scale pulse. |
| 262 | + tl.to(".underline", { |
| 263 | + scale: 1.08, |
| 264 | + duration: 0.45, |
| 265 | + ease: "sine.inOut", |
| 266 | + yoyo: true, |
| 267 | + repeat: 1, |
| 268 | + transformOrigin: "50% 50%", |
| 269 | + }, 4.50); |
| 270 | + |
| 271 | + // === t=5.4s: phrase 2 exits. |
| 272 | + tl.to(charsByPhrase[1], { |
| 273 | + opacity: 0, |
| 274 | + y: -Y_FROM, |
| 275 | + filter: "blur(" + BLUR_FROM + "px)", |
| 276 | + duration: 0.432, |
| 277 | + stagger: 0.011, |
| 278 | + ease: exitEase, |
| 279 | + }, 5.40); |
| 280 | + |
| 281 | + // === t=5.9s: phrase 3 enters. Held until end of beat. |
| 282 | + tl.to(charsByPhrase[2], { |
| 283 | + opacity: 1, |
| 284 | + y: 0, |
| 285 | + filter: "blur(0px)", |
| 286 | + duration: 0.648, |
| 287 | + stagger: 0.018, |
| 288 | + ease: softEase, |
| 289 | + }, 5.90); |
| 290 | + |
| 291 | + // === Continuous motion 6.7s-8.0s: subtle breathing on the final phrase + grain return. |
| 292 | + tl.to(charsByPhrase[2], { |
| 293 | + y: -4, |
| 294 | + duration: 1.3, |
| 295 | + ease: "sine.inOut", |
| 296 | + stagger: 0.005, |
| 297 | + }, 6.70); |
| 298 | + tl.to(".grain", { |
| 299 | + x: 0, |
| 300 | + y: 0, |
| 301 | + opacity: 1, |
| 302 | + duration: 1.3, |
| 303 | + ease: "sine.inOut", |
| 304 | + }, 6.70); |
| 305 | + |
| 306 | + window.__timelines["scene-01-soft-blur-in"] = tl; |
| 307 | + })(); |
| 308 | + </script> |
| 309 | +</body> |
| 310 | +</html> |
0 commit comments