60 lines
4.2 KiB
HTML
60 lines
4.2 KiB
HTML
<!-- Extension popup: Start/Stop button, mic-grant link, status line and transcript view. -->
|
|
<meta charset="utf-8">
|
|
<style>
|
|
:root { --accent: #64748b; }
|
|
body { width: 380px; margin: 0; padding: 16px; box-sizing: border-box; font: 13px/1.4 system-ui, "Segoe UI", sans-serif; color: #0f172a; background: #f8fafc; }
|
|
body[data-state=recording] { --accent: #dc2626; }
|
|
body[data-state=transcribing] { --accent: #2563eb; }
|
|
body[data-state=done] { --accent: #16a34a; }
|
|
body[data-state=error] { --accent: #d97706; }
|
|
body[data-state=offline] { --accent: #dc2626; }
|
|
#off { margin-bottom: 12px; padding: 12px 14px; border-radius: 8px; background: #fef2f2; border: 2px solid #dc2626; color: #7f1d1d; }
|
|
#off b { display: block; margin-bottom: 4px; font-size: 15px; color: #b91c1c; }
|
|
#off ol { margin: 8px 0 0; padding-left: 20px; }
|
|
body[data-state=offline] #st, body[data-state=offline] #txt { display: none; }
|
|
body[data-state=offline] #go:disabled { opacity: 1; background: #fecaca; color: #991b1b; }
|
|
/* Offline alarm: banner, button and dot strobe red/white. 0.4 s per cycle = 2.5 flashes/s, under the 3/s photosensitivity limit.
|
|
No prefers-reduced-motion opt-out on purpose: Windows with animations off reports "reduce" and would hide the alarm. */
|
|
body[data-state=offline] #off { animation: strobe .4s steps(1) infinite; }
|
|
body[data-state=offline] #go:disabled, body[data-state=offline] .dot { animation: strobe .4s steps(1) infinite reverse; }
|
|
@keyframes strobe { 0% { background: #dc2626; color: #fff; border-color: #fff; } 50% { background: #fff; color: #b91c1c; border-color: #dc2626; } }
|
|
body[data-state=offline] #off b { color: inherit; }
|
|
h1 { margin: 0 0 12px; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
|
|
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; }
|
|
body[data-state=recording] .dot { animation: pulse 1.2s infinite; }
|
|
@keyframes pulse { 50% { opacity: .25; } }
|
|
#go { width: 100%; padding: 10px; border: 0; border-radius: 8px; font: inherit; font-weight: 600; color: #fff; background: var(--accent); cursor: pointer; transition: filter .15s; }
|
|
#go:hover:not(:disabled) { filter: brightness(1.1); }
|
|
#go:disabled { opacity: .5; cursor: default; }
|
|
body[data-state=idle] #go, body[data-state=done] #go, body[data-state=error] #go { background: #0f172a; }
|
|
#st { margin-top: 12px; padding: 8px 10px; background: #fff; border: 1px solid #e2e8f0; border-left: 3px solid var(--accent); border-radius: 6px; word-break: break-word; }
|
|
#txt { margin: 12px 0 0; padding: 10px; white-space: pre-wrap; max-height: 260px; overflow: auto; background: #fff; border: 1px solid #e2e8f0; border-radius: 6px; font: 12px/1.45 ui-monospace, Consolas, monospace; }
|
|
#txt:empty { display: none; }
|
|
#srv { margin-top: 8px; font-size: 12px; color: #475569; display: flex; align-items: center; gap: 6px; }
|
|
#srv::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; }
|
|
#srv[data-ok=true]::before { background: #16a34a; }
|
|
#srv[data-ok=false] { color: #dc2626; font-weight: 600; }
|
|
#srv[data-ok=false]::before { background: #dc2626; }
|
|
a { display: inline-block; margin-top: 12px; color: #475569; font-size: 12px; }
|
|
</style>
|
|
<body data-state="idle">
|
|
<h1><span class="dot"></span>Teams Whisper</h1>
|
|
<!-- Shown by popup.js when /health fails and nothing is recording. -->
|
|
<div id="off" hidden>
|
|
<b>Backend offline. Recording is NOT possible.</b>
|
|
The Teams Whisper server (127.0.0.1:18765) is not running, so nothing would be saved.
|
|
<ol><li>Open Pinokio, then Teams Whisper, then press <b style="display:inline;font-size:inherit">Start</b>.</li><li>Wait until the dot below turns green.</li><li>Press Start here again.</li></ol>
|
|
</div>
|
|
<!-- Start/Stop; popup.js drives it. -->
|
|
<button id="go">Start</button>
|
|
<!-- Status line, filled by popup.js. -->
|
|
<div id="st"></div>
|
|
<!-- Backend health (/health), refreshed every second by popup.js. -->
|
|
<div id="srv"></div>
|
|
<!-- Transcript/result text returned by the recorder. -->
|
|
<pre id="txt"></pre>
|
|
<!-- mic.html opens in a new tab so the permission prompt can appear; needed once. -->
|
|
<a href="mic.html" target="_blank">grant mic (once)</a>
|
|
<script src="popup.js"></script>
|
|
</body>
|