PageSourceSearch

https://chayyek.com/assets/js/main.js

js chayyek.com collected 2026-10-06 07:26:41 UTC 8,058 bytes, 361 lines download raw bytes

1jQuery(function ($) {
2    'use strict';
3	
4	// Header Sticky
5	$(window).on('scroll',function() {
6		if ($(this).scrollTop() > 120){  
7			$('.navbar-area').addClass("is-sticky");
8		}
9		else{
10			$('.navbar-area').removeClass("is-sticky");
11		}
12	});
13
14	// Mean Menu
15	jQuery('.mean-menu').meanmenu({
16		meanScreenWidth: "1199"
17	});
18	
19	// Others Option For Responsive JS
20	$(".others-option-for-responsive .dot-menu").on("click", function(){
21		$(".others-option-for-responsive .container .container").toggleClass("active");
22	});
23
24	// Video Slides
25	$('.video-slides').owlCarousel({
26		loop: true,
27		nav: true,
28		rtl: true,
29		dots: false,
30		autoplayHoverPause: true,
31		autoplay: true,
32		margin: 30,
33		navText: [
34			"<i class='bx bx-chevron-left'></i>",
35			"<i class='bx bx-chevron-right'></i>"
36		],
37		responsive: {
38			0: {
39				items: 1,
40			},
41			576: {
42				items: 1,
43			},
44			768: {
45				items: 2,
46			},
47			1200: {
48				items: 2,
49			}
50		}
51	});
52
53	// Popup Video
54	$('.popup-youtube').magnificPopup({
55		disableOn: 320,
56		type: 'iframe',
57		mainClass: 'mfp-fade',
58		removalDelay: 160,
59		preloader: false,
60		fixedContentPos: false
61	});
62	
63	// Business News Slides
64	$('.business-news-slides').owlCarousel({
65		loop: true,
66		nav: true,
67		rtl: true,
68		dots: false,
69		autoplayHoverPause: true,
70		autoplay: true,
71		margin: 30,
72		navText: [
73			"<i class='bx bx-chevron-left'></i>",
74			"<i class='bx bx-chevron-right'></i>"
75		],
76		responsive: {
77			0: {
78				items: 1,
79			},
80			576: {
81				items: 1,
82			},
83			768: {
84				items: 2,
85			},
86			1200: {
87				items: 2,
88			}
89		}
90	});
91
92	// Health News Slides
93	$('.health-news-slides').owlCarousel({
94		loop: true,
95		nav: true,
96		rtl: true,
97		dots: false,
98		autoplayHoverPause: true,
99		autoplay: true,
100		margin: 30,
101		navText: [
102			"<i class='bx bx-chevron-left'></i>",
103			"<i class='bx bx-chevron-right'></i>"
104		],
105		responsive: {
106			0: {
107				items: 1,
108			},
109			576: {
110				items: 1,
111			},
112			768: {
113				items: 2,
114			},
115			1200: {
116				items: 2,
117			}
118		}
119	});
120
121	// Subscribe form
122	$(".newsletter-form").validator().on("submit", function (event) {
123		if (event.isDefaultPrevented()) {
124		// handle the invalid form...
125			formErrorSub();
126			submitMSGSub(false, "Please enter your email correctly.");
127		} else {
128			// everything looks good!
129			event.preventDefault();
130		}
131	});
132	function callbackFunction (resp) {
133		if (resp.result === "success") {
134			formSuccessSub();
135		}
136		else {
137			formErrorSub();
138		}
139	}
140	function formSuccessSub(){
141		$(".newsletter-form")[0].reset();
142		submitMSGSub(true, "Thank you for subscribing!");
143		setTimeout(function() {
144			$("#validator-newsletter").addClass('hide');
145		}, 4000)
146	}
147	function formErrorSub(){
148		$(".newsletter-form").addClass("animated shake");
149		setTimeout(function() {
150			$(".newsletter-form").removeClass("animated shake");
151		}, 1000)
152	}
153	function submitMSGSub(valid, msg){
154		if(valid){
155			var msgClasses = "validation-success";
156		} else {
157			var msgClasses = "validation-danger";
158		}
159		$("#validator-newsletter").removeClass().addClass(msgClasses).text(msg);
160	}
161	// AJAX MailChimp
162	$(".newsletter-form").ajaxChimp({
163		url: "https://envytheme.us20.list-manage.com/subscribe/post?u=60e1ffe2e8a68ce1204cd39a5&amp;id=42d6d188d9", // Your url MailChimp
164		callback: callbackFunction
165	});
166
167	// Go to Top
168	$(function(){
169		// Scroll Event
170		$(window).on('scroll', function(){
171			var scrolled = $(window).scrollTop();
172			if (scrolled > 600) $('.go-top').addClass('active');
173			if (scrolled < 600) $('.go-top').removeClass('active');
174		});  
175		// Click Event
176		$('.go-top').on('click', function() {
177			$("html, body").animate({ scrollTop: "0" },  500);
178		});
179	});
180
181	// Sports Slides
182	$('.sports-slider').owlCarousel({
183		loop: true,
184		nav: true,
185		rtl: true,
186		dots: false,
187		autoplayHoverPause: true,
188		autoplay: true,
189		items: 1,
190		margin: 30,
191		navText: [
192			"<i class='bx bx-chevron-left'></i>",
193			"<i class='bx bx-chevron-right'></i>"
194		],
195		
196		responsive: {
197			0: {
198				items: 1,
199			},
200			576: {
201				items: 2,
202			},
203			768: {
204				items: 1,
205			},
206			1200: {
207				items: 1,
208			}
209		}
210	});
211	
212	// Tech Slides
213	$('.tech-slider').owlCarousel({
214		loop: true,
215		nav: true,
216		rtl: true,
217		dots: false,
218		autoplayHoverPause: true,
219		autoplay: true,
220		items: 1,
221		margin: 30,
222		navText: [
223			"<i class='bx bx-chevron-left'></i>",
224			"<i class='bx bx-chevron-right'></i>"
225		],
226		
227		responsive: {
228			0: {
229				items: 1,
230			},
231			576: {
232				items: 2,
233			},
234			768: {
235				items: 1,
236			},
237			1200: {
238				items: 1,
239			}
240		}
241	});
242
243	// Breaking News Slides
244	$('.breaking-news-slides').owlCarousel({
245		loop: true,
246		nav: false,
247		rtl: true,
248		dots: false,
249		autoplayHoverPause: true,
250		autoplay: true,
251		animateOut:"slideOutDown",
252		animateIn:"flipInX",
253		items: 1,
254		margin: 30,
255		navText: [
256			"<i class='bx bx-chevron-left'></i>",
257			"<i class='bx bx-chevron-right'></i>"
258		],
259	});
260	
261	// Main News Slides
262	$('.main-news-slides').owlCarousel({
263		loop: true,
264		nav: true,
265		rtl: true,
266		dots: false,
267		autoplayHoverPause: true,
268		autoplay: true,
269		margin: 30,
270		navText: [
271			"<i class='bx bx-chevron-left'></i>",
272			"<i class='bx bx-chevron-right'></i>"
273		],
274		responsive: {
275			0: {
276				items: 1,
277			},
278			576: {
279				items: 1,
280			},
281			768: {
282				items: 1,
283			},
284			1200: {
285				items: 1,
286			}
287		}
288	});
289	
290	// FAQ Accordion
291	$(function() {
292		$('.accordion').find('.accordion-title').on('click', function(){
293			// Adds Active Class
294			$(this).toggleClass('active');
295			// Expand or Collapse This Panel
296			$(this).next().slideToggle('fast');
297			// Hide The Other Panels
298			$('.accordion-content').not($(this).next()).slideUp('fast');
299			// Removes Active Class From Other Titles
300			$('.accordion-title').not($(this)).removeClass('active');		
301		});
302	});
303
304	// Nice Select JS
305	$('select').niceSelect();
306
307	// Count Time 
308	function makeTimer() {
309		var endTime = new Date("September 20, 3000 17:00:00 PDT");			
310		var endTime = (Date.parse(endTime)) / 1000;
311		var now = new Date();
312		var now = (Date.parse(now) / 1000);
313		var timeLeft = endTime - now;
314		var days = Math.floor(timeLeft / 86400); 
315		var hours = Math.floor((timeLeft - (days * 86400)) / 3600);
316		var minutes = Math.floor((timeLeft - (days * 86400) - (hours * 3600 )) / 60);
317		var seconds = Math.floor((timeLeft - (days * 86400) - (hours * 3600) - (minutes * 60)));
318		if (hours < "10") { hours = "0" + hours; }
319		if (minutes < "10") { minutes = "0" + minutes; }
320		if (seconds < "10") { seconds = "0" + seconds; }
321		$("#days").html(days + "<span>Days</span>");
322		$("#hours").html(hours + "<span>Hours</span>");
323		$("#minutes").html(minutes + "<span>Minutes</span>");
324		$("#seconds").html(seconds + "<span>Seconds</span>");
325	}
326	setInterval(function() { makeTimer(); }, 0);
327	
328	// Preloader
329	$(window).on('load', function() {
330		$('.preloader').fadeOut();
331		$('.preloader-area').addClass('preloader-deactivate');
332	});
333
334	// Buy Now Btn
335    $('body').append("<a href='https://themeforest.net/checkout/84153981/create_account?_ga=2.24597562.1430237439.1644119533-1297998632.1635997908' class='buy-now-btn' target='_blank'>Buy Now</a>");
336
337}(jQuery));
338
339// function to set a given theme/color-scheme
340function setTheme(themeName) {
341	localStorage.setItem('theme', themeName);
342	document.documentElement.className = themeName;
343}
344// function to toggle between light and dark theme
345function toggleTheme() {
346	if (localStorage.getItem('theme') === 'theme-dark') {
347		setTheme('theme-light');
348	} else {
349		setTheme('theme-dark');
350	}
351}
352// Immediately invoked function to set the theme on initial load
353(function () {
354	if (localStorage.getItem('theme') === 'theme-dark') {
355		setTheme('theme-dark');
356		document.getElementById('slider').checked = false;
357	} else {
358		setTheme('theme-light');
359	  document.getElementById('slider').checked = true;
360	}
361})();

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.