-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·89 lines (88 loc) · 5.11 KB
/
index.html
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
84
85
86
87
88
89
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<title id="taitl">Harmless Games</title>
<link rel="stylesheet" href="style.css" />
<script src="res/settings.js"></script>
</head>
<body>
YOU SHOULD NOT BE SEEING THIS AT ALL
<div style="display: table; width: 100%; height: 100%; position: fixed; top: 0; left: 0;">
<div class="top-bar" style="display: table-row; height: 0px;">
<div style="display: table-cell; width: 100%; height: 0px;" class="top-bar" id="topbartext"><span id="time"></span></div></div>
<div class="body" style="display: table-row; height: 100%;"><div style="display: table-cell; height: 100%; width: 100%; position: relative;">
<div style="position: absolute; top: 0; left: 0; z-index: 1; width: 100%; height: 100%;" id="desktop-background"></div>
<div style="position: absolute; top: 0; left: 0; z-index: 1; width: 100%; height: 100%;" id="windows"><iframe style="border: none; width: 100%; height: 100%; background-color: transparent; z-index: 2;" src="windows.html" id="windowFrame"></iframe></div>
</div></div>
<div style="display: table-row; width: 100%; height: 0px;" class="application-row">
<div style="display: table-cell;" class="application-row">
<button style="background-color: transparent; padding: 0; border: none; vertical-align: middle;" onclick="document.getElementById('app-list').style.display = 'block'; document.getElementById('app-list').focus();"><img height="34.3333" src="img/appicon.svg" alt="Open new application" style="display: block;" /></button>
<span id="applications">No windows open.</span>
</div>
</div>
</div>
<div id="app-list" class="center">
<h2>Application List</h2>
<div id="application-list">
</div>
</div>
<div id="restart">
<h2>Restart</h2>
<p>Are you sure you want to restart the application?</p>
<button onclick="location.reload();">Yes</button>
<button onclick="document.getElementById('restart').style.display = 'none';">No</button>
</div>
<div id="shutdown">
<h2>Shut down</h2>
<p>Are you sure you want to close the application?</p>
<button onclick="window.close()">Yes</button>
<button onclick="document.getElementById('shutdown').style.display = 'none';">No</button>
</div>
<script src="res/time.js"></script>
<script src="res/loadsettings.js"></script>
<script>
document.getElementById('windowFrame').onload = function() { if (localStorage.getItem('firstrun')) return; document.getElementById('windowFrame').contentWindow.postMessage({"type": 'newApp', "title": 'Welcome!', "url":'apps/welcome/index.html', 'height': '450px', 'width': '700px'}, '*'); localStorage.setItem('firstrun', 'true'); }
window.onmessage = function(ev) {
switch (ev.data.type) {
case 'restart':
document.getElementById('restart').style.display = 'block';
document.getElementById('restart').focus();
break;
case 'shutdown':
document.getElementById('shutdown').style.display = 'block';
document.getElementById('shutdown').focus();
break;
case 'windowsChanged':
document.getElementById('applications').innerHTML = '';
if (!ev.data['windows'].length) document.getElementById('applications').textContent = 'No windows open.';
for (var i = 0; i < ev.data['windows'].length; i++) {
var windowButton = document.createElement('button');
windowButton.classList.add('window-button');
if (ev.data['windows'][i].focused) windowButton.classList.add('active-window-button');
windowButton.setAttribute('data-window-id', ev.data['windows'][i].id);
windowButton.addEventListener('click', function() {
document.getElementById('windowFrame').contentWindow.postMessage({"type": "unminimizeWindowById", "id": this.getAttribute('data-window-id')});
document.getElementById('windowFrame').contentWindow.postMessage({"type": "focusWindowById", "id": this.getAttribute('data-window-id')});
});
windowButton.textContent = ev.data['windows'][i].title;
document.getElementById('applications').appendChild(windowButton);
document.getElementById('applications').appendChild(document.createTextNode(' '));
}
}
}
window.onresize = function(ev) {
clearTimeout(globalThis.rst);
document.getElementById('resolution-width').textContent = window.innerWidth;
document.getElementById('resolution-height').textContent = window.innerHeight;
document.getElementById('resolution-changed').style.display = 'block';
globalThis.rst = setTimeout(function() { document.getElementById('resolution-changed').style.display = 'none'; }, getSetting('resolution-change-hide-timeout') * 1000);
}
</script>
<script src="preload.js"></script>
<div class="resolution-changed" id="resolution-changed">
<span id="resolution-width">888</span>×<span id="resolution-height">888</span>
</div>
</body>
</html>