|
47 | 47 | transition: background var(--transition); |
48 | 48 | } |
49 | 49 |
|
| 50 | + body, |
| 51 | + #editor, |
| 52 | + .btn, |
| 53 | + #editor::placeholder { |
| 54 | + transition: background var(--transition), color var(--transition); |
| 55 | + } |
| 56 | + |
| 57 | + #count, |
| 58 | + [data-action="theme"] { |
| 59 | + transition: opacity var(--transition); |
| 60 | + } |
| 61 | + |
50 | 62 | .controls { |
51 | 63 | display: flex; |
52 | 64 | justify-content: space-between; |
|
61 | 73 |
|
62 | 74 | .btn { |
63 | 75 | cursor: pointer; |
64 | | - opacity: 0.5; |
65 | 76 | font-size: 14px; |
66 | 77 | transition: opacity var(--transition), color var(--transition); |
67 | 78 | user-select: none; |
68 | | - color: var(--text); |
| 79 | + color: rgb(from var(--text) r g b / 0.6); |
69 | 80 | } |
70 | 81 |
|
71 | 82 | .btn:hover { |
72 | | - opacity: 1; |
73 | 83 | color: var(--hover-accent); |
74 | 84 | } |
75 | 85 |
|
|
294 | 304 | } |
295 | 305 |
|
296 | 306 | toggleCountMode() { |
297 | | - this.countMode = this.countMode === 'words' ? 'characters' : 'words'; |
298 | | - localStorage.setItem(SHIRO_COUNT_MODE, this.countMode); |
299 | | - this.updateCount(); |
| 307 | + this.countDisplay.style.opacity = '0'; |
| 308 | + setTimeout(() => { |
| 309 | + this.countMode = this.countMode === 'words' ? 'characters' : 'words'; |
| 310 | + localStorage.setItem(SHIRO_COUNT_MODE, this.countMode); |
| 311 | + this.updateCount(); |
| 312 | + this.countDisplay.style.opacity = '1'; |
| 313 | + }, 150); |
300 | 314 | } |
301 | 315 |
|
302 | 316 | hide() { |
|
315 | 329 | } |
316 | 330 |
|
317 | 331 | setTheme(theme = this.theme) { |
318 | | - document.documentElement.setAttribute('data-theme', theme); |
319 | | - document.querySelector('[data-action="theme"]').textContent = theme === 'dark' ? 'Light' : 'Dark'; |
| 332 | + const button = document.querySelector('[data-action="theme"]'); |
| 333 | + button.style.opacity = '0'; |
| 334 | + setTimeout(() => { |
| 335 | + document.documentElement.setAttribute('data-theme', theme); |
| 336 | + button.textContent = theme === 'dark' ? 'Light' : 'Dark'; |
| 337 | + button.style.opacity = '1'; |
| 338 | + }, 150); |
320 | 339 | localStorage.setItem(SHIRO_THEME, theme); |
321 | 340 | this.theme = theme; |
322 | 341 | } |
|
0 commit comments