Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Fix mascot using wrong mp3 source

Cette révision appartient à :
kipukun 2017-05-27 17:33:52 -04:00
Parent 05701f1c38
révision 2f78f61ade
2 fichiers modifiés avec 10 ajouts et 17 suppressions

Voir le fichier

@ -32,13 +32,6 @@ function switchThemes(){
}
function changeTheme(opt) {
theme = opt.value;
localStorage.setItem("theme", theme);
document.getElementById("theme").href = "/css/" + theme;
console.log(theme);
}
function toggleMascot(btn) {
var state= btn.value;
if (state == "hide") {
@ -86,13 +79,11 @@ window.onload = function() {
};
function playVoice() {
switch (theme) {
case "tomorrow.css":
if (explosion) {
explosion.play();
break;
default:
}
else {
nyanpassu.volume = 0.5;
nyanpassu.play();
break;
}
}

Voir le fichier

@ -73,14 +73,16 @@
{{block "content" .}}{{call $.T "nothing_here"}}{{end}}
</div>
<div id="mascot" class="hide-xs" onclick="playVoice();"></div>
{{ if eq .Theme "tomorrow" }}
<audio id="explosion" hidden preload="none">
<source src="https://megumin.love/sounds/explosion.mp3" type="audio/mpeg">
</audio>
{{ else }}
<audio id="nyanpassu" hidden preload="none">
<source src="https://a.doko.moe/sewang.mp3" type="audio/mpeg">
</audio>
<audio id="explosion" hidden preload="none">
<source src="https://megumin.love/sounds/explosion.mp3" type="audio/mpeg">
</audio>
<div class="pagination">
{{end}}
<div class="pagination">
{{ genNav .Navigation .URL 15 }}
</div>