From 0d367e43a62b496b64a5d8b2b0572bc86fe68235 Mon Sep 17 00:00:00 2001 From: Alfie King Date: Wed, 4 Mar 2026 21:54:21 +0000 Subject: [PATCH] audio "fix" --- static/css/terminal.css | 9 +++++++++ static/js/smileos.js | 8 ++++++++ templates/terminal.html | 5 ++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/static/css/terminal.css b/static/css/terminal.css index 752fb5d..84530d4 100644 --- a/static/css/terminal.css +++ b/static/css/terminal.css @@ -119,4 +119,13 @@ #smileos-window-content img { width: 100%; +} + +#smileos-restart-music { + color: #FF4343; + cursor: pointer; +} + +#smileos-restart-music:hover { + font-weight: 700; } \ No newline at end of file diff --git a/static/js/smileos.js b/static/js/smileos.js index 47debfe..fe31150 100644 --- a/static/js/smileos.js +++ b/static/js/smileos.js @@ -89,6 +89,14 @@ document.addEventListener("DOMContentLoaded", async function() { document.getElementById("smileos-window-content").innerHTML = tips_of_the_day[Math.floor(Math.random() * tips_of_the_day.length)]; await playAudio('/static/content/smileos/SmileOS2Startup.ogx'); + var music = new Audio('/static/content/smileos/Shopmusic.ogx'); + music.loop = true; + music.play(); +}); + +document.getElementById("smileos-restart-music").addEventListener("click", async function() { + await playAudio('/static/content/smileos/SmileOS2Startup.ogx'); + var music = new Audio('/static/content/smileos/Shopmusic.ogx'); music.loop = true; music.play(); diff --git a/templates/terminal.html b/templates/terminal.html index 0987ae9..9abebc8 100644 --- a/templates/terminal.html +++ b/templates/terminal.html @@ -49,7 +49,10 @@
- Note: this page has background music, you may have to allow the music in the browser and refesh to let it play :P +

+ Note: this page has background music, you may have to allow the music in the browser and refesh to let it play, or you can try + press this to restart it +

{% endblock %}