Files
Levyraati26_go/static/style.css
T
Esa Kataja 91e136055c Add the YouTube submission path
Step 5. A URL goes through the same pipeline as an upload — it just gains a
download step and a source_url.

- The host allowlist is checked on the parsed hostname before yt-dlp is
  invoked, so lookalikes and userinfo tricks are refused too
- yt-dlp -J reads metadata synchronously with a 15s timeout; a timeout leaves
  the fields blank rather than failing the submission
- Over-long tracks are refused from that metadata, before a byte is downloaded
- Failed URL submissions offer Yritä uudelleen with the typed text intact;
  uploads cannot retry, so they offer re-upload

Prefill takes track then title, and artist then creator then uploader, and
leaves a field blank rather than inventing one. testdata/ytdlp-noose.json is a
real dump of an ordinary upload, which has none of the music fields.

Also fixes a URL-only submit being blocked by the file input's required
attribute — HTML cannot express "one of these two", so the server says it.

The image now takes yt-dlp from Alpine 3.24 instead of pip, which drops
python3 and pip entirely; see decision 19.
2026-07-31 21:54:15 +03:00

234 lines
7.0 KiB
CSS

/* Theme tokens first — the dark rock/metal look lives here and nowhere else. */
:root {
--bg: #121212;
--surface: #1c1c1e;
--surface-2: #26262a;
--border: #35353a;
--text: #ece9e6;
--muted: #9a948d;
--accent: #ff5722;
--accent-2: #c62828;
--error: #ef5350;
--radius: 4px;
/* ponytail: system stack until an Oswald woff2 is vendored into /static. */
--font-head: "Oswald", "Fira Sans Condensed", "Arial Narrow", system-ui, sans-serif;
--font-body: system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
margin: 0;
background: var(--bg);
color: var(--text);
font-family: var(--font-body);
line-height: 1.5;
}
h1, h2, h3 {
font-family: var(--font-head);
text-transform: uppercase;
letter-spacing: 0.04em;
margin: 0 0 0.6rem;
}
h1 { color: var(--accent); font-size: 1.9rem; }
h2 { font-size: 1.2rem; border-bottom: 1px solid var(--border); padding-bottom: 0.3rem; }
a { color: var(--accent); }
header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
padding: 0.8rem 1.2rem;
background: var(--surface);
border-bottom: 2px solid var(--accent-2);
}
.brand {
font-family: var(--font-head);
font-size: 1.3rem;
text-transform: uppercase;
text-decoration: none;
color: var(--text);
}
nav { display: flex; align-items: center; gap: 1rem; }
nav a { text-decoration: none; }
main { max-width: 52rem; margin: 0 auto; padding: 1.5rem 1.2rem 4rem; }
section { margin-bottom: 2.5rem; }
.muted { color: var(--muted); }
.error { color: var(--error); display: block; font-size: 0.9rem; }
.tag {
font-size: 0.7rem;
text-transform: uppercase;
letter-spacing: 0.06em;
background: var(--accent-2);
padding: 0.1rem 0.4rem;
border-radius: var(--radius);
}
.flash {
max-width: 52rem;
margin: 1rem auto 0;
padding: 0.7rem 1rem;
background: var(--surface-2);
border-left: 3px solid var(--accent);
border-radius: var(--radius);
}
.avatar {
display: inline-flex;
align-items: center;
justify-content: center;
width: 2rem;
height: 2rem;
border-radius: 50%;
background: var(--accent-2);
font-family: var(--font-head);
font-size: 0.85rem;
}
form.stack { display: flex; flex-direction: column; gap: 0.9rem; max-width: 24rem; }
form.stack label { display: flex; flex-direction: column; gap: 0.25rem; }
form.stack label.row { flex-direction: row; align-items: center; gap: 0.5rem; }
input {
background: var(--surface-2);
color: var(--text);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 0.5rem 0.6rem;
font: inherit;
}
input:focus-visible, button:focus-visible, a:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
}
button {
background: var(--accent);
color: #150c07;
border: 0;
border-radius: var(--radius);
padding: 0.5rem 0.9rem;
font: inherit;
font-weight: 600;
cursor: pointer;
}
button:hover { background: #ff7043; }
button.link {
background: none;
color: var(--accent);
padding: 0;
font-weight: normal;
text-decoration: underline;
}
table { width: 100%; border-collapse: collapse; margin-top: 0.8rem; }
th, td { text-align: left; padding: 0.5rem 0.4rem; border-bottom: 1px solid var(--border); }
th { font-family: var(--font-head); text-transform: uppercase; font-size: 0.8rem; color: var(--muted); }
tr.banned { opacity: 0.55; }
.actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.actions form { display: flex; gap: 0.3rem; }
.actions input { width: 10rem; }
code { background: var(--surface-2); padding: 0.1rem 0.35rem; border-radius: var(--radius); }
.invite { word-break: break-all; }
/* Drop target that is the file input — the native control is hidden behind it, so keyboard
focus, validation and submission keep working. */
.dropzone {
display: flex;
flex-direction: column;
align-items: center;
gap: 0.3rem;
padding: 2.2rem 1rem;
border: 2px dashed var(--border);
border-radius: var(--radius);
background: var(--surface);
cursor: pointer;
text-align: center;
transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover { border-color: var(--accent); }
.dropzone.over { border-color: var(--accent); background: var(--surface-2); }
.dropzone.has-file { border-style: solid; border-color: var(--accent); }
/* Visually hidden, still focusable and still the thing that gets submitted. */
.dropzone input[type="file"] {
position: absolute;
width: 1px;
height: 1px;
opacity: 0;
}
.dropzone:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.dz-title { font-family: var(--font-head); text-transform: uppercase; letter-spacing: 0.04em; }
.filename { color: var(--accent); word-break: break-all; }
.small { font-size: 0.85rem; }
select, textarea {
background: var(--surface-2);
color: var(--text);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 0.5rem 0.6rem;
font: inherit;
}
textarea { resize: vertical; }
select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.player { width: 100%; margin: 0.6rem 0 1rem; }
.byline { color: var(--muted); margin-top: -0.3rem; }
.intro { white-space: pre-wrap; background: var(--surface); padding: 0.8rem 1rem;
border-left: 3px solid var(--border); border-radius: var(--radius); }
.empty { font-family: var(--font-head); text-transform: uppercase; color: var(--muted);
padding: 2rem 0; }
.nowrap { white-space: nowrap; }
.tag.done { background: var(--surface-2); color: var(--muted); }
.average { font-size: 1.1rem; }
.score { display: inline-block; font-family: var(--font-head); font-size: 1.1rem;
color: var(--accent); }
.review { background: var(--surface); border-radius: var(--radius); padding: 0.8rem 1rem;
margin-bottom: 0.8rem; }
.review header { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.4rem; }
.review p { white-space: pre-wrap; margin: 0; }
.scorerow { display: flex; align-items: center; gap: 0.8rem; }
.scorerow input[type="range"] { flex: 1; accent-color: var(--accent); }
.scorerow output { font-family: var(--font-head); font-size: 1.3rem; color: var(--accent);
min-width: 2.5ch; text-align: right; }
.editbox { background: var(--surface); border-radius: var(--radius); padding: 0.6rem 1rem;
margin-bottom: 1.5rem; }
.editbox summary { cursor: pointer; font-family: var(--font-head); text-transform: uppercase; }
.editbox form { margin: 0.8rem 0; }
button.danger { background: var(--accent-2); color: var(--text); }
button.danger:hover { background: #e53935; }
.saved { color: var(--muted); font-size: 0.85rem; min-height: 1.2em; }
.status { background: var(--surface); border-left: 3px solid var(--accent); border-radius: var(--radius);
padding: 0.8rem 1rem; margin-bottom: 1.2rem; }
.status p { margin: 0 0 0.5rem; }
button:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.or { text-align: center; color: var(--muted); text-transform: uppercase;
font-family: var(--font-head); margin: 0; }