-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwavy.js
48 lines (35 loc) · 982 Bytes
/
wavy.js
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
var popups = [];
function loop() {
popups.forEach(function (popup, y) {
var i,
s = '#',
l = Math.round(Math.sin(performance.now()/200 + (y/2)) * 5) + 5;
s += String.fromCharCode(0x2588);
for (i = 0; i < l; i ++) {
//s += String.fromCharCode(0x2581);
s += String.fromCharCode(0x2588);
}
//s += 'x';
popup.document.location.hash = s;
});
setTimeout(loop, 1000/20);
}
function closeWindows() {
var popup;
running = false;
while (popups.length) {
popup = popups.shift();
popup.close();
}
}
function setup() {
var closeButton;
closeButton = document.createElement('button');
closeButton.innerHTML = 'close';
closeButton.addEventListener('click', closeWindows);
document.body.appendChild(closeButton);
loop();
/*popups.forEach(function (popup) {
popup.history.replaceState({}, '', '/');
});*/
}