-
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 #2876 from shanolhere/shanolhere-loaderAnimation
Loader animation
- Loading branch information
Showing
4 changed files
with
126 additions
and
72 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 |
---|---|---|
@@ -1,117 +1,115 @@ | ||
|
||
body { | ||
margin: 0; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100vh; | ||
background-color: #f0f0f0; | ||
overflow: hidden; | ||
margin: 0; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100vh; | ||
background-color: #f0f0f0; | ||
overflow: hidden; | ||
} | ||
|
||
.dog { | ||
position: relative; | ||
width: 120px; | ||
height: 120px; | ||
position: relative; | ||
width: 120px; | ||
height: 120px; | ||
} | ||
|
||
/* Dog Body */ | ||
.body { | ||
width: 70px; | ||
height: 50px; | ||
background-color: #b5651d; | ||
border-radius: 50%; | ||
position: absolute; | ||
top: 30px; | ||
left: 25px; | ||
width: 70px; | ||
height: 50px; | ||
background-color: #b5651d; | ||
border-radius: 50%; | ||
position: absolute; | ||
top: 30px; | ||
left: 25px; | ||
} | ||
|
||
/* Dog Head */ | ||
.head { | ||
width: 60px; | ||
height: 60px; | ||
background-color: #b5651d; | ||
border-radius: 50%; | ||
position: absolute; | ||
top: 0; | ||
left: 30px; | ||
width: 60px; | ||
height: 60px; | ||
background-color: #b5651d; | ||
border-radius: 50%; | ||
position: absolute; | ||
top: 0; | ||
left: 30px; | ||
} | ||
|
||
/* Dog Ears */ | ||
.ear-left, | ||
.ear-right { | ||
width: 20px; | ||
height: 30px; | ||
background-color: #b5651d; | ||
position: absolute; | ||
top: 0; | ||
border-radius: 50%; | ||
.ear-left, .ear-right { | ||
width: 20px; | ||
height: 30px; | ||
background-color: #b5651d; | ||
position: absolute; | ||
top: 0; | ||
border-radius: 50%; | ||
} | ||
.ear-left { | ||
left: 5px; | ||
transform: rotate(-30deg); | ||
left: 5px; | ||
transform: rotate(-30deg); | ||
} | ||
.ear-right { | ||
right: 5px; | ||
transform: rotate(30deg); | ||
right: 5px; | ||
transform: rotate(30deg); | ||
} | ||
|
||
/* Dog Eyes */ | ||
.eye-left, | ||
.eye-right { | ||
width: 10px; | ||
height: 10px; | ||
background-color: #fff; | ||
border-radius: 50%; | ||
position: absolute; | ||
top: 20px; | ||
.eye-left, .eye-right { | ||
width: 10px; | ||
height: 10px; | ||
background-color: #fff; | ||
border-radius: 50%; | ||
position: absolute; | ||
top: 20px; | ||
} | ||
.eye-left { | ||
left: 15px; | ||
left: 15px; | ||
} | ||
.eye-right { | ||
right: 15px; | ||
right: 15px; | ||
} | ||
|
||
/* Dog Nose */ | ||
.nose { | ||
width: 12px; | ||
height: 12px; | ||
background-color: #333; | ||
border-radius: 50%; | ||
position: absolute; | ||
top: 35px; | ||
left: 50%; | ||
transform: translateX(-50%); | ||
width: 12px; | ||
height: 12px; | ||
background-color: #333; | ||
border-radius: 50%; | ||
position: absolute; | ||
top: 35px; | ||
left: 50%; | ||
transform: translateX(-50%); | ||
} | ||
|
||
|
||
/* Dog Legs */ | ||
.leg-left, | ||
.leg-right { | ||
width: 10px; | ||
height: 30px; | ||
background-color: #b5651d; | ||
position: absolute; | ||
top: 70px; | ||
border-radius: 5px; | ||
.leg-left, .leg-right { | ||
width: 10px; | ||
height: 30px; | ||
background-color: #b5651d; | ||
position: absolute; | ||
top: 70px; | ||
border-radius: 5px; | ||
} | ||
.leg-left { | ||
left: 10px; | ||
left: 10px; | ||
} | ||
.leg-right { | ||
right: 10px; | ||
right: 10px; | ||
} | ||
|
||
/* Animation for walking */ | ||
@keyframes walk { | ||
0%, | ||
100% { | ||
transform: translateX(0); | ||
} | ||
50% { | ||
transform: translateX(300px); | ||
} | ||
0%, 100% { | ||
transform: translateX(0); | ||
} | ||
50% { | ||
transform: translateX(300px); | ||
} | ||
} | ||
|
||
.dog { | ||
animation: walk 4s ease-in-out infinite; | ||
animation: walk 4s ease-in-out infinite; | ||
} |
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,16 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Loader Animation</title> | ||
<link rel="stylesheet" href="styles.css"> | ||
</head> | ||
<body> | ||
<div class="loader"> | ||
<div class="dot"></div> | ||
<div class="dot"></div> | ||
<div class="dot"></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": "Loader Animation", | ||
"githubHandle": "shanolhere" | ||
} |
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,36 @@ | ||
body { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100vh; | ||
background-color: #f0f0f0; | ||
margin: 0; | ||
} | ||
|
||
.loader { | ||
display: flex; | ||
align-items: flex-end; | ||
} | ||
|
||
.dot { | ||
width: 15px; | ||
height: 15px; | ||
margin: 0 5px; | ||
background-color: #3498db; | ||
border-radius: 50%; | ||
animation: bounce 0.6s infinite alternate; | ||
} | ||
|
||
.dot:nth-child(2) { | ||
animation-delay: 0.2s; | ||
} | ||
|
||
.dot:nth-child(3) { | ||
animation-delay: 0.4s; | ||
} | ||
|
||
@keyframes bounce { | ||
to { | ||
transform: translateY(-20px); | ||
} | ||
} |