Dough Git

commit

remove sfx

commit
429c805a7596c36abfca89d9d603e411abf963a2
author
Clove Twilight <[email protected]>
date
2026-10-22 21:01

diff --git a/package.json b/package.json
index 5cc9aa6..7587bbc 100644
--- a/package.json
+++ b/package.json
@@ -16,5 +16,9 @@
     "hono": "^4.13.5",
     "jose": "^6.2.10",
     "resend": "^6.24.0"
+  },
+  "allowScripts": {
+    "esbuild": true,
+    "workerd": true
   }
 }
diff --git a/public/index.html b/public/index.html
index 90ce733..6623dab 100644
--- a/public/index.html
+++ b/public/index.html
@@ -97,6 +97,5 @@
   <div id="toastHost" class="toast-host"></div>
 
   <script src="/app.js"></script>
-  <script src="/sfx.js"></script>
 </body>
 </html>
\ No newline at end of file
diff --git a/public/login.html b/public/login.html
index 0b9ddc5..ad754db 100644
--- a/public/login.html
+++ b/public/login.html
@@ -33,6 +33,5 @@
       <a href="/auth/login" class="btn-accent">๐Ÿ”‘ Sign in with SSO</a>
     </div>
   </div>
-  <script src="/sfx.js"></script>
 </body>
 </html>
diff --git a/public/settings.html b/public/settings.html
index d0d6436..946de18 100644
--- a/public/settings.html
+++ b/public/settings.html
@@ -102,6 +102,5 @@
   </div>
 
   <script src="/settings.js"></script>
-  <script src="/sfx.js"></script>
 </body>
 </html>
diff --git a/public/sfx.js b/public/sfx.js
deleted file mode 100644
index e6fd330..0000000
--- a/public/sfx.js
+++ /dev/null
@@ -1,124 +0,0 @@
-/* sfx.js
- * Copyright (c) 2026 Clove Nytrix Doughmination Twilight
- * Licensed under the DASL-1.0 Licence.
- * See LICENCE.md in the project root for full licence information.
- *
- * UI sounds: hover, click, toggle. On by default, muteable (persisted),
- * silenced under prefers-reduced-motion. Set window.SFX_BASE to point at the
- * folder holding hover.mp3 / click.mp3 / toggle.mp3 (defaults to "/sfx/").
- */
-(function () {
-  var base = window.SFX_BASE || "https://m.doughmination.gay/sfx/";
-
-  var reduceMotion = window.matchMedia
-    ? window.matchMedia("(prefers-reduced-motion: reduce)").matches
-    : false;
-
-  var STORE_KEY = "sfx-muted";
-
-  function readMuted() {
-    if (reduceMotion) return true;
-    try {
-      return localStorage.getItem(STORE_KEY) === "1";
-    } catch (e) {
-      return false;
-    }
-  }
-
-  var muted = readMuted();
-
-  var names = ["hover", "click", "toggle"];
-
-  var sounds = {};
-  names.forEach(function (name) {
-    var audio = new Audio(base + name + ".mp3");
-    audio.preload = "auto";
-    audio.volume = 0.3;
-    sounds[name] = audio;
-  });
-
-  var lastHover = 0;
-
-  function play(name) {
-    if (muted) return;
-    var audio = sounds[name];
-    if (!audio) return;
-    try {
-      audio.currentTime = 0;
-      var attempt = audio.play();
-      if (attempt && attempt.catch) attempt.catch(function () {});
-    } catch (e) {}
-  }
-
-  var interactive = 'a,button,[role="button"],summary,.row,.copy,.zip';
-  var toggleable = 'input[type="checkbox"],input[type="radio"],[role="switch"]';
-
-  document.addEventListener(
-    "pointerover",
-    function (event) {
-      var el = event.target.closest(interactive);
-      if (!el) return;
-      var now = Date.now();
-      if (now - lastHover < 90) return;
-      lastHover = now;
-      play("hover");
-    },
-    true,
-  );
-
-  document.addEventListener(
-    "click",
-    function (event) {
-      if (event.target.closest(toggleable)) {
-        play("toggle");
-        return;
-      }
-      if (event.target.closest(interactive)) play("click");
-    },
-    true,
-  );
-
-  document.addEventListener(
-    "change",
-    function (event) {
-      if (event.target.matches(toggleable + ",select")) play("toggle");
-    },
-    true,
-  );
-
-  function label() {
-    return muted ? "Unmute interface sounds" : "Mute interface sounds";
-  }
-
-  function glyph() {
-    return muted ? "๐Ÿ”‡" : "๐Ÿ”Š";
-  }
-
-  function mount() {
-    var button = document.querySelector(".sfx-toggle");
-    if (!button) {
-      button = document.createElement("button");
-      button.className = "sfx-toggle";
-      document.body.appendChild(button);
-    }
-    button.type = "button";
-    button.textContent = glyph();
-    button.setAttribute("aria-label", label());
-
-    button.addEventListener("click", function () {
-      muted = !muted;
-      try {
-        localStorage.setItem(STORE_KEY, muted ? "1" : "0");
-      } catch (e) {}
-      button.textContent = glyph();
-      button.setAttribute("aria-label", label());
-      if (!muted) play("toggle");
-    });
-  }
-
-  if (document.readyState === "loading") {
-    document.addEventListener("DOMContentLoaded", mount);
-  } else {
-    mount();
-  }
-})();
diff --git a/server.ts b/server.ts
index 8369078..29be540 100644
--- a/server.ts
+++ b/server.ts
@@ -195,7 +195,6 @@ const app = new Hono<{ Variables: { user: string } }>();
 const PUBLIC_PATHS = new Set([
   "/login",
   "/login.html",
-  "/sfx.js",
   "/style.css",
   "/favicon.ico",
   "/apple-touch-icon.png",