forked from rDrama/rDrama
1
0
Fork 0

fix fistmas song

master
Aevann 2023-01-01 04:24:36 +02:00
parent 40d8fb252c
commit 710502000e
2 changed files with 3 additions and 1 deletions

View File

@ -1,4 +1,5 @@
const audio = new Audio("{{song}}");
const song = document.getElementById('fistmas-song').value;
const audio = new Audio(song);
audio.loop=true;
audio.play();

View File

@ -2,6 +2,7 @@
{% if not song %}
{% set path = "assets/event/media/music" %}
{% set song = "/" ~ path ~ "/" ~ listdir('files/' ~ path)|random() ~ '?v=45' %}
<input hidden id="fistmas-song" value="{{song}}">
{% endif %}
<script defer src="{{'event/js/music.js' | asset}}"></script>
{% endif %}