-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
151 lines (140 loc) · 5.06 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<!DOCTYPE html>
<html lang="en">
<head>
<title>Hello world!</title>
<style type="text/css">
main {
margin: 8px;
}
[draggable="true"] {
width: fit-content;
color: black;
/* background-color: rgb(0, 0, 0, 50%); */
background-color: yellow;
border-radius: 10px;
padding: 10px;
position: absolute;
}
body {
/* background: url("https://ttma1046.github.io/gallery/vscode.jpg"); */
background: url("./img0.jpg") no-repeat black;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
bottom: 0;
margin: 0;
overflow: hidden;
}
#taskbar {
width: 100%;
height: 50px;
display: block;
background-color: rgb(37 37 37);
position: absolute;
bottom: 0;
}
#taskbar > button {
display: block;
width: 50px;
height: 50px;
background-color: rgb(37 37 37);
border: none;
float: left;
}
#taskbar > button:hover {
background-color: rgb(57 57 57);
}
#taskbar > button.start-button > img {
filter: grayscale(1) brightness(2);
}
#taskbar > button > img {
width: -webkit-fill-available;
margin: 8px;
}
</style>
<script>
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/drag_event
document.addEventListener("DOMContentLoaded", (event) => {
const dragElements = document.querySelectorAll("[draggable]");
let offsetX = 0;
let offsetY = 0;
dragElements.forEach(dragElement => {
dragElement.addEventListener("dragstart", (event) => {
offsetX = event.clientX - event.target.getBoundingClientRect().left;
offsetY = event.clientY - event.target.getBoundingClientRect().top;
event.dataTransfer.effectAllowed = "move";
event.target.style.cursor = "grabbing";
console.log("Drag started.");
});
dragElement.addEventListener("dragover", (event) => {
event.preventDefault();
event.target.style.cursor = "grabbing";
event.dataTransfer.dropEffect = "move";
console.log("Dragging.");
console.log(`X: ${event.clientX}, Y: ${event.clientY}`);
});
dragElement.addEventListener("dragend", (event) => {
event.target.style.left = `${event.clientX - offsetX}px`;
event.target.style.top = `${event.clientY - offsetY}px`;
event.target.style.cursor = "grab";
console.log("Drag ended.");
});
});
});
</script>
<script>
let previousContent = '';
function fetchPage() {
fetch(window.location.href, { cache: "no-store" })
.then(response => response.text())
.then(content => {
if (previousContent && previousContent !== content) {
console.log('Content changed, reloading page...');
location.reload();
}
previousContent = content;
})
.catch(error => console.error('Error fetching page:', error));
}
setInterval(fetchPage, 500);
fetchPage();
</script>
</head>
<body>
<main>
<div draggable="true" style="cursor: grab; background: linear-gradient(135deg,#c8102e 16.66%,#fd8c00 33.32%,#ffe500 49.98%,#119f0b 66.64%,#0644b3 83.3%,#c22edc);">
<nav>Hello world!</nav>
<p>Hello world...</p>
<h2>Hello world:</h2>
<ul>
<li>Hello world!</li>
<li>Hello world!</li>
<li>Hello world!</li>
<li>Hello world!</li>
</ul>
</div>
<div draggable="true" style="cursor: grab;">
<nav>Hello world!</nav>
<p>Hello world...</p>
<h2>Hello world:</h2>
<ul>
<li>Hello world!</li>
<li>Hello world!</li>
<li>Hello world!</li>
<li>Hello world!</li>
</ul>
</div>
<!-- <img src="https://ttma1046.github.io/gallery/vscode.jpg" alt="Hello world!" width="1000px"> -->
</main>
<nav id="taskbar">
<button class="start-button" title="Start"><img src="./Windows_logo.svg"></button>
<button title="Windows Explorer"><img src="./Windows_Explorer.svg"></button>
<button title="Windows Explorer"><img src="./Windows_Explorer.svg"></button>
<button title="Windows Explorer"><img src="./Windows_Explorer.svg"></button>
<button title="Windows Explorer"><img src="./Windows_Explorer.svg"></button>
<button style="float: right; width: 5px; border-left: white 1px; padding: 0; border-left: solid gray 1px;"></button>
<button title="Notifications" style="float: right;"><img style="filter: invert(1) brightness(2);" src="./Windows_notifications.svg"></button>
</nav>
</body>
</html>