forked from rDrama/rDrama
fix
parent
4f8e536f51
commit
9641a0599d
|
@ -393,28 +393,28 @@
|
|||
|
||||
{% if u.song %}
|
||||
<script>
|
||||
window.addEventListener("load",function(event) {
|
||||
var audio = new Audio('/songs/{{u.id}}');
|
||||
audio.loop=true;
|
||||
const uid = {{ u.id }}
|
||||
|
||||
{% if not u.unmutable %}
|
||||
function pause() {
|
||||
audio.pause();
|
||||
document.getElementById("pause1").classList.toggle("hidden");
|
||||
document.getElementById("play1").classList.toggle("hidden");
|
||||
document.getElementById("pause2").classList.toggle("hidden");
|
||||
document.getElementById("play2").classList.toggle("hidden");
|
||||
}
|
||||
let audio = new Audio(`/songs/${uid}`);
|
||||
audio.loop=true;
|
||||
|
||||
function play() {
|
||||
audio.play();
|
||||
document.getElementById("pause1").classList.toggle("hidden");
|
||||
document.getElementById("play1").classList.toggle("hidden");
|
||||
document.getElementById("pause2").classList.toggle("hidden");
|
||||
document.getElementById("play2").classList.toggle("hidden");
|
||||
}
|
||||
{% endif %}
|
||||
function pause() {
|
||||
audio.pause();
|
||||
document.getElementById("pause1").classList.toggle("hidden");
|
||||
document.getElementById("play1").classList.toggle("hidden");
|
||||
document.getElementById("pause2").classList.toggle("hidden");
|
||||
document.getElementById("play2").classList.toggle("hidden");
|
||||
}
|
||||
|
||||
function play() {
|
||||
audio.play();
|
||||
document.getElementById("pause1").classList.toggle("hidden");
|
||||
document.getElementById("play1").classList.toggle("hidden");
|
||||
document.getElementById("pause2").classList.toggle("hidden");
|
||||
document.getElementById("play2").classList.toggle("hidden");
|
||||
}
|
||||
|
||||
window.addEventListener('load', (e) => {
|
||||
audio.play();
|
||||
document.getElementById('userpage').addEventListener('click', () => {
|
||||
if (audio.paused) audio.play();
|
||||
|
|
Loading…
Reference in New Issue