-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2874 from vedpawar2254/Addmyartwork
BouncingBall
- Loading branch information
Showing
3 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Bouncing Ball Animation</title> | ||
<link rel="stylesheet" href="styles.css"> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<div class="ball"></div> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"artName": "bouncingball", | ||
"githubHandlde":"vedpawar2254" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
* { | ||
margin: 0; | ||
padding: 0; | ||
box-sizing: border-box; | ||
} | ||
|
||
body { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100vh; | ||
background-color: #282c34; | ||
} | ||
|
||
.container { | ||
position: relative; | ||
width: 300px; | ||
height: 500px; | ||
overflow: hidden; | ||
border: 2px solid #61dafb; | ||
} | ||
|
||
.ball { | ||
position: absolute; | ||
bottom: 0; | ||
left: 50%; | ||
width: 50px; | ||
height: 50px; | ||
background-color: #61dafb; | ||
border-radius: 50%; | ||
animation: bounce 1s infinite ease-in-out; | ||
} | ||
|
||
@keyframes bounce { | ||
0%, 100% { | ||
transform: translateY(0); | ||
background-color: #61dafb; /* Initial color */ | ||
} | ||
|
||
50% { | ||
transform: translateY(-200px); | ||
background-color: #ff6f61; /* Change color at the peak */ | ||
} | ||
} |