- Replace the static nginx site with a small Node server: serves public/, stores plays on a /data volume and exposes a JSON API. Writes need a shared UPLOAD_PASSWORD; unpublished plays are hidden without it. - Page photos (shrunk to <=1.15 MP JPEG in the browser) are transcribed one request per page by a Claude vision model (claude-haiku-5-5 by default, CLAUDE_MODEL to change) into the play markup, then stitched together: speaker spellings unified, gaps in page numbers marked as missing pages, failed pages flagged. DAILY_PAGE_LIMIT caps spend. - New pages: library (play menu), add (upload + progress), editor (text next to the photos, checks for [?] readings and one-off names, publish, delete). The reader loads plays from the API and remembers the chosen role per play; old /?postava= links still work. - PDF export: text now flows across original pages and prints at the on-screen size, so A4 sheets are full instead of half empty; page numbers in the footer. - docker-compose.yml + .env.example for one-click deploys; the 1931 play moves to seed/ and is copied into an empty volume on first start. - Tests: parser leniency, transcription assembly, API end to end with a stubbed Claude client. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HA82gVRDXpoukzgMFumoJt
376 lines
13 KiB
CSS
376 lines
13 KiB
CSS
:root {
|
|
--bg: #ffffff;
|
|
--panel: #f5f5f3;
|
|
--fg: #1d1d1b;
|
|
--muted: #6b6a66;
|
|
--line: #dddcd7;
|
|
--accent: #9a3b1b;
|
|
--hl: #fff1a8;
|
|
--hl-edge: #e0b400;
|
|
--ui-font: system-ui, -apple-system, "Segoe UI", sans-serif;
|
|
--script-font: "Atkinson Hyperlegible", system-ui, sans-serif;
|
|
--script-size: 19px;
|
|
--who-w: 7em;
|
|
color-scheme: light;
|
|
}
|
|
:root[data-theme="sepia"] {
|
|
--bg: #f6eedb;
|
|
--panel: #ede2c8;
|
|
--fg: #2e261b;
|
|
--muted: #7a6a52;
|
|
--line: #d9caa8;
|
|
--accent: #8a3214;
|
|
--hl: #f5d77a;
|
|
--hl-edge: #b98a00;
|
|
}
|
|
:root[data-theme="dark"] {
|
|
--bg: #17171a;
|
|
--panel: #202024;
|
|
--fg: #e8e6e1;
|
|
--muted: #9c9a94;
|
|
--line: #34343a;
|
|
--accent: #f0a37f;
|
|
--hl: #4a3f12;
|
|
--hl-edge: #d6b13a;
|
|
color-scheme: dark;
|
|
}
|
|
:root[data-mono="1"] { --who-w: 9ch; }
|
|
|
|
* { box-sizing: border-box; }
|
|
[hidden] { display: none !important; }
|
|
html, body { margin: 0; }
|
|
body {
|
|
background: var(--bg);
|
|
color: var(--fg);
|
|
font-family: var(--ui-font);
|
|
font-size: 16px;
|
|
line-height: 1.45;
|
|
}
|
|
button, select, input { font: inherit; color: inherit; }
|
|
|
|
/* ---- layout ---- */
|
|
.layout {
|
|
display: grid;
|
|
grid-template-columns: 330px minmax(0, 1fr);
|
|
min-height: 100vh;
|
|
}
|
|
.panel {
|
|
position: sticky;
|
|
top: 0;
|
|
height: 100vh;
|
|
overflow-y: auto;
|
|
padding: 20px 20px 32px;
|
|
background: var(--panel);
|
|
border-right: 1px solid var(--line);
|
|
}
|
|
.panel h1 { font-size: 20px; margin: 0 0 16px; }
|
|
.play-note { color: var(--muted); font-size: 13.5px; margin: -6px 0 16px; }
|
|
.field { display: block; border: 0; margin: 0 0 18px; padding: 0; min-width: 0; }
|
|
.field > span, .field > legend { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; padding: 0; }
|
|
.field output { font-weight: 400; color: var(--muted); }
|
|
select, input[type="range"] { width: 100%; }
|
|
select {
|
|
padding: 8px 10px;
|
|
border-radius: 8px;
|
|
border: 1px solid var(--line);
|
|
background: var(--bg);
|
|
}
|
|
input[type="range"] { accent-color: var(--accent); }
|
|
.radio { display: block; padding: 3px 0; }
|
|
.radio small { color: var(--muted); display: block; margin-left: 1.6em; font-size: 12.5px; }
|
|
input[type="radio"] { accent-color: var(--accent); }
|
|
|
|
.fonts { display: grid; gap: 6px; }
|
|
.font-card {
|
|
display: grid;
|
|
grid-template-columns: auto 1fr;
|
|
gap: 0 8px;
|
|
padding: 8px 10px;
|
|
border: 1px solid var(--line);
|
|
border-radius: 8px;
|
|
background: var(--bg);
|
|
cursor: pointer;
|
|
}
|
|
.font-card:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
|
|
.font-card input { grid-row: span 2; align-self: center; }
|
|
.font-name { font-weight: 700; font-size: 15px; }
|
|
.font-sample { font-size: 13.5px; color: var(--muted); }
|
|
|
|
.seg { display: flex; gap: 6px; }
|
|
.seg label {
|
|
flex: 1;
|
|
text-align: center;
|
|
padding: 6px 4px;
|
|
border: 1px solid var(--line);
|
|
border-radius: 8px;
|
|
background: var(--bg);
|
|
cursor: pointer;
|
|
font-size: 14px;
|
|
}
|
|
.seg label:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
|
|
.seg input { position: absolute; opacity: 0; pointer-events: none; }
|
|
.seg label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
|
|
|
|
.actions { display: flex; gap: 8px; margin-top: 4px; }
|
|
.actions button {
|
|
flex: 1;
|
|
padding: 10px 12px;
|
|
border-radius: 8px;
|
|
border: 1px solid var(--line);
|
|
background: var(--bg);
|
|
cursor: pointer;
|
|
font-weight: 600;
|
|
}
|
|
.actions .primary { background: var(--accent); border-color: var(--accent); color: #fff; }
|
|
:root[data-theme="dark"] .actions .primary { color: #17171a; }
|
|
.hint { font-size: 12.5px; color: var(--muted); margin-top: 10px; }
|
|
|
|
/* ---- script ---- */
|
|
.script {
|
|
padding: 24px 40px 120px;
|
|
font-family: var(--script-font);
|
|
font-size: var(--script-size);
|
|
line-height: 1.5;
|
|
outline: none;
|
|
}
|
|
.script > * { max-width: 46em; margin-inline: auto; }
|
|
:root[data-mono="1"] .script > * { max-width: 72ch; }
|
|
.loading, .error { color: var(--muted); font-family: var(--ui-font); }
|
|
.error { color: var(--accent); }
|
|
|
|
.page { padding: 8px 0 28px; border-bottom: 1px dashed var(--line); }
|
|
.pnum { text-align: center; color: var(--muted); font-size: 0.8em; margin: 8px 0 12px; }
|
|
.missing-note { text-align: center; color: var(--muted); font-style: italic; padding: 2em 0; }
|
|
|
|
.speech {
|
|
display: grid;
|
|
grid-template-columns: var(--who-w) minmax(0, 1fr);
|
|
gap: 0 1em;
|
|
margin: 0.75em 0;
|
|
border-radius: 6px;
|
|
}
|
|
.speech.cont { margin-top: 0.2em; }
|
|
.who { font-weight: 700; overflow-wrap: anywhere; }
|
|
.say p { margin: 0; }
|
|
.say p + p { margin-top: 0.2em; }
|
|
.stage { color: var(--muted); padding-left: 1.5em; }
|
|
.verse { padding-left: 2.5em; margin-block: 0.35em !important; }
|
|
.scene { margin: 1em 0; }
|
|
.center { text-align: center; margin: 1em 0; letter-spacing: 0.03em; }
|
|
.gap { height: 0.4em; }
|
|
|
|
:root[data-layout="flow"] .stage { font-style: italic; }
|
|
:root[data-layout="original"] .say p,
|
|
:root[data-layout="original"] .scene { white-space: pre-wrap; }
|
|
:root[data-layout="original"] .stage { padding-left: 2.5em; }
|
|
|
|
.speech.mine .say {
|
|
background: var(--hl);
|
|
border-left: 3px solid var(--hl-edge);
|
|
border-radius: 3px;
|
|
padding: 0.1em 0.5em;
|
|
margin-left: calc(-0.5em - 3px);
|
|
}
|
|
.speech.mine .who { color: var(--accent); }
|
|
.speech.mine .stage { color: inherit; opacity: 0.75; }
|
|
.speech.current { outline: 2px solid var(--hl-edge); outline-offset: 6px; }
|
|
|
|
/* ---- floating navigation for the chosen role / reading mode ---- */
|
|
.lines-nav {
|
|
position: fixed;
|
|
right: 16px;
|
|
bottom: 16px;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 4px;
|
|
padding: 6px;
|
|
border-radius: 999px;
|
|
background: var(--panel);
|
|
border: 1px solid var(--line);
|
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
|
|
font-family: var(--ui-font);
|
|
}
|
|
.lines-nav[hidden] { display: none; }
|
|
.lines-nav button {
|
|
min-width: 40px;
|
|
height: 40px;
|
|
border-radius: 999px;
|
|
border: 0;
|
|
background: transparent;
|
|
cursor: pointer;
|
|
font-size: 15px;
|
|
}
|
|
.lines-nav button:hover { background: var(--line); }
|
|
.lines-nav span { min-width: 4.5em; text-align: center; font-size: 14px; color: var(--muted); }
|
|
.lines-nav .exit, .lines-nav .read-only { display: none; }
|
|
.lines-nav.no-role #prev, .lines-nav.no-role #next, .lines-nav.no-role span { display: none; }
|
|
|
|
body.reading .layout { grid-template-columns: minmax(0, 1fr); }
|
|
body.reading .panel { display: none; }
|
|
body.reading .script { padding-top: 32px; }
|
|
body.reading .lines-nav .exit,
|
|
body.reading .lines-nav .read-only { display: inline-block; }
|
|
|
|
/* ---- narrow screens ---- */
|
|
@media (max-width: 820px) {
|
|
.layout { grid-template-columns: minmax(0, 1fr); }
|
|
.panel { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
|
|
.script { padding: 16px 16px 120px; }
|
|
}
|
|
@media (max-width: 560px) {
|
|
.speech { display: block; }
|
|
.who { font-size: 0.85em; letter-spacing: 0.02em; }
|
|
.stage { padding-left: 1em; }
|
|
:root[data-layout="original"] .stage { padding-left: 1.5em; }
|
|
}
|
|
|
|
/* ---- shared bits for the library, upload and editor pages ---- */
|
|
a { color: var(--accent); }
|
|
.muted { color: var(--muted); }
|
|
.small { font-size: 13px; }
|
|
.error { color: var(--accent); font-weight: 600; }
|
|
.crumbs { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; margin-bottom: 10px; }
|
|
.crumbs a { text-decoration: none; }
|
|
.crumbs a:hover { text-decoration: underline; }
|
|
input:not([type]), input[type="text"], input[type="password"], textarea {
|
|
width: 100%;
|
|
padding: 8px 10px;
|
|
border-radius: 8px;
|
|
border: 1px solid var(--line);
|
|
background: var(--bg);
|
|
}
|
|
button, .button {
|
|
display: inline-block;
|
|
padding: 8px 14px;
|
|
border-radius: 8px;
|
|
border: 1px solid var(--line);
|
|
background: var(--bg);
|
|
cursor: pointer;
|
|
font-weight: 600;
|
|
font-size: 15px;
|
|
text-decoration: none;
|
|
color: var(--fg);
|
|
}
|
|
button:disabled { opacity: 0.5; cursor: default; }
|
|
.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
|
|
:root[data-theme="dark"] .primary { color: #17171a; }
|
|
button.link { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); text-align: left; cursor: pointer; }
|
|
|
|
.topbar {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
flex-wrap: wrap;
|
|
gap: 8px 16px;
|
|
padding: 14px 24px;
|
|
background: var(--panel);
|
|
border-bottom: 1px solid var(--line);
|
|
}
|
|
.topbar h1 { font-size: 20px; margin: 0; }
|
|
.topbar .crumbs { margin: 0; }
|
|
.topbar-actions { display: flex; align-items: center; gap: 10px; }
|
|
.wrap { max-width: 760px; margin: 0 auto; padding: 20px 16px 60px; }
|
|
.wrap.wide { max-width: 1400px; }
|
|
.stack > * + * { margin-top: 12px; }
|
|
|
|
.play-list { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 10px; }
|
|
.play-card {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
padding: 14px 16px;
|
|
border: 1px solid var(--line);
|
|
border-radius: 10px;
|
|
background: var(--panel);
|
|
}
|
|
.play-main { flex: 1; min-width: 0; text-decoration: none; color: inherit; display: grid; gap: 2px; }
|
|
.play-main:hover .play-title { color: var(--accent); }
|
|
.play-title { font-weight: 700; font-size: 17px; }
|
|
.play-card .play-note { margin: 0; }
|
|
.play-meta { font-size: 12.5px; color: var(--muted); }
|
|
.badge { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--hl); color: var(--fg); vertical-align: 2px; }
|
|
|
|
dialog.login { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--fg); padding: 20px; width: min(380px, calc(100vw - 32px)); }
|
|
dialog.login h2 { margin: 0 0 8px; font-size: 18px; }
|
|
dialog::backdrop { background: rgba(0, 0, 0, 0.4); }
|
|
|
|
.dropzone {
|
|
display: block;
|
|
padding: 28px 16px;
|
|
border: 2px dashed var(--line);
|
|
border-radius: 10px;
|
|
text-align: center;
|
|
cursor: pointer;
|
|
background: var(--panel);
|
|
}
|
|
.dropzone.over { border-color: var(--accent); }
|
|
.dropzone input { position: absolute; opacity: 0; width: 1px; height: 1px; }
|
|
.dropzone:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
|
|
.thumbs { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
|
|
.thumb { position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); font-size: 12px; }
|
|
.thumb img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
|
|
.thumb-num { position: absolute; top: 4px; left: 4px; background: var(--accent); color: #fff; border-radius: 999px; padding: 0 7px; font-weight: 700; }
|
|
.thumb-name { display: block; padding: 4px 6px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
|
|
.thumb-tools { display: flex; justify-content: space-between; padding: 4px; }
|
|
.thumb-tools button { padding: 2px 8px; font-size: 12px; }
|
|
.progress progress { width: 100%; accent-color: var(--accent); }
|
|
form.busy .dropzone, form.busy .thumb-tools { pointer-events: none; opacity: 0.6; }
|
|
|
|
.meta-row { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
|
|
.meta-row .grow { flex: 1 1 260px; }
|
|
.field.toggle { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; }
|
|
.field.toggle span { margin: 0; }
|
|
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 0.8fr); gap: 16px; align-items: start; }
|
|
.editor textarea {
|
|
height: calc(100vh - 230px);
|
|
min-height: 360px;
|
|
font-family: "Courier Prime", ui-monospace, monospace;
|
|
font-size: 15px;
|
|
line-height: 1.45;
|
|
resize: vertical;
|
|
tab-size: 4;
|
|
}
|
|
.editor-side { position: sticky; top: 12px; display: grid; gap: 14px; }
|
|
.photo-nav { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 14px; }
|
|
.photo-nav span { flex: 1; text-align: center; color: var(--muted); }
|
|
.photo-nav button { padding: 4px 10px; font-size: 13px; }
|
|
.photo img { display: block; width: 100%; max-height: calc(100vh - 330px); object-fit: contain; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
|
|
.checks h2 { font-size: 16px; margin: 0 0 4px; }
|
|
.checks ul { margin: 6px 0 10px; padding-left: 18px; max-height: 220px; overflow-y: auto; font-size: 14px; }
|
|
.help { font-size: 14px; margin-top: 8px; }
|
|
.help td { padding: 2px 10px 2px 0; vertical-align: top; }
|
|
.danger button { color: var(--accent); border-color: var(--accent); background: transparent; }
|
|
@media (max-width: 900px) {
|
|
.editor { grid-template-columns: minmax(0, 1fr); }
|
|
.editor-side { position: static; order: -1; }
|
|
.photo img { max-height: 60vh; }
|
|
.editor textarea { height: 70vh; }
|
|
}
|
|
|
|
/* ---- PDF export (print) ----
|
|
The text runs on from one original page to the next so every sheet is full,
|
|
at the size chosen on screen (1 CSS px = 0.75 pt, so the default 19 px is ~14 pt). */
|
|
@page {
|
|
size: A4;
|
|
margin: 14mm 15mm 16mm;
|
|
@bottom-center { content: counter(page) " / " counter(pages); font-family: system-ui, sans-serif; font-size: 9pt; color: #666; }
|
|
}
|
|
@media print {
|
|
:root, :root[data-theme] {
|
|
--bg: #fff; --fg: #000; --muted: #444; --line: #ccc; --accent: #000;
|
|
--hl: #fff1a8; --hl-edge: #c99a00;
|
|
}
|
|
body { background: #fff; }
|
|
.layout { display: block; }
|
|
.panel, .lines-nav { display: none !important; }
|
|
.script { padding: 0; font-size: var(--script-size); line-height: 1.4; orphans: 2; widows: 2; }
|
|
.script > * { max-width: none; }
|
|
.page { border: 0; padding: 0; }
|
|
/* original page numbers stay as small markers in the margin of the flow */
|
|
.pnum { font-size: 0.65em; margin: 0.6em 0 0.2em; text-align: right; }
|
|
.missing-note { padding: 0.4em 0; }
|
|
.speech { margin: 0.5em 0; }
|
|
.speech.current { outline: none; }
|
|
.speech.mine .say { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
|
|
.speech.mine .who { text-decoration: underline; }
|
|
}
|