Files
frontend-helper/src/styles/mobile.css
T

573 lines
18 KiB
CSS

/*
* Phone feed: full-screen snapping slides (spec "Mobile layout" > "Full-screen
* feed", ADR 0001). Ported from the mockup's .reel / .slide / .sl-* rules with
* the `slide-` and `reel-` prefixes, tokens only. White, the dark fades and the
* dark glass over photos and video come from the --on-media / --media-* tokens.
* Only rendered at 760px and below (AppShell measures .app).
*/
@keyframes slide-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes slide-shimmer { from { background-position: 120% 0; } to { background-position: -100% 0; } }
.reel-feed {
position: relative;
height: 100%;
overflow: hidden;
background: var(--bg);
}
.reel {
position: absolute;
inset: 0;
overflow-y: auto;
scroll-snap-type: y mandatory;
overscroll-behavior: contain;
scrollbar-width: none;
}
.reel::-webkit-scrollbar { display: none; }
/* Long text is open on the slide on screen: the reel holds still, swipes scroll the text. */
.reel[data-locked="true"] { overflow-y: hidden; }
.slide {
--slide-text-bg: radial-gradient(120% 70% at 0% 0%, var(--accent-soft), transparent 62%), var(--bg);
position: relative;
height: 100%;
scroll-snap-align: start;
scroll-snap-stop: always;
overflow: hidden;
background: var(--slide-text-bg);
color: var(--ink);
}
/* Media: edge to edge. Scaled to 104% until the slide is on screen, then eases to 100%. */
.slide-media { position: absolute; inset: 0; background: var(--tile-3); }
.slide-art {
position: absolute;
inset: 0;
display: block;
width: 100%;
height: 100%;
object-fit: cover;
transform: scale(1.04);
transition: transform 6s ease-out;
}
.is-cur .slide-art { transform: scale(1); }
.slide-video .slide-art video,
.slide-video .slide-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.slide-video .slide-art > div { height: 100%; }
.slide-video .slide-art video { background: transparent; }
/* Wider than 4:5: show the whole video, centered, over a blurred, darkened, enlarged copy of its own thumbnail. */
.slide-backdrop { display: none; }
.slide-video[data-fit="contain"] .slide-backdrop {
display: block;
position: absolute;
inset: 0;
width: 100%;
height: 100%;
object-fit: cover;
transform: scale(1.25);
filter: blur(28px) brightness(0.5);
pointer-events: none;
}
.slide-video[data-fit="contain"] .slide-art video,
.slide-video[data-fit="contain"] .slide-art img { object-fit: contain; }
.slide-pending { display: grid; place-items: center; color: var(--ink-2); font-size: 14px; }
.slide-play { z-index: 4; }
.slide-dur { top: 128px; right: 16px; z-index: 4; }
/* Several media items: a sideways snap track; each pane is one full-slide item. */
.slide-track {
position: absolute;
inset: 0;
display: flex;
overflow-x: auto;
overflow-y: hidden;
scroll-snap-type: x mandatory;
overscroll-behavior-x: contain;
scrollbar-width: none;
}
.slide-track::-webkit-scrollbar { display: none; }
.slide-pane { position: relative; flex: 0 0 100%; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; }
.slide-dots {
position: absolute;
left: 0;
right: 0;
bottom: 90px;
z-index: 4;
display: flex;
justify-content: center;
gap: 5px;
pointer-events: none;
}
.slide-dot {
display: block;
width: 5px;
height: 5px;
border-radius: 3px;
background: var(--on-media-line);
transition: width .5s var(--ease), background-color .5s;
}
.slide-dot-on { width: 18px; background: var(--accent); }
.slide-scrim,
.slide-scrim-top { position: absolute; left: 0; right: 0; z-index: 1; pointer-events: none; }
.slide-scrim { bottom: 0; height: 58%; background: linear-gradient(180deg, var(--media-fade-0), var(--media-fade)); }
.slide-scrim-top { top: 0; height: 150px; background: linear-gradient(180deg, var(--media-fade-top), var(--media-fade-0)); }
/* A playing video: the author, text and fades step aside so the native controls are clear. */
.slide-meta,
.slide-scrim,
.slide-scrim-top { transition: opacity .3s var(--ease); }
.slide-playing .slide-meta,
.slide-playing .slide-scrim,
.slide-playing .slide-scrim-top { opacity: 0; pointer-events: none; }
.slide-playing .slide-meta > * { pointer-events: none; }
/* Author and text over the bottom fade. */
.slide-meta {
position: absolute;
left: 20px;
right: 24px;
bottom: 108px;
z-index: 3;
display: flex;
flex-direction: column;
gap: 12px;
pointer-events: none;
}
.slide-meta > * { pointer-events: auto; }
.slide-on-media .slide-meta { color: var(--on-media); }
.slide-who { display: flex; align-items: center; gap: 12px; }
.slide-who > div { display: flex; flex-direction: column; min-width: 0; }
.slide-who strong { display: flex; align-items: center; font-size: 15px; font-weight: 700; }
.slide-who time { font-size: 12.5px; opacity: .72; }
.slide-on-media .slide-you { color: var(--on-media); box-shadow: inset 0 0 0 1px var(--on-media-badge); }
.slide-text {
margin: 0;
font-size: 15px;
line-height: 1.6;
white-space: pre-wrap;
overflow-wrap: anywhere;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
text-shadow: 0 1px 12px var(--media-shadow);
}
.slide-error { margin: 0; color: var(--danger); font-size: 13px; font-weight: 600; }
.slide-on-media .slide-error { color: var(--on-media); }
/* Text-only post: the text is the hero, a serif quote with a crimson opening mark.
The box spans from under the top bar (or the own-post menu) to above the author
block; SlideText steps the size 31 → 26 → 22 → 19px until the text fits. */
.slide-quote-w {
position: absolute;
top: calc(72px + env(safe-area-inset-top, 0px));
bottom: 181px; /* .slide-meta bottom (108px) + the author block (53px) + 20px */
left: 24px;
right: 28px;
z-index: 2;
display: flex;
flex-direction: column;
overflow: hidden;
pointer-events: none;
}
.slide-own .slide-quote-w { top: calc(122px + env(safe-area-inset-top, 0px)); }
/* Auto margins center the quote and, unlike justify-content, never push overflow above the box. */
.slide-quote-in { margin: auto 0; }
.slide-quote-w.is-clamped .slide-quote-in { margin-top: 0; }
.slide-quote-mark {
display: block;
margin-bottom: 6px;
color: var(--accent);
font-family: var(--font-serif), Georgia, serif;
font-size: 84px;
font-weight: 600;
line-height: .62;
}
.slide-quote {
margin: 0;
font-family: var(--font-serif), Georgia, serif;
font-size: 31px;
font-weight: 600;
line-height: 1.2;
white-space: pre-wrap;
overflow-wrap: anywhere;
}
.slide-quote.is-clamped {
display: -webkit-box;
-webkit-box-orient: vertical;
overflow: hidden;
}
/* "Read more", "Close", "more" and "less": real buttons, 44px tall to tap. */
.slide-more {
appearance: none;
display: inline-flex;
align-items: center;
justify-content: center;
min-height: 44px;
margin: 0;
padding: 0 18px;
border: 0;
border-radius: 14px;
font: inherit;
font-size: 14px;
font-weight: 700;
letter-spacing: .01em;
color: var(--ink);
background: var(--glass);
-webkit-backdrop-filter: blur(16px) saturate(1.6);
backdrop-filter: blur(16px) saturate(1.6);
box-shadow: inset 0 0 0 1px var(--line);
cursor: pointer;
pointer-events: auto;
transition: transform .15s;
}
.slide-more:active { transform: scale(.96); }
.slide-more:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.slide-more-quote { position: absolute; left: 0; bottom: 0; }
/* The full text of a long text-only post, over the slide between the top bar and the dock. */
@keyframes slide-reader-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.slide-reader {
position: absolute;
top: calc(64px + env(safe-area-inset-top, 0px));
bottom: calc(88px + env(safe-area-inset-bottom, 0px));
left: 12px;
right: 12px;
z-index: 7;
display: flex;
flex-direction: column;
gap: 10px;
padding: 20px 14px 14px 20px;
border-radius: 22px;
color: var(--ink);
background: var(--bg);
box-shadow: var(--shadow-pop), inset 0 0 0 1px var(--line);
animation: slide-reader-in .28s var(--ease) both;
}
.slide-reader-scroll {
flex: 1;
min-height: 0;
overflow-y: auto;
overscroll-behavior: contain;
padding-right: 6px;
}
.slide-reader-scroll:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
.slide-reader-text {
margin: 0;
font-family: var(--font-serif), Georgia, serif;
font-size: 22px;
font-weight: 600;
line-height: 1.35;
white-space: pre-wrap;
overflow-wrap: anywhere;
}
.slide-reader-close { flex: none; align-self: flex-end; }
/* Caption "more" / "less": a text button right under the three-line clamp. */
.slide-more.slide-more-caption {
align-self: flex-start;
flex: none;
margin: -12px 0 -10px -6px;
padding: 0 6px;
min-width: 44px;
background: none;
-webkit-backdrop-filter: none;
backdrop-filter: none;
box-shadow: none;
color: inherit;
text-decoration: underline;
text-underline-offset: 3px;
text-shadow: 0 1px 12px var(--media-shadow);
}
/* Open caption: the full text over the media on a darker scrim, scrolling inside the slide. */
.slide-who,
.slide-error { flex: none; }
.slide-text-open .slide-meta {
top: calc(122px + env(safe-area-inset-top, 0px));
justify-content: flex-end;
}
.slide-text.is-open {
display: block;
-webkit-line-clamp: unset;
flex: 0 1 auto;
min-height: 0;
overflow-y: auto;
overscroll-behavior: contain;
animation: slide-reader-in .28s var(--ease) both;
}
.slide-text.is-open:focus-visible { outline: 2px solid var(--on-media); outline-offset: 4px; }
.slide-text-open .slide-scrim { height: 100%; background: var(--media-scrim); }
.slide-text-open .slide-scrim-top { opacity: 0; }
/* The slide on screen: its content rises in when it snaps into place. */
.is-cur .slide-meta,
.is-cur .slide-quote-w { animation: slide-rise .7s var(--ease) both; }
/* The rise animation's fill would keep the meta visible; a playing video takes it off. */
.is-cur.slide-playing .slide-meta { animation: none; }
/* Own-post menu: frosted "..." at the top right, the card's delete confirm under it. */
.slide-menu { position: absolute; top: calc(70px + env(safe-area-inset-top, 0px)); right: 12px; z-index: 6; }
.slide-menu-btn {
appearance: none;
display: grid;
place-items: center;
width: 44px;
height: 44px;
margin: 0;
padding: 0;
border: 0;
border-radius: 14px;
color: var(--ink);
background: var(--glass);
-webkit-backdrop-filter: blur(16px) saturate(1.6);
backdrop-filter: blur(16px) saturate(1.6);
box-shadow: inset 0 0 0 1px var(--line);
cursor: pointer;
transition: transform .15s, background-color .2s;
}
.slide-menu-btn svg { width: 20px; height: 20px; }
.slide-menu-btn:active { transform: scale(.92); }
.slide-menu-btn:disabled { cursor: default; }
.slide-on-media .slide-menu-btn {
color: var(--on-media);
background: var(--media-glass);
box-shadow: inset 0 0 0 1px var(--on-media-line);
}
.slide-menu .post-pop { min-width: 230px; }
/* Double-tap heart burst over a post slide (mockup .burst), crimson accent. */
@keyframes slide-burst {
0% { opacity: 0; transform: scale(.2); }
25% { opacity: 1; transform: scale(1.15); }
60% { opacity: 1; transform: scale(1); }
100% { opacity: 0; transform: scale(1.25) translateY(-20px); }
}
.slide-burst {
position: absolute;
left: 50%;
top: 44%;
width: 120px;
height: 120px;
margin: -60px 0 0 -60px;
color: var(--accent);
z-index: 5;
pointer-events: none;
animation: slide-burst .95s cubic-bezier(.2, .9, .3, 1.3) both;
filter: drop-shadow(0 12px 30px color-mix(in oklab, var(--accent), transparent 45%));
}
/* Featured experts slide: not a post. Eyebrow, title, carousel at 156px, hint. */
@keyframes slide-nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
.slide-featured {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 70px 0 110px;
background: radial-gradient(90% 55% at 50% 46%, color-mix(in oklab, var(--accent), transparent 84%), transparent 70%), var(--bg);
}
/* The crimson glow tints the light page enough to drop --ink-3 meta below 4.5:1. */
[data-theme="light"] .slide-featured { --ink-3: var(--ink-2); }
.slide-feat-title {
margin: 10px 24px 0;
text-align: center;
font-size: 32px;
line-height: 1.1;
color: var(--ink);
}
.slide-feat-cf { width: 100%; margin-top: 26px; }
.featured-bare { background: none; }
.featured-bare .featured-cap { padding-top: 16px; }
.slide-hint {
display: flex;
align-items: center;
gap: 6px;
margin-top: 14px;
font-size: 12px;
font-weight: 600;
letter-spacing: .04em;
color: var(--ink-3);
}
.slide-hint svg { width: 16px; height: 16px; animation: slide-nudge 1.6s ease-in-out infinite; }
/* Loading slide: a skeleton card in the middle while the next page loads. */
.slide-load { background: var(--bg); }
.slide-load .sentinel { position: absolute; top: 0; left: 0; right: 0; }
.slide-load-body {
position: absolute;
inset: 0;
display: flex;
flex-direction: column;
justify-content: center;
gap: 14px;
padding: 0 22px 110px;
}
.slide-skel {
display: flex;
flex-direction: column;
gap: 10px;
padding: 16px;
border: 1px solid var(--line);
border-radius: var(--r-card);
}
.slide-skel-head { display: flex; align-items: center; gap: 12px; }
.slide-skel-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.slide-skel i {
display: block;
height: 12px;
border-radius: 6px;
background: linear-gradient(90deg, var(--tile-2) 0%, var(--tile-3) 40%, var(--tile-2) 80%);
background-size: 220% 100%;
animation: slide-shimmer 1.4s linear infinite;
}
.slide-skel .slide-skel-hex {
flex: none;
width: 46px;
height: 53px;
border-radius: 0;
clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
/* Empty feed or a failed page, as a slide. */
.slide-message {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 4px;
padding: 0 24px 110px;
text-align: center;
color: var(--ink-3);
}
/* New-posts pill floats over the top of the reel. */
.reel-pill {
position: absolute;
top: calc(76px + env(safe-area-inset-top, 0px));
left: 0;
right: 0;
z-index: 8;
display: flex;
justify-content: center;
pointer-events: none;
animation: feed-pill-in .45s var(--ease) backwards;
}
.reel-pill > * { pointer-events: auto; }
/* Bottom dock (spec "Bottom dock"): a frosted bar 16px above the bottom. Like and
comments act on the post on screen. Disabled buttons stay fully opaque and use
a solid muted ink instead of fading. */
.dock {
position: absolute;
left: 12px;
right: 12px;
bottom: calc(16px + env(safe-area-inset-bottom, 0px));
z-index: 30;
display: flex;
align-items: center;
gap: 4px;
padding: 6px;
border-radius: 22px;
background: var(--glass);
-webkit-backdrop-filter: blur(24px) saturate(1.8);
backdrop-filter: blur(24px) saturate(1.8);
box-shadow: var(--shadow-pop), inset 0 0 0 1px var(--line);
}
.dk {
appearance: none;
flex: 1;
min-width: 44px;
height: 52px;
padding: 0;
border: 0;
border-radius: 16px;
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
background: transparent;
color: var(--ink);
font-size: 14px;
font-weight: 700;
font-variant-numeric: tabular-nums;
cursor: pointer;
transition: background-color .25s, color .25s;
}
.dk svg { width: 22px; height: 22px; flex: none; }
@media (hover: hover) { .dk:hover:not(:disabled) { background: var(--tile-3); } }
.dk:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.dk.dk-like-on { color: var(--accent-text); }
.dk.dk-like-on svg { color: var(--accent); }
.dk-beat svg { animation: post-beat .5s cubic-bezier(.2,.9,.3,1.4); }
.dk:disabled { opacity: 1; color: var(--ink-3); cursor: default; }
.btn-spark.btn-spark-fab.dk-plus { flex: 0 0 64px; width: 64px; height: 52px; }
@media (prefers-reduced-motion: reduce) {
.is-cur .slide-meta,
.is-cur .slide-quote-w,
.slide-skel i,
.slide-burst,
.slide-reader,
.slide-text.is-open,
.slide-hint svg,
.reel-pill,
.dk-beat svg { animation: none !important; }
.slide-art,
.slide-more { transition: none !important; }
}
/* Top bar (spec "Top bar"): frosted pills over the feed. Over a media slide they use a
dark translucent glass with white text; over a text slide the theme glass. The bar
ends 56px (plus the top inset) down, above the own-post menu at 70px. */
.ph-top {
position: absolute;
top: 0;
left: 0;
right: 0;
z-index: 20;
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
padding: calc(14px + env(safe-area-inset-top, 0px)) 14px 0;
pointer-events: none;
}
.ph-top > * { pointer-events: auto; }
.ph-glass {
background: var(--glass);
-webkit-backdrop-filter: blur(16px) saturate(1.6);
backdrop-filter: blur(16px) saturate(1.6);
box-shadow: inset 0 0 0 1px var(--line);
color: var(--ink);
transition: background .3s var(--ease), color .3s var(--ease);
}
.reel-feed[data-on-media="true"] .ph-glass {
background: var(--media-glass);
color: var(--on-media);
box-shadow: inset 0 0 0 1px var(--on-media-line);
}
.ph-brand { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px 0 10px; border-radius: 14px; }
.ph-brand .type-wordmark { font-size: 13px; }
.ph-theme { appearance: none; border: 0; margin: 0; display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border-radius: 14px; cursor: pointer; }
.ph-theme svg { width: 20px; height: 20px; }
.ph-theme:active { transform: scale(.94); }
/* Progress rail: position in the loaded feed, on the right edge. */
.rail-v {
position: absolute;
right: 5px;
top: 50%;
height: 110px;
margin-top: -55px;
width: 3px;
border-radius: 2px;
background: var(--line-2);
z-index: 15;
overflow: hidden;
pointer-events: none;
}
.rail-v i { display: block; width: 100%; background: var(--accent); border-radius: 2px; transition: height .5s var(--ease); }
@media (prefers-reduced-motion: reduce) { .rail-v i { transition: none; } }