PageSourceSearch

https://www.tehransang.com/_PortalThemes/demo303/assets/plugin/go-to-top/script.js

js tehransang.com collected 2026-09-28 12:27:33 UTC 1,715 bytes, 59 lines download raw bytes

1
2
3/* Please ❤ this if you like it! */
4
5
6
7(function($) { "use strict";
8
9	//Switch dark/light
10	
11	$(".switch").on('click', function () {
12		if ($("body").hasClass("light")) {
13			$("body").removeClass("light");
14			$(".switch").removeClass("switched");
15		}
16		else {
17			$("body").addClass("light");
18			$(".switch").addClass("switched");
19		}
20	});
21		
22	$(document).ready(function(){"use strict";
23	
24		//Scroll back to top
25		
26		var progressPath = document.querySelector('.progress-wrap path');
27		var pathLength = progressPath.getTotalLength();
28		progressPath.style.transition = progressPath.style.WebkitTransition = 'none';
29		progressPath.style.strokeDasharray = pathLength + ' ' + pathLength;
30		progressPath.style.strokeDashoffset = pathLength;
31		progressPath.getBoundingClientRect();
32		progressPath.style.transition = progressPath.style.WebkitTransition = 'stroke-dashoffset 10ms linear';		
33		var updateProgress = function () {
34			var scroll = $(window).scrollTop();
35			var height = $(document).height() - $(window).height();
36			var progress = pathLength - (scroll * pathLength / height);
37			progressPath.style.strokeDashoffset = progress;
38		}
39		updateProgress();
40		$(window).scroll(updateProgress);	
41		var offset = 50;
42		var duration = 550;
43		jQuery(window).on('scroll', function() {
44			if (jQuery(this).scrollTop() > offset) {
45				jQuery('.progress-wrap').addClass('active-progress');
46			} else {
47				jQuery('.progress-wrap').removeClass('active-progress');
48			}
49		});				
50		jQuery('.progress-wrap').on('click', function(event) {
51			event.preventDefault();
52			jQuery('html, body').animate({scrollTop: 0}, duration);
53			return false;
54		})
55		
56		
57	});
58	
59})(jQuery); 

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.