super-productivity/electron/overlay-indicator/overlay.css
Johannes Millan 6b9ef0dee2 feat(overlay): resizable responsive overlay with opacity and always-show
- Make overlay window resizable with persisted bounds via simpleStore
- Add new OverlayIndicatorConfig section (isEnabled, isAlwaysShow, opacity)
- Move setting from misc.isOverlayIndicatorEnabled to overlayIndicator
  with migration in reducer
- Add responsive CSS with scale variable (full/tiny modes)
- Add always-show mode that keeps overlay visible when main window is open
- Add opacity slider (10-100%) applied as CSS variable
- Consolidate overlay init into single updateOverlayEnabled path
- Remove dead code: updateOverlayTheme, setIgnoreMouseEvents, unused
  shortcut param
2026-03-20 21:36:30 +01:00

169 lines
3 KiB
CSS

* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Open Sans', sans-serif;
overflow: hidden;
background: transparent;
user-select: none;
-webkit-context-menu: none;
--scale: 1;
--opacity: 0.95;
}
body,
body * {
pointer-events: auto;
}
/* ── Main container ── */
#overlay-container {
display: flex;
align-items: center;
width: 100%;
height: 100vh;
padding: calc(4px * var(--scale));
background-color: rgba(255, 255, 255, var(--opacity));
border-radius: calc(8px * var(--scale));
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
transition:
background-color 0.3s,
color 0.3s;
-webkit-app-region: drag;
}
@media (prefers-color-scheme: dark) {
#overlay-container {
background-color: rgba(32, 32, 32, var(--opacity));
color: #e0e0e0;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
}
/* ── Content area ── */
#content {
flex: 1;
padding: 0 calc(8px * var(--scale));
min-width: 0;
display: flex;
align-items: center;
}
#task-title {
font-size: calc(20px * var(--scale));
font-weight: 500;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: #333;
}
@media (prefers-color-scheme: dark) {
#task-title {
color: #e0e0e0;
}
}
#time-display {
font-size: calc(20px * var(--scale));
font-weight: 600;
font-variant-numeric: tabular-nums;
color: #666;
margin-left: auto;
padding-left: calc(8px * var(--scale));
white-space: nowrap;
}
@media (prefers-color-scheme: dark) {
#time-display {
color: #aaa;
}
}
/* ── Mode-specific colors ── */
.mode-pomodoro #time-display {
color: #dc3545;
}
.mode-focus #time-display {
color: #007bff;
}
.mode-task #time-display {
color: #28a745;
}
@media (prefers-color-scheme: dark) {
.mode-pomodoro #time-display {
color: #ff6b7a;
}
.mode-focus #time-display {
color: #5cb3ff;
}
.mode-task #time-display {
color: #5dd66f;
}
}
/* ── Show-main button ── */
#show-main {
width: calc(32px * var(--scale));
height: calc(32px * var(--scale));
min-width: 20px;
min-height: 20px;
border: none;
background: rgba(0, 0, 0, 0.05);
border-radius: 4px;
cursor: pointer;
color: #666;
font-size: calc(12px * var(--scale));
transition: all 0.2s;
-webkit-app-region: no-drag;
flex-shrink: 0;
}
@media (prefers-color-scheme: dark) {
#show-main {
background: rgba(255, 255, 255, 0.1);
color: #aaa;
}
}
#show-main:hover {
background: rgba(0, 0, 0, 0.1);
transform: scale(1.1);
}
@media (prefers-color-scheme: dark) {
#show-main:hover {
background: rgba(255, 255, 255, 0.2);
}
}
#show-main:active {
transform: scale(0.95);
}
/* ── Responsive width breakpoints ── */
.size-tiny #task-title {
display: none;
}
.size-tiny #show-main {
display: none;
}
.size-tiny #overlay-container {
justify-content: center;
}
.size-tiny #content {
padding: 0 calc(4px * var(--scale));
justify-content: center;
}
.size-tiny #time-display {
margin-left: 0;
padding-left: 0;
}