← back to Wallco Ai
Age prompt: voice the message on load via Web Speech API (best-effort; re-tries on first gesture if the browser gates speech)
a72f554b4febb873d83ea552c45b3575c3bce5ef · 2026-05-29 14:15:54 -0700 · Steve
Files touched
Diff
commit a72f554b4febb873d83ea552c45b3575c3bce5ef
Author: Steve <steve@designerwallcoverings.com>
Date: Fri May 29 14:15:54 2026 -0700
Age prompt: voice the message on load via Web Speech API (best-effort; re-tries on first gesture if the browser gates speech)
---
server.js | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/server.js b/server.js
index c51d6fe..3b418fc 100644
--- a/server.js
+++ b/server.js
@@ -5280,6 +5280,18 @@ const HAMBURGER_JS = `
if (!seen && overlay && onHome) {
overlay.classList.add('is-open');
overlay.setAttribute('aria-hidden','false');
+ // Voice the prompt on load (best-effort — some browsers gate speech until a
+ // gesture; if so it stays silent, no error). Also re-try on first click.
+ (function(){
+ var said = false;
+ function speak(){
+ if (said || !window.speechSynthesis) return; said = true;
+ try { var u = new SpeechSynthesisUtterance('We are asking to serve the best theme for your eyes.');
+ u.rate = 0.95; u.pitch = 1; u.volume = 1; window.speechSynthesis.cancel(); window.speechSynthesis.speak(u); } catch(e){ said = false; }
+ }
+ speak();
+ document.addEventListener('pointerdown', function once(){ document.removeEventListener('pointerdown', once); speak(); }, { once: true });
+ })();
setTimeout(function(){ var i = document.getElementById('age-input'); if (i) i.focus(); }, 100);
document.getElementById('age-submit').addEventListener('click', function(){
var a = parseInt(document.getElementById('age-input').value, 10);
← f9d25bc fix(colorways): restore original chip visual after anchor sw
·
back to Wallco Ai
·
Cactus curator: click a card's color dot to recolor via nati 838401d →