-
Notifications
You must be signed in to change notification settings - Fork 5
/
moveto.html
106 lines (87 loc) · 2.71 KB
/
moveto.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
<html>
<body>
<h1>Click on the page to start this test</h1>
<h2>This page is a YouAreAnIdiot like, for modern Browser</h2>
<button onclick="start()">Clic me for start the test !</button>
<button onclick="Next_test()">Clic me for go to the next test !</button>
<script>
let windows = []; //Liste des hehe
let minX = 0;
let minY = 0;
let maxX = 800;
let maxY = 600;
async function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
function openWin() {
hehe = window.open('', '', 'width=400, height=400');
windows.push(hehe ); // Ajoute la nouvelle fenêtre a la liste
}
function moveWin() {
windows.forEach(win => {
if (win && !win.closed) { // Vérifie si la fenêtre est définie et n'est pas fermée
let randomX = Math.floor(Math.random() * (maxX - minX + 1)) + minX;
let randomY = Math.floor(Math.random() * (maxY - minY + 1)) + minY;
win.moveTo(randomX, randomY);
openWin();
}
});
}
document.body.addEventListener('click', function(event) {
openWin()
});
async function start() {
openWin();
openWin();
while(1) await sleep(100) | moveWin()
}
function Next_test() {
location='https://mehliug-git.github.io/cool-website/js.html';
}
</script>
<style>
body {
background-color: #f2f2f2;
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
}
header {
background-color: #333;
color: #fff;
padding: 20px;
text-align: center;
}
h1 {
font-size: 36px;
margin: 0;
}
main {
margin: 20px;
text-align: center;
}
p {
font-size: 18px;
line-height: 1.5;
margin: 0 0 20px;
}
a {
color: #333;
text-decoration: none;
}
a:hover {
color: #666;
}
button {
background-color: #333;
border: none;
border-radius: 5px;
color: #fff;
cursor: pointer;
font-size: 18px;
padding: 10px 20px;
transition: background-color 0.3s ease;
}
</style>
</body>
</html>