#MonthOfCode - Day 21: wave

My entry for the 21st day of the month of code. The theme for today is: wave.

Code after the break.

1
2
3
4
5
6
7
8
9
10
11
12
<div id="moc-21">
<div></div><div></div><div></div><div></div><div></div>
<div></div><div></div><div></div><div></div><div></div>
<div></div><div></div><div></div><div></div><div></div>
<div></div><div></div><div></div><div></div><div></div>
<div></div><div></div><div></div><div></div><div></div>
<div></div><div></div><div></div><div></div><div></div>
<div></div><div></div><div></div><div></div><div></div>
<div></div><div></div><div></div><div></div><div></div>
<div></div><div></div><div></div><div></div><div></div>
<div></div><div></div><div></div><div></div><div></div>
</div>
wave.cssview raw
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
#moc-21 {
margin: 20px 0;
width: 100%;
height: 160px;
}


#moc-21 > div {
width: 2%;
height: 10px;
background-color: #bada55;
float: left;

-webkit-animation: wave 1s infinite ease-in-out alternate;
}


#moc-21 > div:nth-child(10n) {
-webkit-animation-delay: 0.0s;
}

#moc-21 > div:nth-child(10n+1) {
-webkit-animation-delay: 0.2s;
}

#moc-21 > div:nth-child(10n+2) {
-webkit-animation-delay: 0.4s;
}

#moc-21 > div:nth-child(10n+3) {
-webkit-animation-delay: 0.6s;
}

#moc-21 > div:nth-child(10n+4) {
-webkit-animation-delay: 0.8s;
}

#moc-21 > div:nth-child(10n+5) {
-webkit-animation-delay: 1s;
}

#moc-21 > div:nth-child(10n+6) {
-webkit-animation-delay: 1.2s;
}

#moc-21 > div:nth-child(10n+7) {
-webkit-animation-delay: 1.4s;
}

#moc-21 > div:nth-child(10n+8) {
-webkit-animation-delay: 1.6s;
}

#moc-21 > div:nth-child(10n+9) {
-webkit-animation-delay: 1.8s;
}



@-webkit-keyframes wave {
from {
margin-top: 0;
}

to {
margin-top: 100px;
}

}