From 3250161b729cd7e03719026ab7c334160233de0e Mon Sep 17 00:00:00 2001 From: usernames122 Date: Mon, 11 Aug 2025 04:09:20 +0200 Subject: [PATCH] feat: add some hidden apps, logging and settings menu --- alwaysLoaded.js | 43 ++++++++++++ script.js | 1 + shell.js | 183 ++++++++++++++++++++++++++++++++++++++++++++++-- style.css | 4 ++ 4 files changed, 226 insertions(+), 5 deletions(-) diff --git a/alwaysLoaded.js b/alwaysLoaded.js index ab172a1..2e77f57 100644 --- a/alwaysLoaded.js +++ b/alwaysLoaded.js @@ -1,3 +1,46 @@ +// This file is used for global shit thats useful for os-gui + function setDisplayURL(newURL) { window.history.pushState(null, '', newURL); } + +var yourFuckingSavefile = { + debugMode: false +}; + +var globalSaveid = 5; + +function save(saveid) { + console.log("Saving..."); + const savefile = saveid || 1; + window.localStorage.setItem("__LAMINAXOS:SAVEFILE_".concat(savefile.toString()), + JSON.stringify(yourFuckingSavefile)); + console.log("Saved to SAVE#".concat(savefile.toString())); +} + +function load(saveid) { + console.log("Loaded..."); + const savefile = saveid || 1; + const eee = window.localStorage.getItem("__LAMINAXOS:SAVEFILE_".concat(savefile.toString())); + if (eee === "undefined") { + throw new Error(`Key "${key}" not found in localStorage.`); + } + yourFuckingSavefile = JSON.parse( +eee + ) + console.log("Loaded from SAVE#".concat(savefile.toString())); +} + +// Add stuff that would make David cry + +for (let i = 0; i < 10; i++) { + console.log("%c" + "Hold Up!", "color: #7289DA; -webkit-text-stroke: 2px black; font-size: 72px; font-weight: bold;"); + console.warn("IF YOU USE THIS CONSOLE YOUR SAVE IS NOT CANON!!"); + console.log("... Also dont edit your savefile like an idiot. Btw its at the var yourFuckingSavefile"); +} +try { + load(globalSaveid); +} catch (eee) { + console.log(eee); + save(globalSaveid); +} \ No newline at end of file diff --git a/script.js b/script.js index 40d143f..a7fe819 100644 --- a/script.js +++ b/script.js @@ -86,6 +86,7 @@ function createWindow(url, settings) { const windowDiv = document.createElement('div'); windowDiv.classList.add('window'); + if (headerless) windowDiv.classList.add('window-noborder'); if (shouldIndent) windowDiv.style.top = '50px'; if (shouldIndent) windowDiv.style.left = '50px'; windowDiv.style.zIndex = zIndexCounter++; diff --git a/shell.js b/shell.js index 872cdda..e799c4b 100644 --- a/shell.js +++ b/shell.js @@ -3,6 +3,43 @@ var embeddedApps = { notepad: "data:text/html;charset=utf-8;base64,PGh0bWw+PGhlYWQ+PHRpdGxlPm5vdGVwYWQ8L3RpdGxlPjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Ym9keXttYXJnaW46MH10ZXh0YXJlYXtyZXNpemU6bm9uZTt3aWR0aDo5OCU7aGVpZ2h0Ojk4JTtwb3NpdGlvbjphYnNvbHV0ZTt0b3A6MDtib3JkZXI6bm9uZTttYXJnaW46MSU7Zm9udC1mYW1pbHk6bW9ub3NwYWNlO2ZvbnQtc2l6ZToxZW07b3ZlcmZsb3c6aGlkZGVufXRleHRhcmVhOmZvY3Vze291dGxpbmU6MH08L3N0eWxlPjwvaGVhZD48Ym9keT48dGV4dGFyZWE+PC90ZXh0YXJlYT48L2JvZHk+PC9odG1sPg==" } +function download(filename, text) { + var element = document.createElement('a'); + element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text)); + element.setAttribute('download', filename); + + element.style.display = 'none'; + document.body.appendChild(element); + + element.click(); + + document.body.removeChild(element); +} +function openJsonFilePrompt(callback) { + const input = document.createElement('input'); + input.type = 'file'; + input.accept = '.json,application/json'; + + input.onchange = (event) => { + const file = event.target.files[0]; + if (!file) return; + + const reader = new FileReader(); + reader.onload = () => { + try { + const json = JSON.parse(reader.result); + callback(null, json); + } catch (err) { + callback(err); + } + }; + reader.readAsText(file); + }; + + input.click(); +} + + var shell = { taskbar_wind: null, taskbar_size: 25, @@ -22,13 +59,15 @@ function doTheBullshitByShellBruh() { ) } -shell.launch = function(app) { - if (app === "Notepad") { +shell.launch = function (app) { + switch (app) { + case "Notepad": createWindow(embeddedApps.notepad, { resizable: true, name: "Notepad" }); // Launch notepad - } else if (app === "Calculator") { + break; + case "Calculator": const calc = createWindow(embeddedApps.calc, { resizable: true, name: "Calculator" @@ -36,6 +75,125 @@ shell.launch = function(app) { calc.minSizeX = 500; calc.minSizeY = 444; updateWindowMin(calc.windID); + break; + case "laminax": + createWindow("https://www.youtube.com/embed/6uN3dxJRnss", { name: "You found the easter egg!" }); + break; + case "lamver": { + const wind = createWindow("about:blank", { + name: "About LaminaxOS" + }); + const smDoc = wind.iframe.contentDocument || wind.iframe.contentWindow.document; + smDoc.open(); + smDoc.write(` + + + + + + +

LaminaxOS 8 Enterprise

+
+

LaminaxOS

+

Version 7.6 (Build 17503: Service Pack 2)

+

"Copyright" 2040 LAMINAX Corporation; Some Rights Reserved

+ + + `); + smDoc.close(); + break; + } + case "Settings": + { + const wind = createWindow("about:blank", { + name: "LaminaxOS Settings" + }); + const smDoc = wind.iframe.contentDocument || wind.iframe.contentWindow.document; + smDoc.open(); + smDoc.write(` + + + + + + +

Adjust your computer's settings

+