Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Art/Parth-co79-the-ball/index.html
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>Simple Looping Animation</title>
<!-- Link to the external CSS file -->
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="ball"></div>
<div class="ground"></div>
</body>
</html>
4 changes: 4 additions & 0 deletions Art/Parth-co79-the-ball/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"artName": "bouncing ball",
"githubHandle": "Parth-co79"
}
48 changes: 48 additions & 0 deletions Art/Parth-co79-the-ball/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/* Basic page setup */
body {
margin: 0;
height: 100vh;
background-color: #f0f4f8;
display: flex;
align-items: flex-end;
justify-content: center;
overflow: hidden;
}

/* Ground for reference */
.ground {
position: absolute;
bottom: 0;
width: 100%;
height: 40px;
background: #bbb;
}

/* The ball */
.ball {
width: 60px;
height: 60px;
background-color: #ff6b6b;
border-radius: 50%;
position: relative;
animation: bounce 2s ease-in-out infinite;
}

/* Keyframes for the looping animation */
@keyframes bounce {
0% {
transform: translateY(0) translateX(-200px);
}
25% {
transform: translateY(-200px) translateX(-100px);
}
50% {
transform: translateY(0) translateX(0);
}
75% {
transform: translateY(-200px) translateX(100px);
}
100% {
transform: translateY(0) translateX(200px);
}
}