Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a scroll down button #3319

Merged
merged 1 commit into from
Oct 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6137,6 +6137,45 @@ <h1>Privacy Notice</h1>
animateCircles();
</script>

<button id="scrollBtn" class="scroll-button">Scroll</button>
<style>
.scroll-button {
position: fixed;
right: 45px;
top: 40%;
transform: translateY(-50%);
background :linear-gradient(hwb(357 6% 36%),#d26d6d);
color: white;
border: none;
border-radius: 50%; /* Make it circular */
width: 50px; /* Set width */
height: 50px; /* Set height */
padding: 0; /* Remove padding */
cursor: pointer;
z-index: 1000; /* Ensure button is on top */
display: flex; /* Center content */
justify-content: center; /* Center content horizontally */
align-items: center; /* Center content vertically */
font-size: 12px; /* Smaller font size */
text-align: center; /* Center text */
}
.scroll-button:hover {
transform: translateY(-50%) scale(1.2);
}
</style>
<script>
document.getElementById("scrollBtn").addEventListener("click", function() {
// Get the height of the viewport
const viewportHeight = window.innerHeight;

// Scroll down by one viewport height
window.scrollBy({
top: viewportHeight,
behavior: "smooth" // This makes the scrolling smooth
});
});
</script>

</body>

</html>
Loading