1/* 2Template Name: Fabkin - Admin & Dashboard Template 3Author: Pixeleyez 4Website: https://pixeleyez.com/ 5Contact: [email protected] 6File: Scroll To Top Js File 7*/ 8 9const scrollToTop = document.getElementById("progress-scroll"); 10if (scrollToTop) { 11 const scroller = document.getElementById("progress-scroll"); 12 13 if (scroller) { 14 scroller.addEventListener("click", () => { 15 window.scrollTo({ top: 0, behavior: "smooth" }); 16 }); 17 } 18 19 document.addEventListener("DOMContentLoaded", () => { 20 const progressWrap = document.querySelector('.progress-wrap'); 21 const progressCircle = document.querySelector('.progress'); 22 const pathLength = 282.6; // Circumference of the circle (2 * Ï * radius) = 2 * Ï * 45 23 24 progressCircle.style.strokeDasharray = `${pathLength} ${pathLength}`; 25 progressCircle.style.strokeDashoffset = `${pathLength}`; 26 27 const updateProgress = () => { 28 const scroll = window.scrollY || document.documentElement.scrollTop; 29 const height = document.documentElement.scrollHeight - window.innerHeight; 30 const progress = pathLength - (scroll * pathLength / height); 31 progressCircle.style.strokeDashoffset = `${progress}`; 32 }; 33 34 window.addEventListener('scroll', () => { 35 updateProgress(); 36 37 if (window.scrollY > 200) { 38 progressWrap.classList.add('active-progress'); 39 } else { 40 progressWrap.classList.remove('active-progress'); 41 } 42 }); 43 }); 44}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.