Revert "Revert "minor fix""

This reverts commit 9485ffc21d.
pull/83/head
Aevann 2022-12-27 04:22:32 +02:00
parent b440bf81b4
commit 4930e1198b
1 changed files with 7 additions and 9 deletions

View File

@ -4,16 +4,14 @@
{% set song = "/" ~ path ~ "/" ~ listdir('files/' ~ path)|random() ~ '?v=45' %}
{% endif %}
<script nonce="{{g.nonce}}">
const audio = new Audio("{{song}}");
audio.loop=true;
function play() {
audio.play();
}
audio.loop=true;
window.addEventListener('load', function() {
const audio = new Audio("{{song}}");
audio.loop=true;
function play() {
audio.play();
}
audio.play();
window.addEventListener('click', () => {
if (audio.paused) audio.play();