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 Progress Bar for the Website Visual-Sort #142

Merged
merged 1 commit into from
Oct 13, 2024
Merged
Show file tree
Hide file tree
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
42 changes: 42 additions & 0 deletions Terms.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,54 @@
.hover-move:hover {
transform: translateX(20px);
}
#progress-container {
width: 100%;
height: 5px;
background-color: #f3f3f3;
border-radius: 5px;
overflow: hidden;
position: fixed;
top: 0;
left: 0;
z-index: 9999;
}

#progress-bar {
/* width: 0%; */
height: 100%;
background-color: rgb(219, 127, 219);
}
</style>

</head>

<body>

<div id="progress-container">
<div id="progress-bar"></div>
</div>

<script>
let lastScrollPercentage = 0; // Keep track of the last scroll percentage

function updateProgressBar() {
const scrollTop = window.scrollY; // Current scroll position
const windowHeight = document.documentElement.scrollHeight - window.innerHeight; // Total scrollable height
const scrollPercentage = (scrollTop / windowHeight) * 100; // Calculate scroll percentage

// Smoothly transition to the new percentage
const progressBar = document.getElementById('progress-bar');

// Use a linear interpolation to gradually move towards the new percentage
lastScrollPercentage += (scrollPercentage - lastScrollPercentage) * 0.1; // Adjust the smoothing factor here
progressBar.style.width = lastScrollPercentage + '%'; // Update the progress bar width
}

// Listen for the scroll event
window.addEventListener('scroll', updateProgressBar);

</script>

<body data-spy="scroll" data-target=".site-navbar-target" data-offset="72">

<div id="Loader"></div>
Expand Down
45 changes: 45 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,56 @@
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }

#progress-container {
width: 100%;
height: 5px;
background-color: #f3f3f3;
border-radius: 5px;
overflow: hidden;
position: fixed;
top: 0;
left: 0;
z-index: 9999;
}

#progress-bar {
/* width: 0%; */
height: 100%;
background-color: rgb(219, 127, 219);
}

</style>
</head>

<body data-spy="scroll" data-target=".site-navbar-target" data-offset="72">

<div id="progress-container">
<div id="progress-bar"></div>
</div>

<script>
let lastScrollPercentage = 0; // Keep track of the last scroll percentage

function updateProgressBar() {
const scrollTop = window.scrollY; // Current scroll position
const windowHeight = document.documentElement.scrollHeight - window.innerHeight; // Total scrollable height
const scrollPercentage = (scrollTop / windowHeight) * 100; // Calculate scroll percentage

// Smoothly transition to the new percentage
const progressBar = document.getElementById('progress-bar');

// Use a linear interpolation to gradually move towards the new percentage
lastScrollPercentage += (scrollPercentage - lastScrollPercentage) * 0.1; // Adjust the smoothing factor here
progressBar.style.width = lastScrollPercentage + '%'; // Update the progress bar width
}

// Listen for the scroll event
window.addEventListener('scroll', updateProgressBar);

</script>


<div id="Loader"></div>

<div class="site-wrap">
Expand Down
43 changes: 43 additions & 0 deletions licensing.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,24 @@
.hover-move:hover {
transform: translateX(20px);
}

#progress-container {
width: 100%;
height: 5px;
background-color: #f3f3f3;
border-radius: 5px;
overflow: hidden;
position: fixed;
top: 0;
left: 0;
z-index: 9999;
}

#progress-bar {
/* width: 0%; */
height: 100%;
background-color: rgb(219, 127, 219);
}
</style>
<style>
body{
Expand All @@ -68,6 +86,31 @@
</head>
<body>

<div id="progress-container">
<div id="progress-bar"></div>
</div>

<script>
let lastScrollPercentage = 0; // Keep track of the last scroll percentage

function updateProgressBar() {
const scrollTop = window.scrollY; // Current scroll position
const windowHeight = document.documentElement.scrollHeight - window.innerHeight; // Total scrollable height
const scrollPercentage = (scrollTop / windowHeight) * 100; // Calculate scroll percentage

// Smoothly transition to the new percentage
const progressBar = document.getElementById('progress-bar');

// Use a linear interpolation to gradually move towards the new percentage
lastScrollPercentage += (scrollPercentage - lastScrollPercentage) * 0.1; // Adjust the smoothing factor here
progressBar.style.width = lastScrollPercentage + '%'; // Update the progress bar width
}

// Listen for the scroll event
window.addEventListener('scroll', updateProgressBar);

</script>

<body data-spy="scroll" data-target=".site-navbar-target" data-offset="72">

<div id="Loader"></div>
Expand Down
44 changes: 44 additions & 0 deletions privacy-policy.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,54 @@
margin-bottom: 0;
}
}

#progress-container {
width: 100%;
height: 5px;
background-color: #f3f3f3;
border-radius: 5px;
overflow: hidden;
position: fixed;
top: 0;
left: 0;
z-index: 9999;
}

#progress-bar {
/* width: 0%; */
height: 100%;
background-color: rgb(219, 127, 219);
}
</style>
</head>

<body>

<div id="progress-container">
<div id="progress-bar"></div>
</div>

<script>
let lastScrollPercentage = 0; // Keep track of the last scroll percentage

function updateProgressBar() {
const scrollTop = window.scrollY; // Current scroll position
const windowHeight = document.documentElement.scrollHeight - window.innerHeight; // Total scrollable height
const scrollPercentage = (scrollTop / windowHeight) * 100; // Calculate scroll percentage

// Smoothly transition to the new percentage
const progressBar = document.getElementById('progress-bar');

// Use a linear interpolation to gradually move towards the new percentage
lastScrollPercentage += (scrollPercentage - lastScrollPercentage) * 0.1; // Adjust the smoothing factor here
progressBar.style.width = lastScrollPercentage + '%'; // Update the progress bar width
}

// Listen for the scroll event
window.addEventListener('scroll', updateProgressBar);

</script>

<nav class="navbar navbar-expand-lg fixed-top" style="background-color: #303842;">
<div class="container-fluid">
<a class="navbar-brand" style="font-weight: 900; color: rgb(255, 255, 255);" href="index.html">Visual
Expand Down
43 changes: 43 additions & 0 deletions visual.html
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,52 @@
overflow-y: auto;
}
}
#progress-container {
width: 100%;
height: 5px;
background-color: #f3f3f3;
border-radius: 5px;
overflow: hidden;
position: fixed;
top: 0;
left: 0;
z-index: 9999;
}

#progress-bar {
/* width: 0%; */
height: 100%;
background-color: rgb(219, 127, 219);
}
</style>
</head>
<body>

<div id="progress-container">
<div id="progress-bar"></div>
</div>

<script>
let lastScrollPercentage = 0; // Keep track of the last scroll percentage

function updateProgressBar() {
const scrollTop = window.scrollY; // Current scroll position
const windowHeight = document.documentElement.scrollHeight - window.innerHeight; // Total scrollable height
const scrollPercentage = (scrollTop / windowHeight) * 100; // Calculate scroll percentage

// Smoothly transition to the new percentage
const progressBar = document.getElementById('progress-bar');

// Use a linear interpolation to gradually move towards the new percentage
lastScrollPercentage += (scrollPercentage - lastScrollPercentage) * 0.1; // Adjust the smoothing factor here
progressBar.style.width = lastScrollPercentage + '%'; // Update the progress bar width
}

// Listen for the scroll event
window.addEventListener('scroll', updateProgressBar);

</script>

<div id="Loader"></div>
<div class="header">
<h1 id="heading">Sorting Algorithms Visualization</h1>
Expand Down
Loading