Files
tueit_Transkriptor/frontend/index.html
T
thomas.kopp 0eb85b98f1 feat: add frontend speaker naming card for diarization
Shows a card with excerpt navigation and name inputs when the backend
emits speakers_unknown. Submitting posts the mapping to /speakers or
leaves speakers anonymous; handles awaiting_speakers status label.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 01:17:23 +02:00

276 lines
12 KiB
HTML

<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>tüit Transkriptor</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=Overpass:wght@300;400;600;700&display=swap" rel="stylesheet">
<style>
:root {
--red: #DA251C;
--yellow: #FFD802;
--bg: #111;
--surface: #1a1a1a;
--surface2: #232323;
--text: #e8e8e8;
--muted: #888;
--border: #2e2e2e;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: 'Overpass', system-ui, sans-serif;
background: var(--bg);
color: var(--text);
min-height: 100vh;
display: flex;
flex-direction: column;
}
header {
display: flex;
align-items: center;
gap: 12px;
padding: 16px 24px;
border-bottom: 1px solid var(--border);
}
.header-logo { height: 28px; width: auto; display: block; }
.header-divider { width: 1px; height: 20px; background: var(--border); flex-shrink: 0; }
.header-appname { font-size: 1rem; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.status-badge {
font-size: 0.75rem;
padding: 4px 10px;
border-radius: 20px;
background: var(--surface2);
color: var(--muted);
text-transform: uppercase;
letter-spacing: 0.08em;
}
.status-badge.recording { background: var(--red); color: #fff; }
.status-badge.processing { background: var(--yellow); color: #111; }
.user-chip {
font-size: 0.75rem;
padding: 4px 10px;
border-radius: 20px;
background: var(--surface2);
color: var(--muted);
letter-spacing: 0.04em;
}
.logout-btn {
font-size: 0.75rem;
padding: 4px 10px;
border-radius: 20px;
background: none;
border: 1px solid var(--border);
color: var(--muted);
cursor: pointer;
font-family: inherit;
transition: border-color 0.15s, color 0.15s;
}
.logout-btn:hover { border-color: var(--red); color: var(--red); }
.back-btn {
font-size: .75rem; padding: 4px 10px; border-radius: 20px;
background: none; border: 1px solid var(--border); color: var(--muted);
cursor: pointer; font-family: inherit; text-decoration: none;
transition: border-color .15s, color .15s;
}
.back-btn:hover { border-color: var(--red); color: var(--red); }
main {
flex: 1;
display: flex;
flex-direction: column;
gap: 20px;
padding: 24px;
max-width: 800px;
width: 100%;
margin: 0 auto;
}
.record-section { display: flex; flex-direction: column; align-items: center; gap: 16px; }
#record-btn {
width: 96px; height: 96px; border-radius: 50%;
background: var(--surface2); border: 3px solid var(--border);
cursor: pointer; transition: all 0.15s ease;
display: flex; align-items: center; justify-content: center;
outline: none;
}
#record-btn:hover { border-color: var(--red); }
#record-btn.recording { background: var(--red); border-color: var(--red); animation: pulse 1.4s infinite; }
#record-btn.processing { background: var(--yellow); border-color: var(--yellow); cursor: default; }
@keyframes pulse {
0%,100% { box-shadow: 0 0 0 0 rgba(218,37,28,0.4); }
50% { box-shadow: 0 0 0 16px rgba(218,37,28,0); }
}
.mic-icon { width: 36px; height: 36px; fill: var(--text); }
#record-btn.recording .mic-icon { fill: #fff; }
#record-btn.processing .mic-icon { fill: #111; }
#status-text { font-size: 0.85rem; color: var(--muted); }
.instructions-section { display: flex; flex-direction: column; gap: 8px; }
label { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
textarea {
background: var(--surface); border: 1px solid var(--border);
color: var(--text); border-radius: 8px; padding: 12px;
font-family: inherit; font-size: 0.9rem; resize: vertical;
min-height: 80px; outline: none; transition: border-color 0.15s;
}
textarea:focus { border-color: var(--yellow); }
textarea::placeholder { color: var(--muted); }
.transcripts-section { display: flex; flex-direction: column; gap: 8px; }
#transcript-list { display: flex; flex-direction: column; gap: 6px; }
.transcript-item {
background: var(--surface); border: 1px solid var(--border);
border-radius: 6px; padding: 10px 14px;
display: flex; align-items: center; gap: 10px;
font-size: 0.82rem; cursor: pointer; transition: border-color 0.1s;
}
.transcript-item:hover { border-color: var(--red); }
.transcript-item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transcript-item .meta { color: var(--muted); font-size: 0.75rem; flex-shrink: 0; }
.item-date { font-size: 0.75rem; color: var(--muted); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.item-actions { display: flex; gap: 2px; flex-shrink: 0; }
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.7); }
.modal-panel {
position: relative; z-index: 1;
background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
width: min(800px, 95vw); max-height: 85vh;
display: flex; flex-direction: column;
}
.modal-header {
display: flex; align-items: center; justify-content: space-between;
padding: 14px 18px; border-bottom: 1px solid var(--border);
flex-shrink: 0;
}
.modal-title { font-size: 0.9rem; font-weight: 600; }
.modal-actions { display: flex; gap: 8px; }
.modal-btn {
background: none; border: 1px solid var(--border); color: var(--muted);
border-radius: 6px; padding: 4px 8px; cursor: pointer; font-family: inherit;
font-size: 0.85rem; display: flex; align-items: center;
transition: border-color 0.15s, color 0.15s;
}
.modal-btn:hover { border-color: var(--red); color: var(--red); }
.modal-body {
padding: 20px 24px; overflow-y: auto; flex: 1;
font-size: 0.9rem; line-height: 1.7; color: var(--text);
}
.modal-body h1,.modal-body h2,.modal-body h3 { margin: 1em 0 0.4em; font-weight: 600; }
.modal-body h1 { font-size: 1.3rem; }
.modal-body h2 { font-size: 1.1rem; }
.modal-body p { margin: 0 0 0.8em; }
.modal-body ul,.modal-body ol { padding-left: 1.5em; margin: 0 0 0.8em; }
.modal-body code { background: var(--surface2); padding: 2px 5px; border-radius: 3px; font-size: 0.85em; }
.modal-body pre { background: var(--surface2); padding: 12px; border-radius: 6px; overflow-x: auto; margin: 0 0 0.8em; }
.modal-body pre code { background: none; padding: 0; }
.modal-body hr { border: none; border-top: 1px solid var(--border); margin: 1em 0; }
.del-btn {
background: none; border: none; color: var(--muted); cursor: pointer;
padding: 4px; border-radius: 4px; display: flex; align-items: center;
transition: color 0.15s; flex-shrink: 0;
}
.del-btn:hover { color: var(--red); }
.speaker-card {
background: var(--surface); border: 1px solid var(--yellow);
border-radius: 10px; padding: 20px; display: flex; flex-direction: column; gap: 16px;
}
.speaker-card.hidden { display: none; }
.speaker-card-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--yellow); }
.speaker-rows { display: flex; flex-direction: column; gap: 14px; }
.speaker-row { display: flex; flex-direction: column; gap: 6px; }
.excerpt-nav { display: flex; align-items: center; gap: 8px; }
.excerpt-nav-btn {
background: none; border: 1px solid var(--border); color: var(--muted);
border-radius: 4px; padding: 2px 8px; cursor: pointer; font-family: inherit;
font-size: 0.85rem; transition: border-color 0.15s, color 0.15s;
}
.excerpt-nav-btn:hover { border-color: var(--yellow); color: var(--yellow); }
.excerpt-counter { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.speaker-excerpt {
font-size: 0.82rem; color: var(--muted); font-style: italic;
background: var(--surface2); border-radius: 6px; padding: 8px 12px;
line-height: 1.5; min-height: 3em;
}
.speaker-name-input {
background: var(--surface2); border: 1px solid var(--border); color: var(--text);
border-radius: 6px; padding: 8px 12px; font-family: inherit; font-size: 0.9rem;
outline: none; transition: border-color 0.15s; width: 100%;
}
.speaker-name-input:focus { border-color: var(--yellow); }
.speaker-card-actions { display: flex; gap: 10px; justify-content: flex-end; }
.card-btn {
padding: 8px 18px; border-radius: 6px; border: 1px solid var(--border);
background: none; color: var(--text); cursor: pointer; font-family: inherit;
font-size: 0.85rem; transition: all 0.15s;
}
.card-btn:hover { border-color: var(--yellow); color: var(--yellow); }
.card-btn.primary { background: var(--yellow); color: #111; border-color: var(--yellow); font-weight: 600; }
.card-btn.primary:hover { background: #e6c200; border-color: #e6c200; }
</style>
</head>
<body>
<header>
<img src="/logo.svg" class="header-logo" alt="tüit">
<div class="header-divider"></div>
<span class="header-appname">Transkriptor</span>
<div class="header-right">
<span class="status-badge" id="header-status">Bereit</span>
<span class="user-chip" id="user-chip"></span>
<button class="logout-btn" id="logout-btn">Abmelden</button>
</div>
</header>
<main>
<div id="speaker-card" class="speaker-card hidden">
<span class="speaker-card-title">Sprecher identifizieren</span>
<div id="speaker-rows" class="speaker-rows"></div>
<div class="speaker-card-actions">
<button id="speaker-anonym-btn" class="card-btn">Anonym lassen</button>
<button id="speaker-confirm-btn" class="card-btn primary">Übernehmen</button>
</div>
</div>
<section class="record-section">
<button id="record-btn" title="Aufnahme starten / stoppen">
<svg class="mic-icon" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path d="M12 1a4 4 0 0 1 4 4v6a4 4 0 0 1-8 0V5a4 4 0 0 1 4-4zm0 2a2 2 0 0 0-2 2v6a2 2 0 0 0 4 0V5a2 2 0 0 0-2-2zM6.5 10.5A5.5 5.5 0 0 0 12 16a5.5 5.5 0 0 0 5.5-5.5h2A7.5 7.5 0 0 1 13 17.93V21h2v2H9v-2h2v-3.07A7.5 7.5 0 0 1 4.5 10.5h2z"/>
</svg>
</button>
<span id="status-text">Klicken zum Starten</span>
</section>
<section class="instructions-section">
<label for="instructions">Instruktionen für den Sekretär</label>
<textarea
id="instructions"
placeholder="z.B. &quot;Heb die wichtigsten Punkte hervor&quot; · &quot;Erstelle ein Ticket&quot; · &quot;Mach ein Angebot daraus&quot;"
></textarea>
</section>
<section class="transcripts-section">
<label>Meine Transkripte</label>
<div id="transcript-list"></div>
</section>
<div id="modal" class="modal hidden" role="dialog" aria-modal="true">
<div class="modal-backdrop"></div>
<div class="modal-panel">
<div class="modal-header">
<span id="modal-title" class="modal-title"></span>
<div class="modal-actions">
<button id="modal-open-btn" class="modal-btn" title="Im Editor öffnen">
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
<path d="M14 3h7v7h-2V6.41l-9.29 9.3-1.42-1.42L17.59 5H14V3zm-1 2H5a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8h-2v8H5V7h8V5z"/>
</svg>
</button>
<button id="modal-close-btn" class="modal-btn" title="Schließen"></button>
</div>
</div>
<div id="modal-body" class="modal-body"></div>
</div>
</div>
</main>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/dompurify/dist/purify.min.js"></script>
<script src="/app.js"></script>
</body>
</html>