ad43df87c0
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.
313 lines
5.2 KiB
CSS
313 lines
5.2 KiB
CSS
/* RangerHQ Tuner popup — ~360x520, dark earthy palette echoing the
|
|
RangerHQ family brand (forest green + warm cream). Vanilla CSS,
|
|
no preprocessor, no build step. */
|
|
|
|
:root {
|
|
--bg: #0f1411;
|
|
--bg-soft: #1a221c;
|
|
--bg-row: #1f2823;
|
|
--bg-row-hi: #2a3530;
|
|
--fg: #e8e4d4;
|
|
--fg-muted: #97a094;
|
|
--accent: #6dbf7a; /* RangerHQ green */
|
|
--accent-dim: #2a7d3e;
|
|
--cream: #f4e9b7;
|
|
--danger: #c9685b;
|
|
--radius: 6px;
|
|
}
|
|
|
|
* { box-sizing: border-box; }
|
|
|
|
html, body {
|
|
margin: 0;
|
|
padding: 0;
|
|
width: 360px;
|
|
background: var(--bg);
|
|
color: var(--fg);
|
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
font-size: 13px;
|
|
line-height: 1.4;
|
|
}
|
|
|
|
/* Header */
|
|
.tuner-header {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding: 10px 12px;
|
|
background: var(--bg-soft);
|
|
border-bottom: 1px solid #000;
|
|
}
|
|
|
|
.tuner-brand {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
}
|
|
|
|
.tuner-brand h1 {
|
|
margin: 0;
|
|
font-size: 14px;
|
|
font-weight: 600;
|
|
letter-spacing: 0.2px;
|
|
}
|
|
|
|
.tuner-dot {
|
|
width: 10px;
|
|
height: 10px;
|
|
border-radius: 50%;
|
|
background: var(--accent);
|
|
box-shadow: 0 0 8px var(--accent);
|
|
}
|
|
|
|
.tuner-state {
|
|
font-size: 11px;
|
|
color: var(--fg-muted);
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.5px;
|
|
padding: 2px 8px;
|
|
border-radius: 999px;
|
|
background: var(--bg-row);
|
|
}
|
|
|
|
.tuner-state[data-state="playing"] {
|
|
color: var(--bg);
|
|
background: var(--accent);
|
|
}
|
|
|
|
.tuner-state[data-state="buffering"] {
|
|
color: var(--bg);
|
|
background: var(--cream);
|
|
}
|
|
|
|
.tuner-state[data-state="error"] {
|
|
color: var(--cream);
|
|
background: var(--danger);
|
|
}
|
|
|
|
/* Now playing */
|
|
.now-playing {
|
|
padding: 10px 12px;
|
|
background: var(--bg-soft);
|
|
border-bottom: 1px solid #000;
|
|
}
|
|
|
|
.np-station {
|
|
font-weight: 600;
|
|
font-size: 13px;
|
|
}
|
|
|
|
.np-track {
|
|
font-size: 12px;
|
|
color: var(--fg-muted);
|
|
margin-top: 2px;
|
|
min-height: 1.4em;
|
|
}
|
|
|
|
/* Controls */
|
|
.controls {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
padding: 10px 12px;
|
|
border-bottom: 1px solid #000;
|
|
}
|
|
|
|
.btn {
|
|
padding: 6px 14px;
|
|
font-size: 13px;
|
|
font-weight: 500;
|
|
border: 1px solid var(--accent-dim);
|
|
border-radius: var(--radius);
|
|
background: var(--bg-row);
|
|
color: var(--fg);
|
|
cursor: pointer;
|
|
}
|
|
|
|
.btn:hover:not(:disabled) {
|
|
background: var(--bg-row-hi);
|
|
}
|
|
|
|
.btn:disabled {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
.btn-primary {
|
|
background: var(--accent-dim);
|
|
}
|
|
|
|
.btn-primary[aria-pressed="true"] {
|
|
background: var(--accent);
|
|
color: var(--bg);
|
|
}
|
|
|
|
.vol-wrap {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
flex: 1;
|
|
}
|
|
|
|
.vol-label {
|
|
font-size: 11px;
|
|
color: var(--fg-muted);
|
|
}
|
|
|
|
#volume {
|
|
flex: 1;
|
|
accent-color: var(--accent);
|
|
}
|
|
|
|
/* Search */
|
|
.search-wrap {
|
|
display: block;
|
|
padding: 8px 12px 4px;
|
|
}
|
|
|
|
#search {
|
|
width: 100%;
|
|
padding: 6px 8px;
|
|
font-size: 12px;
|
|
background: var(--bg-row);
|
|
color: var(--fg);
|
|
border: 1px solid var(--bg-row-hi);
|
|
border-radius: var(--radius);
|
|
}
|
|
|
|
#search:focus {
|
|
outline: none;
|
|
border-color: var(--accent);
|
|
}
|
|
|
|
/* Station list */
|
|
.station-list {
|
|
margin: 0;
|
|
padding: 0;
|
|
list-style: none;
|
|
max-height: 280px;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
.station-row {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
padding: 8px 12px;
|
|
border-bottom: 1px solid var(--bg-soft);
|
|
cursor: pointer;
|
|
}
|
|
|
|
.station-row:hover {
|
|
background: var(--bg-row);
|
|
}
|
|
|
|
.station-row.is-active {
|
|
background: var(--bg-row-hi);
|
|
border-left: 3px solid var(--accent);
|
|
padding-left: 9px;
|
|
}
|
|
|
|
.station-art {
|
|
width: 28px;
|
|
height: 28px;
|
|
border-radius: 4px;
|
|
background: var(--bg-soft);
|
|
flex-shrink: 0;
|
|
object-fit: cover;
|
|
}
|
|
|
|
.station-meta {
|
|
flex: 1;
|
|
min-width: 0;
|
|
}
|
|
|
|
.station-name {
|
|
font-size: 12px;
|
|
font-weight: 500;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
.station-genre {
|
|
font-size: 10px;
|
|
color: var(--fg-muted);
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
.station-empty {
|
|
padding: 16px;
|
|
text-align: center;
|
|
color: var(--fg-muted);
|
|
font-size: 12px;
|
|
}
|
|
|
|
/* Nav — quick-link row above the footer */
|
|
.tuner-nav {
|
|
display: grid;
|
|
grid-template-columns: repeat(3, 1fr);
|
|
background: var(--bg-soft);
|
|
border-top: 1px solid #000;
|
|
gap: 1px;
|
|
}
|
|
|
|
.tuner-nav-btn {
|
|
background: var(--bg-soft);
|
|
color: var(--fg-muted);
|
|
border: 0;
|
|
padding: 8px 4px;
|
|
font: inherit;
|
|
font-size: 11px;
|
|
font-weight: 500;
|
|
cursor: pointer;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
gap: 3px;
|
|
font-family: inherit;
|
|
}
|
|
|
|
.tuner-nav-btn:hover {
|
|
background: var(--bg-row);
|
|
color: var(--fg);
|
|
}
|
|
|
|
.tuner-nav-btn:active {
|
|
background: var(--bg-row-hi);
|
|
}
|
|
|
|
.tuner-nav-icon {
|
|
font-size: 14px;
|
|
line-height: 1;
|
|
color: var(--accent);
|
|
}
|
|
|
|
.tuner-nav-label {
|
|
letter-spacing: 0.3px;
|
|
}
|
|
|
|
/* Footer */
|
|
.tuner-footer {
|
|
padding: 6px 12px;
|
|
background: var(--bg-soft);
|
|
border-top: 1px solid var(--bg-row);
|
|
font-size: 10px;
|
|
color: var(--fg-muted);
|
|
text-align: center;
|
|
}
|
|
|
|
/* Scrollbar styling — subtle, on-brand */
|
|
.station-list::-webkit-scrollbar {
|
|
width: 6px;
|
|
}
|
|
.station-list::-webkit-scrollbar-thumb {
|
|
background: var(--bg-row-hi);
|
|
border-radius: 3px;
|
|
}
|
|
.station-list::-webkit-scrollbar-track {
|
|
background: transparent;
|
|
}
|