From b25d691eb7b7ff04f4d53f2e710694e11631f2f1 Mon Sep 17 00:00:00 2001 From: Francesco Luzzana Date: Fri, 24 Jun 2022 14:53:36 +0200 Subject: [PATCH] audio button --- background.js | 7 +++++++ style.css | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/background.js b/background.js index 2e5af0d..3e2dced 100644 --- a/background.js +++ b/background.js @@ -21,3 +21,10 @@ const meta = function (release) { date.innerHTML = release.date; date.classList.remove("hidden"); }; + +const intro = document.querySelector("#intro"); +let introOutro = new Audio("https://hub.xpub.nl/soupboat/SI18/08/si18-8-intro-outro-final.mp3"); +intro.addEventListener("click", () => { + if (introOutro.paused) introOutro.play(); + else introOutro.pause(); +}); diff --git a/style.css b/style.css index 1962650..7bfdcd1 100644 --- a/style.css +++ b/style.css @@ -206,6 +206,10 @@ dd { padding: 2px 4px; } +#intro { + cursor: pointer; +} + @media (max-width: 767.98px) { .index li { width: 32px;