From 3d44dc6d666cc5a2296ac65087d059636d9b79c6 Mon Sep 17 00:00:00 2001 From: slweeb <91897291+slweeb@users.noreply.github.com> Date: Mon, 7 Apr 2025 14:24:50 -0400 Subject: [PATCH] prep --- index.html | 75 +++++++++++++++++++++++++++++++++++++++------------- mods/glow.js | 13 +++++++-- style.css | 3 +++ 3 files changed, 70 insertions(+), 21 deletions(-) diff --git a/index.html b/index.html index f571f22b..ec665a45 100644 --- a/index.html +++ b/index.html @@ -12963,23 +12963,33 @@ SEEDRISE: function(pixel) { "infection_ice": { color: "#ff7090" }, }; + +// standalone glow.js +if (standalone) { + var script = document.createElement('script'); + script.src = "mods/glow.js"; + document.head.appendChild(script); +} + var currentMonth = new Date().getMonth(); if (window.location.href.includes("holiday=false")) {} else if (currentMonth == 3) { // April - if (new Date().getDate() <= 3) { + if (new Date().getDate() <= 3 && !standalone) { var script = document.createElement('script'); script.src = "mods/fools25.js"; document.head.appendChild(script); } - if (new Date().getDate() === 20) { + else if (new Date().getDate() === 20) { elements.egg.color = elements.bead.color; } } else if (currentMonth == 9) { // October elements.pumpkin_seed.hidden = false; - var script = document.createElement('script'); - script.src = "mods/souls.js" - document.head.appendChild(script); + if (!standalone) { + var script = document.createElement('script'); + script.src = "mods/souls.js" + document.head.appendChild(script); + } if (new Date().getDate() >= 30) { elements.body.color = "#bf5c00"; } @@ -18590,7 +18600,7 @@ window.onload = function() { @@ -19070,6 +19103,10 @@ Cancer, Landmine, Grenade, Smoke Grenade">? document.getElementById("bottomInfoBox").style.display = "none"; document.getElementById("pagetitle").style.display = "none"; document.getElementById("noMods").insertAdjacentHTML("afterend","Requires Internet connection.

") + document.getElementById("gameDiv").classList.add("standalone"); + if (isMobile) { + document.getElementById("gameDiv").classList.add("mobile"); + } } diff --git a/mods/glow.js b/mods/glow.js index 12cc3f2b..066313a4 100644 --- a/mods/glow.js +++ b/mods/glow.js @@ -1,7 +1,9 @@ var isChromium = !!window.chrome; +var ua = navigator.userAgent.toLowerCase(); +var isAndroid = ua.indexOf("android") > -1; //&& ua.indexOf("mobile"); -if (!isChromium) { +if (!isChromium && !isAndroid) { window.addEventListener("load",function(){ console.log(1) logMessage("Error: glow.js only works on Chrome or Chromium-based browsers.") @@ -58,6 +60,13 @@ elements.malware.emit = 2; elements.border.emit = 2; elements.void.emit = 10; +window.addEventListener("load",()=>{ + glowmodCtx2.canvas.width = ctx.canvas.width; + glowmodCtx2.canvas.height = ctx.canvas.height; + glowmodCtx.canvas.width = ctx.canvas.width; + glowmodCtx.canvas.height = ctx.canvas.height; +}) + viewInfo[1] = { // Blur Glow (Emissive pixels only) name: "", pixel: viewInfo[1].pixel, @@ -85,7 +94,7 @@ viewInfo[1] = { // Blur Glow (Emissive pixels only) }; renderEachPixel(function(pixel,ctx) { - if (view === 1) { + if (view === 1 && settings.textures !== 0) { if (elements[pixel.element].emit || pixel.emit || (elements[pixel.element].colorOn && pixel.charge)) { let a = (settings.textures !== 0) ? pixel.alpha : undefined; let d = pixel.emit||elements[pixel.element].emit||true; diff --git a/style.css b/style.css index af33c67e..72393cfc 100644 --- a/style.css +++ b/style.css @@ -50,6 +50,9 @@ a:active, a:hover:active, .saveOption:active, .saveOption:hover:active {filter: margin-top: 0!important; border: none!important; } +.standalone.mobile #savesButton, .standalone.mobile #extraInfo { + display: none +} #game { image-rendering: pixelated; }