Spaces:
Running
Running
fix: welcome overlay button styling and add debugging
Browse files- Use correct 'typewriter-button' class instead of 'btn btn-primary'
- Add console logging to debug overlay display issues
- Add forceShow() method for testing
- Ensure button styling matches rest of application
- src/welcomeOverlay.js +9 -1
src/welcomeOverlay.js
CHANGED
|
@@ -6,11 +6,13 @@ class WelcomeOverlay {
|
|
| 6 |
}
|
| 7 |
|
| 8 |
show() {
|
|
|
|
| 9 |
if (this.hasBeenShown) return;
|
| 10 |
|
| 11 |
this.isVisible = true;
|
| 12 |
const overlay = this.createOverlay();
|
| 13 |
document.body.appendChild(overlay);
|
|
|
|
| 14 |
|
| 15 |
// Animate in
|
| 16 |
requestAnimationFrame(() => {
|
|
@@ -57,7 +59,7 @@ class WelcomeOverlay {
|
|
| 57 |
</p>
|
| 58 |
</div>
|
| 59 |
|
| 60 |
-
<button id="welcome-start-btn" class="
|
| 61 |
Start Reading
|
| 62 |
</button>
|
| 63 |
`;
|
|
@@ -96,6 +98,12 @@ class WelcomeOverlay {
|
|
| 96 |
localStorage.removeItem('cloze-reader-welcomed');
|
| 97 |
this.hasBeenShown = false;
|
| 98 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 99 |
}
|
| 100 |
|
| 101 |
export default WelcomeOverlay;
|
|
|
|
| 6 |
}
|
| 7 |
|
| 8 |
show() {
|
| 9 |
+
console.log('WelcomeOverlay.show() called, hasBeenShown:', this.hasBeenShown);
|
| 10 |
if (this.hasBeenShown) return;
|
| 11 |
|
| 12 |
this.isVisible = true;
|
| 13 |
const overlay = this.createOverlay();
|
| 14 |
document.body.appendChild(overlay);
|
| 15 |
+
console.log('Welcome overlay added to DOM');
|
| 16 |
|
| 17 |
// Animate in
|
| 18 |
requestAnimationFrame(() => {
|
|
|
|
| 59 |
</p>
|
| 60 |
</div>
|
| 61 |
|
| 62 |
+
<button id="welcome-start-btn" class="typewriter-button">
|
| 63 |
Start Reading
|
| 64 |
</button>
|
| 65 |
`;
|
|
|
|
| 98 |
localStorage.removeItem('cloze-reader-welcomed');
|
| 99 |
this.hasBeenShown = false;
|
| 100 |
}
|
| 101 |
+
|
| 102 |
+
// Force show overlay (for testing)
|
| 103 |
+
forceShow() {
|
| 104 |
+
this.hasBeenShown = false;
|
| 105 |
+
this.show();
|
| 106 |
+
}
|
| 107 |
}
|
| 108 |
|
| 109 |
export default WelcomeOverlay;
|