Files
radio/assets/css/radio.css
T
2026-07-24 12:06:00 -05:00

207 lines
6.7 KiB
CSS

/*
* radio.css — all colors/fonts come from CSS variables defined in <head>
* (see partials/head.php, fed by .env). Restyle a station without editing CSS.
* When THEME_DYNAMIC_BG is on, player.js overrides --text and the background
* colors at runtime to match the album art.
*/
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 10px;
background: var(--bg);
color: var(--text);
font-family: var(--font);
text-align: center;
-webkit-font-smoothing: antialiased;
transition: background-color .6s ease;
}
a { color: var(--muted); text-decoration: none; }
a:hover, a:focus { color: var(--text); text-decoration: underline; }
/* -------------------------------------------------------------- layout */
.player-wrap {
width: 100%;
max-width: 660px;
padding: 16px;
display: flex;
flex-direction: column;
align-items: center;
gap: 14px;
}
.player-card {
width: 100%;
padding: 24px;
background: var(--surface);
border-radius: calc(var(--radius) + 10px);
display: flex;
flex-direction: column;
align-items: center;
gap: 16px;
transition: background-color .6s ease;
}
/* ----------------------------------------------------------- album art */
.album-art {
width: 100%;
max-width: 600px;
height: auto;
aspect-ratio: 1 / 1;
object-fit: cover;
border-radius: var(--radius);
box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
opacity: 0.92;
transition: opacity .2s ease-in-out, border-radius .2s ease-in-out;
}
.album-art:hover { opacity: 1; border-radius: 0; }
/* ---------------------------------------------------------- track meta */
.track-meta { width: 100%; }
.track-name { font-size: 1.25rem; font-weight: 700; line-height: 1.3; word-break: break-word; }
.track-artist { font-size: 1rem; opacity: 0.9; margin-top: 2px; word-break: break-word; }
.track-album { font-size: 0.85rem; opacity: 0.65; margin-top: 2px; word-break: break-word; }
/* ------------------------------------------------------------ controls */
.controls { display: flex; justify-content: center; }
.playpause {
width: 64px; height: 64px;
display: flex; align-items: center; justify-content: center;
border: none; border-radius: 50%;
background: var(--accent); color: var(--accent-text);
cursor: pointer;
transition: background .15s ease, transform .1s ease;
}
.playpause:hover, .playpause:focus { background: var(--accent-hover); outline: 0; }
.playpause:active { transform: scale(0.94); }
.icon-btn {
background: none; border: none; color: var(--text);
cursor: pointer; padding: 4px; display: inline-flex; opacity: 0.85;
}
.icon-btn:hover { opacity: 1; }
/* ---------------------------------------------------- seek / volume rows */
.seek-row, .vol-row {
width: 100%;
display: flex;
align-items: center;
gap: 10px;
}
.vol-row { justify-content: center; }
.time { font-variant-numeric: tabular-nums; font-size: 0.8rem; opacity: 0.8; min-width: 40px; }
.live-badge { display: inline-flex; align-items: center; gap: 6px; }
.live-text {
color: #ffffff;
font-size: 0.78rem; font-weight: 700; letter-spacing: .12em;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.live-dot {
width: 10px; height: 10px; border-radius: 50%;
background: #21d05f;
animation: live-pulse 2.6s ease-in-out infinite;
}
@keyframes live-pulse {
0%, 100% { box-shadow: 0 0 3px 0 rgba(33, 208, 95, 0.5); opacity: 0.85; }
50% { box-shadow: 0 0 11px 3px rgba(33, 208, 95, 0.95); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
.live-dot { animation: none; box-shadow: 0 0 6px rgba(33, 208, 95, 0.9); }
}
.range {
-webkit-appearance: none; appearance: none;
height: 6px; border-radius: 3px;
background: rgba(127, 127, 127, 0.35);
outline: none; cursor: pointer;
}
.seek { flex: 1; }
.volume { width: 140px; }
.range::-webkit-slider-thumb {
-webkit-appearance: none; appearance: none;
width: 14px; height: 14px; border-radius: 50%;
background: var(--accent); border: none; cursor: pointer;
}
.range::-moz-range-thumb {
width: 14px; height: 14px; border-radius: 50%;
background: var(--accent); border: none; cursor: pointer;
}
.range:disabled { opacity: 0.45; cursor: default; }
/* native <audio> fallback (PLAYER_STYLE=simple / noscript) */
audio[controls] { width: 100%; outline: 0; }
/* --------------------------------------------------------------- buttons */
.btn-accent {
min-width: 120px;
padding: 9px 16px;
background: var(--accent); color: var(--accent-text);
font-variant: small-caps; font-size: 1rem;
border: 1px solid var(--accent); border-radius: 6px;
cursor: pointer;
transition: background .15s ease, box-shadow .15s ease;
}
.btn-accent:hover, .btn-accent:focus {
background: var(--accent-hover); border-color: var(--accent-hover);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35); outline: 0;
}
/* --------------------------------------------------------------- lyrics */
.lyrics {
width: 100%; max-width: 460px;
max-height: 42vh; overflow-y: auto;
text-align: left; white-space: pre-line; line-height: 1.5;
padding: 12px 14px;
background: rgba(0, 0, 0, 0.25);
border-radius: var(--radius);
color: var(--text);
}
/* ----------------------------------------------------- history panel */
.history-toggle {
position: fixed; top: 16px; right: 16px; z-index: 30;
padding: 8px 14px;
background: var(--accent); color: var(--accent-text);
font-variant: small-caps; border: none; border-radius: 8px; cursor: pointer;
}
.history-toggle:hover, .history-toggle:focus { background: var(--accent-hover); outline: 0; }
.history {
position: fixed; top: 0; right: 0; height: 100%;
width: min(90vw, 420px); padding: 64px 16px 16px;
background: var(--surface);
box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
transform: translateX(100%); transition: transform .35s ease;
overflow-y: auto; z-index: 25;
}
.history.open { transform: translateX(0); }
.history-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; text-align: left; }
.history-table th, .history-table td {
padding: 6px 8px; border-bottom: 1px solid rgba(127, 127, 127, 0.25); vertical-align: top;
}
.history-table th { opacity: 0.7; font-weight: 600; }
/* ------------------------------------------------------------ listeners */
.listeners {
position: fixed; bottom: 12px; left: 12px;
font-size: 0.9rem; color: var(--text); opacity: 0.85;
}
/* ------------------------------------------------------------ responsive */
@media (max-width: 575px) {
body { background: var(--bg-mobile); }
.player-card { padding: 16px; }
.album-art { width: 88%; }
.history { width: min(96vw, 420px); }
}
@media print { html, body { display: none; } }