Files
rangerhq-tuner/src/options/options.css
T
ranger ad43df87c0 feat: v0.3.0 — history, 4-button search, options page, newtab override
Web Store submission target. Mirrors rangerhq-radio's track-history pattern
(inc/history.php) so the family stays coherent across surfaces.

Highlights
- New Tab Page override (Tier 2.5) — Chrome's default new tab replaced with
  a RangerHQ-branded landing showing the player, current track, quick chips,
  searchable browse list, and now history + favourites tabs.
- Track history + favourites — capped FIFO 500, dedup against last entry,
  skip "(unknown)" artist (SomaFM dead-air). Stored in chrome.storage.local
  under tuner.history + tuner.favourites.
- 4-button search per entry — Spotify / YouTube / Apple Music / Bandcamp.
  Pure public-search-URL link-outs in a new tab, NO auth, NO API keys, NO
  quota, NO third-party SDK embedded.
- Options page (chrome://extensions → details → options) — live stats,
  history cap slider (50-500), Clear history / Clear favourites / Clear
  EVERYTHING buttons, About panel with Gitea + davidtkeane.com links.
- Popup nav row — Open in tab / History (#hash deep link) / Settings,
  using chrome.tabs.create + chrome.runtime.openOptionsPage. No new perms.
- Cross-surface sync — popup ↔ newtab listen on chrome.storage.onChanged
  for tuner.currentStationId / tuner.isPlaying / history / favourites.
- Storage gateway — offscreen doc can't reliably reach chrome.storage in
  some Chrome versions, so it sends LOG_TRACK_REQUEST to the SW which
  does the write. history.js also defensively guards every storage call.
- Metadata latency fix — polling now starts immediately on PLAY, in
  parallel with audio buffer fill. First track display drops from
  ~10-15s to ~1-2s.

Permissions unchanged
- Still ["offscreen", "storage"] + somafm.com host only.
- chrome.tabs.create works on our own extension URLs without "tabs" perm.
- No webRequest, no <all_urls>, no third-party SDK.

Bumped from 0.1.0 (last tag on Gitea) directly to 0.3.0.
v0.2.0 (newtab + clock) was a working local build but never tagged;
its features ship together with v0.3.0 in this single commit.
2026-06-09 00:23:36 +01:00

263 lines
4.3 KiB
CSS

/* RangerHQ Tuner — Options page.
Same earthy palette as popup + newtab.
*/
:root {
--bg: #0f1411;
--bg-soft: #1a221c;
--bg-row: #1f2823;
--bg-row-hi: #2a3530;
--fg: #e8e4d4;
--fg-muted: #97a094;
--accent: #6dbf7a;
--accent-dim: #2a7d3e;
--cream: #f4e9b7;
--danger: #c9685b;
--radius: 6px;
}
* { box-sizing: border-box; }
html, body {
margin: 0;
padding: 0;
background: var(--bg);
color: var(--fg);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
font-size: 14px;
min-height: 100vh;
}
.opt-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 18px 28px;
background: var(--bg-soft);
border-bottom: 1px solid #000;
}
.opt-brand {
display: flex;
align-items: center;
gap: 12px;
}
.opt-helmet {
width: 28px;
height: 28px;
object-fit: contain;
}
.opt-brand h1 {
margin: 0;
font-size: 15px;
font-weight: 600;
letter-spacing: 0.3px;
}
.opt-version {
font-size: 11px;
color: var(--fg-muted);
letter-spacing: 0.5px;
padding: 3px 10px;
background: var(--bg-row);
border-radius: 999px;
}
.opt-main {
max-width: 680px;
margin: 0 auto;
padding: 28px;
display: flex;
flex-direction: column;
gap: 18px;
}
.opt-card {
background: var(--bg-soft);
border: 1px solid var(--bg-row);
border-radius: var(--radius);
padding: 20px 22px;
}
.opt-card h2 {
margin: 0 0 14px;
font-size: 13px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 1px;
color: var(--accent);
}
.opt-note {
margin: 0 0 16px;
font-size: 12px;
color: var(--fg-muted);
line-height: 1.5;
}
.opt-stats {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 10px;
margin-bottom: 18px;
}
.opt-stat {
padding: 10px 14px;
background: var(--bg-row);
border-radius: 4px;
}
.opt-stat-label {
font-size: 10px;
color: var(--fg-muted);
text-transform: uppercase;
letter-spacing: 0.5px;
margin-bottom: 2px;
}
.opt-stat-value {
font-size: 14px;
font-weight: 500;
font-variant-numeric: tabular-nums;
}
.opt-row {
margin: 16px 0;
}
.opt-row label {
display: block;
font-size: 13px;
font-weight: 500;
margin-bottom: 6px;
}
.opt-row--inline {
display: flex;
justify-content: space-between;
align-items: center;
padding: 8px 0;
border-bottom: 1px solid var(--bg-row);
margin: 0;
}
.opt-row--inline:last-child { border-bottom: none; }
.opt-row--inline label { margin-bottom: 0; }
.opt-help {
display: block;
font-size: 11px;
font-weight: 400;
color: var(--fg-muted);
margin-top: 2px;
}
.opt-slider-wrap {
display: flex;
align-items: center;
gap: 14px;
}
#opt-cap {
flex: 1;
accent-color: var(--accent);
}
.opt-slider-value {
font-variant-numeric: tabular-nums;
font-weight: 500;
min-width: 3em;
text-align: right;
}
.opt-actions {
display: flex;
gap: 8px;
flex-wrap: wrap;
margin-top: 18px;
padding-top: 16px;
border-top: 1px solid var(--bg-row);
}
.opt-btn {
font-family: inherit;
font-size: 12px;
font-weight: 500;
padding: 8px 16px;
background: var(--bg-row);
color: var(--fg);
border: 1px solid var(--bg-row-hi);
border-radius: var(--radius);
cursor: pointer;
}
.opt-btn:hover {
border-color: var(--accent);
}
.opt-btn--danger {
border-color: var(--danger);
color: var(--danger);
}
.opt-btn--danger:hover {
background: var(--danger);
color: var(--cream);
}
.opt-about {
margin: 0 0 14px;
font-size: 13px;
color: var(--fg-muted);
line-height: 1.6;
}
.opt-about a, .opt-links a {
color: var(--accent);
text-decoration: none;
border-bottom: 1px dotted transparent;
}
.opt-about a:hover, .opt-links a:hover {
border-bottom-color: var(--accent);
}
.opt-links {
margin: 0;
padding: 0;
list-style: none;
font-size: 12px;
color: var(--fg-muted);
display: grid;
grid-template-columns: 1fr;
gap: 6px;
}
.opt-links strong {
color: var(--fg);
font-weight: 500;
}
.opt-toast {
position: fixed;
bottom: 24px;
left: 50%;
transform: translateX(-50%);
background: var(--accent);
color: var(--bg);
padding: 10px 18px;
border-radius: var(--radius);
font-size: 13px;
font-weight: 500;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.opt-toast[data-tone="error"] {
background: var(--danger);
color: var(--cream);
}