Files

57 lines
4.8 KiB
CSS

/* /security entrances (enter.js). Five ways in, one per section, in page order; each ends in the plain final state.
Start states only with JS (html.js) and only when motion is welcome. Deck easing; the landing squash is the one
allowed give, and it settles inside 700 ms. */
.xsc-hero-v { position: relative; }
.xsc-hero-v::before, .xsc-hero-v::after { content: ''; position: absolute; left: -12px; right: -12px; height: 50.5%; background: #ededed; z-index: 3; pointer-events: none; visibility: hidden; }
.xsc-hero-v::before { top: 0; transform: scaleY(0); transform-origin: 50% 0; }
.xsc-hero-v::after { bottom: 0; transform: scaleY(0); transform-origin: 50% 100%; }
.xsc-where[data-enter] { perspective: 900px; }
.xsc-slot { display: block; overflow: hidden; padding: .02em 0 .1em; margin-bottom: -.1em; }
.xsc-slot-in { position: relative; display: block; }
/* the reel's other faces exist only while it rolls (their descenders would otherwise peek into the line below) */
.xsc-slot-in::before, .xsc-slot-in::after { position: absolute; left: 0; right: 0; opacity: .35; filter: blur(2px); pointer-events: none; }
.xsc-slot-in::before { bottom: calc(100% + .2em); }
.xsc-slot-in::after { bottom: calc(200% + .4em); }
@media (prefers-reduced-motion: no-preference) {
/* 1. shutter (hero, from first paint): two grey bars close over the six layers from top and bottom, then open on them */
.js .xsc-hero-v::before { visibility: visible; animation: xsc-shut-t .95s cubic-bezier(.65, 0, .35, 1) .05s both; }
.js .xsc-hero-v::after { visibility: visible; animation: xsc-shut-b .95s cubic-bezier(.65, 0, .35, 1) .05s both; }
.js .xsc-hero-v > * { animation: xsc-shut-c .95s linear .05s both; }
@keyframes xsc-shut-t { 0% { transform: scaleY(0); } 40%, 54% { transform: none; } 100% { transform: scaleY(0); visibility: hidden; } }
@keyframes xsc-shut-b { 0% { transform: scaleY(0); } 40%, 54% { transform: none; } 100% { transform: scaleY(0); visibility: hidden; } }
@keyframes xsc-shut-c { 0%, 47% { opacity: 0; } 48%, 100% { opacity: 1; } }
/* 2. depth-parallax: the list near, the stack far; they drift at their own speeds and meet at mid-screen */
.js [data-enter='depth'] .xsc-tabs, .js [data-enter='depth'] .xsc-layers-l > .pf-head { translate: 0 calc(var(--xsc-p, 0) * 28px); }
.js [data-enter='depth'] .xsc-stk { translate: 0 calc(var(--xsc-p, 0) * -48px); }
.js [data-enter='depth'] .xsc-tabs, .js [data-enter='depth'] .xsc-stk { transition: opacity .7s cubic-bezier(0, 0, .2, 1); }
.js [data-enter='depth'] .xsc-stk { transition-delay: .15s; }
.js [data-enter='depth']:not([data-in]) .xsc-tabs, .js [data-enter='depth']:not([data-in]) .xsc-stk { opacity: 0; }
/* 3. squash-land: the rack drops onto its line, squashes, stretches once and settles (scale and translate, so the
rack's own grow-as-it-powers transform is untouched) */
.js [data-enter='squash']:not([data-in]) .xsc-rack { opacity: 0; translate: 0 -56px; }
.js [data-enter='squash'][data-in]:not([data-done]) .xsc-rack { animation: xsc-land .7s cubic-bezier(.3, 0, .3, 1) backwards; }
@keyframes xsc-land {
0% { opacity: 0; translate: 0 -56px; scale: .97 1.04; }
45% { opacity: 1; translate: 0 0; scale: 1.035 .93; }
70% { scale: .99 1.015; }
100% { opacity: 1; translate: 0 0; scale: 1 1; }
}
/* 4. scroll-tilt: the switcher arrives tilted back and levels; after that it leans with the scroll speed (enter.js) */
.js [data-enter='tilt'] .xsc-where-s, .js [data-enter='tilt'] .xsc-where-b { transform-origin: 50% 100%; }
.js [data-enter='tilt']:not([data-in]) .xsc-where-s, .js [data-enter='tilt']:not([data-in]) .xsc-where-b { opacity: 0; rotate: x 48deg; }
.js [data-enter='tilt'] .xsc-where-s, .js [data-enter='tilt'] .xsc-where-b { transition: rotate .9s cubic-bezier(.16, 1, .3, 1), opacity .5s cubic-bezier(0, 0, .2, 1), transform var(--sl) var(--pf-emph); }
.js [data-enter='tilt'][data-done] .xsc-where-s { rotate: x var(--xsc-tilt, 0deg); transition: rotate .12s linear, transform var(--sl) var(--pf-emph); }
/* 5. slot-roll: each line of "Ask us the hard question" rolls down through its reel and stops in place */
.js [data-enter='slot']:not([data-in]) .xsc-slot-in { transform: translate3d(0, -100%, 0); opacity: 0; }
.js [data-enter='slot'][data-in]:not([data-done]) .xsc-slot-in { animation: xsc-roll 1s cubic-bezier(.2, .6, .25, 1) backwards; }
.js [data-enter='slot'][data-in]:not([data-done]) .xsc-slot-in::before, .js [data-enter='slot'][data-in]:not([data-done]) .xsc-slot-in::after { content: attr(data-t); }
.js [data-enter='slot'][data-in]:not([data-done]) .xsc-slot + .xsc-slot .xsc-slot-in { animation-delay: .12s; }
@keyframes xsc-roll { 0% { transform: translate3d(0, calc(-300% - .6em), 0); opacity: 0; } 12% { opacity: 1; } 78% { transform: translate3d(0, 6%, 0); } 100% { transform: none; opacity: 1; } }
}