Skip to content

Commit

Permalink
Merge pull request #43 from mugdhaK21/main
Browse files Browse the repository at this point in the history
Loading Animation(Pre-loader)
  • Loading branch information
palakg01 authored Oct 7, 2021
2 parents 43e315d + c6dd5c6 commit d1c7b79
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 0 deletions.
69 changes: 69 additions & 0 deletions LoadingAnimation/LoadingAnimation.css
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;}


26 changes: 26 additions & 0 deletions LoadingAnimation/LoadingAnimation.html
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>
10 changes: 10 additions & 0 deletions LoadingAnimation/LoadingAnimation.js
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);
11 changes: 11 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,17 @@ <h5 class="card-title text-dark">Testimonials</h5>
</div>
</div>

<!-- Loading Animation(pre-loader) -->

<div class="card" style="width: 18rem;">
<div class="card-body">
<h5 class="card-title text-dark">Loading Animation(pre-loader)</h5>
<p class="card-text">Name: <br />Mugdha Kshirsagar</p>
<a href="/animated-components/LoadingAnimation/LoadingAnimation.html" class="card-link text-warning"><strong>Demo</strong></a>
</div>
</div>


<!-- Add your card above this line -->

</div>
Expand Down

0 comments on commit d1c7b79

Please sign in to comment.