|
27 | 27 | --rmx-button-surface-secondary: #ebeff2; |
28 | 28 | --rmx-button-label-secondary: #25292d; |
29 | 29 |
|
30 | | - /* Shadow recipes (from Figma) */ |
31 | 30 | --rmx-shadow-low: |
32 | 31 | 0 1px 1px 1px #00274f59, 0 2px 3px 0 #0138701a, 0 4px 4px 0 #0138700d; |
33 | 32 | --rmx-shadow-mid: |
34 | 33 | 0 2px 4px 0 #011d3940, 0 8px 12px 0 #01387014, 0 12px 16px 0 #0138700a, |
35 | 34 | 0 16px 20px 0 #0138700a, 0 20px 24px 0 #01387005; |
36 | 35 |
|
| 36 | + --rmx-intro-black-hold: 150ms; |
| 37 | + --rmx-intro-black-fade: 400ms; |
| 38 | + |
| 39 | + --rmx-intro-logo-delay: calc( |
| 40 | + var(--rmx-intro-black-hold) + var(--rmx-intro-black-fade) |
| 41 | + ); |
| 42 | + --rmx-intro-logo-duration: 1500ms; |
| 43 | + --rmx-intro-logo-easing: cubic-bezier(0.85, 0, 0.15, 1); |
| 44 | + --rmx-intro-logo-start: calc( |
| 45 | + var(--rmx-intro-black-hold) + var(--rmx-intro-logo-delay) |
| 46 | + ); |
| 47 | + |
| 48 | + --rmx-intro-r-fade-duration: 600ms; |
| 49 | + |
| 50 | + --rmx-hero-fade-delay: calc( |
| 51 | + var(--rmx-intro-logo-start) + (var(--rmx-intro-logo-duration) / 2) |
| 52 | + ); |
| 53 | + --rmx-hero-fade-duration: 750ms; |
| 54 | + |
37 | 55 | &:where(.dark) { |
38 | 56 | --rmx-text-primary: #e5e7eb; |
39 | 57 | --rmx-text-muted: #9aa0a6; |
|
227 | 245 | background: var(--rmx-surface-3); |
228 | 246 | } |
229 | 247 |
|
230 | | -.rmx-intro-mask-overlay { |
231 | | - /* How long the screen stays black before fading */ |
232 | | - --intro-black-hold: 150ms; |
233 | | - /* How long the black fade-out takes */ |
234 | | - --intro-black-fade: 400ms; |
235 | | - /* Delay after black fade before logo starts animating */ |
236 | | - --intro-logo-delay: calc(var(--intro-black-hold) + var(--intro-black-fade)); |
237 | | - /* How long the logo scale/reveal animation takes */ |
238 | | - --intro-logo-duration: 1500ms; |
239 | | - /* Easing for the logo animation */ |
240 | | - --intro-logo-easing: cubic-bezier(0.85, 0, 0.15, 1); |
241 | | - |
242 | | - /* Computed: total delay before logo animation starts */ |
243 | | - --intro-logo-start: calc(var(--intro-black-hold) + var(--intro-logo-delay)); |
| 248 | +/* ======================================== |
| 249 | + * Intro & Hero Animations |
| 250 | + * ======================================== |
| 251 | + * |
| 252 | + * Animation sequence: |
| 253 | + * 1. Black screen holds, then fades out |
| 254 | + * 2. Logo scales up and reveals content behind |
| 255 | + * 3. R fill fades out (so users can see the R shape first) |
| 256 | + * 4. Hero text content fades in |
| 257 | + * |
| 258 | + * ======================================== */ |
244 | 259 |
|
245 | | - position: fixed; |
246 | | - inset: 0; |
247 | | - z-index: 9999; |
248 | | - overflow: hidden; |
249 | | - pointer-events: none; |
250 | | - |
251 | | - animation: rmx-intro-reveal var(--intro-logo-duration) |
252 | | - var(--intro-logo-easing) var(--intro-logo-start) forwards; |
253 | | -} |
| 260 | +/* --- Keyframes --- */ |
254 | 261 |
|
255 | | -/* Black cover that fades out before the logo animation starts */ |
256 | | -.rmx-intro-mask-overlay::before { |
257 | | - content: ""; |
258 | | - position: absolute; |
259 | | - inset: 0; |
260 | | - background: black; |
261 | | - z-index: 1; |
262 | | - animation: rmx-intro-black-fade var(--intro-black-fade) ease-out |
263 | | - var(--intro-black-hold) forwards; |
| 262 | +@keyframes rmx-fade-in { |
| 263 | + from { |
| 264 | + opacity: 0; |
| 265 | + } |
| 266 | + to { |
| 267 | + opacity: 1; |
| 268 | + } |
264 | 269 | } |
265 | 270 |
|
266 | | -@keyframes rmx-intro-black-fade { |
267 | | - 0% { |
| 271 | +@keyframes rmx-fade-out { |
| 272 | + from { |
268 | 273 | opacity: 1; |
269 | 274 | } |
270 | | - 100% { |
| 275 | + to { |
271 | 276 | opacity: 0; |
272 | 277 | } |
273 | 278 | } |
274 | 279 |
|
275 | | -.rmx-intro-mask-svg { |
276 | | - position: absolute; |
277 | | - width: 100%; |
278 | | - height: 100%; |
279 | | - transform-origin: center center; |
280 | | - |
281 | | - animation: rmx-intro-scale var(--intro-logo-duration) var(--intro-logo-easing) |
282 | | - var(--intro-logo-start) forwards; |
283 | | -} |
284 | | - |
285 | 280 | @keyframes rmx-intro-scale { |
286 | | - 0% { |
| 281 | + from { |
287 | 282 | transform: translate(0, 0) scale(1); |
288 | 283 | } |
289 | | - 100% { |
| 284 | + to { |
290 | 285 | transform: translate(-55%, 100%) scale(80); |
291 | 286 | } |
292 | 287 | } |
|
306 | 301 | } |
307 | 302 | } |
308 | 303 |
|
| 304 | +.rmx-intro-mask-overlay { |
| 305 | + position: fixed; |
| 306 | + inset: 0; |
| 307 | + z-index: 9999; |
| 308 | + overflow: hidden; |
| 309 | + pointer-events: none; |
| 310 | + animation: rmx-intro-reveal var(--rmx-intro-logo-duration) |
| 311 | + var(--rmx-intro-logo-easing) var(--rmx-intro-logo-start) forwards; |
| 312 | +} |
| 313 | + |
| 314 | +.rmx-intro-mask-overlay::before { |
| 315 | + content: ""; |
| 316 | + position: absolute; |
| 317 | + inset: 0; |
| 318 | + background: black; |
| 319 | + z-index: 1; |
| 320 | + animation: rmx-fade-out var(--rmx-intro-black-fade) ease-out |
| 321 | + var(--rmx-intro-black-hold) forwards; |
| 322 | +} |
| 323 | + |
| 324 | +/* SVG that scales up to reveal content */ |
| 325 | +.rmx-intro-mask-svg { |
| 326 | + position: absolute; |
| 327 | + width: 100%; |
| 328 | + height: 100%; |
| 329 | + transform-origin: center center; |
| 330 | + animation: rmx-intro-scale var(--rmx-intro-logo-duration) |
| 331 | + var(--rmx-intro-logo-easing) var(--rmx-intro-logo-start) forwards; |
| 332 | +} |
| 333 | + |
| 334 | +/* Solid fill behind the R that fades out so users can see the R shape first */ |
| 335 | +.rmx-intro-r-fill { |
| 336 | + animation: rmx-fade-out var(--rmx-intro-r-fade-duration) ease-out |
| 337 | + var(--rmx-intro-logo-start) forwards; |
| 338 | +} |
| 339 | + |
| 340 | +.rmx-hero { |
| 341 | + opacity: 0; |
| 342 | + animation: rmx-fade-in var(--rmx-hero-fade-duration) ease-out |
| 343 | + var(--rmx-hero-fade-delay) forwards; |
| 344 | +} |
| 345 | + |
309 | 346 | @media (prefers-reduced-motion: reduce) { |
310 | | - .rmx-intro-mask-overlay { |
| 347 | + .rmx-intro-mask-overlay, |
| 348 | + .rmx-intro-mask-overlay::before, |
| 349 | + .rmx-intro-mask-svg, |
| 350 | + .rmx-intro-r-fill { |
311 | 351 | animation: none; |
| 352 | + } |
| 353 | + |
| 354 | + .rmx-intro-mask-overlay { |
312 | 355 | visibility: hidden; |
313 | 356 | opacity: 0; |
314 | 357 | } |
315 | 358 |
|
316 | 359 | .rmx-intro-mask-overlay::before { |
317 | | - animation: none; |
318 | 360 | opacity: 0; |
319 | 361 | } |
320 | 362 |
|
321 | | - .rmx-intro-mask-svg { |
| 363 | + .rmx-intro-r-fill { |
| 364 | + opacity: 0; |
| 365 | + } |
| 366 | + |
| 367 | + .rmx-hero { |
322 | 368 | animation: none; |
| 369 | + opacity: 1; |
323 | 370 | } |
324 | 371 | } |
0 commit comments