Skip to content

Commit

Permalink
Added the scroll to top with enhanced ui and fixed someone has putted…
Browse files Browse the repository at this point in the history
… the css directly on button which is bad habbit fixed that
  • Loading branch information
tarunkumar2005 committed Oct 4, 2024
1 parent aa1027b commit 6549fd2
Show file tree
Hide file tree
Showing 3 changed files with 450 additions and 437 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ <h3>Wireless Controllers for Nintendo Switch</h3>
<span>Overall Rating:</span>
<p class="star">4.2★</p>
</div>
<button type="button">Buy Now<img src="images/arrow.png" alt="Arrow"></button>
<button class="buyNow" type="button">Buy Now<img src="images/arrow.png" alt="Arrow"></button>
</div>
<div class="col-2">
<img src="images/controller3.png" class="controller" alt="Controller">
Expand Down
5 changes: 4 additions & 1 deletion script.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ document.addEventListener('DOMContentLoaded', function() {
scrollToTopBtn.classList.remove('show');
}

setProgress(scrolled * 100);
// Ensure smooth progress updates
requestAnimationFrame(() => {
setProgress(scrolled * 100);
});
}

function scrollToTop() {
Expand Down
Loading

0 comments on commit 6549fd2

Please sign in to comment.