Skip to content

Commit e74b39e

Browse files
committed
theme switch button caption
1 parent 58ee2c3 commit e74b39e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/EventHandlers.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export class EventHandlers {
1+
class EventHandlers {
22
constructor(elements, textProcessor, speedController, uiController) {
33
this.elements = elements;
44
this.textProcessor = textProcessor;
@@ -13,6 +13,8 @@ export class EventHandlers {
1313
this.pauseStart = 0;
1414

1515
this.initEventListeners();
16+
this.uiController.updateButtonStates(this.isPlaying, this.currentWordIndex, this.words);
17+
this.elements.themeToggle.setAttribute('data-tooltip', 'Dark theme');
1618
}
1719

1820
initEventListeners() {
@@ -28,6 +30,8 @@ export class EventHandlers {
2830
toggleTheme() {
2931
document.body.classList.toggle('dark-theme');
3032
this.elements.themeToggle.textContent = document.body.classList.contains('dark-theme') ? '☀️' : '🌚';
33+
this.elements.themeToggle.setAttribute('data-tooltip',
34+
document.body.classList.contains('dark-theme') ? 'Light theme' : 'Dark theme');
3135
}
3236

3337
handleFileUpload(event) {

src/styles.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ button:disabled {
246246

247247
#themeToggle {
248248
position: absolute;
249-
right: 20px;
249+
right: 30px;
250250
top: 20px;
251251
font-size: 40px;
252252
cursor: pointer;

0 commit comments

Comments
 (0)