From 681d1afc68f4410d3a62bf873f1016b9e73e6468 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Sun, 20 Aug 2023 02:23:00 +0400 Subject: [PATCH] Shortened a code for changing maskImage. --- web/assets/js/main.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/web/assets/js/main.js b/web/assets/js/main.js index 1cf36c7..bdf4ae3 100644 --- a/web/assets/js/main.js +++ b/web/assets/js/main.js @@ -61,9 +61,7 @@ $("play").addEventListener("click", e => { audio.pause(); audio.src = ""; } - e.target.style.maskImage = audio.paused ? - "url(/assets/img/play.svg)" : "url(/assets/img/stop.svg)"; - e.target.style.webkitMaskImage = audio.paused ? + e.target.style.maskImage = e.target.style.webkitMaskImage = audio.paused ? "url(/assets/img/play.svg)" : "url(/assets/img/stop.svg)"; }); audio.addEventListener("timeupdate", e => {