mirror of
https://github.com/hanzoai/site.git
synced 2026-11-20 21:14:28 +00:00
- land: the stage's title (the card's own words) flies onto the destination <main> h1 (PLAN 2.3: title lands on the h1); the stage holds until the page's headline is really visible (pages cut their h1 in with a line mask), at most 1.6 s, so there is no blank frame - stage: the card's colour now reads gradients, and falls back to its text colour (light text = dark card) instead of the page behind, so a dark card never flashes white; the picture may be the data-morph element itself; the title is looked for in the whole link - open: the card's own snapshot fades in 0.22 s, so its text is never seen magnified - Hanzo's footer 'Privacy choices' icon drawn in ink instead of #0072CE (0 UI hues) Verified at 1470x801 and 375x812 on /customers, /blog, /solutions: open ~0.7 s, land ~0.7-0.9 s, no skip, stage removed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01DqUybA3gCfaruBE8tifYd5
25 lines
2.6 KiB
CSS
25 lines
2.6 KiB
CSS
/* Morph navigation (components/Morph.jsx). Hanzo's header never moves.
|
|
open: the card grows into a full-screen stage (600 ms). land: the stage settles into the new page's hero (600 ms).
|
|
leave / arrive: a small link dims the page at once and fades the next one in (opacity only, so pinned and fixed
|
|
parts of a page never jump). */
|
|
header._z-z-header { view-transition-name: hz-header; }
|
|
::view-transition-group(hz-header) { animation: none; z-index: 3; }
|
|
html[data-morph=open]::view-transition-old(root), html[data-morph=open]::view-transition-new(root),
|
|
html[data-morph=land]::view-transition-old(root), html[data-morph=land]::view-transition-new(root) { animation: none; }
|
|
::view-transition-group(hz-morph) { animation-duration: .6s; animation-timing-function: cubic-bezier(.16, 1, .3, 1); z-index: 2; }
|
|
::view-transition-old(hz-morph), ::view-transition-new(hz-morph) { height: 100%; width: 100%; object-fit: cover; overflow: clip; } /* the browser's own crossfade (plus-lighter): no dip between the two */
|
|
::view-transition-group(hz-title) { animation-duration: .6s; animation-timing-function: cubic-bezier(.16, 1, .3, 1); z-index: 3; }
|
|
::view-transition-old(hz-title), ::view-transition-new(hz-title) { height: 100%; width: auto; object-fit: none; object-position: left top; }
|
|
html[data-morph=open]::view-transition-old(hz-morph) { animation: hz-fade-out .22s cubic-bezier(.22, 1, .36, 1) both; } /* the card's own text never shows magnified */
|
|
html[data-morph=open]::view-transition-new(hz-morph) { animation: hz-fade-in .22s cubic-bezier(.22, 1, .36, 1) both; }
|
|
@keyframes hz-fade-out { to { opacity: 0; } }
|
|
@keyframes hz-fade-in { from { opacity: 0; } }
|
|
.x-stage { position: fixed; inset: 0; z-index: 250; overflow: hidden; pointer-events: none; }
|
|
.x-stage-m { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
|
|
.x-stage-t { position: absolute; left: max(24px, calc((100vw - 1200px) / 2)); right: 24px; bottom: 14vh; margin: 0; max-width: 14ch; font: 560 clamp(48px, 7.2vw, 112px)/1.02 var(--sans); letter-spacing: -.045em; text-wrap: balance; animation: hz-stage-t .6s .18s cubic-bezier(.16, 1, .3, 1) both; }
|
|
@keyframes hz-stage-t { from { opacity: 0; transform: translateY(24px); } }
|
|
html[data-morph=leave] main { opacity: .35; transition: opacity .25s cubic-bezier(.7, 0, .84, 0); }
|
|
html[data-morph=arrive] main { animation: hz-arrive .5s cubic-bezier(.22, 1, .36, 1) both; }
|
|
@keyframes hz-arrive { from { opacity: 0; } }
|
|
@media (prefers-reduced-motion: reduce) { ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; } html[data-morph] main { opacity: 1 !important; animation: none !important; } }
|