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