| 1 |
/** |
| 2 |
* Focus Timer widget styles. |
| 3 |
* |
| 4 |
* The card chrome (glass background, padding) is provided by the widget |
| 5 |
* layer; these rules only lay out the timer's own contents. Built into |
| 6 |
* assets/js/widget-focus-timer[.min].css by the Vite target — never |
| 7 |
* hand-edit the built file. |
| 8 |
*/ |
| 9 |
|
| 10 |
.dm-focus { |
| 11 |
--dm-focus-accent: #7c3aed; |
| 12 |
--dm-focus-accent-2: #2563eb; |
| 13 |
/* The widget card is dark glass; the os-select / os-checkbox-label |
| 14 |
components default their text to the near-black --os-ui-fg, |
| 15 |
which vanishes here. Override the tokens to light, matching the |
| 16 |
Note Pad widget, and tint the accent to the timer's own colour. */ |
| 17 |
--os-ui-fg: rgba( 255, 255, 255, 0.9 ); |
| 18 |
--os-ui-fg-muted: rgba( 255, 255, 255, 0.6 ); |
| 19 |
--wp-admin-theme-color: var( --dm-focus-accent ); |
| 20 |
display: flex; |
| 21 |
flex-direction: column; |
| 22 |
gap: 10px; |
| 23 |
align-items: stretch; |
| 24 |
height: 100%; |
| 25 |
box-sizing: border-box; |
| 26 |
text-align: center; |
| 27 |
font-variant-numeric: tabular-nums; |
| 28 |
} |
| 29 |
|
| 30 |
/* The shell forces `cursor: default !important`; out-specify it so our |
| 31 |
controls feel clickable. */ |
| 32 |
body.os-active .dm-focus button { |
| 33 |
cursor: pointer !important; |
| 34 |
} |
| 35 |
|
| 36 |
/* --- Time display -------------------------------------------------- */ |
| 37 |
|
| 38 |
.dm-focus__time-row { |
| 39 |
display: flex; |
| 40 |
align-items: center; |
| 41 |
justify-content: center; |
| 42 |
gap: 8px; |
| 43 |
} |
| 44 |
|
| 45 |
.dm-focus__time { |
| 46 |
font-size: clamp( 34px, 22cqw, 56px ); |
| 47 |
font-weight: 700; |
| 48 |
line-height: 1; |
| 49 |
letter-spacing: 0.01em; |
| 50 |
flex: 0 1 auto; |
| 51 |
min-width: 3.2em; |
| 52 |
} |
| 53 |
|
| 54 |
.dm-focus__time--running { |
| 55 |
margin-top: 6px; |
| 56 |
background: linear-gradient( |
| 57 |
135deg, |
| 58 |
var( --dm-focus-accent ), |
| 59 |
var( --dm-focus-accent-2 ) |
| 60 |
); |
| 61 |
-webkit-background-clip: text; |
| 62 |
background-clip: text; |
| 63 |
-webkit-text-fill-color: transparent; |
| 64 |
} |
| 65 |
|
| 66 |
.dm-focus__time.is-hidden { |
| 67 |
font-size: 20px; |
| 68 |
font-weight: 600; |
| 69 |
opacity: 0.75; |
| 70 |
-webkit-text-fill-color: currentColor; |
| 71 |
} |
| 72 |
|
| 73 |
.dm-focus__step { |
| 74 |
width: 30px; |
| 75 |
height: 30px; |
| 76 |
border-radius: 50%; |
| 77 |
border: 1px solid color-mix( in srgb, currentColor 25%, transparent ); |
| 78 |
background: color-mix( in srgb, currentColor 6%, transparent ); |
| 79 |
color: inherit; |
| 80 |
font-size: 18px; |
| 81 |
line-height: 1; |
| 82 |
display: flex; |
| 83 |
align-items: center; |
| 84 |
justify-content: center; |
| 85 |
flex: 0 0 auto; |
| 86 |
} |
| 87 |
|
| 88 |
.dm-focus__step:hover { |
| 89 |
background: color-mix( in srgb, currentColor 14%, transparent ); |
| 90 |
} |
| 91 |
|
| 92 |
/* --- Presets ------------------------------------------------------- */ |
| 93 |
|
| 94 |
.dm-focus__presets { |
| 95 |
display: flex; |
| 96 |
flex-wrap: wrap; |
| 97 |
gap: 6px; |
| 98 |
justify-content: center; |
| 99 |
} |
| 100 |
|
| 101 |
.dm-focus__chip { |
| 102 |
flex: 1 1 auto; |
| 103 |
min-width: 54px; |
| 104 |
padding: 5px 8px; |
| 105 |
border-radius: 999px; |
| 106 |
border: 1px solid color-mix( in srgb, currentColor 18%, transparent ); |
| 107 |
background: color-mix( in srgb, currentColor 5%, transparent ); |
| 108 |
color: inherit; |
| 109 |
font-size: 12px; |
| 110 |
font-weight: 600; |
| 111 |
} |
| 112 |
|
| 113 |
.dm-focus__chip:hover { |
| 114 |
border-color: color-mix( in srgb, var( --dm-focus-accent ) 55%, transparent ); |
| 115 |
color: var( --dm-focus-accent ); |
| 116 |
} |
| 117 |
|
| 118 |
/* --- Fields -------------------------------------------------------- */ |
| 119 |
|
| 120 |
.dm-focus__field { |
| 121 |
display: flex; |
| 122 |
flex-direction: column; |
| 123 |
gap: 4px; |
| 124 |
text-align: left; |
| 125 |
} |
| 126 |
|
| 127 |
.dm-focus__field-label { |
| 128 |
font-size: 11px; |
| 129 |
font-weight: 600; |
| 130 |
opacity: 0.7; |
| 131 |
text-transform: uppercase; |
| 132 |
letter-spacing: 0.04em; |
| 133 |
} |
| 134 |
|
| 135 |
.dm-focus__select { |
| 136 |
width: 100%; |
| 137 |
} |
| 138 |
|
| 139 |
.dm-focus__toggle { |
| 140 |
text-align: left; |
| 141 |
font-size: 12px; |
| 142 |
} |
| 143 |
|
| 144 |
/* --- Actions / buttons --------------------------------------------- */ |
| 145 |
|
| 146 |
.dm-focus__actions { |
| 147 |
display: flex; |
| 148 |
gap: 8px; |
| 149 |
margin-top: auto; |
| 150 |
} |
| 151 |
|
| 152 |
.dm-focus__btn { |
| 153 |
flex: 1 1 auto; |
| 154 |
padding: 9px 12px; |
| 155 |
border-radius: 10px; |
| 156 |
border: 1px solid color-mix( in srgb, currentColor 20%, transparent ); |
| 157 |
background: color-mix( in srgb, currentColor 6%, transparent ); |
| 158 |
color: inherit; |
| 159 |
font-size: 13px; |
| 160 |
font-weight: 600; |
| 161 |
} |
| 162 |
|
| 163 |
.dm-focus__btn:hover { |
| 164 |
background: color-mix( in srgb, currentColor 12%, transparent ); |
| 165 |
} |
| 166 |
|
| 167 |
.dm-focus__btn.is-primary { |
| 168 |
border-color: transparent; |
| 169 |
background: linear-gradient( |
| 170 |
135deg, |
| 171 |
var( --dm-focus-accent ), |
| 172 |
var( --dm-focus-accent-2 ) |
| 173 |
); |
| 174 |
color: #fff; |
| 175 |
} |
| 176 |
|
| 177 |
.dm-focus__btn.is-primary:hover { |
| 178 |
filter: brightness( 1.08 ); |
| 179 |
} |
| 180 |
|
| 181 |
.dm-focus__btn--stop { |
| 182 |
animation: dm-focus-pulse 1.1s ease-in-out infinite; |
| 183 |
} |
| 184 |
|
| 185 |
/* --- Running / finished sub-line ----------------------------------- */ |
| 186 |
|
| 187 |
.dm-focus__sub { |
| 188 |
font-size: 12px; |
| 189 |
opacity: 0.7; |
| 190 |
min-height: 1.2em; |
| 191 |
overflow: hidden; |
| 192 |
text-overflow: ellipsis; |
| 193 |
white-space: nowrap; |
| 194 |
} |
| 195 |
|
| 196 |
.dm-focus__bell { |
| 197 |
font-size: 44px; |
| 198 |
line-height: 1; |
| 199 |
margin-top: 4px; |
| 200 |
} |
| 201 |
|
| 202 |
.dm-focus__done { |
| 203 |
font-size: 20px; |
| 204 |
font-weight: 700; |
| 205 |
color: var( --dm-focus-accent ); |
| 206 |
} |
| 207 |
|
| 208 |
/* --- Finished: shake the whole card + pulse the stop button -------- */ |
| 209 |
|
| 210 |
.dm-focus.is-finished { |
| 211 |
animation: dm-focus-shake 0.6s ease-in-out infinite; |
| 212 |
} |
| 213 |
|
| 214 |
@keyframes dm-focus-shake { |
| 215 |
0%, |
| 216 |
100% { |
| 217 |
transform: translateX( 0 ); |
| 218 |
} |
| 219 |
20% { |
| 220 |
transform: translateX( -5px ); |
| 221 |
} |
| 222 |
40% { |
| 223 |
transform: translateX( 5px ); |
| 224 |
} |
| 225 |
60% { |
| 226 |
transform: translateX( -3px ); |
| 227 |
} |
| 228 |
80% { |
| 229 |
transform: translateX( 3px ); |
| 230 |
} |
| 231 |
} |
| 232 |
|
| 233 |
@keyframes dm-focus-pulse { |
| 234 |
0%, |
| 235 |
100% { |
| 236 |
box-shadow: 0 0 0 0 |
| 237 |
color-mix( in srgb, var( --dm-focus-accent ) 55%, transparent ); |
| 238 |
} |
| 239 |
50% { |
| 240 |
box-shadow: 0 0 0 6px |
| 241 |
color-mix( in srgb, var( --dm-focus-accent ) 0%, transparent ); |
| 242 |
} |
| 243 |
} |
| 244 |
|
| 245 |
/* Respect reduced-motion: drop the animations, keep a static accent. */ |
| 246 |
@media ( prefers-reduced-motion: reduce ) { |
| 247 |
.dm-focus.is-finished, |
| 248 |
.dm-focus__btn--stop { |
| 249 |
animation: none; |
| 250 |
} |
| 251 |
.dm-focus.is-finished { |
| 252 |
outline: 2px solid var( --dm-focus-accent ); |
| 253 |
outline-offset: 2px; |
| 254 |
} |
| 255 |
} |
| 256 |
|