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

380 lines
11 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; }
.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-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. */
.slide-quote-w { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.slide-quote {
position: absolute;
left: 24px;
right: 28px;
top: 46%;
transform: translateY(-50%);
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;
display: -webkit-box;
-webkit-line-clamp: 8;
-webkit-box-orient: vertical;
overflow: hidden;
}
.slide-quote::before {
content: "\201C";
display: block;
margin-bottom: 6px;
color: var(--accent);
font-size: 84px;
line-height: .62;
}
/* 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: 70px; 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);
}
.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: 76px;
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); }
.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-hint svg,
.reel-pill,
.dk-beat svg { animation: none !important; }
.slide-art { transition: none !important; }
}