/* SPDX-License-Identifier: AGPL-3.0-only The poster wall (see ../README.md), ported from Folia's src/components/wall/wall.css and src/components/app/lattice/Lattice.css, LatticeChrome.css and lyrics/LatticeLyrics.css. Class names keep Folia's `lattice-` prefix. Sizes are in the wall's own units (a cell is 128, a gap 8) and the whole world is scaled to the page, as Folia's camera scales it to the window. Changed from Folia: the wall stands in the page's flow (no camera, no panning, no vignette over the window); the colours come from four variables the host sets on the root (--text-primary, --text-accent, --text-secondary, --bg-color); a narrow screen gets a two-column grid; and by day the cards keep the dark shade and the light ink of the night (Folia's light theme turns the shade white, the ink dark, and lays a pale tint over every card that is not playing: the sleeves looked washed out, and the host's owner had it taken off). */ .lattice-root { --lattice-poster-ink: var(--text-primary, #f7f4ee); --lattice-shade-rgb: 0 0 0; --lattice-poster-background: color-mix(in srgb, var(--bg-color, #070707) 88%, var(--lattice-poster-ink)); --lattice-expanded-shadow: rgb(0 0 0 / 74%); --lattice-focus-lift: 0 12px 32px rgb(0 0 0 / 45%); --lattice-poster-tint-intensity: .5; --lattice-poster-tint-effective-opacity: var(--lattice-poster-tint-intensity); --lattice-chrome-shadow: rgb(0 0 0 / 55%); position: relative; color: var(--text-primary, #f7f4ee); -webkit-user-select: none; user-select: none; isolation: isolate; } /* By day only what belongs to the page around the cards changes: the ground a card waits on, the shadows it casts on the page, and no tint over the cards that are not playing. What is written on a sleeve (ink, shade, the transport's shadow) stays as at night. */ .lattice-root.is-daylight { --lattice-poster-background: color-mix(in srgb, var(--bg-color, #fafaf9) 94%, #1c1917); --lattice-expanded-shadow: rgb(0 0 0 / 25%); --lattice-focus-lift: 0 12px 32px rgb(0 0 0 / 25%); --lattice-poster-tint-effective-opacity: 0; } .lattice-root *, .lattice-root *::before, .lattice-root *::after { box-sizing: border-box; } .lattice-world { position: relative; margin: 0; padding: 0; list-style: none; transform-origin: 0 0; } /* A wall the page placed (see wall.ts): until the wall's script writes its own numbers, the world takes its size and scale from what the page left on the root, and each card its slot from what the page wrote on it. */ .lattice-root.is-placed:not(.is-narrow) .lattice-world:not([style]) { width: calc(var(--lattice-plan-width) * 1px); height: calc(var(--lattice-plan-height) * 1px); margin-left: var(--lattice-left, 0px); transform: scale(var(--lattice-fit, 1)); } .lattice-root.is-placed:not(.is-narrow) .lattice-poster { transform: translate(calc(var(--lx, 0) * 1px), calc(var(--ly, 0) * 1px)); width: calc(var(--lw, 128) * 1px); height: calc(var(--lh, 128) * 1px); } /* A card. Its place and size are written by the wall (a transform and a box in world units). */ .lattice-poster { position: absolute; top: 0; left: 0; overflow: hidden; margin: 0; padding: 0; color: var(--lattice-poster-ink); text-align: left; background-color: var(--lattice-poster-background); background-position: center; background-size: cover; box-shadow: 0 0 0 1px transparent, 0 0 0 4px transparent, 0 0 0 5px transparent, var(--lattice-poster-elevation, 0 12px 32px transparent); transition: box-shadow 600ms ease, filter 600ms ease; contain: layout paint; } /* A card's sleeve. The page names two copies of it on the card (--sleeve-s 400 px, --sleeve-l 600 px) and whether the card is a small or a large one of the wall; a card that still waits for its turn (data-cover) draws none. A small card, and every card of the narrow grid, draws the small copy; a large card the large one; an open card the large one over the small, which shows until the large has come. A card without a sleeve carries a gradient of its own in its style. */ .lattice-poster:not([data-cover]) { background-image: var(--sleeve-s, none); } .lattice-poster[data-size='large']:not([data-cover]) { background-image: var(--sleeve-l, none); } .lattice-root.is-narrow .lattice-poster:not([data-cover]) { background-image: var(--sleeve-s, none); } .lattice-root .lattice-poster.is-current:not([data-cover]) { background-image: var(--sleeve-l, none), var(--sleeve-s, none); } .lattice-poster[hidden] { display: none; } .lattice-poster__hit { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; color: inherit; font: inherit; cursor: pointer; } .lattice-poster__hit:focus-visible { outline: none; } .lattice-poster.is-expanded .lattice-poster__hit { pointer-events: none; } /* The playing card's mark is built inward (the card clips its children): the accent stroke, a shade hairline behind it so it reads over a bright sleeve, and a soft inward glow. */ .lattice-poster.is-current::before { content: ''; position: absolute; inset: 0; z-index: 4; border: 2px solid var(--text-accent, var(--text-primary, #fff)); box-shadow: inset 0 0 0 1px rgb(var(--lattice-shade-rgb) / 52%), inset 0 0 0 3px transparent, inset 0 0 15px -7px color-mix(in srgb, var(--text-accent, var(--text-primary, #fff)) 46%, transparent); pointer-events: none; transition: box-shadow 300ms ease; } @media (hover: hover) { .lattice-poster:hover { z-index: 3; filter: saturate(1.08) brightness(1.05); } .lattice-poster.is-expanded:hover { filter: none; } } /* Keyboard focus: a hairline, the ring, a second hairline, so the ring stays crisp against artwork and wall. */ .lattice-poster:has(.lattice-poster__hit:focus-visible) { z-index: 4; box-shadow: 0 0 0 1px rgb(0 0 0 / 62%), 0 0 0 4px var(--text-primary, #fff), 0 0 0 5px rgb(0 0 0 / 38%), var(--lattice-poster-elevation, var(--lattice-focus-lift)); } .lattice-root.is-daylight .lattice-poster:has(.lattice-poster__hit:focus-visible) { box-shadow: 0 0 0 1px rgb(255 255 255 / 78%), 0 0 0 4px var(--lattice-page-ink, #111), 0 0 0 5px rgb(255 255 255 / 45%), var(--lattice-poster-elevation, var(--lattice-focus-lift)); } .lattice-poster::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(255 255 255 / 10%), transparent 60%); opacity: 0; pointer-events: none; transition: opacity 200ms ease; } .lattice-poster:has(.lattice-poster__hit:focus-visible)::after { opacity: 1; } .lattice-poster-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgb(var(--lattice-shade-rgb) / 5%) 34%, rgb(var(--lattice-shade-rgb) / 24%) 56%, rgb(var(--lattice-shade-rgb) / 92%) 100%); pointer-events: none; } /* Theme colour quiets the cards behind without muting the playing one or the one under the pointer. */ .lattice-poster-tint { position: absolute; inset: 0; z-index: 3; background: linear-gradient(145deg, color-mix(in srgb, var(--bg-color, #070707) 78%, var(--text-accent, #fd5c47)), color-mix(in srgb, var(--bg-color, #070707) 84%, var(--text-secondary, #6a48ff))); opacity: var(--lattice-poster-tint-effective-opacity); pointer-events: none; transition: opacity 260ms ease; } .lattice-poster.is-current .lattice-poster-tint, .lattice-poster:has(.lattice-poster__hit:focus-visible) .lattice-poster-tint { opacity: 0; } @media (hover: hover) { .lattice-poster:hover .lattice-poster-tint { opacity: 0; } } .lattice-poster.is-expanded { --lattice-poster-elevation: 0 42px 110px var(--lattice-expanded-shadow); z-index: 20; } /* The bottom band keeps the transport, which has no card of its own, readable. */ .lattice-poster.is-expanded .lattice-poster-shade { background: linear-gradient(0deg, rgb(var(--lattice-shade-rgb) / 86%) 0%, rgb(var(--lattice-shade-rgb) / 62%) 14%, rgb(var(--lattice-shade-rgb) / 26%) 30%, rgb(var(--lattice-shade-rgb) / 0%) 46%), linear-gradient(90deg, rgb(var(--lattice-shade-rgb) / 88%), rgb(var(--lattice-shade-rgb) / 50%) 52%, rgb(var(--lattice-shade-rgb) / 8%)); } .lattice-poster-badge { position: absolute; top: 14px; left: 14px; z-index: 2; padding: 5px 8px; font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .12em; line-height: 1.2; background: rgb(var(--lattice-shade-rgb) / 62%); pointer-events: none; } .lattice-poster-badge [data-lattice-now] { display: none; } .lattice-poster.is-current .lattice-poster-badge { color: var(--text-accent, var(--text-primary, #fff)); background: rgb(var(--lattice-shade-rgb) / 78%); } .lattice-poster.is-current .lattice-poster-badge [data-lattice-now] { display: inline; } .lattice-poster-copy { position: absolute; right: 17px; bottom: 17px; left: 17px; z-index: 2; display: flex; flex-direction: column; gap: 5px; pointer-events: none; } .lattice-poster-copy strong { display: -webkit-box; overflow: hidden; /* Tight display line-heights crop ascenders and descenders at the clamp: padding widens the paint area and the matching negative margin keeps the copy anchored. */ margin-block: -.14em; padding-block: .14em; font-size: clamp(22px, 2vw, 36px); font-weight: 700; line-height: .96; letter-spacing: -.045em; text-wrap: balance; -webkit-line-clamp: 3; -webkit-box-orient: vertical; } .lattice-poster-copy small { overflow: hidden; font-size: 13px; font-weight: 650; opacity: .78; white-space: nowrap; text-overflow: ellipsis; } .lattice-poster.is-expanded .lattice-poster-copy { right: 32px; bottom: 152px; left: 32px; } .lattice-poster.is-expanded .lattice-poster-copy strong { max-width: 76%; font-size: clamp(48px, 6vw, 82px); line-height: .95; } .lattice-poster.is-expanded .lattice-poster-copy small { margin-top: 7px; font-size: 17px; } /* With lyrics on the card the title steps up to a heading above them. */ .lattice-poster.is-expanded.has-lyrics .lattice-poster-copy { top: 74px; right: 100px; bottom: auto; } .lattice-poster.is-expanded.has-lyrics .lattice-poster-copy strong { max-width: 100%; font-size: 22px; line-height: 1.2; letter-spacing: -.02em; -webkit-line-clamp: 1; } .lattice-poster.is-expanded.has-lyrics .lattice-poster-copy small { margin-top: 2px; font-size: 13px; } /* The transport on the open card: no card of its own, straight on the poster. */ .lattice-poster-controls { position: absolute; right: 24px; bottom: 28px; left: 32px; z-index: 5; animation: lattice-controls-in 240ms ease 140ms backwards; } .lattice-poster-controls[hidden] { display: none; } @keyframes lattice-controls-in { from { opacity: 0; transform: translateY(12px); } } .lattice-chrome { --lattice-chrome-ink: currentColor; display: flex; flex-direction: column; gap: 10px; width: min(100%, 520px); color: inherit; filter: drop-shadow(0 1px 3px var(--lattice-chrome-shadow)); } .lattice-chrome-transport { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; min-height: 44px; } /* The further controls wipe open sideways after the play key when the pointer is on the card. */ .lattice-chrome-details { display: grid; grid-template-columns: 0fr; opacity: 0; transition: grid-template-columns 180ms ease, opacity 150ms ease; } .lattice-chrome-actions { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; } .lattice-poster:is(:hover, :focus-within) .lattice-chrome-details, .lattice-root.is-narrow .lattice-chrome-details { grid-template-columns: 1fr; opacity: 1; } .lattice-chrome-time { margin-left: auto; padding-left: 8px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; opacity: 0; transition: opacity 180ms ease; } .lattice-poster:is(:hover, :focus-within) .lattice-chrome-time, .lattice-root.is-narrow .lattice-chrome-time { opacity: .6; } .lattice-chrome button { display: grid; flex-shrink: 0; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid transparent; border-radius: 12px; background: transparent; color: inherit; cursor: pointer; } .lattice-chrome button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; } .lattice-chrome .lattice-transport-button svg { fill: currentColor; } .lattice-secondary-action, .lattice-chrome-actions button { opacity: .65; } .lattice-chrome button:hover { border-color: color-mix(in srgb, currentColor 26%, transparent); opacity: 1; background: color-mix(in srgb, currentColor 16%, transparent); } .lattice-chrome button:focus-visible { outline: 2px solid currentColor; outline-offset: -2px; } .lattice-progress { position: relative; height: 36px; margin: -17px 12px -17px 0; cursor: pointer; } .lattice-progress::before, .lattice-progress i { content: ''; position: absolute; top: 50%; left: 0; width: 100%; height: 2px; background: color-mix(in srgb, var(--lattice-chrome-ink) 20%, transparent); translate: 0 -50%; } .lattice-progress i { background: var(--lattice-chrome-ink); transform-origin: 0 50%; scale: var(--music-progress, 0) 1; transition: scale .3s linear; } /* The volume, beside its mute key: the same thin line as the progress, in the card's ink, filled as far as the level (--music-fill, written by the page's controls). Not in Folia's chrome, which has the mute key alone. */ .lattice-volume { --music-fill: 80%; flex: none; width: 76px; height: 44px; margin: 0 2px; padding: 0; border: 0; color: inherit; background: transparent; opacity: .65; cursor: pointer; appearance: none; -webkit-appearance: none; } .lattice-volume:is(:hover, :focus-visible, :active) { opacity: 1; } .lattice-volume::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(to right, currentColor var(--music-fill), color-mix(in srgb, currentColor 24%, transparent) var(--music-fill)); } .lattice-volume::-moz-range-track { height: 2px; background: color-mix(in srgb, currentColor 24%, transparent); } .lattice-volume::-moz-range-progress { height: 2px; background: currentColor; } .lattice-volume::-webkit-slider-thumb { width: 10px; height: 10px; margin-top: -4px; border: 0; border-radius: 50%; background: currentColor; appearance: none; -webkit-appearance: none; } .lattice-volume::-moz-range-thumb { width: 10px; height: 10px; border: 0; border-radius: 50%; background: currentColor; } .lattice-chrome .lattice-volume:focus-visible { outline: 2px solid currentColor; outline-offset: -6px; border-radius: 12px; } /* Lyrics on the open card: three lines that spring to their places, the sung one brightening word by word. */ .lattice-lyrics { position: absolute; inset: 128px 24px 110px; z-index: 2; overflow: hidden; opacity: 0; pointer-events: none; transition: opacity 240ms ease; } .lattice-poster.has-lyrics .lattice-lyrics.is-ready { opacity: 1; } .lattice-lyric-line { position: absolute; top: 0; left: 0; font-size: var(--lattice-lyric-size, 24px); line-height: var(--lattice-lyric-line, 30px); letter-spacing: .01em; transform-origin: 0 0; will-change: transform, opacity; } .lattice-lyric-text { max-height: calc(var(--lattice-lyric-line, 30px) * 2); overflow: hidden; color: var(--lattice-lyric-base); } .lattice-lyric-line.is-active .lattice-lyric-text { max-height: none; overflow: visible; } .lattice-lyric-token { --f: 0; --p: calc(var(--f) * (100% + .36em) - .18em); color: transparent; background-image: linear-gradient(90deg, var(--lattice-lyric-word) calc(var(--p) - .18em), var(--lattice-lyric-base) calc(var(--p) + .18em)); -webkit-background-clip: text; background-clip: text; } .lattice-lyric-token.is-glowing { filter: drop-shadow(0 0 .28em color-mix(in srgb, var(--lattice-lyric-word) calc(var(--glow, 0) * 100%), transparent)) drop-shadow(0 0 .65em color-mix(in srgb, var(--lattice-lyric-word) calc(var(--glow, 0) * 70%), transparent)); } .lattice-lyric-sub { display: none; margin-top: .3em; font-size: .5em; font-weight: 500; line-height: 1.35; opacity: .68; } .lattice-lyric-line.is-active .lattice-lyric-sub { display: block; } /* A narrow screen: a plain grid of square covers, the playing one across both columns. */ .lattice-root.is-narrow .lattice-world { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: dense; gap: 6px; padding: 0 6px; } .lattice-root.is-narrow .lattice-poster { position: relative; aspect-ratio: 1; transition: opacity 260ms ease; } .lattice-root.is-narrow .lattice-poster.is-expanded { grid-column: span 2; aspect-ratio: 1 / 1.12; } .lattice-root.is-narrow .lattice-poster-copy strong { font-size: 19px; } .lattice-root.is-narrow .lattice-poster-copy small { font-size: 11.5px; } .lattice-root.is-narrow .lattice-poster.is-expanded .lattice-poster-copy { right: 20px; bottom: 132px; left: 20px; } .lattice-root.is-narrow .lattice-poster.is-expanded .lattice-poster-copy strong { max-width: 100%; font-size: 34px; } .lattice-root.is-narrow .lattice-poster.is-expanded.has-lyrics .lattice-poster-copy { top: 52px; right: 20px; bottom: auto; } .lattice-root.is-narrow .lattice-poster.is-expanded.has-lyrics .lattice-poster-copy strong { font-size: 17px; } .lattice-root.is-narrow .lattice-poster-controls { right: 12px; bottom: 16px; left: 14px; } /* A phone sets the volume with its own keys, and the narrow card has no room for the slider, nor for the mute key (four keys were cut off at the card's edge). */ .lattice-root.is-narrow :is(.lattice-volume, .lattice-chrome-actions [data-music-mute]) { display: none; } .lattice-root.is-narrow .lattice-lyrics { inset: 100px 14px 96px; } @media (prefers-reduced-motion: reduce) { .lattice-poster, .lattice-poster::after, .lattice-poster-tint, .lattice-chrome-details, .lattice-chrome-time, .lattice-progress i, .lattice-lyrics { transition: none; } .lattice-poster-controls { animation: none; } }