Add API documentation and underground station importer

- Introduced a new HTML documentation page for the oradio API, including a JavaScript file to handle dynamic content and API requests.
- Added a CSS file for styling the documentation page.
- Implemented an underground station importer script that fetches data from Radio-Browser and writes it to a JSON file.
- Created a stats module to compute and manage vote and play statistics for radio stations.
- Added a polyfill for modulepreload to ensure compatibility with older browsers.
This commit is contained in:
Marco Mooren
2026-05-11 02:06:48 +02:00
parent e0a60f7b64
commit 00246389bc
52 changed files with 6280 additions and 2475 deletions

View File

@@ -189,6 +189,37 @@ input, select, textarea { font: inherit; color: inherit; }
.btn-add:hover { background: #ff8a55; }
.btn-add:active { transform: scale(0.94); }
.btn-random {
display: flex; align-items: center; gap: 6px;
height: 36px; padding: 0 12px;
border-radius: 999px;
background: var(--bg-2); color: var(--fg);
border: 1px solid var(--line);
font-size: 13px; font-weight: 600;
transition: background 120ms, border-color 120ms, transform 80ms;
}
.btn-random:hover { background: var(--bg-3); border-color: rgba(255,122,61,0.4); }
.btn-random:active { transform: scale(0.96); }
.btn-random .rand-icon { font-size: 15px; line-height: 1; }
.btn-random .rand-mode {
font-size: 11px; padding: 2px 6px; border-radius: 999px;
background: rgba(255,122,61,0.18); color: var(--accent-2);
border: 1px solid rgba(255,122,61,0.30);
letter-spacing: 0.02em;
}
.btn-docs {
display: flex; align-items: center; justify-content: center;
height: 36px; padding: 0 12px;
border-radius: 999px;
background: var(--bg-2); color: var(--muted);
border: 1px solid var(--line);
font-size: 12px; font-weight: 700; letter-spacing: 0.06em;
text-decoration: none;
transition: background 120ms, color 120ms, border-color 120ms;
}
.btn-docs:hover { background: var(--bg-3); color: var(--fg); border-color: rgba(78,201,166,0.4); }
.chips {
display: flex; flex-wrap: wrap; gap: 5px;
max-height: 64px; overflow-y: auto;
@@ -656,3 +687,83 @@ dialog.add-station select:focus { border-color: var(--accent) !important; box-sh
box-shadow: none !important;
text-transform: uppercase; letter-spacing: 0.06em; font-weight: 800; font-size: 12px;
}
/* ============================================================
Voting: up/down buttons in the now-playing bar, score badge
on every card, and a sort dropdown for the Browse tab.
============================================================ */
.vote-group {
display: flex;
gap: 0;
margin-right: 6px;
}
.vote {
display: flex; align-items: center; gap: 6px;
height: 46px; min-width: 64px;
padding: 0 12px;
background: var(--bg-2) !important;
color: var(--fg);
border: 1px solid var(--line) !important;
font-weight: 800; font-size: 14px;
font-variant-numeric: tabular-nums;
transition: background 80ms linear, color 80ms linear, border-color 80ms linear !important;
}
.vote + .vote { margin-left: -1px; }
.vote:disabled { opacity: 0.35; cursor: not-allowed; }
.vote .vote-icon { font-size: 17px; line-height: 1; }
.vote .vote-count { font-size: 13px; letter-spacing: 0.02em; }
.vote.up:not(:disabled):hover {
background: var(--good) !important; color: #000 !important; border-color: var(--good) !important;
}
.vote.down:not(:disabled):hover {
background: var(--bad) !important; color: #000 !important; border-color: var(--bad) !important;
}
.vote.up.on {
background: var(--good) !important; color: #000 !important; border-color: var(--good) !important;
}
.vote.down.on {
background: var(--bad) !important; color: #000 !important; border-color: var(--bad) !important;
}
/* Sort dropdown next to search */
.sort {
height: 36px;
padding: 0 28px 0 12px;
background: var(--bg-2) !important;
color: var(--fg);
border: 1px solid var(--line) !important;
font-size: 12px; font-weight: 700;
text-transform: uppercase; letter-spacing: 0.05em;
appearance: none;
background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
linear-gradient(135deg, var(--muted) 50%, transparent 50%);
background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
background-size: 5px 5px, 5px 5px;
background-repeat: no-repeat;
outline: none;
cursor: pointer;
}
.sort:focus, .sort:hover { border-color: var(--accent) !important; }
.sort option { background: var(--bg-1); color: var(--fg); }
/* Grid card: add a column for the score badge. */
.card {
grid-template-columns: 44px 1fr auto auto auto !important;
}
.score-badge {
display: inline-flex; align-items: center; justify-content: center;
min-width: 36px; height: 26px;
padding: 0 8px;
background: var(--bg-2);
border: 1px solid var(--line);
color: var(--muted);
font-weight: 800; font-size: 12px;
font-variant-numeric: tabular-nums;
letter-spacing: 0.02em;
}
.score-badge.pos { color: var(--good); border-color: rgba(0,210,122,0.35); }
.score-badge.neg { color: var(--bad); border-color: rgba(255,48,48,0.35); }
.score-badge.neu { color: var(--muted-2); }
.card.playing .score-badge { border-color: var(--accent); }