diff options
| author | Danilo M. <danix@danix.xyz> | 2026-04-22 12:43:22 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-04-22 12:43:22 +0200 |
| commit | 5b476f8905f411768e23cb01d577a60e5a5fd725 (patch) | |
| tree | 0a08cc83d809dbea714f52826e822501ee7c0165 /themes/danix-xyz-hacker/assets/js/reading-progress.js | |
| parent | 082e9246ffe453031894d32d3cee9d5d1bf2b67a (diff) | |
| download | danixxyz-5b476f8905f411768e23cb01d577a60e5a5fd725.tar.gz danixxyz-5b476f8905f411768e23cb01d577a60e5a5fd725.zip | |
chore: extract theme into git submodule (danix2-hugo-theme)
Diffstat (limited to 'themes/danix-xyz-hacker/assets/js/reading-progress.js')
| -rw-r--r-- | themes/danix-xyz-hacker/assets/js/reading-progress.js | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/themes/danix-xyz-hacker/assets/js/reading-progress.js b/themes/danix-xyz-hacker/assets/js/reading-progress.js deleted file mode 100644 index ee1192f..0000000 --- a/themes/danix-xyz-hacker/assets/js/reading-progress.js +++ /dev/null @@ -1,29 +0,0 @@ -// Reading progress bar for single pages/articles -(function() { - const progressBar = document.getElementById('reading-progress'); - - if (!progressBar) return; - - function updateProgress() { - const windowHeight = window.innerHeight; - const documentHeight = document.documentElement.scrollHeight - windowHeight; - const scrollProgress = documentHeight > 0 ? (window.scrollY / documentHeight) * 100 : 0; - progressBar.style.width = scrollProgress + '%'; - } - - // Throttle the scroll event for better performance - let ticking = false; - - window.addEventListener('scroll', function() { - if (!ticking) { - window.requestAnimationFrame(function() { - updateProgress(); - ticking = false; - }); - ticking = true; - } - }, false); - - // Initial call - updateProgress(); -})(); |
