Sh3ll
OdayForums


Server : LiteSpeed
System : Linux premium84.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
User : claqxcrl ( 523)
PHP Version : 8.1.32
Disable Function : NONE
Directory :  /home/claqxcrl/claquemagazineawards.com/wp-content/themes/exs/assets/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/claqxcrl/claquemagazineawards.com/wp-content/themes/exs/assets/js/read-progress.js
'use strict';
//IIFE
;(function(d,w,gel) {
	w.addEventListener('load',function() {
		var article = gel('#layout > article');
		article = article ? article : gel('#main');
		article = article ? article : gel('#box');
		// console.log(article);
		var progressBar = gel('#read-progress div');
		if(article&&progressBar){
			var rect = article.getBoundingClientRect();
			var top = rect.y + w.pageYOffset;
			var bottom = rect.height + top;
			w.addEventListener('scroll', function (){
				var offset=w.pageYOffset;
				if(offset>top && offset<bottom){
					progressBar.style.width=(offset-top)*100/rect.height+'%';
				}else{
					if(offset<top){
						progressBar.style.width='0%';
					}
					if(offset>top){
						progressBar.style.width='100%';
					}
				}
			});
			w.addEventListener('resize', function (){
				rect = article.getBoundingClientRect();
				top = rect.y + w.pageYOffset;
				bottom = rect.height + top;
			});
			w.dispatchEvent(new Event('scroll'));
		}
	});
})(document,window,document.querySelector.bind(document));

ZeroDay Forums Mini