-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
63 lines (56 loc) · 1.49 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
<!DOCTYPE html>
<title>Quantitive Query test</title>
<style>
body,
html {
margin: 0;
padding: 0;
}
.panels {
margin: 0;
padding: 0;
}
.panel {
display: inline-block;
height: 120px;
vertical-align: top;
width: 25%;
}
.panel:nth-child(8n) { background: #FF332E; }
.panel:nth-child(8n+1) { background: #FF902E; }
.panel:nth-child(8n+2) { background: #1F95A0; }
.panel:nth-child(8n+3) { background: #25CB30; }
.panel:nth-child(8n+4) { background: #B40500; }
.panel:nth-child(8n+5) { background: #B45500; }
.panel:nth-child(8n+6) { background: #01656E; }
.panel:nth-child(8n+7) { background: #008E09; }
.panel:nth-child(3n),
.panel:nth-child(3n+1):last-child,
.panel:nth-child(6n+1):nth-last-child(4),
.panel:nth-child(6n+1):nth-last-child(4) ~ .panel,
.panel:nth-child(6n+4):nth-last-child(4),
.panel:nth-child(6n+4):nth-last-child(4) ~ .panel {
width: 25%;
}
.panel:nth-child(6n+1),
.panel:nth-child(6n+6),
.panel:nth-child(6n+2):last-child,
.panel:nth-child(6n+4):nth-last-child(2),
.panel:nth-child(6n+4):nth-last-child(2) ~ .panel {
width: 50%;
}
.panel:first-child:last-child { width: 100%; }
</style>
<ul class="panels"><li class="panel"></li></ul>
<script>
var panels = document.querySelector('.panels');
function addPanel() {
var panel = document.createElement('li');
panel.className = 'panel';
panels.appendChild(panel);
}
var panelCreator = setInterval(addPanel, 1000);
setTimeout(function () {
clearInterval(panelCreator);
}, 20000);
</script>