Files
srt-streamer/src/styles/App.css
T
admin acbd3b6349 feat: v1.2.0 — auto-reconnect, recording, monitor bounds, WASAPI loopback
- Auto-reconnect: stream retries with exponential backoff (2s→30s max)
  on unexpected exit; stops only when user clicks Stop
- Recording: global RecordingBar with folder picker, segment duration (min),
  per-stream checkbox, Select All; uses FFmpeg tee muxer for simultaneous
  SRT + segmented .ts file output
- Monitor capture: PowerShell System.Windows.Forms.Screen gives exact
  pixel bounds (x/y/width/height); per-monitor deviceName is now unique
  (desktop_monitor_N); gdigrab uses -offset_x/-offset_y/-video_size
- Window capture: windowTitle now explicitly propagated in handleVideoSelect
- System audio: added WASAPI Loopback option (no VB-Audio required),
  existing virtual-audio-capturer kept as fallback
- Reconnecting event forwarded to renderer; status shows "Reconnecting…"
  with attempt count in logs
- IPC: pick-folder (dialog.showOpenDialog) and open-folder (shell.openPath)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 12:10:39 +03:00

924 lines
19 KiB
CSS

/* ========== RESET & BASE ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
--bg-primary: #0f0f1a;
--bg-secondary: #16213e;
--bg-card: #1a1a2e;
--bg-hover: #1e2a4a;
--bg-input: #0d1117;
--bg-section: #12162a;
--accent: #4f8ef7;
--accent-hover: #6aa0ff;
--accent-dim: rgba(79, 142, 247, 0.15);
--green: #22c55e;
--green-dim: rgba(34, 197, 94, 0.15);
--red: #ef4444;
--red-dim: rgba(239, 68, 68, 0.15);
--orange: #f59e0b;
--orange-dim: rgba(245, 158, 11, 0.15);
--text-primary: #e2e8f0;
--text-secondary: #94a3b8;
--text-muted: #475569;
--text-code: #7dd3fc;
--border: #1e2a4a;
--border-bright: #2d3f6a;
--border-focus: #4f8ef7;
--radius-sm: 6px;
--radius: 10px;
--radius-lg: 14px;
--shadow: 0 2px 12px rgba(0,0,0,0.4);
--shadow-lg: 0 4px 24px rgba(0,0,0,0.6);
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
font-size: 13px;
line-height: 1.5;
color: var(--text-primary);
}
html, body, #root {
height: 100%;
background: var(--bg-primary);
overflow: hidden;
}
/* ========== APP LAYOUT ========== */
.app {
display: flex;
flex-direction: column;
height: 100vh;
background: var(--bg-primary);
}
/* ========== TITLE BAR ========== */
.titlebar {
display: flex;
align-items: center;
justify-content: space-between;
height: 36px;
background: var(--bg-secondary);
border-bottom: 1px solid var(--border);
padding: 0 8px 0 12px;
flex-shrink: 0;
user-select: none;
}
.titlebar-left {
display: flex;
align-items: center;
gap: 8px;
}
.app-logo {
color: var(--accent);
font-size: 14px;
}
.app-title {
font-weight: 600;
font-size: 13px;
color: var(--text-primary);
}
.active-badge {
background: var(--green);
color: #000;
font-size: 10px;
font-weight: 700;
padding: 1px 6px;
border-radius: 10px;
letter-spacing: 0.02em;
}
.titlebar-controls {
display: flex;
gap: 4px;
}
.tb-btn {
width: 28px;
height: 24px;
border: none;
background: transparent;
color: var(--text-secondary);
border-radius: var(--radius-sm);
cursor: pointer;
font-size: 15px;
display: flex;
align-items: center;
justify-content: center;
transition: background 0.15s, color 0.15s;
}
.tb-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
/* ========== TAB BAR ========== */
.tabbar {
display: flex;
align-items: center;
background: var(--bg-secondary);
border-bottom: 1px solid var(--border);
padding: 0 8px;
height: 38px;
gap: 2px;
flex-shrink: 0;
}
.tab {
position: relative;
padding: 0 14px;
height: 30px;
border: none;
background: transparent;
color: var(--text-secondary);
border-radius: var(--radius-sm);
cursor: pointer;
font-size: 12.5px;
font-weight: 500;
transition: background 0.15s, color 0.15s;
display: flex;
align-items: center;
gap: 6px;
white-space: nowrap;
}
.tab:hover { background: var(--bg-hover); color: var(--text-primary); }
.tab.active {
background: var(--accent-dim);
color: var(--accent);
border: 1px solid rgba(79, 142, 247, 0.3);
}
.tab--icon { margin-left: 4px; font-size: 12px; }
.tab-badge {
background: var(--accent);
color: #fff;
font-size: 9px;
font-weight: 700;
padding: 1px 5px;
border-radius: 8px;
line-height: 1.4;
}
.tab-badge--green { background: var(--green); padding: 1px 3px; }
.tab-badge--red { background: var(--red); }
.tabbar-spacer { flex: 1; }
/* ========== CONTENT AREA ========== */
.content {
flex: 1;
overflow-y: auto;
overflow-x: hidden;
padding: 16px;
}
.content::-webkit-scrollbar { width: 6px; }
.content::-webkit-scrollbar-track { background: transparent; }
.content::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 3px; }
.content::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
/* ========== STREAMS VIEW ========== */
.streams-view { min-height: 100%; }
.streams-grid {
display: flex;
flex-direction: column;
gap: 12px;
}
/* ========== ADD STREAM BUTTON ========== */
.add-stream-btn {
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
width: 100%;
padding: 14px;
border: 2px dashed var(--border-bright);
background: transparent;
color: var(--text-muted);
border-radius: var(--radius);
cursor: pointer;
font-size: 13px;
font-weight: 500;
transition: all 0.2s;
}
.add-stream-btn:hover {
border-color: var(--accent);
color: var(--accent);
background: var(--accent-dim);
}
.add-icon {
font-size: 20px;
font-weight: 300;
line-height: 1;
}
/* ========== STREAM CARD ========== */
.stream-card {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
overflow: hidden;
transition: border-color 0.2s, box-shadow 0.2s;
}
.stream-card:hover { border-color: var(--border-bright); }
.stream-card--active { border-color: var(--green); box-shadow: 0 0 0 1px var(--green-dim); }
.stream-card.status--error { border-color: var(--red); }
/* Card Header */
.card-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 12px;
background: var(--bg-secondary);
border-bottom: 1px solid var(--border);
gap: 8px;
}
.card-header-left {
display: flex;
align-items: center;
gap: 8px;
flex: 1;
min-width: 0;
}
.card-header-right {
display: flex;
align-items: center;
gap: 6px;
flex-shrink: 0;
}
/* Status dot */
.status-dot {
width: 8px;
height: 8px;
border-radius: 50%;
flex-shrink: 0;
background: var(--text-muted);
}
.status-dot.status--idle { background: var(--text-muted); }
.status-dot.status--connecting {
background: var(--orange);
animation: pulse 1s infinite;
}
.status-dot.status--running {
background: var(--green);
box-shadow: 0 0 6px var(--green);
}
.status-dot.status--error { background: var(--red); }
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.3; }
}
.stream-name {
font-weight: 600;
font-size: 13.5px;
cursor: pointer;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.stream-name:hover { color: var(--accent); }
.name-input {
background: var(--bg-input);
border: 1px solid var(--border-focus);
color: var(--text-primary);
border-radius: var(--radius-sm);
padding: 2px 8px;
font-size: 13.5px;
font-weight: 600;
outline: none;
width: 180px;
}
.status-label {
font-size: 11px;
color: var(--text-muted);
flex-shrink: 0;
}
/* Card summary */
.card-summary {
padding: 8px 12px;
font-size: 12px;
color: var(--text-muted);
font-family: 'SF Mono', 'Consolas', monospace;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/* ========== BUTTONS ========== */
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 5px;
padding: 5px 12px;
border: none;
border-radius: var(--radius-sm);
cursor: pointer;
font-size: 12px;
font-weight: 600;
letter-spacing: 0.02em;
transition: all 0.15s;
white-space: nowrap;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn--start {
background: var(--green);
color: #000;
}
.btn--start:hover:not(:disabled) {
background: #16a34a;
box-shadow: 0 0 10px rgba(34,197,94,0.4);
}
.btn--stop {
background: var(--red);
color: #fff;
}
.btn--stop:hover {
background: #dc2626;
box-shadow: 0 0 10px rgba(239,68,68,0.4);
}
.btn--icon {
width: 28px;
height: 28px;
padding: 0;
background: transparent;
border: 1px solid var(--border);
color: var(--text-secondary);
}
.btn--icon:hover { background: var(--bg-hover); border-color: var(--border-bright); color: var(--text-primary); }
.btn--danger:hover { border-color: var(--red); color: var(--red); }
.btn--small {
padding: 4px 10px;
background: var(--bg-hover);
color: var(--text-secondary);
border: 1px solid var(--border);
}
.btn--small:hover { color: var(--text-primary); border-color: var(--border-bright); }
/* ========== STREAM SETTINGS ========== */
.stream-settings {
padding: 12px;
}
.section-tabs {
display: flex;
gap: 4px;
margin-bottom: 12px;
border-bottom: 1px solid var(--border);
padding-bottom: 8px;
}
.section-tab {
padding: 4px 12px;
border: none;
background: transparent;
color: var(--text-muted);
border-radius: var(--radius-sm);
cursor: pointer;
font-size: 12px;
font-weight: 500;
transition: all 0.15s;
}
.section-tab:hover { background: var(--bg-hover); color: var(--text-primary); }
.section-tab.active {
background: var(--accent-dim);
color: var(--accent);
}
.settings-section { display: flex; flex-direction: column; gap: 12px; }
.settings-group {
background: var(--bg-section);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 12px;
}
.group-title {
font-size: 11px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.08em;
color: var(--text-muted);
margin-bottom: 10px;
}
/* ========== FIELDS ========== */
.field {
display: flex;
flex-direction: column;
gap: 4px;
margin-bottom: 8px;
}
.field:last-child { margin-bottom: 0; }
.field-label {
font-size: 11.5px;
font-weight: 500;
color: var(--text-secondary);
}
.field-select,
.field-input {
background: var(--bg-input);
border: 1px solid var(--border);
color: var(--text-primary);
border-radius: var(--radius-sm);
padding: 6px 10px;
font-size: 12.5px;
outline: none;
transition: border-color 0.15s;
width: 100%;
appearance: none;
-webkit-appearance: none;
}
.field-select {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 8px center;
padding-right: 28px;
cursor: pointer;
}
.field-select:focus,
.field-input:focus {
border-color: var(--border-focus);
box-shadow: 0 0 0 2px rgba(79,142,247,0.15);
}
.field-select:disabled,
.field-input:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.field-input--small {
margin-top: 4px;
font-size: 12px;
}
.field-loading {
padding: 6px 10px;
color: var(--text-muted);
font-size: 12px;
font-style: italic;
background: var(--bg-input);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
}
.field-label-row {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 4px;
}
.field-label-row .field-label { margin-bottom: 0; }
.btn-inline-refresh {
padding: 2px 8px;
font-size: 11px;
background: transparent;
border: 1px solid var(--border);
color: var(--text-muted);
border-radius: var(--radius-sm);
cursor: pointer;
transition: all 0.15s;
white-space: nowrap;
}
.btn-inline-refresh:hover:not(:disabled) {
border-color: var(--accent);
color: var(--accent);
background: var(--accent-dim);
}
.btn-inline-refresh:disabled { opacity: 0.4; cursor: not-allowed; }
.fields-row {
display: flex;
gap: 8px;
margin-bottom: 8px;
}
.fields-row:last-child { margin-bottom: 0; }
.fields-row .field { margin-bottom: 0; }
.field--grow { flex: 1; }
.field--half { flex: 1; }
.field--port { width: 100px; flex-shrink: 0; }
.checkbox-label {
display: flex;
align-items: center;
gap: 6px;
cursor: pointer;
font-size: 12.5px;
color: var(--text-secondary);
user-select: none;
}
.checkbox-label input { cursor: pointer; accent-color: var(--accent); }
/* SRT URL Preview */
.srt-preview {
display: flex;
align-items: center;
gap: 8px;
margin-top: 8px;
padding: 6px 10px;
background: rgba(0,0,0,0.3);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
}
.srt-preview-label {
font-size: 11px;
color: var(--text-muted);
white-space: nowrap;
flex-shrink: 0;
}
.srt-url {
font-family: 'SF Mono', 'Consolas', 'Courier New', monospace;
font-size: 11px;
color: var(--text-code);
word-break: break-all;
}
/* ========== TOLBEK SETTINGS ========== */
.tolbek-settings {
max-width: 700px;
margin: 0 auto;
}
.section-header {
margin-bottom: 16px;
}
.section-title {
font-size: 16px;
font-weight: 700;
color: var(--text-primary);
margin-bottom: 4px;
}
.section-desc {
font-size: 12.5px;
color: var(--text-muted);
}
.settings-card {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
padding: 16px;
display: flex;
flex-direction: column;
gap: 12px;
}
.tolbek-status {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
}
.status-indicator {
display: flex;
align-items: center;
gap: 8px;
font-size: 12.5px;
}
.status-indicator.status--running { color: var(--green); }
.status-indicator.status--connecting { color: var(--orange); }
.status-indicator.status--error { color: var(--red); }
.status-indicator.status--idle { color: var(--text-muted); }
.tolbek-actions { display: flex; gap: 8px; }
.tolbek-log {
margin-top: 8px;
max-height: 120px;
overflow-y: auto;
background: var(--bg-input);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
padding: 8px;
font-family: monospace;
font-size: 11px;
color: var(--text-secondary);
}
.info-text {
font-size: 12px;
color: var(--text-muted);
line-height: 1.6;
margin-bottom: 6px;
}
.info-text:last-child { margin-bottom: 0; }
.info-text strong { color: var(--text-secondary); }
.info-text em { color: var(--text-code); font-style: normal; }
/* Tolbek modes info */
.tolbek-modes-info {
display: flex;
flex-direction: column;
gap: 8px;
}
.mode-row {
display: flex;
gap: 10px;
align-items: flex-start;
font-size: 12px;
}
.mode-tag {
flex-shrink: 0;
width: 82px;
padding: 2px 8px;
border-radius: 4px;
font-size: 11px;
font-weight: 700;
text-align: center;
background: var(--accent-dim);
color: var(--accent);
border: 1px solid rgba(79,142,247,0.25);
}
.mode-desc {
color: var(--text-muted);
line-height: 1.5;
}
.mode-desc em { color: var(--text-code); font-style: normal; }
/* ========== LOG PANEL ========== */
.log-panel {
display: flex;
flex-direction: column;
height: calc(100vh - 74px - 32px);
}
.log-toolbar {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
padding-bottom: 8px;
border-bottom: 1px solid var(--border);
margin-bottom: 8px;
flex-shrink: 0;
flex-wrap: wrap;
}
.log-filters {
display: flex;
gap: 4px;
flex-wrap: wrap;
}
.filter-btn {
padding: 3px 10px;
border: 1px solid var(--border);
background: transparent;
color: var(--text-muted);
border-radius: var(--radius-sm);
cursor: pointer;
font-size: 11.5px;
transition: all 0.15s;
}
.filter-btn:hover { border-color: var(--border-bright); color: var(--text-secondary); }
.filter-btn.active {
background: var(--accent-dim);
border-color: var(--accent);
color: var(--accent);
}
.log-actions {
display: flex;
align-items: center;
gap: 10px;
flex-shrink: 0;
}
.log-content {
flex: 1;
overflow-y: auto;
font-family: 'SF Mono', 'Consolas', 'Courier New', monospace;
font-size: 11px;
line-height: 1.5;
background: var(--bg-input);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 8px;
}
.log-empty {
text-align: center;
color: var(--text-muted);
padding: 24px;
font-family: inherit;
}
.log-line {
display: flex;
gap: 6px;
padding: 1px 0;
word-break: break-all;
}
.log-line--error { color: var(--red); }
.log-stream {
color: var(--accent);
flex-shrink: 0;
font-size: 10px;
padding-top: 1px;
}
.log-text {
color: var(--text-secondary);
flex: 1;
}
.log-line--error .log-text { color: var(--red); }
/* ========== SCROLLBAR ========== */
* { scrollbar-width: thin; scrollbar-color: var(--border-bright) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 3px; }
/* ========== SELECT OPTION STYLING ========== */
option { background: #1a1a2e; color: var(--text-primary); }
option:disabled { color: var(--text-muted); }
/* ========== RECORDING BAR ========== */
.recording-bar {
display: flex;
align-items: center;
gap: 12px;
padding: 6px 14px;
background: rgba(239, 68, 68, 0.06);
border-bottom: 1px solid rgba(239, 68, 68, 0.2);
flex-shrink: 0;
flex-wrap: wrap;
min-height: 38px;
}
.rec-label {
font-size: 11.5px;
color: var(--text-secondary);
white-space: nowrap;
flex-shrink: 0;
}
.rec-label-unit {
font-size: 11.5px;
color: var(--text-muted);
flex-shrink: 0;
}
.rec-folder-section {
display: flex;
align-items: center;
gap: 6px;
flex: 1;
min-width: 0;
}
.rec-folder-path {
font-size: 11.5px;
color: var(--accent);
cursor: pointer;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 260px;
text-decoration: underline;
text-underline-offset: 2px;
}
.rec-folder-path:hover { color: var(--accent-hover); }
.rec-folder-empty {
font-size: 11.5px;
color: var(--text-muted);
font-style: italic;
}
.rec-segment-section {
display: flex;
align-items: center;
gap: 5px;
flex-shrink: 0;
}
.rec-segment-input {
width: 56px;
background: var(--bg-input);
border: 1px solid var(--border);
color: var(--text-primary);
border-radius: var(--radius-sm);
padding: 3px 6px;
font-size: 12px;
text-align: center;
}
.rec-segment-input:focus {
outline: none;
border-color: var(--border-focus);
}
.rec-select-section {
display: flex;
align-items: center;
gap: 6px;
flex-shrink: 0;
}
.rec-selectall-label {
display: flex;
align-items: center;
gap: 5px;
cursor: pointer;
font-size: 11.5px;
color: var(--text-secondary);
user-select: none;
padding: 3px 8px;
border-radius: var(--radius-sm);
border: 1px solid var(--border);
background: transparent;
transition: all 0.15s;
}
.rec-selectall-label:hover { border-color: var(--red); color: var(--red); }
.rec-selectall-label--on { border-color: var(--red); color: var(--red); background: var(--red-dim); }
.rec-selectall-label--partial { border-color: var(--orange); color: var(--orange); }
.rec-selectall-box { font-size: 14px; line-height: 1; }
.rec-active-badge {
font-size: 10px;
font-weight: 700;
padding: 2px 6px;
border-radius: 8px;
background: var(--red);
color: #fff;
}
.rec-warn {
font-size: 11px;
color: var(--orange);
flex-shrink: 0;
}
/* btn--sm and btn--outline for RecordingBar */
.btn--sm {
padding: 3px 8px;
font-size: 11.5px;
height: auto;
}
.btn--outline {
background: transparent;
border: 1px solid var(--border-bright);
color: var(--text-secondary);
}
.btn--outline:hover:not(:disabled) {
border-color: var(--accent);
color: var(--accent);
background: var(--accent-dim);
}
/* ========== RECORD CHECKBOX IN STREAM SETTINGS ========== */
.rec-checkbox-label {
color: var(--text-secondary);
flex-wrap: wrap;
row-gap: 4px;
}
.rec-checkbox-label--on {
color: var(--red);
}
.rec-checkbox-label--on input { accent-color: var(--red); }
.rec-warn-inline {
font-size: 11px;
color: var(--orange);
margin-left: 4px;
}
.rec-folder-hint {
font-size: 11px;
color: var(--text-muted);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 220px;
margin-left: 4px;
}