-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
83 lines (79 loc) · 2.75 KB
/
index.html
File metadata and controls
83 lines (79 loc) · 2.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>MrServer</title>
<script src="/etc/jquery.min.js"></script>
<script src="/etc/xterm.js"></script>
<script src="/etc/xterm-addon-fit.min.js"></script>
<script src="/etc/sha256.min.js"></script>
<link rel="stylesheet" href="/etc/xterm.css" />
<script>
async function loadScripts(url) {
try {
const response = await fetch("./" + url + "/.json");
const scripts = await response.json();
for (const script of scripts) {
await new Promise((resolve, reject) => {
const scriptElement = document.createElement("script");
scriptElement.src = `/${url}/${script}.js`;
scriptElement.type = script.startsWith("m_")
? "module"
: "text/javascript";
scriptElement.onload = resolve;
scriptElement.onerror = reject;
document.body.appendChild(scriptElement);
});
}
} catch (error) {
console.error("Failed to load apps:", error);
}
}
(async () => {
await loadScripts("apps");
await loadScripts("3rd_party_apps");
})();
(function () {
const savedTheme = localStorage.getItem("theme") || "default";
loadTheme(savedTheme);
function loadTheme(themeName) {
const oldLink = document.getElementById("theme-style");
if (oldLink) oldLink.remove();
const link = document.createElement("link");
link.rel = "stylesheet";
link.href = `/themes/${themeName}.css`;
link.id = "theme-style";
document.head.appendChild(link);
}
window.setTheme = (themeName) => {
localStorage.setItem("theme", themeName);
loadTheme(themeName);
};
window.loadTheme = loadTheme;
})();
</script>
<link rel="stylesheet" href="/global.css" />
</head>
<body>
<div id="desktop">
<div id="notifications-container"></div>
</div>
<div id="taskbar" style="align-items: center">
<div id="start-buttons">
<img id="start-button" height="40" src="/logo.png" />
</div>
</div>
<div onclick="jsexec()" id="clock"></div>
<div id="start-menu">
<div class="start-sidebar">MrServer</div>
<div class="start-items">
<div class="start-item" onclick="shutdown()">⏻</div>
<div class="start-item" onclick="openApp('reboot')">⟳</div>
<div class="start-item" onclick="bye()">🔒</div>
<div class="start-item" onclick="loadapp()">📦</div>
</div>
<div class="start-content"></div>
</div>
<script src="/index.js"></script>
</body>
</html>