mirror of
https://wiilab.wiimart.org/wiimart/WiiMart-github-io
synced 2025-09-02 19:40:59 +02:00
fix little pause issue and HOPEEFULLY fix the loader, if not i tell mario to stop karting, gem
This commit is contained in:
parent
cc1d2cfba4
commit
a02d770d26
@ -1,21 +1,17 @@
|
||||
var loading = new Audio(""); var loadvolume; var browserageworkswithloader = false; var spinner = true; var shouldaloadedalr = null; var playsound = null;
|
||||
var loading = new Audio("/media/load.wav");
|
||||
var loadvolume;
|
||||
var allowedtoload = true;
|
||||
function showspinner() {
|
||||
if (spinner === true) {
|
||||
if (allowedtoload === true) {
|
||||
document.getElementById("wscspinnerbg").style.display="block";
|
||||
|
||||
if (shouldaloadedalr) {clearTimeout(shouldaloadedalr);}
|
||||
|
||||
shouldaloadedalr = setTimeout(stopspinner,3100);
|
||||
|
||||
if (playsound) {clearTimeout(playsound);}
|
||||
setTimeout(stopspinner,3100);
|
||||
|
||||
/* moved down for compatability */
|
||||
loading = new Audio("/media/load.wav");
|
||||
loading.loop = true;
|
||||
loading.play(); loading.currentTime=0; loadvolume = 0.01; loading.volume = loadvolume;
|
||||
loadup();
|
||||
} else {
|
||||
|
||||
document.getElementById("wscspinnerbg").style.display="none";
|
||||
}
|
||||
|
||||
function stopspinner() {
|
||||
@ -24,20 +20,23 @@ loading.pause();
|
||||
}
|
||||
}
|
||||
|
||||
function loadrimg() {document.getElementById("wscspinner").style.outline="none"; document.getElementById("wscspinner").alt="spinr";}
|
||||
|
||||
function loadup() {
|
||||
var timee = setTimeout(loadup,100);
|
||||
/* i hate javascript sometime :))))))) */
|
||||
if (loadvolume > 0) {
|
||||
loadvolume += 0.01;
|
||||
}
|
||||
if (loadvolume >= 0.4) {
|
||||
loadvolume = 0;
|
||||
clearTimeout(timee);
|
||||
}
|
||||
|
||||
loading.volume = loadvolume;
|
||||
playsound = setTimeout(loadup, 100);
|
||||
loading.volume = loadvolume;
|
||||
}
|
||||
|
||||
|
||||
var checkbgmplayerstatus = null;
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
|
||||
const userAgent = navigator.userAgent.toLowerCase();
|
||||
@ -46,17 +45,20 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||
userAgent.includes('nintendo ds') ||
|
||||
userAgent.includes('nintendo 3ds') ||
|
||||
userAgent.includes('nintendo');
|
||||
if (isConsoleBrowser) {browserageworkswithloader = false;}
|
||||
if (isConsoleBrowser) {checkbgmplayerstatus = false;}
|
||||
else
|
||||
{
|
||||
browserageworkswithloader = true;
|
||||
document.getElementById("wscspinnerbg").style.display="none";
|
||||
checkbgmplayerstatus = true;
|
||||
stopspinner();
|
||||
document.querySelectorAll("a").forEach(link => {
|
||||
link.addEventListener("click", showspinner);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function stopspinner() {
|
||||
document.getElementById("wscspinnerbg").style.display="none";
|
||||
loading.pause();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
@ -40,7 +40,7 @@ function loadwscmusic() {
|
||||
/* wscmusic = loadwscmusic(); */
|
||||
|
||||
function playBGMonload() {
|
||||
|
||||
localStorage.setItem("wmtsiteBGMplaying","playing");
|
||||
if (currenttiime > 0) {
|
||||
wscmusic.currentTime=currenttiime;
|
||||
wscmusic.volume = initialvolume;
|
||||
@ -49,12 +49,13 @@ function playBGMonload() {
|
||||
}
|
||||
|
||||
function playBGM() {
|
||||
localStorage.setItem("wmtsiteBGMplaying","playing");
|
||||
wscmusic.play();
|
||||
document.getElementById("shopbgm").innerText = "Pause";
|
||||
document.getElementById("shopbgmselector").href = "javascript:pauseBGM();";
|
||||
}
|
||||
|
||||
function pauseBGM() {wscmusic.pause(); document.getElementById("shopbgm").innerText = "Play"; document.getElementById("shopbgmselector").href = "javascript:playBGM();";}
|
||||
function pauseBGM() {localStorage.setItem("wmtsiteBGMplaying","paused");wscmusic.pause(); document.getElementById("shopbgm").innerText = "Play"; document.getElementById("shopbgmselector").href = "javascript:playBGM();";}
|
||||
|
||||
function fadeinbgm() {
|
||||
wscmusic.play();
|
||||
@ -85,6 +86,7 @@ function firebgmbox() {
|
||||
var currenttiime = localStorage.getItem("bgmcurrenttime") || 0;
|
||||
|
||||
if (currenttiime > 0) {
|
||||
localStorage.setItem("wmtsiteBGMplaying","paused");
|
||||
activatebgmplayerfocus();
|
||||
document.getElementById("shopbgmselector").href = "javascript:playBGMonload();";
|
||||
}
|
||||
@ -106,7 +108,6 @@ function bgmplayerfocus() {
|
||||
|
||||
function activatebgmplayer() {
|
||||
document.getElementById('bgmplayer').classList.add('bgmplayerdisplayed');
|
||||
document.getElementById("shopbgm").innerText = "Play";
|
||||
document.getElementById("bgmplrtitle").innerText="BGM player"; document.getElementById("bgmplrtitle").style.marginTop="0px";
|
||||
document.getElementById("bgmplayer").style.backdropFilter="blur(1.8px)";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user