Skip to content

Commit

Permalink
Merge pull request #277 from solanki505/main
Browse files Browse the repository at this point in the history
pre loader
  • Loading branch information
vimistify authored Oct 6, 2024
2 parents 4942002 + 5c2de78 commit 0f523e4
Show file tree
Hide file tree
Showing 3 changed files with 142 additions and 2 deletions.
13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,22 @@
color: red; /* Change the color of letters in this class to red */
}
</style>
<link rel="icon" href="./ambulance.png" type="image/png">
<!--<a href="https://www.flaticon.com/free-icons/ambulance" title="ambulance icons">Ambulance icons created by Freepik - Flaticon</a>-->
</head>

<body>
<div id="loader-wrapper">
<div id="loader"></div>
<div class="loader-section section-left"></div>
<div class="loader-section section-right"></div>
</div>
<script>document.addEventListener("DOMContentLoaded", function () {
setTimeout(function () {
document.querySelector("body").classList.add("loaded");
}, 500)
});</script>

<header>
<div class="container">
<div class="logo">
Expand Down
4 changes: 3 additions & 1 deletion script.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ accordions.forEach((accordion, index) => {
}
});
});
});
});


127 changes: 126 additions & 1 deletion src/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,129 @@ header {
font-size: 1.2rem;
color: #1d4ed8;
margin-top: 20px;
}
}
#loader-wrapper {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1001;
}

#loader-wrapper .loader-section {
position: fixed;
top: 0;
width: 51%;
height: 100%;
background:#EEEEEE;
z-index: 1000;
-webkit-transform: translateX(0);
transform: translateX(0);
}

#loader-wrapper .loader-section.section-left {
left: 0;
}

#loader-wrapper .loader-section.section-right {
right: 0;
}

#loader {
display: block;
position: relative;
left: 50%;
top: 50%;
width: 150px;
height: 150px;
margin: -75px 0 0 -75px;
border-radius: 50%;
border: 3px solid transparent;
border-top-color:#DC5F00;
-webkit-animation: spin 2s linear infinite;
animation: spin 2s linear infinite;
z-index: 99999;
}

#loader:before {
content: "";
position: absolute;
top: 5px;
left: 5px;
right: 5px;
bottom: 5px;
border-radius: 50%;
border: 3px solid transparent;
border-top-color:#373A40;
-webkit-animation: spin 3s linear infinite;
animation: spin 3s linear infinite;
}

#loader:after {
content: "";
position: absolute;
top: 15px;
left: 15px;
right: 15px;
bottom: 15px;
border-radius: 50%;
border: 3px solid transparent;
border-top-color: #686D76;
-webkit-animation: spin 1.5s linear infinite;
animation: spin 1.5s linear infinite;
}

.loaded #loader-wrapper {
visibility: hidden;
-webkit-transform: translateY(-100%);
transform: translateY(-100%);
-webkit-transition: all 0.3s 1s ease-out;
transition: all 0.3s 1s ease-out;
}

.loaded #loader-wrapper .loader-section.section-left {
-webkit-transform: translateX(-100%);
transform: translateX(-100%);
-webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.loaded #loader-wrapper .loader-section.section-right {
-webkit-transform: translateX(100%);
transform: translateX(100%);
-webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.loaded #loader {
opacity: 0;
-webkit-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
}

@-webkit-keyframes spin {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}

100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}

@keyframes spin {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}

100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}

/* Preloader Css Ends */

0 comments on commit 0f523e4

Please sign in to comment.