ext: state-driven toolbar icon, restyled popup
This commit is contained in:
+29
-5
@@ -1,10 +1,34 @@
|
||||
<!-- Extension popup: Start/Stop button, mic-grant link, status line and transcript view. -->
|
||||
<body style="width:380px;font:13px sans-serif">
|
||||
<!-- mic.html opens in a new tab so the permission prompt can appear; needed once. -->
|
||||
<button id="go">Start</button> <a href="mic.html" target="_blank">grant mic (once)</a>
|
||||
<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; }
|
||||
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; }
|
||||
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>
|
||||
<!-- Start/Stop; popup.js drives it. -->
|
||||
<button id="go">Start</button>
|
||||
<!-- Status line, filled by popup.js. -->
|
||||
<div id="st"></div>
|
||||
<!-- Transcript/result text returned by the recorder. -->
|
||||
<pre id="txt" style="white-space:pre-wrap;max-height:300px;overflow:auto"></pre>
|
||||
<!-- popup.js drives the UI. -->
|
||||
<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>
|
||||
|
||||
Reference in New Issue
Block a user