Skip to content

Commit

Permalink
Merge pull request #1089 from samarsajad/loader
Browse files Browse the repository at this point in the history
Added the preloader
  • Loading branch information
sunny0625 authored Jun 21, 2024
2 parents 670ecba + a21a213 commit 06fbca9
Show file tree
Hide file tree
Showing 3 changed files with 341 additions and 1 deletion.
85 changes: 84 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,91 @@
<link rel="stylesheet" href="Css-files/navbar.css">
<link rel="stylesheet" href="Css-files/footer.css">
<link rel="stylesheet" href="./style.css">


<style>
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

#icon{
width: 30px;
margin-top: 5px;
cursor: pointer;
}

<link rel="stylesheet" href="./login1.css">
<style>
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
body{
overflow-x: hidden;
}
</style>

<script src="hamburger.js" defer></script>


<link rel="stylesheet" href="https://unpkg.com/aos@next/dist/aos.css" />
<link rel="stylesheet" href="preloader.css" />
</head>


<body>
<div id="loader-wrapper">
<!--<div id="loader-wrapper">
<div id="loader"></div>
<div class="loader-section section-left"></div>
<div class="loader-section section-right"></div>
</div>-->

<!-- <div id="icons-container">
<svg class="food-icon" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
<circle cx="50" cy="50" r="40" stroke="red" stroke-width="5" fill="none" />
<rect x="45" y="10" width="10" height="20" fill="brown" />
</svg>
<svg class="food-icon" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
<path d="M10,50 Q25,25 50,50 Q75,75 90,50" fill="yellow" stroke="black" stroke-width="5" />
</svg>
<svg class="food-icon" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
<circle cx="30" cy="70" r="15" stroke="red" stroke-width="5" fill="none" />
<circle cx="70" cy="70" r="15" stroke="red" stroke-width="5" fill="none" />
<line x1="30" y1="70" x2="50" y2="40" stroke="brown" stroke-width="5" />
<line x1="70" y1="70" x2="50" y2="40" stroke="brown" stroke-width="5" />
</svg>
<svg id="food-icon" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
<!-- <circle cx="50" cy="50" r="40" fill="orange" /> -->
<!-- Add more SVG elements here to create a food icon -->
<!--</svg>-->
<!--Preloader Start-->

<div id="preloader">
<h1>Loading...</h1>
<div class="bubble"></div>
<div class="bubble"></div>
<div class="bubble"></div>
<div class="bubble"></div>
<div class="bubble"></div>
<div id="area">
<div id="sides">
<div id="pan"></div>
<div id="handle"></div>
</div>
<div id="pancake">
<div id="pastry"></div>
</div>
</div>
</div>


<nav>
<div class="navigbar">
<div class="logo">
<a href="index.html"><img src="Images/Foodielogo.png" height="40" class="transparent-image"></a>
</div>
<button class="navbar-toggler" id="menu-toggle" aria-label="Toggle navigation">
<span class="bar"></span>
<span class="bar"></span>
<span class="bar"></span>

</div>
<nav class="navbar navbar-expand-lg bg-black fixed-top" data-bs-theme="dark">
<div class="container-fluid">
Expand All @@ -48,6 +125,7 @@
<button class="navbar-toggler order-1" type="button" data-bs-toggle="collapse" data-bs-target=".hamburgeritems"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>

</button>
<div class="collapse navbar-collapse hamburgeritems centerdiv order-2 order-lg-0">
<ul class="navbar-nav center-links">
Expand Down Expand Up @@ -626,9 +704,14 @@ <h4>Follow Us</h4>

<script src="https://unpkg.com/aos@next/dist/aos.js"></script>
<script src="Html-files/top.js"></script>

<script src="preloader.js"></script>


<script src="script.js"></script>
<script src="Html-files/themechange.js"></script>
<script src="https://cdn.botpress.cloud/webchat/v1/inject.js"></script>

