Spaces:
Running on Zero
Running on Zero
Demo shortcut: press ` / ~ to replay the intro and re-arm the WHO AM I tutorial pulse + welcome
Browse files- app.py +18 -0
- tabs/whoami.tab.js +1 -0
app.py
CHANGED
|
@@ -7621,6 +7621,24 @@ TITLE_OVERLAY_JS = f"""
|
|
| 7621 |
function boot() {{ install(); installMuteButton(); }}
|
| 7622 |
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', boot);
|
| 7623 |
else boot();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7624 |
}})();
|
| 7625 |
"""
|
| 7626 |
|
|
|
|
| 7621 |
function boot() {{ install(); installMuteButton(); }}
|
| 7622 |
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', boot);
|
| 7623 |
else boot();
|
| 7624 |
+
|
| 7625 |
+
// Demo shortcut: press ` (or ~) to replay the title intro (brings back the play button) and
|
| 7626 |
+
// re-arm the first-run tutorial so the WHO AM I tab pulses again. Ignored while typing.
|
| 7627 |
+
window.addEventListener('keydown', function (e) {{
|
| 7628 |
+
if (e.key !== '`' && e.key !== '~' && e.code !== 'Backquote') return;
|
| 7629 |
+
var t = e.target || {{}};
|
| 7630 |
+
var tag = (t.tagName || '').toLowerCase();
|
| 7631 |
+
if (tag === 'input' || tag === 'textarea' || t.isContentEditable) return;
|
| 7632 |
+
e.preventDefault();
|
| 7633 |
+
try {{
|
| 7634 |
+
if (window.__kwTheme) {{ window.__kwTheme.pause(); window.__kwTheme.currentTime = 0; }}
|
| 7635 |
+
window.__kwThemeStarted = false; // let the replayed intro restart the theme
|
| 7636 |
+
}} catch (err) {{}}
|
| 7637 |
+
var existing = document.getElementById('kw-title-overlay');
|
| 7638 |
+
if (existing) existing.remove(); // force a fresh overlay even if one lingers
|
| 7639 |
+
install(); // brings back the intro + play button
|
| 7640 |
+
try {{ window.dispatchEvent(new Event('kimodo-tutorial-restart')); }} catch (err) {{}}
|
| 7641 |
+
}});
|
| 7642 |
}})();
|
| 7643 |
"""
|
| 7644 |
|
tabs/whoami.tab.js
CHANGED
|
@@ -283,6 +283,7 @@
|
|
| 283 |
// Restart the tutorial (from the account drawer): re-arm step 1's pulse.
|
| 284 |
window.addEventListener('kimodo-tutorial-restart', function () {
|
| 285 |
var o = load(); o.whoamiSeen = false; save(o); setPulse(true);
|
|
|
|
| 286 |
});
|
| 287 |
|
| 288 |
// Don't start the first-run pulse until the intro TITLE overlay has finished.
|
|
|
|
| 283 |
// Restart the tutorial (from the account drawer): re-arm step 1's pulse.
|
| 284 |
window.addEventListener('kimodo-tutorial-restart', function () {
|
| 285 |
var o = load(); o.whoamiSeen = false; save(o); setPulse(true);
|
| 286 |
+
welcomePlayedThisSession = false; // re-arm the auto welcome voice for the demo replay
|
| 287 |
});
|
| 288 |
|
| 289 |
// Don't start the first-run pulse until the intro TITLE overlay has finished.
|