diff options
| author | Paul Buetow <paul@buetow.org> | 2026-04-25 23:11:10 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-04-25 23:11:10 +0300 |
| commit | eebb1df14b26b65493702c090d13e1a9c7563db6 (patch) | |
| tree | 5662bc4e05910403204c55d0fc2f1caf74d37061 /internal | |
| parent | b163e32473aba57936283a39c5d62089bebab46d (diff) | |
Fix splash screen Enter/Space key not playing chime sound
The splash overlay played its chime on pointerdown (click) but not when
dismissing via Enter or Space. Expose playSplashChime on window so the
global keydown handler can trigger the same sound before dismissal.
Escape continues to dismiss silently.
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/generator/templates/shared/shared.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/internal/generator/templates/shared/shared.js b/internal/generator/templates/shared/shared.js index 13c99dd..6391d6c 100644 --- a/internal/generator/templates/shared/shared.js +++ b/internal/generator/templates/shared/shared.js @@ -704,6 +704,7 @@ window._snonuxRebindHeader = bindHeaderTriggers; window._snonuxDismissSplash = dismiss; window._snonuxShowSplash = show; + window._snonuxPlaySplashChime = playSplashChime; if (document.documentElement.classList.contains('sno-splash-skip')) { dismiss(); return; @@ -1407,7 +1408,11 @@ if (tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT') return; var splash = document.getElementById('splash-overlay'); if (splash && !splash.classList.contains('splash--dismissed')) { - if (e.key === 'Enter' || e.key === ' ' || e.key === 'Escape') { + if (e.key === 'Enter' || e.key === ' ') { + e.preventDefault(); + if (window._snonuxPlaySplashChime) window._snonuxPlaySplashChime(); + if (window._snonuxDismissSplash) window._snonuxDismissSplash(); + } else if (e.key === 'Escape') { e.preventDefault(); if (window._snonuxDismissSplash) window._snonuxDismissSplash(); } else if (e.key === 'w' && !e.repeat) { |
