Skip to content

Commit 296d28a

Browse files
animation added (#3222)
Co-authored-by: Laureline Paris <laurelinedev@gmail.com>
1 parent 5f273a1 commit 296d28a

3 files changed

Lines changed: 54 additions & 0 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Bouncing Ball Animation</title>
7+
<link rel="stylesheet" href="styles.css" />
8+
</head>
9+
<body>
10+
<div class="container">
11+
<div class="ball"></div>
12+
</div>
13+
</body>
14+
</html>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"githubHandle": "agrawalshreyansh",
3+
"artName": "bouncing_ball"
4+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
body {
2+
background: linear-gradient(to bottom, #87ceeb, #fff);
3+
overflow: hidden;
4+
margin: 0;
5+
height: 100vh;
6+
}
7+
8+
.container {
9+
position: relative;
10+
width: 100%;
11+
height: 100%;
12+
overflow: hidden;
13+
}
14+
15+
.ball {
16+
position: absolute;
17+
bottom: 50px;
18+
left: 50%;
19+
transform: translateX(-50%);
20+
width: 50px;
21+
height: 50px;
22+
background: radial-gradient(circle at 30% 30%, #ff6b6b, #4ecdc4);
23+
border-radius: 50%;
24+
animation: bounce 1.5s infinite ease-in-out;
25+
}
26+
27+
@keyframes bounce {
28+
0%, 100% {
29+
bottom: 50px;
30+
transform: translateX(-50%) scale(1);
31+
}
32+
50% {
33+
bottom: 200px;
34+
transform: translateX(-50%) scale(1.1);
35+
}
36+
}

0 commit comments

Comments
 (0)