garfieeeeld (add shitty loader)
This commit is contained in:
3
alwaysLoaded.js
Normal file
3
alwaysLoaded.js
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
function setDisplayURL(newURL) {
|
||||||
|
window.history.pushState(null, '', newURL);
|
||||||
|
}
|
||||||
60
index.html
60
index.html
@@ -1,23 +1,67 @@
|
|||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<title>LAMINAX Windower</title>
|
<title>LAMINAX Windower</title>
|
||||||
<link rel="stylesheet" href="style.css" />
|
<link rel="stylesheet" href="style.css" />
|
||||||
|
<script src="alwaysLoaded.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<noscript>The Laminax OS project needs javascript. Yes even the original terminal version needs it.</noscript>
|
<noscript>The Laminax OS project needs javascript. Yes even the original terminal version needs it.</noscript>
|
||||||
<div id="desktop"></div>
|
<div id="desktop"></div>
|
||||||
<div id="background-layer" class="background-layer-windower"></div>
|
<div id="background-layer" class="background-layer-windower"></div>
|
||||||
<script src="script.js"></script>
|
|
||||||
<!-- Load the shell -->
|
|
||||||
<script src="shell.js"></script>
|
|
||||||
<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>
|
</script>
|
||||||
<!-- Load OPTIONAL stuff -->
|
|
||||||
<script src="immersion.js"></script>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
|
||||||
|
</html>
|
||||||
56
loader.html
Normal file
56
loader.html
Normal 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>
|
||||||
@@ -86,7 +86,7 @@ function createWindow(url, settings) {
|
|||||||
|
|
||||||
const windowDiv = document.createElement('div');
|
const windowDiv = document.createElement('div');
|
||||||
windowDiv.classList.add('window');
|
windowDiv.classList.add('window');
|
||||||
windowDiv.style.top = '50px';
|
if (shouldIndent) windowDiv.style.top = '50px';
|
||||||
if (shouldIndent) windowDiv.style.left = '50px';
|
if (shouldIndent) windowDiv.style.left = '50px';
|
||||||
windowDiv.style.zIndex = zIndexCounter++;
|
windowDiv.style.zIndex = zIndexCounter++;
|
||||||
windowDiv.id = windID;
|
windowDiv.id = windID;
|
||||||
|
|||||||
Reference in New Issue
Block a user