344 lines
12 KiB
CSS
344 lines
12 KiB
CSS
/* Base Theme */
|
|
|
|
:root {
|
|
color-scheme: dark;
|
|
--accent: #5b8def;
|
|
--bg: #0a0d14;
|
|
--card: #151a25;
|
|
--edge: #232b3b;
|
|
--ink: #eef2f9;
|
|
--ink-bright: #fff;
|
|
--ink-bright-muted: rgba(255, 255, 255, .8);
|
|
--live: #3ddc97;
|
|
--media: #1a3333;
|
|
--muted: #8d98ad;
|
|
--radius-lg: 16px;
|
|
--radius-xl: 22px;
|
|
--raised: #29334a;
|
|
--scrim: rgba(4, 6, 11, .6);
|
|
--shadow: rgba(0, 0, 0, .45);
|
|
--shade: rgba(255, 255, 255, .05);
|
|
--space-xs: 4px;
|
|
--space-sm: 8px;
|
|
--space-md: 12px;
|
|
--space-lg: 24px;
|
|
--toast-bad-bg: #2b1f24;
|
|
--toast-bad-edge: #52303a;
|
|
--toast-bad-ink: #ffd9d4;
|
|
--toast-ok-bg: #172a21;
|
|
--toast-ok-edge: #2a5540;
|
|
--toast-ok-ink: #c9f7df;
|
|
--warn: #ff7a6b;
|
|
}
|
|
|
|
* { box-sizing: border-box; }
|
|
|
|
@media (prefers-reduced-motion: reduce) {
|
|
* { animation: none !important; transition: none !important; }
|
|
}
|
|
|
|
[hidden] { display: none !important; }
|
|
|
|
html { background: var(--bg); }
|
|
|
|
body {
|
|
margin: 0;
|
|
background: var(--bg);
|
|
color: var(--ink);
|
|
font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
|
|
-webkit-font-smoothing: antialiased;
|
|
-webkit-tap-highlight-color: transparent;
|
|
-webkit-touch-callout: none;
|
|
user-select: none;
|
|
overscroll-behavior-y: contain;
|
|
}
|
|
|
|
button {
|
|
font: inherit;
|
|
color: inherit;
|
|
border: 0;
|
|
background: none;
|
|
cursor: pointer;
|
|
touch-action: manipulation;
|
|
box-shadow: 1px 1px 1px 0px var(--shadow);
|
|
}
|
|
button:active { transform: scale(.96); }
|
|
|
|
svg { width: 22px; height: 22px; fill: currentColor; }
|
|
|
|
.app {
|
|
max-width: 520px;
|
|
margin: 0 auto;
|
|
padding: max(var(--space-md), env(safe-area-inset-top)) max(var(--space-md), env(safe-area-inset-right))
|
|
max(var(--space-lg), env(safe-area-inset-bottom)) max(var(--space-md), env(safe-area-inset-left));
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--space-md);
|
|
}
|
|
|
|
.wide { width: 100%; height: 50px; border-radius: var(--radius-lg); font-size: 15px; }
|
|
.ghost { background: transparent; border: 1px solid var(--edge); color: var(--muted); }
|
|
|
|
@keyframes spin { to { transform: rotate(360deg); } }
|
|
@keyframes rise { from { transform: translateY(14%); opacity: .4; } }
|
|
|
|
/* Header */
|
|
|
|
header { order: -2; display: flex; align-items: center; justify-content: center; }
|
|
header .logo { height: 44px; width: auto; display: block; margin: var(--space-xs); }
|
|
|
|
/* Card */
|
|
|
|
/* A playing card goes to the top. order does not transition, so the swap
|
|
rides on a view transition instead -- see placeCards() in app.js. */
|
|
.app > .on-top { order: -1; }
|
|
|
|
::view-transition-group(*) {
|
|
animation-duration: .4s;
|
|
animation-timing-function: cubic-bezier(.22, 1, .36, 1);
|
|
}
|
|
|
|
.card {
|
|
background: var(--card);
|
|
border: 1px solid var(--edge);
|
|
border-radius: var(--radius-xl);
|
|
padding: var(--space-md);
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--space-md);
|
|
}
|
|
.card.offline { opacity: .5; }
|
|
.card.room.playing, .card.avr.playing {
|
|
background: linear-gradient(135deg,
|
|
color-mix(in srgb, var(--live) 25%, var(--card)) 0%,
|
|
var(--card) 70%);
|
|
}
|
|
|
|
.card-head { display: flex; align-items: center; justify-content: center; gap: var(--space-md); }
|
|
.card-head h2 {
|
|
display: flex; align-items: center; gap: var(--space-md);
|
|
margin: var(--space-sm); min-width: 0;
|
|
font-size: 20px; font-weight: 600;
|
|
}
|
|
.card-head h2 .room-icon { flex: 0 0 auto; height: 20px; width: auto; fill: currentColor; }
|
|
.card-head h2 .room-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
|
|
/* Card - Media being played */
|
|
|
|
.media {
|
|
background: var(--shade);
|
|
border-radius: var(--radius-lg);
|
|
padding: var(--space-md);
|
|
display: flex;
|
|
row-gap: var(--space-md);
|
|
flex-direction: column;
|
|
}
|
|
|
|
.now-playing {
|
|
display: flex; align-items: center; gap: var(--space-md); min-width: 0;
|
|
}
|
|
.cover {
|
|
flex: 0 0 auto;
|
|
width: 62px; height: 62px;
|
|
border-radius: 13px;
|
|
object-fit: cover;
|
|
background: var(--raised);
|
|
}
|
|
.cover.poster { width: 50px; height: 75px; border-radius: 9px; }
|
|
.track { display: flex; flex-direction: column; min-width: 0; }
|
|
.track span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
.song { font-size: 17px; font-weight: 550; }
|
|
.artist { font-size: 15px; color: var(--muted); }
|
|
.progress { display: flex; align-items: center; gap: var(--space-md); }
|
|
.progress-line { position: relative; flex: 1; height: 3px; border-radius: 2px; background: var(--muted); }
|
|
.progress-fill {
|
|
display: block; height: 100%; width: calc(var(--progress, 0) * 1%);
|
|
border-radius: 999px; background: var(--muted);
|
|
transition: width .12s ease-out;
|
|
}
|
|
.progress-cursor {
|
|
display: none;
|
|
position: absolute; top: 50%;
|
|
left: calc(var(--progress, 0) * 1%);
|
|
width: 7px; height: 7px; margin-left: -3.5px;
|
|
border-radius: 50%; background: var(--muted);
|
|
transform: translateY(-50%);
|
|
transition: left .12s ease-out;
|
|
}
|
|
.progress-time,
|
|
.progress-total {
|
|
display: none;
|
|
font-size: 12px; line-height: 1; color: var(--muted);
|
|
font-variant-numeric: tabular-nums; white-space: nowrap;
|
|
}
|
|
.progress-time {
|
|
position: absolute;
|
|
left: clamp(var(--half, 0px), calc(var(--progress, 0) * 1%), calc(100% - var(--half, 0px)));
|
|
transform: translateX(-50%);
|
|
transition: left .12s ease-out;
|
|
}
|
|
.progress-time.elapsed { bottom: 9px; }
|
|
.progress-time.remaining { top: 9px; }
|
|
.progress.known { padding: var(--space-md) 0; } /* room for the labels above and below the cursor */
|
|
.progress.known .progress-cursor,
|
|
.progress.known .progress-time,
|
|
.progress.known .progress-total { display: block; }
|
|
.progress.seekable .progress-cursor,
|
|
.progress.seekable .progress-time { cursor: grab; touch-action: pan-y; }
|
|
.progress.seekable .progress-cursor::before { content: ''; position: absolute; inset: calc(var(--space-md) * -1); }
|
|
.progress.dragging .progress-cursor,
|
|
.progress.dragging .progress-time { transition: none; cursor: grabbing; }
|
|
.progress.dragging .progress-cursor { background: var(--ink); transform: translateY(-50%) scale(1.6); }
|
|
.progress.dragging .progress-time { color: var(--ink); }
|
|
|
|
/* Card - Volume */
|
|
|
|
.volume { display: flex; align-items: center; gap: var(--space-md); }
|
|
|
|
.control-btn {
|
|
flex: 0 0 auto;
|
|
width: 72px; height: 62px;
|
|
border-radius: var(--radius-lg);
|
|
background: var(--raised);
|
|
display: grid; place-items: center;
|
|
}
|
|
.control-btn svg { width: 20px; height: 20px; }
|
|
.control-btn:disabled { opacity: .5; }
|
|
|
|
.meter { position: relative; flex: 1; height: 8px; border-radius: 4px; background: var(--bg); }
|
|
.meter i {
|
|
display: block; height: 100%; width: calc(var(--level, 0) * 1%);
|
|
border-radius: 999px; background: var(--accent);
|
|
transition: width .12s ease-out;
|
|
}
|
|
|
|
.knob {
|
|
position: absolute; top: 50%;
|
|
left: calc((100% - 46px) * var(--level, 0) / 100);
|
|
width: 46px; height: 30px;
|
|
transform: translateY(-50%);
|
|
display: grid; place-items: center;
|
|
border-radius: 999px;
|
|
background: var(--accent); color: var(--ink-bright);
|
|
box-shadow: 0 0 0 3px var(--card);
|
|
font-size: 14px; font-weight: 640; font-variant-numeric: tabular-nums;
|
|
transition: left .12s ease-out;
|
|
cursor: grab;
|
|
touch-action: none; /* the drag is ours, not a page scroll */
|
|
}
|
|
.knob::before { /* A thumb-sized grip around a knob only 30px tall. A press on the pseudo-element lands on the knob itself. */
|
|
content: '';
|
|
position: absolute;
|
|
inset: calc(var(--space-md) * -1) calc(var(--space-sm) * -1);
|
|
}
|
|
.meter.dragging i,
|
|
.meter.dragging .knob { transition: none; }
|
|
.meter.dragging .knob { cursor: grabbing; transform: translateY(-50%) scale(1.12); }
|
|
|
|
/* Card - Navigation */
|
|
|
|
.actions { display: flex; align-items: stretch; justify-content: center; gap: var(--space-md); }
|
|
|
|
.control-btn .icon-pause { display: none; }
|
|
.control-btn.playing .icon-play { display: none; }
|
|
.control-btn.playing .icon-pause { display: block; }
|
|
|
|
/* Card - Sources */
|
|
|
|
.sources { display: flex; gap: var(--space-md); }
|
|
.sources-btn {
|
|
flex: 1; min-width: 0;
|
|
height: 50px; border-radius: var(--radius-lg);
|
|
background: var(--raised);
|
|
display: flex; align-items: center; justify-content: center; gap: var(--space-sm);
|
|
font-size: 15px; font-weight: 550;
|
|
}
|
|
.sources-btn:disabled { opacity: .5; }
|
|
.sources-btn svg { flex: 0 0 auto; color: var(--ink-bright); }
|
|
.sources-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
.sources-btn .spinner { display: none; }
|
|
button.sources-btn.loading .icon { display: none; }
|
|
.sources-btn.loading .spinner { display: block; animation: spin 1s steps(8) infinite; }
|
|
|
|
.spotify[aria-pressed="true"] { border: 2px solid var(--ink); }
|
|
|
|
.toggle .leave { display: none; }
|
|
.toggle[aria-pressed="true"] { background: var(--accent); color: var(--ink-bright); }
|
|
|
|
/* AVR */
|
|
|
|
/* AVR - Input */
|
|
|
|
.input-select {
|
|
display: flex; align-items: center; gap: var(--space-md);
|
|
width: 100%; min-height: 50px;
|
|
padding: var(--space-md) var(--space-md);
|
|
border-radius: var(--radius-lg);
|
|
background: var(--raised);
|
|
text-align: left;
|
|
}
|
|
.input-select .eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
|
|
.input-select [data-role="input-icon"] { flex: 0 0 auto; height: 18px; width: 18px; fill: currentColor; color: var(--muted); }
|
|
.input-select .value { flex: 1; font-size: 19px; font-weight: 600; }
|
|
.input-select .chevron { color: var(--muted); }
|
|
|
|
.sheet-wrap { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; justify-content: flex-end; }
|
|
.scrim { position: absolute; inset: 0; background: var(--scrim); backdrop-filter: blur(3px); }
|
|
|
|
.sheet {
|
|
position: relative;
|
|
background: var(--card);
|
|
border: 1px solid var(--edge);
|
|
border-radius: 28px 28px 0 0;
|
|
padding: var(--space-md) var(--space-md) calc(var(--space-md) + env(safe-area-inset-bottom));
|
|
max-height: 82vh;
|
|
display: flex; flex-direction: column; gap: var(--space-md);
|
|
animation: rise .22s cubic-bezier(.22, .68, .3, 1);
|
|
}
|
|
|
|
.grabber { width: 38px; height: 4px; border-radius: 999px; background: var(--edge); margin: var(--space-xs) auto var(--space-xs); }
|
|
.sheet h3 { margin: 0 var(--space-xs); font-size: 14px; font-weight: 600; color: var(--muted); }
|
|
|
|
.options { display: flex; flex-direction: column; gap: var(--space-sm); overflow-y: auto; -webkit-overflow-scrolling: touch; }
|
|
.option {
|
|
display: flex; align-items: center; justify-content: space-between; gap: var(--space-md);
|
|
min-height: 58px; padding: 0 var(--space-md);
|
|
border-radius: var(--radius-lg); background: var(--raised);
|
|
font-size: 17px; text-align: left;
|
|
}
|
|
.option[aria-current="true"] { background: var(--accent); color: var(--ink-bright); }
|
|
.option-label { display: flex; align-items: center; gap: var(--space-md); min-width: 0; overflow: hidden; }
|
|
.option-label svg { flex: 0 0 auto; height: 18px; width: 18px; fill: currentColor; color: var(--muted); }
|
|
.option-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
.option[aria-current="true"] .option-label svg { color: var(--ink-bright-muted); }
|
|
.option .code { font-size: 12px; color: var(--muted); flex: 0 0 auto; }
|
|
.option[aria-current="true"] .code { color: var(--ink-bright-muted); }
|
|
|
|
/* AVR - Grouped Room */
|
|
|
|
.joined { display: flex; flex-direction: column; gap: var(--space-md); }
|
|
.joined .card.room { background: none; border-color: var(--ink); border-radius: 18px; padding: var(--space-md); gap: var(--space-md); }
|
|
.joined .card-head h2 { font-size: 15px; font-weight: 550; color: var(--muted); }
|
|
.joined .cover { width: 52px; height: 52px; border-radius: 10px; }
|
|
.joined .song { font-size: 18px; }
|
|
.joined .step { height: 54px; }
|
|
.joined .toggle[aria-pressed="true"] { background: var(--raised); color: inherit; }
|
|
.joined .toggle .cinema { display: none; }
|
|
.joined .toggle .leave { display: block; }
|
|
|
|
/* Footer */
|
|
|
|
footer { margin: var(--space-xs) var(--space-xs) 0; min-height: 18px; font-size: 12px; color: var(--muted); text-align: center; }
|
|
footer.bad { color: var(--warn); }
|
|
|
|
/* Toast */
|
|
|
|
.toast {
|
|
position: fixed; left: 50%; transform: translateX(-50%);
|
|
bottom: calc(22px + env(safe-area-inset-bottom));
|
|
z-index: 20; max-width: 90vw;
|
|
padding: var(--space-md) var(--space-md); border-radius: 14px;
|
|
background: var(--toast-bad-bg); border: 1px solid var(--toast-bad-edge); color: var(--toast-bad-ink);
|
|
font-size: 14px; box-shadow: 0 10px 30px var(--shadow);
|
|
}
|
|
.toast.ok { background: var(--toast-ok-bg); border-color: var(--toast-ok-edge); color: var(--toast-ok-ink); } |