-
Notifications
You must be signed in to change notification settings - Fork 27
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 #43 from mugdhaK21/main
Loading Animation(Pre-loader)
- Loading branch information
Showing
4 changed files
with
116 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,69 @@ | ||
body{ | ||
background-color: black; | ||
} | ||
circle{ | ||
fill:none; | ||
stroke-width: 5; | ||
filter: blur(1px); | ||
transform-origin: 170px 170px; | ||
will-change: transform; | ||
border-radius: 50%; | ||
transform: translate(5px,5px); | ||
stroke-dasharray: 500; | ||
stroke-dashoffset: 500; | ||
stroke-linecap: round; | ||
animation: animate .3s linear infinite; | ||
} | ||
@keyframes animate{ | ||
100%{ | ||
stroke-dashoffset: 500px; | ||
} | ||
50%{ | ||
stroke-dashoffset: 500px; | ||
} | ||
50.1%{ | ||
stroke-dashoffset: 1000px; | ||
} | ||
|
||
} | ||
.loader{ | ||
position: relative; | ||
max-width: 15rem; | ||
width: 100%; | ||
height:auto; | ||
stroke-linecap: round; | ||
} | ||
|
||
.chasing-circle{ | ||
display: flex; | ||
min-height: 98vh; | ||
background-color: black; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
.chasing-circle .numb{ | ||
position: absolute; | ||
top:50%; | ||
left: 50%; | ||
transform: translate(-50%,-50%); | ||
z-index: 10; | ||
font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif; | ||
font-size: 30px; | ||
font-weight: 400; | ||
color: red; | ||
|
||
} | ||
circle:nth-of-type(1){stroke-dasharray: 400px; | ||
animation-delay: -.3s;} | ||
circle:nth-of-type(2){stroke-dasharray: 700px;stroke-dashoffset: 200px; | ||
animation-delay: -.1s;} | ||
circle:nth-of-type(3){stroke-dasharray: 400px; | ||
animation-delay: -.3s;} | ||
circle:nth-of-type(4){stroke-dasharray:700px;stroke-dashoffset: 200px; | ||
animation-delay: -.1s;} | ||
circle:nth-of-type(5){stroke-dasharray: 400px; | ||
animation-delay: -.3s;} | ||
circle:nth-of-type(6){stroke-dasharray:700px;stroke-dashoffset: 200px; | ||
animation-delay: -.1s;} | ||
|
||
|
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,26 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Document</title> | ||
<link rel="stylesheet" href="LoadingAnimation.css"> | ||
</head> | ||
<body> | ||
|
||
<div class="chasing-circle"> | ||
<div class="numb"><b>100</b></div> | ||
<svg class="loader" xmlns="www.w3.org/2000/svg" viewBox="0 0 340 340"> | ||
<circle cx="170" cy="170" r="140" stroke="red"/> | ||
<circle cx="170" cy="170" r="139" stroke="purple"/> | ||
<circle cx="170" cy="170" r="120" stroke="red"/> | ||
<circle cx="170" cy="170" r="119" stroke="purple"/> | ||
<circle cx="170" cy="170" r="100" stroke="red"/> | ||
<circle cx="170" cy="170" r="99" stroke="purple"/> | ||
|
||
</svg> | ||
</div> | ||
<script src="LoadingAnimation.js"></script> | ||
</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,10 @@ | ||
const numb = document.querySelector(".numb"); | ||
let counter = 0; | ||
setInterval(()=>{ | ||
if(counter == 100){ | ||
clearInterval(); | ||
}else{ | ||
counter+=1; | ||
numb.textContent = counter; | ||
} | ||
}, 80); |
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