Skip to content

Commit

Permalink
✨[Feature Request]: Addition of Preloader and Custom Cursor.
Browse files Browse the repository at this point in the history
issue #387
  • Loading branch information
Anjaliavv51 committed Jun 1, 2024
1 parent 66ce101 commit a0290ae
Show file tree
Hide file tree
Showing 2 changed files with 134 additions and 16 deletions.
5 changes: 2 additions & 3 deletions chatbox.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
box-sizing: border-box;
font-family: "Poppins", sans-serif;
}
body {

}

.chatbot-toggler {

position: fixed;
Expand Down Expand Up @@ -58,6 +56,7 @@ body.show-chatbot .chatbot-toggler span:last-child {
0 32px 64px -48px rgba(0,0,0,0.5);
transition: all 0.1s ease;
}

body.show-chatbot .chatbot {
opacity: 1;
pointer-events: auto;
Expand Down
145 changes: 132 additions & 13 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,79 @@
}
}

</style>
/*Preloader CSS*/
.pre {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
transition: opacity 2s ease-out, visibility 2s ease-out;
opacity: 1;
visibility: visible;
z-index: 9999;
}

.pre--hidden {
opacity: 0;
visibility: hidden;
}

.loader {
display: block;
position: relative;
width: 150px;
height: 150px;
border-radius: 50%;
border: 3px solid transparent;
border-top-color: #55a5ea;
animation: spin 3s linear infinite;
}

.loader:before {
content: "";
position: absolute;
top: 5px;
left: 5px;
right: 5px;
bottom: 5px;
border-radius: 50%;
border: 3px solid transparent;
border-top-color: #3fbcc0c6;
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: #fff;
animation: spin 1.5s linear infinite;
}

@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}

.loader--hidden{
opacity: 0;
visibility: hidden;
}
</style>

<link rel="stylesheet" href="chatbox.css">
<!-- Google Fonts Link For Icons chatboxx -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@48,400,0,0" />
Expand All @@ -125,6 +197,9 @@
</head>

<body>
<div class="pre">
<div class="loader"></div>
</div>
<!-- ############# Header ############# -->

<header class="header_container">
Expand All @@ -148,19 +223,27 @@
</nav>
</div>
</header>
<ul class="chatbox">
<li class="chat incoming">
<span class="material-symbols-outlined">smart_toy</span>
<p>Hi there 👋<br>How can I help you today?</p>
</li>
</ul>
<div class="chat-input">
<textarea placeholder="Enter a message..." spellcheck="false" required></textarea>
<span id="send-btn" class="material-symbols-rounded">send</span>
</div>
</div>


<button class="chatbot-toggler">
<span class="material-symbols-rounded">mode_comment</span>
<span class="material-symbols-outlined">close</span>
</button>
<div class="chatbot">
<header>
<h2>Chatbot</h2>
<span class="close-btn material-symbols-outlined">close</span>
</header>
<ul class="chatbox">
<li class="chat incoming">
<span class="material-symbols-outlined">smart_toy</span>
<p>Hi there 👋<br>How can I help you today?</p>
</li>
</ul>
<div class="chat-input">
<textarea placeholder="Enter a message..." spellcheck="false" required></textarea>
<span id="send-btn" class="material-symbols-rounded">send</span>
</div>
</div>
<!-- ############# Header ############# -->

<header id="header" class="fixed-top">
Expand Down Expand Up @@ -996,6 +1079,42 @@ <h4>RAPIDOC Newsletter</h4>
ScrollReveal().reveal('.feedback', { delay: 400 , origin:'left' });
ScrollReveal().reveal('.footer', { delay: 400 , origin:'bottom' });
</script>
<script>
/* document.addEventListener("DOMContentLoaded", function() {
const preloader = document.getElementById('preloader');
const mainContent = document.getElementById('main-content');
// Listen for the window load event
window.addEventListener('load', function() {
// Set a delay before transitioning the preloader and main content
setTimeout(function() {
preloader.classList.add('hidden');
mainContent.classList.remove('hidden');
mainContent.classList.add('visible');
}, 300); // 2000 milliseconds = 2 seconds delay
});
}); */

window.addEventListener("load", () => {
const loader = document.querySelector(".pre");

loader.classList.add("pre--hidden");

loader.addEventListener("transitionend", () => {
document.body.removeChild(loader);
});
});

window.addEventListener("load", () => {
const loader = document.querySelector(".loader");

loader.classList.add("loader--hidden");

loader.addEventListener("transitionend", () => {
document.body.removeChild(loader);
});
});
</script>
</body>

</html>

0 comments on commit a0290ae

Please sign in to comment.