From d8620186caa13bc18cfef449284ba0ecc27ee1b5 Mon Sep 17 00:00:00 2001 From: Bernd Reuther Date: Mon, 5 Oct 2026 19:51:31 +0200 Subject: [PATCH] css ausgelagert --- config/style.css | 381 +++++++++++++++++++++++++++++++++++++++++++++++ editor.py | 263 ++------------------------------ recorder.py | 259 ++------------------------------ 3 files changed, 403 insertions(+), 500 deletions(-) create mode 100644 config/style.css diff --git a/config/style.css b/config/style.css new file mode 100644 index 0000000..8ca8cc2 --- /dev/null +++ b/config/style.css @@ -0,0 +1,381 @@ +/* Shared Event Audio stylesheet. + * Common visual rules intentionally follow recorder.py as the reference. + * Theme variables are injected by the Flask applications before this file. + */ + +* { + box-sizing: border-box; +} + +.site-header { display:flex; align-items:center; gap:18px; margin-bottom:24px; } +.site-logo { max-width:140px; max-height:48px; object-fit:contain; display:block; flex:0 0 auto; } +.site-header h1 { margin:0; } + +body { + margin: 0; + padding: 24px; + background: var(--color-background); + color: var(--color-text); + font-family: Arial, Helvetica, sans-serif; +} + +h1 { + margin: 0 0 8px 0; + font-size: 28px; +} + +.subtitle { + color: var(--color-text-muted); + margin-bottom: 24px; +} + +.status { + display: inline-block; + padding: 8px 14px; + border-radius: 6px; + margin-bottom: 24px; + font-weight: bold; +} + +.status.recording { + background: var(--color-danger); + color:var(--color-white); +} + +.status.idle { + background: var(--color-border); + color: var(--color-text-secondary); +} + +.status.error { + background: var(--color-warning); + color:var(--color-white); +} + +.recording { + border: 1px solid var(--color-recording); + background: var(--color-live-surface); + border-radius: 8px; + padding: 16px; + margin-bottom: 24px; +} + +.recording-title { + font-size: 20px; + font-weight: bold; + margin-bottom: 8px; +} + +.recording-info { + color: var(--color-text-secondary); + margin-bottom: 12px; +} + +.live-panel { + display: flex; + gap: 16px; + border: 1px solid var(--color-recording); + background: var(--color-live-surface); + border-radius: 8px; + padding: 16px; + margin-bottom: 24px; +} + +.live-item { + flex: 1; + min-width: 0; +} + +.live-item + .live-item { + border-left: 1px solid var(--color-recording-border); + padding-left: 16px; +} + +.live-title { + font-size: 19px; + font-weight: bold; + margin-bottom: 6px; +} + +.live-info { + color: var(--color-text-muted); + font-size: 14px; + margin-bottom: 10px; +} + +.filter-bar { + display: grid; + grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) minmax(120px, 1fr) minmax(220px, 1.8fr); + gap: 10px; + margin-bottom: 14px; +} + +.filter-bar label { + color: var(--color-text-muted); + font-size: 13px; +} + +.filter-bar input, +.filter-bar select { + width: 100%; + margin-top: 5px; + padding: 9px; + background: var(--color-background); + color: var(--color-text); + border: 1px solid var(--color-control-hover); + border-radius: 5px; + font-size: 15px; +} + +.filter-bar .search { + grid-column: auto; +} + +.filter-info { + color: var(--color-text-muted); + font-size: 13px; + margin-bottom: 10px; +} + +table { + width: 100%; + border-collapse: collapse; + background: var(--color-surface); + border-radius: 8px; + overflow: hidden; +} + +th { + text-align: left; + background: var(--color-table-header); + padding: 12px; + color: var(--color-text-secondary); +} + +td { + padding: 12px; + color: var(--color-table-text); + border-top: 1px solid var(--color-border-subtle); + vertical-align: middle; +} + +audio { + width: 500px; + max-width: 100%; + height: 48px; +} + +/* Die Positionsleiste der nativen Audio-Steuerung besser bedienbar machen. + Chromium/WebKit erlaubt zusätzlich eine direkte Vergrößerung der Timeline. */ +audio::-webkit-media-controls-timeline { + height: 8px; +} + +audio::-webkit-media-controls-current-time-display, +audio::-webkit-media-controls-time-remaining-display { + font-size: 13px; +} + +a.button { + display: inline-block; + padding: 8px 12px; + margin-left: 8px; + background: var(--color-border); + color: var(--color-white); + text-decoration: none; + border-radius: 5px; +} + +a.button:hover { + background: var(--color-control-hover); +} + +.empty { + padding: 30px; + text-align: center; + color: var(--color-text-faint); +} + +.footer-links { display:flex; justify-content:center; align-items:center; gap:16px; margin-top:8px; } +.footer-links a { color:var(--color-footer); text-decoration:none; } +.footer-links a:hover { color:var(--color-text); text-decoration:underline; } +.git-icon { display:inline-block; margin-right:4px; font-size:16px; line-height:1; } + +.footer { + margin-top: 24px; + color: var(--color-footer); + font-size: 13px; +} + +@media (max-width: 900px) { + .filter-bar { + grid-template-columns: 1fr 1fr; + } + + .filter-bar .search { + grid-column: auto; + } +} + +@media (max-width:800px) { + body { padding:12px; } + .finished-table, .finished-table tbody, .finished-table tr, .finished-table td { display:block; } + .finished-table { background:transparent; border:0; overflow:visible; } + .finished-table thead { display:none; } + .finished-table tbody { display:grid; gap:18px; } + .finished-table tr { display:grid; grid-template-columns:1fr auto; grid-template-areas:"event date" "title title" "speaker speaker" "duration duration" "audio audio" "actions actions"; gap:0 12px; margin:0; padding:20px; background:var(--color-surface); border:1px solid var(--color-border); border-radius:20px; box-shadow:0 8px 24px var(--color-shadow); } + .finished-table td { border:0; padding:0; min-width:0; } + .finished-table td:nth-child(4) { grid-area:event; justify-self:start; align-self:start; padding:6px 10px; color:var(--color-primary-hover); background:var(--color-selection); border-radius:999px; font-size:12px; font-weight:700; line-height:1.2; } + .finished-table td:nth-child(1) { grid-area:date; justify-self:end; align-self:center; color:var(--color-text-muted); font-size:12px; white-space:nowrap; } + .finished-table td:nth-child(3) { grid-area:title; margin-top:16px; color:var(--color-text); font-size:20px; font-weight:750; line-height:1.25; } + .finished-table td:nth-child(2) { grid-area:speaker; margin-top:6px; color:var(--color-text-muted); font-size:14px; font-weight:600; } + .finished-table td:nth-child(5) { grid-area:duration; margin-top:16px; color:var(--color-text-muted); font-size:13px; } + .finished-table td:nth-child(5)::before { content:"⏱ "; font-size:14px; } + .finished-table td:nth-child(6) { grid-area:audio; margin-top:4px; } + .finished-table td:nth-child(7) { grid-area:actions; margin-top:14px; padding-top:14px; border-top:1px solid var(--color-border-subtle); } + .finished-table audio { width:100%; height:42px; margin:0; } + .finished-table a.button { display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:0 16px; margin:0; border-radius:12px; } + .live-panel { display:block; } + .live-item + .live-item { border-left:0; border-top:1px solid var(--color-recording-border); padding-left:0; padding-top:16px; margin-top:16px; } + a.button { margin-left:0; margin-right:8px; } +} + + +#dynamic-content { + background: var(--color-surface-dark); + color: var(--color-white); + border: 1px solid var(--color-primary); + border-radius: 8px; + padding: 16px; + margin: 0 0 24px 0; + box-shadow: 0 2px 6px var(--color-shadow); +} + + +/* ========================================================================== + Editor-specific styles + ========================================================================== */ + +.container { max-width:1400px; margin:0 auto; } + +.edit-logo { + width:80px !important; + height:28px !important; + max-width:80px !important; + max-height:28px !important; + min-width:80px; + min-height:28px; + object-fit:contain !important; + display:block !important; + margin:0 0 10px 0; +} + +.editor { + background:var(--color-surface); + border:1px solid var(--color-border); + border-radius:10px; + padding:20px; +} + +.wave-wrap { position:relative; width:100%; height:240px; background:var(--color-surface-dark); border-radius:6px; overflow:hidden; user-select:none; touch-action:none; } +.wave-image { position:absolute; top:0; left:0; width:100%; height:100%; object-fit:fill; display:block; opacity:.9; pointer-events:none; } +.selection { position:absolute; top:0; bottom:0; background:rgba(0,52,255,.16); border-left:2px solid #ffffff; border-right:2px solid #ffffff; pointer-events:none; } +.playhead { position:absolute; top:0; bottom:0; width:2px; margin-left:-1px; background:#ffcc33; box-shadow:0 0 5px #000, 0 0 10px rgba(255,204,51,.85); z-index:4; pointer-events:none; } +.handle { position:absolute; top:0; bottom:0; width:18px; margin-left:-9px; cursor:ew-resize; z-index:3; touch-action:none; } +.handle::after { content:""; position:absolute; left:7px; top:0; bottom:0; width:4px; background:var(--color-white); border-radius:2px; box-shadow:0 0 5px var(--color-shadow); } +.view-scroll { position:relative; width:100%; height:14px; margin-top:5px; background:var(--color-border-subtle); border-radius:7px; overflow:hidden; touch-action:none; cursor:grab; } +.view-scroll-thumb { position:absolute; top:2px; bottom:2px; left:0; min-width:14px; background:var(--color-text-faint); border-radius:5px; cursor:grab; touch-action:none; } +.view-scroll-thumb:hover { background:var(--color-text-muted); } +.view-scroll-thumb.dragging { background:var(--color-text-muted); cursor:grabbing; } +.time-row { display:flex; justify-content:space-between; margin-top:8px; color:var(--color-text-muted); font-size:14px; } +.controls { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-top:18px; } +button, a.button { border:0; border-radius:5px; padding:8px 12px; background:var(--color-border); color:var(--color-white); cursor:pointer; text-decoration:none; font:inherit; } +button:hover, a.button:hover { background:var(--color-control-hover); } +button.primary { background:var(--color-primary); color:var(--color-primary-text); } +button.primary:hover { background:var(--color-primary-hover); } +.button.danger { background:var(--color-danger-soft); } +.button.danger:hover { background:var(--color-danger-soft-hover); } +button.danger { background:var(--color-danger); color:var(--color-white); } +button:disabled { opacity:.45; cursor:not-allowed; } +.position { margin-left:auto; color:var(--color-text-secondary); font-variant-numeric:tabular-nums; } +.zoom { color:var(--color-text-muted); font-variant-numeric:tabular-nums; } +.values { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin-top:20px; } +.value { background:var(--color-surface-alt); border-radius:6px; padding:12px; } +.value span { display:block; color:var(--color-text-muted); font-size:13px; margin-bottom:5px; } +.value strong { font-size:20px; font-variant-numeric:tabular-nums; } +.actions { display:flex; gap:10px; flex-wrap:wrap; margin-top:20px; } +.info { margin-top:16px; color:var(--color-text-muted); font-size:14px; } +.message { margin-top:15px; padding:10px 12px; border-radius:6px; display:none; } +.message.ok { display:block; background:var(--color-success); color:var(--color-success-text); } +.message.error { display:block; background:var(--color-error); color:var(--color-error-text); } +.meta-dialog { position:fixed; inset:0; background:var(--color-overlay); display:none; align-items:center; justify-content:center; z-index:900; padding:20px; } +.meta-dialog.active { display:flex; } +.meta-card { width:min(560px,100%); background:var(--color-surface-modal); border:1px solid var(--color-control-hover); border-radius:10px; padding:22px; box-shadow:0 10px 40px var(--color-shadow); } +.meta-card h2 { margin-top:0; } +.meta-card label { display:block; margin:14px 0; color:var(--color-text-secondary); } +.meta-card input { display:block; width:100%; margin-top:6px; padding:10px; background:var(--color-background); color:var(--color-text); border:1px solid var(--color-control-hover); border-radius:5px; font-size:16px; } +.meta-actions { display:flex; gap:10px; justify-content:flex-end; margin-top:20px; } +.meta-actions button { margin:0; } +.progress-box { display:none; margin-top:16px; } +.progress-box.active { display:block; } +.progress-track { height:18px; background:var(--color-border-subtle); border-radius:9px; overflow:hidden; } +.progress-bar { height:100%; width:0; background:var(--color-primary); transition:width .2s ease; } +.progress-info { display:flex; justify-content:space-between; margin-top:7px; color:var(--color-text-muted); font-size:14px; font-variant-numeric:tabular-nums; } +.back { display:inline-block; margin-bottom:18px; color:var(--color-text-secondary); text-decoration:none; } +.loading-overlay { position:fixed; inset:0; background:var(--color-overlay); display:none; align-items:center; justify-content:center; z-index:1000; } +.loading-overlay.active { display:flex; } +.spinner { width:54px; height:54px; border:5px solid var(--color-control-hover); border-top-color:var(--color-white); border-radius:50%; animation:spin .8s linear infinite; } +@keyframes spin { to { transform:rotate(360deg); } } + +/* Editor overview / upload page */ +.section { background:var(--color-surface-dark); color:var(--color-white); border:1px solid var(--color-primary); border-radius:8px; padding:16px; margin:0 0 24px 0; box-shadow:0 2px 6px var(--color-shadow); } +.settings-page .section { background:var(--color-surface); color:var(--color-text); border:1px solid var(--color-border); border-radius:8px; padding:18px; margin-bottom:18px; box-shadow:none; } +.upload-bar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:16px; } +.upload-info { color:var(--color-text-muted); font-size:13px; } +.upload-progress { display:none; flex:1 1 240px; min-width:180px; height:18px; background:var(--color-border-subtle); border-radius:9px; overflow:hidden; } +.upload-progress.active { display:block; } +.upload-progress-bar { width:0; height:100%; background:var(--color-primary); transition:width .15s ease; } +.finished-table .actions { display:flex; gap:6px; flex-wrap:wrap; align-items:center; margin-top:0; } +.finished-table .actions > button.button { margin:0; } + +/* Settings page */ +.settings-container { max-width:1100px; margin:0 auto; } +a { color:var(--color-text-secondary); } +.header { display:flex; align-items:center; gap:14px; margin-bottom:24px; flex-wrap:wrap; } +.header h1 { margin:0; flex:1; } +.logo { max-width:140px; max-height:48px; object-fit:contain; } +.back { text-decoration:none; } +.section h2 { margin:0 0 16px; font-size:20px; } +.grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px 18px; } +.field label { display:block; color:var(--color-text-muted); font-size:13px; margin-bottom:5px; } +.field input { width:100%; padding:9px 10px; background:var(--color-control); color:var(--color-text); border:1px solid var(--color-control-hover); border-radius:5px; font-size:15px; } +.field.full { grid-column:1/-1; } +.color-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px 18px; } +.color-field { padding:12px; background:var(--color-surface-alt); border:1px solid var(--color-border-subtle); border-radius:7px; } +.color-field label { display:block; min-height:2.4em; margin-bottom:7px; color:var(--color-text-muted); font-size:13px; line-height:1.25; } +.color-input-row { display:grid; grid-template-columns:minmax(0,1fr) 48px; gap:8px; align-items:center; } +.color-field input:not([type=color]) { width:100%; min-width:0; height:40px; padding:8px 10px; background:var(--color-control); color:var(--color-text); border:1px solid var(--color-control-hover); border-radius:5px; font-size:14px; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; } +.color-field input[type=color] { width:48px; height:40px; padding:3px; background:var(--color-control); border:1px solid var(--color-control-hover); border-radius:5px; cursor:pointer; } +.theme-intro { margin:-4px 0 16px; color:var(--color-text-muted); font-size:14px; line-height:1.45; } +.note { color:var(--color-text-muted); font-size:13px; margin-top:8px; } + +@media(max-width:1200px) { + .finished-table td:last-child { display:flex; align-items:center; column-gap:8px; row-gap:8px; flex-wrap:wrap; } +} + +@media(max-width:900px) { + .color-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } +} + +@media(max-width:700px) { + .editor { padding:12px; } + .wave-wrap { height:180px; } + .view-scroll { height:18px; } + .view-scroll-thumb { min-width:28px; } + .zoom { width:100%; margin-left:0; } + .values { grid-template-columns:1fr; } + .position { width:100%; margin-left:0; } + button, a.button { flex:1 1 auto; } + .grid,.color-grid { grid-template-columns:1fr; } + .field.full { grid-column:auto; } +} diff --git a/editor.py b/editor.py index aa9355e..44a8b74 100644 --- a/editor.py +++ b/editor.py @@ -959,110 +959,8 @@ EDITOR_HTML = """ {{ page_title }} {% if favicon_url %}{% endif %} - + +
@@ -1477,121 +1375,8 @@ INDEX_HTML = """ {{ page_title }} {% if favicon_url %}{% endif %} - + +
@@ -1956,37 +1741,8 @@ SETTINGS_HTML = """ Einstellungen – {{ site_name }} {% if favicon_url %}{% endif %} - + +
@@ -2082,6 +1838,13 @@ def settings(): return render_template_string(SETTINGS_HTML, settings=settings, saved=saved, color_fields=build_color_fields(colors), **branding_context()) +@app.route("/static/style.css") +def static_style(): + if not STYLE_FILE.is_file(): + abort(404) + return send_file(STYLE_FILE, mimetype="text/css") + + @app.route("/branding/logo") def branding_logo(): settings = load_settings() diff --git a/recorder.py b/recorder.py index efb3ca9..c604e9a 100644 --- a/recorder.py +++ b/recorder.py @@ -714,256 +714,8 @@ HTML = """ {{ page_title }} {% if favicon_url %}{% endif %} - + + @@ -1387,6 +1139,13 @@ def render_index(): ) +@app.route("/static/style.css") +def static_style(): + if not STYLE_FILE.is_file(): + abort(404) + return send_file(STYLE_FILE, mimetype="text/css") + + @app.route("/branding/logo") def branding_logo(): settings = load_settings()