-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
76 lines (65 loc) · 2.65 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
<meta charset="UTF-8">
<button id="wave">load wave</button>
<button id="donky">load donkey kong</button>
<button id="break">load breakout</button>
<button id="webcam">load webcam</button>
<button id="3dcube">load 3d cube</button>
<button id="3dwalk">load 3d walk</button>
<button id="close">close popups</button>
<script>
var popups = [],
popupGap = undefined;
function closeWindows() {
var popup;
running = false;
while (popups.length) {
popup = popups.shift();
popup.close();
}
}
function setupPopups(name, count) {
var i, settings, popup, y,
popupWidth = window.outerWidth,
popupHeight = 50,
x = window.screenX,
yOffset = window.screenY + (window.outerHeight - window.innerHeight);
closeWindows();
for (i = 0; i < count; i ++) {
y = i * (popupGap||50) + yOffset;
settings = 'width='+popupWidth+',height='+popupHeight+',left='+x+',top='+y;
if (i == count-1) {
popup = window.open('popup.html#'+name, 'w'+i, settings);
}
else {
popup = window.open('popup.html', 'w'+i, settings);
}
if (popupGap == undefined) {
setTimeout(function () {
popupGap = popup.outerHeight - popup.innerHeight;
popup.close();
setupPopups.call(null, name, count);
}, 500);
return;
}
else {
popups.push(popup);
}
}
setTimeout(function () {
popups.forEach(function (popup) {
popup.document.title = '-';
});
popups[popups.length-1].popups = popups;
popups[popups.length-1].setup();
}, 1000);
}
window.addEventListener('load', function () {
document.getElementById('wave').addEventListener('click', function () {setupPopups('wavy', 7);});
document.getElementById('donky').addEventListener('click', function () {setupPopups('donkey-kong', 7);});
document.getElementById('break').addEventListener('click', function () {setupPopups('breakout', 7);});
document.getElementById('webcam').addEventListener('click', function () {setupPopups('webcam', 8);});
document.getElementById('3dcube').addEventListener('click', function () {setupPopups('3d-cube', 7);});
document.getElementById('3dwalk').addEventListener('click', function () {setupPopups('3d-walk', 10);});
document.getElementById('close').addEventListener('click', closeWindows);
});
</script>