<script>
AOS.init(
{
Expand Down
248 changes: 248 additions & 0 deletions preloader.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,248 @@
@import url("https://fonts.googleapis.com/css?family=Amatic+SC");
body {

height: 100vh;
width: 100vw;
overflow: hidden;
}

h1 {
position: relative;
margin-bottom:50%;
top: 25vh;
width: 100vw;
text-align: center;
font-family: "Amatic SC";
font-size: 6vh;
color: #333;
opacity: 0.75;
animation: pulse 2.5s linear infinite;
}


#preloader {
width: 100%;
height: 100vh;
position: fixed;
top: 0;
left: 0;
background-color: #ffde6b;
z-index: 2000;
margin-bottom: 50%;
}



#preloader .bubble {
position: absolute;
border-radius: 100%;
box-shadow: 0 0 0.25vh #4d4d4d;
opacity: 0;



}
#preloader .bubble:nth-child(1) {
margin-top: 2.5vh;
left: 58%;
width: 3.5vh;
height: 3.5vh;
background-color: #175486;
animation: bubble 2s cubic-bezier(0.53, 0.16, 0.39, 0.96) infinite;
}
#preloader .bubble:nth-child(2) {
margin-top: 3vh;
left: 52%;
width: 3vh;
height: 3vh;
background-color: #46c0ed;
animation: bubble 2s ease-in-out 0.35s infinite;
}
#preloader .bubble:nth-child(3) {
margin-top: 1.8vh;
left: 50%;
width: 2.5vh;
height: 2.5vh;
background-color: #365cf3;
animation: bubble 1.5s cubic-bezier(0.53, 0.16, 0.39, 0.96) 0.55s infinite;
}
#preloader .bubble:nth-child(4) {
margin-top: 2.7vh;
left: 56%;
width: 2.2vh;
height: 2.2vh;
background-color: #029ef9;
animation: bubble 1.8s cubic-bezier(0.53, 0.16, 0.39, 0.96) 0.9s infinite;
}
#preloader .bubble:nth-child(5) {

left: 54%;
width: 2.1vh;
height: 2.1vh;
background-color: #0b1a7b;
animation: bubble 1.6s ease-in-out 1s infinite;
}
#preloader #area {
position: absolute;
bottom: 0;
right: 0;
width: 25%;
height: 25%;
background-color: transparent;
transform-origin: 15% 60%;
animation: flip 2.1s ease-in-out infinite;
margin-bottom: 10%;
margin-right: 30%;
}
#preloader #area #sides {
position: absolute;
width: 100%;
height: 100%;
transform-origin: 15% 60%;
animation: switchSide 2.1s ease-in-out infinite;
}
#preloader #area #sides #handle {
position: absolute;
bottom: 18%;
right: 80%;
width: 35%;
height: 20%;
background-color: transparent;
border-top: 1vh solid #333;
border-left: 1vh solid transparent;
border-radius: 100%;
transform: rotate(20deg) rotateX(0deg) scale(1.3, 0.9);
}
#preloader #area #sides #pan {
position: absolute;
bottom: 20%;
right: 30%;
width: 50%;
height: 8%;
background-color: #333;
border-radius: 0 0 1.4em 1.4em;
transform-origin: -15% 0;
}
#preloader #area #pancake {
position: absolute;
top: 24%;
width: 100%;
height: 100%;
transform: rotateX(85deg);
animation: jump 2.1s ease-in-out infinite;
}
#preloader #area #pancake #pastry {
position: absolute;
bottom: 26%;
right: 37%;
width: 40%;
height: 45%;
background-color: #907048;
box-shadow: 0 0 3px 0 #333;
border-radius: 100%;
transform-origin: -20% 0;
animation: fly 2.1s ease-in-out infinite;
}

@keyframes jump {
0% {
top: 24%;
transform: rotateX(85deg);
}
25% {
top: 10%;
transform: rotateX(0deg);
}
50% {
top: 30%;
transform: rotateX(85deg);
}
75% {
transform: rotateX(0deg);
}
100% {
transform: rotateX(85deg);
}
}
@keyframes flip {
0% {
transform: rotate(0deg);
}
5% {
transform: rotate(-27deg);
}
30%, 50% {
transform: rotate(0deg);
}
55% {
transform: rotate(27deg);
}
83.3% {
transform: rotate(0deg);
}
100% {
transform: rotate(0deg);
}
}
@keyframes switchSide {
0% {
transform: rotateY(0deg);
}
50% {
transform: rotateY(180deg);
}
100% {
transform: rotateY(0deg);
}
}
@keyframes fly {
0% {
bottom: 26%;
transform: rotate(0deg);
}
10% {
bottom: 40%;
}
50% {
bottom: 26%;
transform: rotate(-190deg);
}
80% {
bottom: 40%;
}
100% {
bottom: 26%;
transform: rotate(0deg);
}
}

@keyframes bubble {
0% {
transform: scale(0.15, 0.15);
top: 80%;
opacity: 0;
}
50% {
transform: scale(1.1, 1.1);
opacity: 1;
}
100% {
transform: scale(0.33, 0.33);
top: 60%;
opacity: 0;
}
}
@keyframes pulse {
0% {
transform: scale(1, 1);
opacity: 0.25;
}
50% {
transform: scale(1.2, 1);
opacity: 1;
}
100% {
transform: scale(1, 1);
opacity: 0.25;
}
}
9 changes: 9 additions & 0 deletions preloader.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Function to remove preloader
function hidePreloader() {
var preloader = document.getElementById('preloader');
preloader.style.display = 'none';
document.body.style.overflow = 'visible';
}


setTimeout(hidePreloader, 3000);

0 comments on commit 06fbca9

Please sign in to comment.