garfieeeeld (add shitty loader)

This commit is contained in:
usernames122
2025-08-09 17:22:25 +02:00
parent 55e1616e1b
commit 923e4220ff
4 changed files with 112 additions and 9 deletions

3
alwaysLoaded.js Normal file
View File

@@ -0,0 +1,3 @@
function setDisplayURL(newURL) {
window.history.pushState(null, '', newURL);
}

View File

@@ -1,23 +1,67 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>LAMINAX Windower</title>
<link rel="stylesheet" href="style.css" />
<script src="alwaysLoaded.js"></script>
</head>
<body>
<noscript>The Laminax OS project needs javascript. Yes even the original terminal version needs it.</noscript>
<div id="desktop"></div>
<div id="background-layer" class="background-layer-windower"></div>
<script src="script.js"></script>
<!-- Load the shell -->
<script src="shell.js"></script>
<script>
window.addEventListener("DOMContentLoaded",shell.init);
function init() {
const scripts = [
'script.js',
'shell.js',
'immersion.js'
];
try {
setDisplayURL("/starting")
} catch {}
scripts.forEach(src => {
const script = document.createElement('script');
script.src = src;
document.body.appendChild(script);
if (src === 'script.js') {
script.onload = () => {
let shouldUpdateLoaderSize = true;
const desktopRect = document.getElementById("desktop").getBoundingClientRect();
// Fake boot screen
const loaderWind = createWindow("loader.html", {
headerless: true,
resizable: false,
indent: false
});
transformWindow(loaderWind.windID, desktopRect.width, desktopRect.height, 0, 0);
window.onresize = () => {
if (shouldUpdateLoaderSize) {
transformWindow(loaderWind.windID, desktopRect.width, desktopRect.height, 0, 0);
}
};
setTimeout(() => {
shell.init();
shouldUpdateLoaderSize = false;
try {
setDisplayURL("/localhost")
} catch {}
killWind(loaderWind.windID); // Close the fake boot screen after 8 seconds
}, 8000);
};
}
});
}
window.document.addEventListener("DOMContentLoaded", init);
</script>
<!-- Load OPTIONAL stuff -->
<script src="immersion.js"></script>
</body>
</html>
</html>

56
loader.html Normal file
View File

@@ -0,0 +1,56 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Loading...</title>
<style>
html, body {
margin: 0; padding: 0; height: 100%;
background: #121212;
display: flex;
justify-content: center;
align-items: center;
font-family: sans-serif;
color: #eee;
}
.loader-container {
width: 300px;
height: 30px;
border: 2px solid #444;
border-radius: 15px;
overflow: hidden;
background: #222;
position: relative;
}
.loader-bar {
height: 100%;
width: 80px;
background: linear-gradient(90deg, #4caf50, #81c784);
border-radius: 15px;
position: absolute;
left: 0;
animation: bounceBar 2s steps(6) infinite;
}
@keyframes bounceBar {
0% { left: 0; }
50% { left: calc(100% - 80px); }
100% { left: 0; }
}
.loading-text {
margin-top: 15px;
font-size: 1.2em;
text-align: center;
user-select: none;
}
</style>
</head>
<body>
<div>
<div class="loader-container">
<div class="loader-bar"></div>
</div>
<div class="loading-text">Loading...</div>
</div>
</body>
</html>

View File

@@ -86,7 +86,7 @@ function createWindow(url, settings) {
const windowDiv = document.createElement('div');
windowDiv.classList.add('window');
windowDiv.style.top = '50px';
if (shouldIndent) windowDiv.style.top = '50px';
if (shouldIndent) windowDiv.style.left = '50px';
windowDiv.style.zIndex = zIndexCounter++;
windowDiv.id = windID;