Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
cvyl authored Nov 5, 2023
1 parent 090f5ce commit 4047dd4
Showing 1 changed file with 52 additions and 52 deletions.
104 changes: 52 additions & 52 deletions js/boot.js
Original file line number Diff line number Diff line change
@@ -1,61 +1,61 @@
$(document).ready(function() {
$(".command").hide();
// Boot-up sequence
const bootUpSequence = [
"WINDOSE BIOS @ " + new Date().toLocaleString() + "<br><br><br>Booting up the system...",
"Initializing hardware...",
"Checking memory...",
"Checking disks...",
"Mounting file systems...",
"Loading drivers...",
"Starting services...",
"Booting complete."
];
$(".command").hide();
// Boot-up sequence
const bootUpSequence = [
"WINDOSE BIOS @ " + new Date().toLocaleString() + "<br><br><br>Booting up the system...",
"Initializing hardware...",
"Checking memory...",
"Checking disks...",
"Mounting file systems...",
"Loading drivers...",
"Starting services...",
"Booting complete."
];

// Display boot-up sequence
function displayBootUpSequence(index) {
if (index < bootUpSequence.length - 1) {
let outputText = "<div class='output'>" + bootUpSequence[index] + "<span class='loading'>/-</span></div>";
let outputElement = $(outputText).appendTo(".terminal");
animateLoading(outputElement.find(".loading"));
setTimeout(function() {
displayBootUpSequence(index + 1);
}, 2000);
} else {
// Handle click outside of prompt box
$(".terminal").click(function() {
$(".command").focus();
});
$(".command").show();
const script = document.createElement('script');
script.src = './js/script.js';
document.head.appendChild(script);
// Remove boot-up sequence
$(".output").remove();
}
}
// Animate loading element
function animateLoading(element) {
let animationIndex = 0;
let animationFrames = ["/", "-", "\\", "|"];
let intervalId = setInterval(function() {
element.text(animationFrames[animationIndex]);
animationIndex = (animationIndex + 1) % animationFrames.length;
}, 100);
setTimeout(function() {
clearInterval(intervalId);
element.text("OK");
}, 2000);
// Display boot-up sequence
function displayBootUpSequence(index) {
if (index < bootUpSequence.length - 1) {
let outputText = "<div class='output'>" + bootUpSequence[index] + "<span class='loading'>/-</span></div>";
let outputElement = $(outputText).appendTo(".terminal");
animateLoading(outputElement.find(".loading"));
setTimeout(function() {
displayBootUpSequence(index + 1);
}, 2000);
} else {
// Handle click outside of prompt box
$(".terminal").click(function() {
$(".command").focus();
});
$(".command").show();
const script = document.createElement('script');
script.src = './js/script.js';
document.head.appendChild(script);
// Remove boot-up sequence
$(".output").remove();
}
}
// Animate loading element
function animateLoading(element) {
let animationIndex = 0;
let animationFrames = ["/", "-", "\\", "|"];
let intervalId = setInterval(function() {
element.text(animationFrames[animationIndex]);
animationIndex = (animationIndex + 1) % animationFrames.length;
}, 100);
setTimeout(function() {
clearInterval(intervalId);
element.text("OK");
}, 2000);
}

displayBootUpSequence(0);
displayBootUpSequence(0);


// Hide mouse cursor
$(".terminal").css("cursor", "none");
$(".terminal").css("overflow", "hidden");
document.documentElement.style.overflow = "hidden";
document.body.style.overflow = "hidden";
// Hide mouse cursor
$(".terminal").css("cursor", "none");
$(".terminal").css("overflow", "hidden");
document.documentElement.style.overflow = "hidden";
document.body.style.overflow = "hidden";


});

0 comments on commit 4047dd4

Please sign in to comment.