Skip to content

Commit

Permalink
add icream image at scroll button
Browse files Browse the repository at this point in the history
  • Loading branch information
rutikakengal committed Nov 9, 2024
1 parent 37ee2a4 commit 7782908
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
Binary file added cone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 22 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,8 @@

<button id="backToTop" style="font-size: 30px; font-weight: bold;">&#8673;</button>

<div class="scroll-progress" id="scrollProgress"></div>

<!-- Header Starts Here -->
<header class="header">

Expand Down Expand Up @@ -1497,6 +1499,20 @@ <h2>Billing Address</h2>
opacity: 0;
}
}
.scroll-to-top {
position: fixed;
bottom: 20px; /* Distance from the bottom of the page */
right: 40px; /* Distance from the right of the page */
background-color: transparent; /* Transparent background */
border: none; /* Remove border */
cursor: pointer; /* Change cursor to pointer */
z-index: 100; /* Ensure it’s above other content */
}

.scroll-to-top img {
width: 60px; /* Adjust size of the cone image */
height: auto; /* Maintain aspect ratio */
}

</style>
<script>
Expand Down Expand Up @@ -1648,8 +1664,12 @@ <h2 data-aos="zoom-out-down" data-aos-duration="1200" data-aos-delay="200">Share

</section>

<button id="scrollToTop" class="scroll-to-top">
<img src="cone.png" alt="Scroll to Top" />
</button>

<script>
//chatbot added here!
//chatbot added here!
window.embeddedChatbotConfig = {
chatbotId: "oSyGH_33H4whnPVyaVVwa",
domain: "www.chatbase.co"
Expand Down Expand Up @@ -1832,6 +1852,7 @@ <h3>Follow Us</h3>
<div class="gtranslate_wrapper"></div>
<script>window.gtranslateSettings = {"default_language":"en","detect_browser_language":true,"wrapper_selector":".gtranslate_wrapper"}</script>
<script src="https://cdn.gtranslate.net/widgets/latest/float.js" defer></script>
<script src="script2.js"></script>
</body>

</html>
20 changes: 20 additions & 0 deletions script2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
document.addEventListener("DOMContentLoaded", function() {
const scrollToTopButton = document.getElementById("scrollToTop");

// Show button when scrolling down
window.onscroll = function() {
if (document.body.scrollTop > 200 || document.documentElement.scrollTop > 200) {
scrollToTopButton.style.display = "block";
} else {
scrollToTopButton.style.display = "none";
}
};

// Scroll to top functionality
scrollToTopButton.addEventListener("click", function() {
window.scrollTo({
top: 0,
behavior: "smooth" // Smooth scrolling
});
});
});

0 comments on commit 7782908

Please sign in to comment.