File tree Expand file tree Collapse file tree
Art/shreyanshagrawal-bouncing_ball Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 1+ {
2+ "githubHandle" : " agrawalshreyansh" ,
3+ "artName" : " bouncing_ball"
4+ }
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments