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

feat: Scroll down progress bar added #1035

Merged
merged 3 commits into from
Jul 17, 2024
Merged
Changes from 2 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
41 changes: 41 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

<!DOCTYPE html>
<html lang="en">

Expand Down Expand Up @@ -143,6 +144,25 @@
gap: 8px; /* Adjust the gap between buttons */
}

.nav-wrapperr{
position: fixed;
height: 10px;
width: 100%;
top: 80px;
left: 0%;
background-color: white;
z-index: 999;
}

.progress-bar{
height: 10px;
left: 0%;
top: 80px;
position: fixed;
background-color: #6a5acd;
z-index: 9999;
}

@media screen and (max-width: 768px) {
body{
align-items: flex-end;
Expand Down Expand Up @@ -230,6 +250,10 @@ <h1>TourGuide . . .</h1>
</nav>
</div>
<header>
<div class="nav-wrapperr">
<div class="progress-bar"></div>
</div>

<section class="section__container header__container" id="Home">
<div class="header__image" data-aos="fade-down-right">
<img src="https://i.ibb.co/88Qnjxg/pexels-josh-hild-2422259.jpg" alt="header" />
Expand Down Expand Up @@ -1791,6 +1815,7 @@ <h4>Contact Us</h4>
</script>

<script>

document.addEventListener('DOMContentLoaded', function() {
function animateValue(id, start, end, duration) {
const obj = document.getElementById(id);
Expand All @@ -1814,7 +1839,23 @@ <h4>Contact Us</h4>
animateValue("toursCount", 0, 20000, 20000);
animateValue("destinationsCount", 0, 10994, 20000);
});

</script>
<script>
const scrollline = document.querySelector('.progress-bar');

function fillscrollline(){
const windowHeight = window.innerHeight;
const fullHeight = document.body.clientHeight;
const scrolled = window.scrollY;
const percentScrolled = (scrolled / (fullHeight - windowHeight)) * 100;

scrollline.style.width = percentScrolled + '%';
};

window.addEventListener('scroll', fillscrollline);

</script>



Expand Down
Loading