Widget:AudioVerse: Difference between revisions
((by SublimeText.Mediawiker)) |
((by SublimeText.Mediawiker)) |
||
| Line 2: | Line 2: | ||
<source src='<!--{$src|default:''}-->' type='audio/mp3' /> | <source src='<!--{$src|default:''}-->' type='audio/mp3' /> | ||
</audio> | </audio> | ||
<a href="#" id="audioControl" class="text-80 offwhite-bg rounded tsdwiki-pop-off px-2 py-1 | <a href="#" id="audioControl" class="text-80 offwhite-bg rounded tsdwiki-pop-off px-2 py-1 d-flex align-items-center">CHANT <i id="audioIcon" class="fa-sharp-duotone fa-solid fa-volume-high fa-xs ml-1"></i></a> | ||
<script> | <script> | ||
Revision as of 11:06, 29 October 2024
<audio id="audioVerse" preload='none'> <source src= type='audio/mp3' /> </audio> <a href="#" id="audioControl" class="text-80 offwhite-bg rounded tsdwiki-pop-off px-2 py-1 d-flex align-items-center">CHANT </a> <script>
var audioControl = document.getElementById("audioControl"), audio = document.getElementById("audioVerse"); icon = document.getElementById("audioIcon");
audioControl.addEventListener("click", (event) => { if (audio.paused) { audio.play(); } else { audio.pause(); audio.currentTime = 0 } icon.classList.toggle("fa-volume-high"); icon.classList.toggle("fa-volume-xmark"); });
</script>