optimizations

This commit is contained in:
sky
2026-02-07 14:45:07 -05:00
parent 62b2436fbf
commit 755211d4b9
12 changed files with 300 additions and 147 deletions

View File

@ -20,7 +20,7 @@
<meta property="og:image"content="https://www.ixl.com/dv3/powZqMuTE7du4asFrVyNGxxoqkw/yui3/opengraph/assets/general_us.png"/>
<!-- initialize my stuff -->
<script src="/js/all.min.js"></script>
<script src="/js/all.min.js" async></script>
<link rel="stylesheet" href="/css/main.css" />
<link rel="stylesheet" href="/css/sidebar.css" />
@ -131,6 +131,48 @@
alertHolder.remove();
}, 1000 * 15)
}
function welcomeScreen() {
let screenIDs = ["zero", "one", "two", "three", "four"];
let screens = screenIDs.map((e) => document.getElementById(e));
let index = 0;
let welcome = document.querySelector("welcome");
let blur = document.getElementById("blur");
// TODO: finish
hideAll();
return;
// LEAKED LEAKED!!!
// new selenite feature woah
function hideAll() {
welcome.remove();
blur.remove();
}
function finish() {
welcome.style.opacity = "0";
blur.style.opacity = "0";
setTimeout(() => {
hideAll();
document.cookie = "selenite.welcomeFinished=true";
}, 1000)
}
function showNextScreen() {
index++;
if(index == screens.length) {finish();return;};
screens[index-1].style.transform = "translateY(-100%)";
screens[index].style.transform = "translateY(0%)";
screens[index].querySelector("#nextPage").addEventListener("click", showNextScreen);
}
if(document.cookie.includes("selenite.welcomeFinished")) hideAll();
welcome.style.display = "block";
welcome.style.opacity = "1";
screens[0].style.transform = "translateY(0%)";
screens[0].querySelector("#nextPage").addEventListener("click", showNextScreen);
screens[0].querySelector("#skip").addEventListener("click", finish);
}
document.addEventListener("DOMContentLoaded", async ()=>{
connectToSocket();
getWeather();
@ -165,7 +207,11 @@
})
});
document.querySelector("loading-game").style.display = "none";
} else {
welcomeScreen();
}
} else {
welcomeScreen();
}
let currentCloak = {name: "", icon: ""};
setInterval(()=>{
@ -241,6 +287,35 @@
<mobile-warning><h1 class="title">your device is not supported!</h1><p>please rotate your screen for the best experience.</p></mobile-warning>
<loading-game><h1 class="title">we are loading your game!</h1><p>please allow us to fetch the data first, this should only take a second.</p></loading-game>
<body>
<welcome>
<section id="zero" style="transform: translateY(100%);">
<h1>welcome to selenite!</h1>
<button id="nextPage">next</button>
<button id="skip">skip</button>
</section>
<section id="one" style="transform: translateY(100%);">
<h1>themes</h1>
<p>theme selector</p>
<button id="nextPage">next</button>
</section>
<section id="two" style="transform: translateY(100%);">
<h1>settings</h1>
<p>tab cloak</p>
<p>panic button</p>
<p>automaically launch in tab cloak</p>
<button id="nextPage">next</button>
</section>
<section id="three" style="transform: translateY(100%);">
<h1>performance</h1>
<p>fast mode</p>
<button id="nextPage">next</button>
</section>
<section id="four" style="transform: translateY(100%);">
<h1>thank you! enjoy</h1>
<button id="nextPage">done</button>
</section>
</welcome>
<div id="blur"></div>
<iframe id="iframe" src="home.html" allow="cross-origin-isolated"></iframe>
<!-- to do
add colors -->