Files

176 lines
16 KiB
CSS

/* FnUses (prefix fn-uc / fn-uo): see FnUses.jsx. Deck values only: ink, greys, white; flat fills, no outline plus
shadow; radii 6/8/12/16/24/999; motion is transform and opacity only; loops run only while the grid is on screen.
With JS off the four cases simply stand with their points. */
.fn-uc { position: relative; padding: clamp(72px, 8vw, 116px) 0; }
.fn-uc-h { display: flex; flex-direction: column; gap: 17px; margin-bottom: 44px; }
.fn-uc-h .kn-lede { max-width: 40ch; }
/* an uneven grid, not a row of equal boxes: 7 + 5 columns twice (the two wide drawings take the wide tiles) */
.fn-uc-r { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--kn-g, 24px); }
.fn-uc-card:nth-child(odd) { grid-column: span 7; }
.fn-uc-card:nth-child(even) { grid-column: span 5; }
/* one case: a flat quiet tile, the drawing on top, the words under it */
.fn-uc-card { position: relative; display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 440px; border-radius: 24px; background: light-dark(#f5f5f5, var(--muted)); overflow: hidden; transition: background-color .3s var(--e-out), transform .15s var(--e-out); }
.fn-uc-obj { display: grid; place-items: center; min-height: 220px; padding: 27px clamp(24px, 3vw, 44px); }
.fn-uc-t { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 0 clamp(24px, 3vw, 44px) clamp(24px, 3vw, 36px); }
.fn-uc-t .kn-body { max-width: 46ch; margin: 0; padding-right: 64px; }
.fn-uc-title { margin: 0; font-size: 21px; font-weight: 497; letter-spacing: -.015em; line-height: 1.25; }
.fn-uc-open { all: unset; cursor: pointer; }
.fn-uc-open::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.fn-uc-n { position: absolute; right: clamp(24px, 3vw, 44px); top: -84px; font: 220 84px/.9 var(--sans); letter-spacing: -.04em; color: light-dark(#a3a3a3, var(--text-tertiary)); transform-origin: 100% 100%; transition: transform .9s var(--e-in), color .3s var(--e-out); }
.fn-uc-go { position: absolute; right: clamp(24px, 3vw, 44px); bottom: clamp(24px, 3vw, 36px); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; background: light-dark(#fff, var(--secondary)); color: var(--ink); transition: background-color .15s var(--e-out), color .15s var(--e-out), transform .3s var(--e-in); }
.fn-uc-pts { margin: 6px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--hair); }
.fn-uc-pts li { padding: 12px 0; border-bottom: 1px solid var(--hair); font-size: 16px; }
.fn-uc-card:has(.fn-uc-open:focus-visible) { outline: 2px solid var(--ink); outline-offset: 4px; }
.fn-uc-card:active { transform: scale(.98); transition-duration: 90ms; }
.fn-uc-card:active .fn-uc-go { transform: scale(.94); transition-duration: 90ms; }
.fn-uo { transition: transform .4s var(--e-in); }
@media (hover: hover) {
.fn-uc-card:hover { background: light-dark(#efefef, var(--secondary)); }
.fn-uc-card:hover .fn-uc-go { background: var(--ink); color: var(--fn-on); transform: translate(2px, -2px); }
.fn-uc-card:hover .fn-uc-n { color: var(--ink); transform: scale(1.08); }
.fn-uc-card:hover .fn-uo { transform: scale(1.03); }
}
/* JS on: the tiles rise in as they are reached (the right-hand one a beat later); the open tile hands its place to its
sheet, so the tile is what grows */
.js .fn-uc-card { opacity: 0; transform: translate3d(0, 40px, 0); transition: opacity .6s var(--e-out), transform .9s var(--e-in), background-color .3s var(--e-out); transition-delay: calc(var(--j, 0) * .12s); }
.js .fn-uc-card[data-seen] { opacity: 1; transform: none; }
.js .fn-uc-card[data-seen]:active { transform: scale(.98); transition-duration: 90ms; transition-delay: 0s; }
.js .fn-uc-card[data-away] { visibility: hidden; }
.js .fn-uc-pts { display: none; }
/* ---------- the drawings ---------- */
.fn-uo { display: grid; align-items: center; gap: 12px; width: 100%; max-width: 640px; }
.fn-uo-col { display: flex; flex-direction: column; gap: 8px; }
.fn-uo-pill { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 16px; border-radius: 999px; background: light-dark(#fff, var(--secondary)); font: 400 14px/1 var(--mono); color: light-dark(#525252, var(--muted-foreground)); white-space: nowrap; }
.fn-uo-pill::after { content: attr(data-t); position: absolute; inset: 0; display: grid; place-items: center; border-radius: inherit; background: var(--ink); color: var(--fn-on); opacity: 0; }
.fn-uo-pill.a::after, .fn-uo-pill.ink::after { opacity: 1; }
.fn-uo-lane { position: relative; height: 2px; min-width: 24px; background: light-dark(rgba(0, 0, 0, .14), var(--border-control)); container-type: inline-size; }
.fn-uo-dot, .fn-uo-ev { position: absolute; left: 0; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); transform: translateX(calc(50cqw - 4px)); }
.fn-uo-dot.back, .fn-uo-ev:not(:first-child) { opacity: 0; }
.fn-uo-box { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 16px; background: light-dark(#fff, var(--secondary)); font: 400 14px/1.2 var(--mono); color: var(--ink); }
.fn-uo-box.ink { background: var(--ink); color: var(--fn-on); }
.fn-uo-box.ink span + span { color: light-dark(#a3a3a3, var(--secondary-hover)); }
.fn-uo-pods { display: grid; grid-template-columns: repeat(3, 22px); gap: 6px; }
.fn-uo-pods i, .fn-uo-cells i, .fn-uo-jobs i { position: relative; display: block; }
.fn-uo-pods i { aspect-ratio: 1; border-radius: 6px; border: 1.5px solid light-dark(#a3a3a3, var(--border-selected)); }
.fn-uo-pods i::before, .fn-uo-cells i::before, .fn-uo-jobs i::before { content: ''; position: absolute; inset: 0; border-radius: inherit; transform: scale(0); }
.fn-uo-pods i::before { inset: 2px; border-radius: 3px; background: var(--ink); }
.fn-uo-pods i.on::before { transform: none; }
.fn-uo-api { grid-template-columns: auto minmax(24px, 1fr) auto minmax(24px, 1fr) auto; }
.fn-uo-stream { grid-template-columns: auto minmax(40px, 1fr) auto auto; }
.fn-uo-bars { display: flex; align-items: flex-end; gap: 4px; height: 72px; }
.fn-uo-bars i { width: 8px; height: 100%; border-radius: 3px; background: var(--ink); transform-origin: 50% 100%; transform: scaleY(var(--h)); }
.fn-uo-gpu { grid-template-columns: auto minmax(24px, 1fr) auto minmax(24px, 1fr) auto; }
.fn-uo-chip { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px; border-radius: 16px; background: #0a0a0a; }
.fn-uo-chip > span { font: 400 12px/1 var(--mono); color: #a3a3a3; white-space: nowrap; }
.fn-uo-cells { display: grid; grid-template-columns: repeat(4, 14px); gap: 4px; }
.fn-uo-cells i { aspect-ratio: 1; border-radius: 3px; background: rgba(255, 255, 255, .14); }
.fn-uo-cells i::before { background: #fafafa; }
.fn-uo-cells i:nth-child(6)::before, .fn-uo-cells i:nth-child(11)::before { transform: none; }
.fn-uo-cron { grid-template-columns: auto minmax(0, 1fr); gap: 27px; justify-items: start; }
.fn-uo-clock { position: relative; width: 132px; height: 132px; }
.fn-uo-clock svg { width: 100%; height: 100%; }
.fn-uo-clock line { stroke: light-dark(#a3a3a3, var(--text-tertiary)); stroke-width: 1.5; stroke-linecap: round; }
.fn-uo-clock::after { content: ''; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--ink); }
.fn-uo-hand { position: absolute; left: 50%; top: 18px; width: 2px; height: 48px; margin-left: -1px; border-radius: 1px; background: var(--ink); transform-origin: 50% 100%; transform: rotate(40deg); }
.fn-uo-jobs { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.fn-uo-jobs li { display: flex; align-items: center; gap: 10px; font: 400 14px/1.2 var(--mono); color: light-dark(#525252, var(--muted-foreground)); }
.fn-uo-jobs i { flex: none; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--ink); }
.fn-uo-jobs i::before { background: var(--ink); }
.fn-uo-jobs li:first-child i::before { transform: none; }
/* the loops: only while the grid is on screen, or inside an open sheet */
:is(.fn-uc[data-live] .fn-uc-card, .fn-uc-sh[data-live]) .fn-uo-pill.a::after { animation: fn-uo-swap 4.8s var(--e-move) infinite; }
:is(.fn-uc[data-live] .fn-uc-card, .fn-uc-sh[data-live]) .fn-uo-pill.b::after { animation: fn-uo-swap 4.8s var(--e-move) -2.4s infinite; }
:is(.fn-uc[data-live] .fn-uc-card, .fn-uc-sh[data-live]) .fn-uo-dot { opacity: 0; animation: fn-uo-go 2.4s linear infinite; }
:is(.fn-uc[data-live] .fn-uc-card, .fn-uc-sh[data-live]) .fn-uo-dot.late { animation-delay: 1.2s; }
:is(.fn-uc[data-live] .fn-uc-card, .fn-uc-sh[data-live]) .fn-uo-dot.back { animation-name: fn-uo-back; animation-delay: .6s; }
:is(.fn-uc[data-live] .fn-uc-card, .fn-uc-sh[data-live]) .fn-uo-ev { opacity: 0; animation: fn-uo-go 1.8s linear infinite; animation-delay: calc(var(--j) * -.26s); }
:is(.fn-uc[data-live] .fn-uc-card, .fn-uc-sh[data-live]) .fn-uo-pods i::before { animation: fn-uo-pod 4.8s var(--e-in) infinite; animation-delay: calc(var(--j) * .3s); }
:is(.fn-uc[data-live] .fn-uc-card, .fn-uc-sh[data-live]) .fn-uo-bars i { animation: fn-uo-bar 1.6s var(--e-move) infinite alternate; animation-delay: calc(var(--j) * -.23s); }
:is(.fn-uc[data-live] .fn-uc-card, .fn-uc-sh[data-live]) .fn-uo-cells i::before { animation: fn-uo-cell 2.4s var(--e-out) infinite; animation-delay: calc(var(--j) * .12s); }
:is(.fn-uc[data-live] .fn-uc-card, .fn-uc-sh[data-live]) .fn-uo-hand { animation: fn-uo-turn 6s linear infinite; }
:is(.fn-uc[data-live] .fn-uc-card, .fn-uc-sh[data-live]) .fn-uo-jobs i::before { animation: fn-uo-job 6s var(--e-in) infinite; animation-delay: calc(var(--j) * 2s); }
@keyframes fn-uo-swap { 0%, 42% { opacity: 1; } 50%, 92% { opacity: 0; } 100% { opacity: 1; } }
@keyframes fn-uo-go { 0% { opacity: 0; transform: translateX(0); } 12% { opacity: 1; } 88% { opacity: 1; } 100% { opacity: 0; transform: translateX(calc(100cqw - 8px)); } }
@keyframes fn-uo-back { 0% { opacity: 0; transform: translateX(calc(100cqw - 8px)); } 12% { opacity: 1; } 88% { opacity: 1; } 100% { opacity: 0; transform: translateX(0); } }
@keyframes fn-uo-pod { 0% { transform: scale(0); } 18% { transform: none; } 70% { transform: none; } 86%, 100% { transform: scale(0); } }
@keyframes fn-uo-bar { to { transform: scaleY(calc(var(--h) * .5 + .4)); } }
@keyframes fn-uo-cell { 0%, 100% { transform: scale(0); } 20%, 45% { transform: none; } }
@keyframes fn-uo-turn { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes fn-uo-job { 0% { transform: scale(0); } 6% { transform: none; } 30% { transform: none; } 36%, 100% { transform: scale(0); } }
/* ---------- the card's own page: a full-screen sheet grown out of the tile ---------- */
.fn-uc-sheet { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; overflow: hidden; color: var(--ink); }
.fn-uc-sheet::backdrop { background: transparent; }
.fn-uc-sh { position: absolute; inset: 0; transform-origin: 0 0; background: light-dark(#f5f5f5, var(--muted)); overflow: auto; overscroll-behavior: contain; outline: none; }
/* the drawings read larger where there is room: in the tile on desktop, and larger again in the sheet */
@media (min-width: 900px) { .fn-uc-obj .fn-uo { zoom: 1.05; } .fn-uc-card:nth-child(even) .fn-uc-obj .fn-uo { zoom: .92; } .fn-uc-sh-obj .fn-uo { zoom: 1.4; } .fn-uc-sh-obj :is(.fn-uo-api, .fn-uo-stream) { zoom: 1.05; } .fn-uc-sh-obj .fn-uo-gpu { zoom: .95; } }
/* a drawing never spills out of its card */
.fn-uc-sh-obj, .fn-uc-obj { min-width: 0; overflow: hidden; }
.fn-uc-sh-in { padding-top: 17px; padding-bottom: 72px; }
.fn-uc-sh-bar { display: flex; align-items: center; justify-content: space-between; gap: 17px; min-height: 72px; }
.fn-uc-sh-n { font: 500 13px/1 var(--mono); letter-spacing: .1em; color: light-dark(#525252, var(--muted-foreground)); }
.fn-uc-sh-nav { display: flex; gap: 8px; }
.fn-uc-sh-b { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 999px; background: light-dark(#fff, var(--secondary)); color: var(--ink); cursor: pointer; transition: background-color .15s var(--e-out), color .15s var(--e-out), transform .15s var(--e-out); }
.fn-uc-sh-b:active { transform: scale(.94); transition-duration: 90ms; }
.fn-uc-sh-b:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (hover: hover) { .fn-uc-sh-b:hover { background: var(--ink); color: var(--fn-on); } }
.fn-uc-sh-g { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--kn-g, 24px); row-gap: 44px; align-items: start; margin-top: clamp(27px, 6svh, 72px); }
.fn-uc-sh-t { grid-column: 1 / span 5; display: flex; flex-direction: column; gap: 17px; }
.fn-uc-sh-h { margin: 0; font-size: 52px; font-weight: 497; letter-spacing: -.03em; line-height: 1.04; text-wrap: balance; }
.fn-uc-sh-t .kn-lede { margin: 0; max-width: 32ch; }
.fn-uc-sh-pts { list-style: none; margin: 17px 0 0; padding: 0; border-top: 1px solid var(--hair); }
.fn-uc-sh-pts li { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: baseline; padding: 17px 0; border-bottom: 1px solid var(--hair); font-size: 16px; line-height: 1.5; }
.fn-uc-sh-pts .kn-fig { font: 500 13px/1 var(--mono); color: light-dark(#737373, var(--text-tertiary)); }
.fn-uc-sh-obj { grid-column: 7 / -1; display: grid; place-items: center; min-height: min(60svh, 520px); padding: clamp(27px, 4vw, 56px); border-radius: 24px; background: light-dark(#fff, var(--secondary)); }
.fn-uc-sh-obj .fn-uo-pill, .fn-uc-sh-obj .fn-uo-box:not(.ink) { background: light-dark(#f5f5f5, var(--muted)); }
@media (max-width: 899px) {
.fn-uc-h { gap: 10px; margin-bottom: 27px; }
.fn-uc-h .kn-lede { font-size: 16px; max-width: none; }
.fn-uc-r { grid-template-columns: minmax(0, 1fr); gap: 17px; }
.fn-uc-card:nth-child(n) { grid-column: 1; }
.js .fn-uc-card { transition-delay: 0s; }
.fn-uc-card { min-height: 380px; border-radius: 20px; }
.fn-uc-obj { min-height: 0; padding: 17px; }
.fn-uc-t { padding: 0 17px 17px; gap: 6px; }
.fn-uc-t .kn-body { font-size: 14px; line-height: 1.5; padding-right: 52px; }
.fn-uc-title { font-size: 17px; }
.fn-uc-n { font-size: 44px; top: -44px; right: 17px; }
.fn-uc-go { right: 17px; bottom: 17px; }
.fn-uo { gap: 8px; }
.fn-uo-pill { min-height: 32px; padding: 0 10px; font-size: 13px; }
.fn-uo-box { padding: 10px; font-size: 13px; }
/* phones: every drawing stacks top to bottom and keeps all of its parts; the lanes turn upright (the dots still travel
them, now downward) */
.fn-uo-api, .fn-uo-gpu, .fn-uo-stream { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 6px; }
.fn-uo-api .fn-uo-col, .fn-uo-gpu .fn-uo-col { flex-direction: row; }
.fn-uo-lane, .fn-uo-lane.wide { width: 40px; min-width: 0; margin: 19px 0; transform: rotate(90deg); }
.fn-uo-box { flex-direction: row; gap: 10px; }
.fn-uo-pods { grid-template-columns: repeat(6, 18px); gap: 5px; }
.fn-uo-bars { height: 40px; }
.fn-uo-chip { flex-direction: row; padding: 10px 14px; }
.fn-uo-cells { grid-template-columns: repeat(4, 10px); }
.fn-uo-clock { width: 96px; height: 96px; }
.fn-uo-hand { top: 13px; height: 35px; }
.fn-uo-cron { gap: 17px; }
.fn-uo-jobs li { font-size: 13px; }
.fn-uc-sh-g { grid-template-columns: minmax(0, 1fr); row-gap: 27px; margin-top: 10px; }
.fn-uc-sh-t, .fn-uc-sh-obj { grid-column: 1; }
.fn-uc-sh-h { font-size: 32px; }
.fn-uc-sh-obj { min-height: 240px; padding: 17px; border-radius: 20px; }
}
@media (prefers-reduced-motion: reduce) {
.fn-uc-card, .fn-uc-n, .fn-uo { transition: none !important; }
.js .fn-uc-card { opacity: 1; transform: none; }
}
/* dark: the drawn marks (bars, pods, the clock's hand and pin) in Hanzo's muted foreground, not light tiles */
html:not(.light) .fn-uo-bars i, html:not(.light) .fn-uo-hand, html:not(.light) .fn-uo-pods i::before, html:not(.light) .fn-uo-clock::after { background: var(--muted-foreground); }