xxxxxxxxxx
1
<div class="stars"></div>
2
<div class="ocean">
3
<div class="wave"></div>
4
<div class="wave"></div>
5
<div class="wave"></div>
6
</div>
xxxxxxxxxx
1
html, body { height: 100%; }
2
body {
3
background:radial-gradient(ellipse at center, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 35%, #000 100%);
4
overflow: hidden;
5
}
6
7
.ocean {
8
height: 5%;
9
width:100%;
10
position:absolute;
11
bottom:0;
12
left:0;
13
background: #30cfd0;
14
}
15
16
.wave {
17
background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/85486/wave.svg) repeat-x;
18
position: absolute;
19
top: -198px;
20
width: 6400px;
21
height: 198px;
22
animation: wave 8s cubic-bezier( 0.36, 0.45, 0.63, 0.53) infinite;
23
transform: translate3d(0, 0, 0);
24
}
25
26
.wave:nth-of-type(2) {
27
top: -175px;
28
animation: wave 7s cubic-bezier( 0.36, 0.45, 0.63, 0.53) -.125s infinite, swell 7s ease -1.25s infinite;
29
opacity: 1;
30
}
31
.wave:nth-of-type(3) {
32
top: -225px;
33
animation: wave 6s cubic-bezier( 0.36, 0.45, 0.63, 0.53) -.125s infinite, swell 7s ease -1.25s infinite;
34
opacity: 1;
35
}
36
37
@keyframes wave {
38
0% {
39
margin-left: 0;
40
}
41
100% {
42
margin-left: -1600px;
43
}
44
}
45
46
@keyframes swell {
47
0%, 100% {
48
transform: translate3d(0,-25px,0);
49
}
50
50% {
51
transform: translate3d(0,5px,0);
52
}
53
}
54
.stars {
55
position:absolute;
56
top:0;
57
left:0;
58
right:0;
59
bottom:0;
60
width:100%;
61
height:100%;
62
display:block;
63
}
64
65
.stars {
66
background:#000 url(http://www.script-tutorials.com/demos/360/images/stars.png) repeat top center;
67
z-index:0;
68
}
69
70
1
1
Console errors: 0