Skip to content

Commit e441b2e

Browse files
authored
add pebbles bounce animation (#2903)
* add pebbles bounce animation * update style.css to styles.css
1 parent b81d937 commit e441b2e

File tree

3 files changed

+104
-0
lines changed

3 files changed

+104
-0
lines changed
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Animation</title>
5+
<link rel="stylesheet" href="styles.css">
6+
</head>
7+
<body class="body">
8+
<div class="anime">
9+
<div class="pebble1"></div>
10+
<div class="pebble2"></div>
11+
<div class="pebble3"></div>
12+
<div class="pebble4"></div>
13+
<div class="pebble5"></div>
14+
</div>
15+
</body>
16+
</html>
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"artName": "pebblesbounce",
3+
"githubHandle": "Nikhila1003"
4+
}
+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
* {
2+
margin: 0;
3+
padding: 0;
4+
box-sizing: border-box;
5+
}
6+
7+
.body {
8+
height: 100vh;
9+
width: 100vw;
10+
background-color:white;
11+
display: flex;
12+
justify-content: center;
13+
align-items: center;
14+
overflow: hidden;
15+
}
16+
17+
.anime {
18+
height: 100vh;
19+
width: 100vw;
20+
display: flex;
21+
position: relative;
22+
background-color: #226666;
23+
justify-content: space-around;
24+
overflow: hidden;
25+
}
26+
27+
.pebble1, .pebble2, .pebble3, .pebble4, .pebble5 {
28+
margin-top: 10px;
29+
background: #B8BBBB;
30+
height: 12px;
31+
width: 12px;
32+
border-radius: 50%;
33+
animation: bounce 3s infinite ease-in-out;
34+
}
35+
36+
.pebble1 {
37+
animation-delay: 0s;
38+
}
39+
40+
.pebble2 {
41+
animation-delay: 0.2s;
42+
}
43+
44+
.pebble3 {
45+
animation-delay: 0.4s;
46+
}
47+
48+
.pebble4 {
49+
animation-delay: 0.6s;
50+
}
51+
52+
.pebble5 {
53+
animation-delay: 0.8s;
54+
}
55+
56+
.anime::after {
57+
content: '';
58+
position: absolute;
59+
bottom: 10vh;
60+
width: 95vw;
61+
height: 5px;
62+
background: #B8BBBB;
63+
}
64+
65+
@keyframes bounce {
66+
0% {
67+
transform: translate(0, 0);
68+
}
69+
20% {
70+
transform: translate(-4vw, 87vh);
71+
}
72+
40% {
73+
transform: translate(-2vw, 35vh);
74+
}
75+
60% {
76+
transform: translate(0vw, 87vh);
77+
}
78+
80% {
79+
transform: translate(2vw, 60vh);
80+
}
81+
100% {
82+
transform: translate(4vw, 87vh);
83+
}
84+
}

0 commit comments

Comments
 (0)