Real-time speech-to-text using OpenAI Whisper (faster-whisper). Features browser audio capture, WebSocket streaming, and customizable display settings. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
568 lines
10 KiB
CSS
568 lines
10 KiB
CSS
/**
|
|
* Live Captions - Stylesheet
|
|
*/
|
|
|
|
/* Reset and Base */
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
:root {
|
|
--bg-primary: #0d0d1a;
|
|
--bg-secondary: #1a1a2e;
|
|
--bg-tertiary: #252542;
|
|
--text-primary: #ffffff;
|
|
--text-secondary: #a0a0b0;
|
|
--accent: #4a9eff;
|
|
--accent-hover: #6ab0ff;
|
|
--danger: #ff4a6a;
|
|
--danger-hover: #ff6a85;
|
|
--success: #4aff8a;
|
|
--warning: #ffa64a;
|
|
--border-radius: 8px;
|
|
--transition: 0.2s ease;
|
|
}
|
|
|
|
html, body {
|
|
height: 100%;
|
|
font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
|
|
background-color: var(--bg-primary);
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
#app {
|
|
display: flex;
|
|
flex-direction: column;
|
|
height: 100vh;
|
|
padding: 20px;
|
|
}
|
|
|
|
/* Caption Container */
|
|
#caption-container {
|
|
flex: 1;
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: center;
|
|
background-color: rgba(26, 26, 46, 0.9);
|
|
border-radius: 10px;
|
|
padding: 20px;
|
|
margin-bottom: 20px;
|
|
overflow: hidden;
|
|
font-size: 32px;
|
|
font-family: Arial, sans-serif;
|
|
text-align: center;
|
|
}
|
|
|
|
#captions {
|
|
line-height: 1.4;
|
|
word-wrap: break-word;
|
|
overflow-wrap: break-word;
|
|
}
|
|
|
|
/* Controls Bar */
|
|
#controls {
|
|
display: flex;
|
|
gap: 10px;
|
|
justify-content: center;
|
|
align-items: center;
|
|
padding: 15px;
|
|
background-color: var(--bg-secondary);
|
|
border-radius: var(--border-radius);
|
|
}
|
|
|
|
/* Buttons */
|
|
.btn {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
padding: 12px 24px;
|
|
border: none;
|
|
border-radius: var(--border-radius);
|
|
font-size: 16px;
|
|
font-weight: 500;
|
|
cursor: pointer;
|
|
transition: background-color var(--transition), transform var(--transition);
|
|
}
|
|
|
|
.btn:hover:not(:disabled) {
|
|
transform: translateY(-1px);
|
|
}
|
|
|
|
.btn:disabled {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
.btn-primary {
|
|
background-color: var(--accent);
|
|
color: white;
|
|
}
|
|
|
|
.btn-primary:hover:not(:disabled) {
|
|
background-color: var(--accent-hover);
|
|
}
|
|
|
|
.btn-danger {
|
|
background-color: var(--danger);
|
|
color: white;
|
|
}
|
|
|
|
.btn-danger:hover:not(:disabled) {
|
|
background-color: var(--danger-hover);
|
|
}
|
|
|
|
.btn-secondary {
|
|
background-color: var(--bg-tertiary);
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
.btn-secondary:hover:not(:disabled) {
|
|
background-color: #323258;
|
|
}
|
|
|
|
.btn-success {
|
|
background-color: var(--success);
|
|
color: #000;
|
|
}
|
|
|
|
.btn-success:hover:not(:disabled) {
|
|
background-color: #5aff9a;
|
|
}
|
|
|
|
/* Toggle Switch */
|
|
.toggle-switch {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
cursor: pointer;
|
|
user-select: none;
|
|
padding: 8px 12px;
|
|
background-color: var(--bg-tertiary);
|
|
border-radius: var(--border-radius);
|
|
}
|
|
|
|
.toggle-switch input {
|
|
display: none;
|
|
}
|
|
|
|
.toggle-slider {
|
|
position: relative;
|
|
width: 44px;
|
|
height: 24px;
|
|
background-color: var(--text-secondary);
|
|
border-radius: 12px;
|
|
transition: background-color var(--transition);
|
|
}
|
|
|
|
.toggle-slider::before {
|
|
content: '';
|
|
position: absolute;
|
|
top: 3px;
|
|
left: 3px;
|
|
width: 18px;
|
|
height: 18px;
|
|
background-color: white;
|
|
border-radius: 50%;
|
|
transition: transform var(--transition);
|
|
}
|
|
|
|
.toggle-switch input:checked + .toggle-slider {
|
|
background-color: var(--success);
|
|
}
|
|
|
|
.toggle-switch input:checked + .toggle-slider::before {
|
|
transform: translateX(20px);
|
|
}
|
|
|
|
.toggle-label {
|
|
font-size: 14px;
|
|
font-weight: 500;
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
.btn-icon {
|
|
width: 48px;
|
|
height: 48px;
|
|
padding: 0;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
background-color: var(--bg-tertiary);
|
|
color: var(--text-primary);
|
|
font-size: 20px;
|
|
}
|
|
|
|
.btn-icon:hover:not(:disabled) {
|
|
background-color: #323258;
|
|
}
|
|
|
|
.icon {
|
|
font-size: 14px;
|
|
}
|
|
|
|
/* Status Indicator */
|
|
#status {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
justify-content: center;
|
|
padding: 10px;
|
|
font-size: 14px;
|
|
color: var(--text-secondary);
|
|
}
|
|
|
|
.dot {
|
|
width: 10px;
|
|
height: 10px;
|
|
border-radius: 50%;
|
|
background-color: var(--text-secondary);
|
|
}
|
|
|
|
.dot.connected {
|
|
background-color: var(--success);
|
|
}
|
|
|
|
.dot.recording {
|
|
background-color: var(--danger);
|
|
animation: pulse 1s infinite;
|
|
}
|
|
|
|
.dot.disconnected {
|
|
background-color: var(--text-secondary);
|
|
}
|
|
|
|
.dot.error {
|
|
background-color: var(--warning);
|
|
}
|
|
|
|
@keyframes pulse {
|
|
0%, 100% { opacity: 1; }
|
|
50% { opacity: 0.5; }
|
|
}
|
|
|
|
/* Settings Panel */
|
|
.panel {
|
|
position: fixed;
|
|
top: 0;
|
|
right: 0;
|
|
width: 350px;
|
|
height: 100vh;
|
|
background-color: var(--bg-secondary);
|
|
box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3);
|
|
z-index: 1000;
|
|
display: flex;
|
|
flex-direction: column;
|
|
transition: transform var(--transition);
|
|
}
|
|
|
|
.panel.hidden {
|
|
transform: translateX(100%);
|
|
}
|
|
|
|
.panel-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
padding: 20px;
|
|
border-bottom: 1px solid var(--bg-tertiary);
|
|
}
|
|
|
|
.panel-header h2 {
|
|
font-size: 20px;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.btn-close {
|
|
width: 36px;
|
|
height: 36px;
|
|
border: none;
|
|
background: var(--bg-tertiary);
|
|
color: var(--text-primary);
|
|
font-size: 24px;
|
|
border-radius: 50%;
|
|
cursor: pointer;
|
|
transition: background-color var(--transition);
|
|
}
|
|
|
|
.btn-close:hover {
|
|
background-color: var(--danger);
|
|
}
|
|
|
|
.panel-content {
|
|
flex: 1;
|
|
overflow-y: auto;
|
|
padding: 20px;
|
|
}
|
|
|
|
/* Settings Groups */
|
|
.setting-group {
|
|
margin-bottom: 25px;
|
|
}
|
|
|
|
.setting-group h3 {
|
|
font-size: 14px;
|
|
font-weight: 600;
|
|
color: var(--accent);
|
|
text-transform: uppercase;
|
|
letter-spacing: 1px;
|
|
margin-bottom: 15px;
|
|
}
|
|
|
|
.setting-group label {
|
|
display: block;
|
|
font-size: 14px;
|
|
color: var(--text-secondary);
|
|
margin-bottom: 5px;
|
|
margin-top: 12px;
|
|
}
|
|
|
|
.setting-group label:first-of-type {
|
|
margin-top: 0;
|
|
}
|
|
|
|
/* Form Controls */
|
|
select,
|
|
input[type="text"] {
|
|
width: 100%;
|
|
padding: 10px 12px;
|
|
background-color: var(--bg-tertiary);
|
|
border: 1px solid transparent;
|
|
border-radius: var(--border-radius);
|
|
color: var(--text-primary);
|
|
font-size: 14px;
|
|
transition: border-color var(--transition);
|
|
}
|
|
|
|
select:focus,
|
|
input[type="text"]:focus {
|
|
outline: none;
|
|
border-color: var(--accent);
|
|
}
|
|
|
|
input[type="range"] {
|
|
width: 100%;
|
|
height: 6px;
|
|
background: var(--bg-tertiary);
|
|
border-radius: 3px;
|
|
appearance: none;
|
|
cursor: pointer;
|
|
}
|
|
|
|
input[type="range"]::-webkit-slider-thumb {
|
|
appearance: none;
|
|
width: 18px;
|
|
height: 18px;
|
|
background: var(--accent);
|
|
border-radius: 50%;
|
|
cursor: pointer;
|
|
transition: background-color var(--transition);
|
|
}
|
|
|
|
input[type="range"]::-webkit-slider-thumb:hover {
|
|
background: var(--accent-hover);
|
|
}
|
|
|
|
input[type="range"]::-moz-range-thumb {
|
|
width: 18px;
|
|
height: 18px;
|
|
background: var(--accent);
|
|
border-radius: 50%;
|
|
border: none;
|
|
cursor: pointer;
|
|
}
|
|
|
|
input[type="color"] {
|
|
width: 100%;
|
|
height: 40px;
|
|
padding: 2px;
|
|
background-color: var(--bg-tertiary);
|
|
border: 1px solid transparent;
|
|
border-radius: var(--border-radius);
|
|
cursor: pointer;
|
|
}
|
|
|
|
input[type="color"]::-webkit-color-swatch-wrapper {
|
|
padding: 0;
|
|
}
|
|
|
|
input[type="color"]::-webkit-color-swatch {
|
|
border: none;
|
|
border-radius: calc(var(--border-radius) - 3px);
|
|
}
|
|
|
|
/* Setting Actions */
|
|
.setting-actions {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 10px;
|
|
margin-top: 20px;
|
|
padding-top: 20px;
|
|
border-top: 1px solid var(--bg-tertiary);
|
|
}
|
|
|
|
.setting-actions .btn {
|
|
width: 100%;
|
|
justify-content: center;
|
|
}
|
|
|
|
/* Overlay */
|
|
#overlay {
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
background-color: rgba(0, 0, 0, 0.5);
|
|
z-index: 999;
|
|
transition: opacity var(--transition);
|
|
}
|
|
|
|
#overlay.hidden {
|
|
opacity: 0;
|
|
pointer-events: none;
|
|
}
|
|
|
|
/* Scrollbar Styling */
|
|
::-webkit-scrollbar {
|
|
width: 8px;
|
|
}
|
|
|
|
::-webkit-scrollbar-track {
|
|
background: var(--bg-tertiary);
|
|
border-radius: 4px;
|
|
}
|
|
|
|
::-webkit-scrollbar-thumb {
|
|
background: var(--text-secondary);
|
|
border-radius: 4px;
|
|
}
|
|
|
|
::-webkit-scrollbar-thumb:hover {
|
|
background: var(--accent);
|
|
}
|
|
|
|
/* Recordings Panel */
|
|
.recordings-list {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 8px;
|
|
}
|
|
|
|
.recordings-empty {
|
|
color: var(--text-secondary);
|
|
text-align: center;
|
|
padding: 40px 20px;
|
|
}
|
|
|
|
.recording-item {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
padding: 12px 15px;
|
|
background-color: var(--bg-tertiary);
|
|
border-radius: var(--border-radius);
|
|
cursor: pointer;
|
|
transition: background-color var(--transition);
|
|
}
|
|
|
|
.recording-item:hover {
|
|
background-color: #323258;
|
|
}
|
|
|
|
.recording-info {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 4px;
|
|
}
|
|
|
|
.recording-date {
|
|
font-size: 14px;
|
|
font-weight: 500;
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
.recording-meta {
|
|
font-size: 12px;
|
|
color: var(--text-secondary);
|
|
}
|
|
|
|
.recording-arrow {
|
|
color: var(--text-secondary);
|
|
font-size: 18px;
|
|
}
|
|
|
|
/* Recording Viewer */
|
|
.recording-viewer {
|
|
display: flex;
|
|
flex-direction: column;
|
|
height: 100%;
|
|
}
|
|
|
|
.recording-viewer.hidden {
|
|
display: none;
|
|
}
|
|
|
|
.viewer-header {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
margin-bottom: 15px;
|
|
padding-bottom: 15px;
|
|
border-bottom: 1px solid var(--bg-tertiary);
|
|
}
|
|
|
|
.viewer-filename {
|
|
font-size: 12px;
|
|
color: var(--text-secondary);
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.viewer-content {
|
|
flex: 1;
|
|
overflow-y: auto;
|
|
padding: 15px;
|
|
background-color: var(--bg-tertiary);
|
|
border-radius: var(--border-radius);
|
|
font-size: 14px;
|
|
line-height: 1.6;
|
|
white-space: pre-wrap;
|
|
word-wrap: break-word;
|
|
}
|
|
|
|
.viewer-actions {
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
margin-top: 15px;
|
|
padding-top: 15px;
|
|
border-top: 1px solid var(--bg-tertiary);
|
|
}
|
|
|
|
.btn-small {
|
|
padding: 8px 16px;
|
|
font-size: 13px;
|
|
}
|
|
|
|
/* Responsive */
|
|
@media (max-width: 600px) {
|
|
#app {
|
|
padding: 10px;
|
|
}
|
|
|
|
.panel {
|
|
width: 100%;
|
|
}
|
|
|
|
#controls {
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
.btn {
|
|
padding: 10px 16px;
|
|
font-size: 14px;
|
|
}
|
|
}
|