diff --git a/assets/byte_dice_border.png b/assets/byte_dice_border.png new file mode 100644 index 0000000..062e776 Binary files /dev/null and b/assets/byte_dice_border.png differ diff --git a/assets/byte_dice_fancy_64x64.png b/assets/byte_dice_fancy_64x64.png new file mode 100644 index 0000000..76de73e Binary files /dev/null and b/assets/byte_dice_fancy_64x64.png differ diff --git a/global/globalScript.js b/global/globalScript.js index a48119c..82fe04e 100644 --- a/global/globalScript.js +++ b/global/globalScript.js @@ -4,7 +4,8 @@ const PAGES = { SYNTHWAVE: 1, TOYS: 2, LICENSE: 3, - SC_TRACKER: 4 + SC_TRACKER: 4, + LOADING: 5 } const CONSOLE_COLORS = { red: "color: #FF0000;", @@ -17,6 +18,7 @@ let CURRENT_PAGE = PAGES.null let isAnimating = true let gridVisible = false +let navBarPresent = false function randomFloat(min, max) { return Math.random() * (max - min) + min @@ -139,7 +141,7 @@ function pauseAnimBtn(state) { function setVh() { - document.documentElement.style.setProperty("--vh", window.innerHeight * 0.01 + "px"); + document.documentElement.style.setProperty("--vh", window.innerHeight * 0.01 + "px") } @@ -161,17 +163,27 @@ document.addEventListener("DOMContentLoaded", async function() { if (densityWidth > densityHeight) { debugPrint("pxDensity", `Width, ${pxDensity}`) } else { debugPrint("pxDensity", `Height, ${pxDensity}`) } - setLoadingProgress("adding navBar...") - await loadNavBarJson() - onLoadNavBar() + if (navBarPresent) { + setLoadingProgress("adding navBar...") + await loadNavBarJson() + onLoadNavBar() + } switch (CURRENT_PAGE) { case (PAGES.SYNTHWAVE): loadingScreenSynthwave(); break case (PAGES.LICENSE): onLoadLicense(); break } - pauseAnimBtn(localStorage["isAnimating"] || "true") - debugPrint("isAnimating", isAnimating) + if (navBarPresent) { + pauseAnimBtn(localStorage["isAnimating"] || "true") + debugPrint("isAnimating", isAnimating) + } + + if (CURRENT_PAGE == PAGES.LOADING) { + clearLoadingScreenClutter() + periodicallyChangeTips() + return + } if (fakeLoading != "true") { removeLoadingScreen(true) diff --git a/global/loadingScreen.js b/global/loadingScreen.js index 2af2d66..b0601dc 100644 --- a/global/loadingScreen.js +++ b/global/loadingScreen.js @@ -7,9 +7,9 @@ let fakeLoadingComplete = false loadingScreenEl.className = "bgDiv" loadingScreenEl.innerHTML = ` - + -
+

Use extended loading screen?
(For immersion) diff --git a/global/navBar.js b/global/navBar.js index e083297..1a89df9 100644 --- a/global/navBar.js +++ b/global/navBar.js @@ -1,6 +1,8 @@ let navBarJson let alts +navBarPresent = true + function onLoadNavBar() { const container = document.getElementById("navBarContainer") const altString = container.dataset.alt || "" diff --git a/toys/index.html b/toys/index.html index 52adeef..6536041 100644 --- a/toys/index.html +++ b/toys/index.html @@ -40,7 +40,7 @@

-
  • + +
  • +
  • diff --git a/toys/loading/index.html b/toys/loading/index.html new file mode 100644 index 0000000..ddd2baa --- /dev/null +++ b/toys/loading/index.html @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + Byte Dice - Loading... + + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + + + + + + + + + + \ No newline at end of file diff --git a/toys/loading/script.js b/toys/loading/script.js new file mode 100644 index 0000000..2fdecbb --- /dev/null +++ b/toys/loading/script.js @@ -0,0 +1,35 @@ +CURRENT_PAGE = PAGES.LOADING + + +let byteDiceSize = 1 +let loadingImg = undefined + + +function clearLoadingScreenClutter() { + document.getElementById("fakeLoadingToggle").remove() + loadingImg = document.getElementById("loadingImg") +} + + +function periodicallyChangeTips() { + newTip() + setLoadingProgress("") + + setInterval(periodicallyChangeTips, 60 * 1000) +} + + +function changeLoadingImgSize() { + loadingImg.style.width = `calc(${32 * byteDiceSize}px * var(--pxDensity))` + loadingImg.style.height = `calc(${32 * byteDiceSize}px * var(--pxDensity))` +} + + +window.onkeydown = function(e) { // keycodes 48..57 = 0-9 + let code = e.keyCode + + if (!(code >= 48 && code <= 57)) { return } + + byteDiceSize = (code - 48) / 9 + 1 + changeLoadingImgSize() +} \ No newline at end of file diff --git a/toys/loading/style.css b/toys/loading/style.css new file mode 100644 index 0000000..e69de29