PageSourceSearch

https://khabarpati.com/public/website/js/custom.js

js khabarpati.com collected 2026-09-25 12:57:10 UTC 9,208 bytes, 360 lines download raw bytes

1$(window).on('load', function () {
2
3    var $container = $('#mixit');
4    $container.isotope({
5        layoutMode: 'masonry',
6        animationOptions: {
7            duration: 750,
8            easing: 'linear',
9            queue: true,
10            layoutMode: 'fitRows'
11        }
12    });
13    $('#the-tabs .related-links-btns').on('click', function () {
14        $('#the-tabs .active').removeClass('active');
15        $(this).addClass('active');
16        var selector = $(this).attr('data-filter');
17
18
19        $container.isotope({
20            filter: selector,
21            animationOptions: {
22                duration: 750,
23                queue: true
24            }
25        });
26
27        return false;
28    });
29
30    setTimeout(function(){$container.isotope('layout')}, 300);
31
32});
33
34$(window).on('load', function () {
35
36    var $container = $('#mixit-artha');
37    $container.isotope({
38        layoutMode: 'masonry',
39        animationOptions: {
40            duration: 750,
41            easing: 'linear',
42            queue: true,
43            layoutMode: 'fitRows'
44        }
45    });
46    $('#the-tabs-artha .related-links-btns').on('click', function () {
47        $('#the-tabs-artha .active').removeClass('active');
48        $(this).addClass('active');
49        var selector = $(this).attr('data-filter');
50
51
52        $container.isotope({
53            filter: selector,
54            animationOptions: {
55                duration: 750,
56                queue: true
57            }
58        });
59
60        return false;
61    });
62
63    setTimeout(function(){$container.isotope('layout')}, 300);
64
65});
66
67
68// var result=document.querySelectorAll('[data-src]');
69//    for (var index in result){
70//       if (result.hasOwnProperty(index)){
71//          console.log(result[index].getAttribute('data-src'));
72//          let imgsrc = result[index].getAttribute('data-src');
73//          $('img').attr('src',imgsrc)
74//       }
75//    }
76
77    // if (window.matchMedia("(prefers-color-scheme: dark)").matches == true) {
78    //     if (sessionStorage.getItem("darkmode") !== null) {
79    //         if (sessionStorage.getItem('darkmode') == 'on') {
80    //             $('body').addClass('theme-dark');
81    //             $('.mode-toggle .icon-light').addClass('hide');
82    //         } else {
83    //             $('body').removeClass('theme-dark');
84    //             $('.mode-toggle .icon-dark').addClass('hide');
85    //         }
86    //     } else {
87    //         $('body').addClass('theme-dark');
88    //         $('.mode-toggle .icon-light').addClass('hide');
89    //     }
90
91    // } else {
92    //     if (sessionStorage.getItem("darkmode") !== null) {
93    //         if (sessionStorage.getItem('darkmode') == 'on') {
94    //             $('body').addClass('theme-dark');
95    //             $('.mode-toggle .icon-light').addClass('hide');
96    //         } else {
97    //             $('body').removeClass('theme-dark');
98    //             $('.mode-toggle .icon-dark').addClass('hide');
99    //         }
100    //     } else {
101    //         $('body').removeClass('theme-dark');
102    //         $('.mode-toggle .icon-dark').addClass('hide');
103    //     }
104    // }
105// PSD
106const darkMode = false;
107if (sessionStorage.getItem("darkmode") === "on") {
108  $('body').toggleClass('theme-dark', darkMode);
109  $('.mode-toggle .icon-light').toggleClass('hide', darkMode);
110  $('.mode-toggle .icon-dark').toggleClass('hide', !darkMode);
111} else {
112  $('body').toggleClass('theme-dark', darkMode);
113  $('.mode-toggle .icon-light').toggleClass('hide', darkMode);
114  $('.mode-toggle .icon-dark').toggleClass('hide', !darkMode);
115}
116
117$('a.mode-toggle').on('click', function () {
118    if ($('body').hasClass('theme-dark')) {
119        sessionStorage.setItem('darkmode', 'off');
120        $('body').removeClass('theme-dark');
121        $('.mode-toggle .icon-dark').addClass('hide').removeClass('rotate');
122        $('.mode-toggle .icon-light').removeClass('hide').addClass('rotate');
123
124    } else {
125        sessionStorage.setItem('darkmode', 'on');
126        $('body').addClass('theme-dark');
127        $('.mode-toggle .icon-light').addClass('hide').removeClass('rotate');
128        $('.mode-toggle .icon-dark').removeClass('hide').addClass('rotate');
129    }
130})
131
132
133$('img').addClass('lazyload');
134
135var distance = $('.nav-section.sticky-top').offset().top,
136    $window = $(window);
137
138$window.scroll(function () {
139    if ($window.scrollTop() >= distance) {
140        $('.sticky-logo').addClass('d-block');
141    } else {
142        $('.sticky-logo').removeClass('d-block');
143    }
144});
145
146
147$('.footer-slider').slick({
148    slidesToShow: 1,
149    slidesToScroll: 1,
150    arrows: false,
151    dots: false,
152    fade: true,
153    autoplay: true,
154    draggable: false,
155    swipe: false,
156    autoplaySpeed: 3000,
157    speed: 500,
158    cssEase: 'linear'
159});
160
161
162$('.footer-slider').on('afterChange', function () {
163    $('.footer-slider a').removeClass('reveal')
164    $('.footer-slider .slick-active a').addClass('reveal')
165
166    $('.footer-slider .img-box img').removeClass('animate__bounceIn unhide')
167    $('.footer-slider .slick-active .img-box img').addClass('animate__bounceIn');
168    setTimeout(() => {
169        $('.footer-slider .slick-active .img-box img').addClass('unhide');
170    }, 500);
171});
172
173
174$('.feature .owl-carousel').owlCarousel({
175    loop: true,
176    margin: 20,
177    nav: true,
178    dots: false,
179    navText: ['<i class="fa fa-angle-left"></i>', '<i class="fa fa-angle-right"></i>'],
180    autoplay: true,
181    mouseDrag: true,
182    autoplaySpeed: 5000,
183    startPosition: 1,
184    responsive: {
185        0: {
186            items: 1
187        },
188        600: {
189            items: 3
190        },
191        1000: {
192            items: 4
193        }
194    }
195});
196
197$('#dristi .owl-carousel').owlCarousel({
198    loop: true,
199    margin: 20,
200    nav: true,
201    dots: false,
202    navText: ['<i class="fa fa-angle-left"></i>', '<i class="fa fa-angle-right"></i>'],
203    autoplay: true,
204    mouseDrag: true,
205    autoplaySpeed: 5000,
206    startPosition: 1,
207    responsive: {
208        0: {
209            items: 1
210        },
211        600: {
212            items: 3
213        },
214        1000: {
215            items: 4
216        }
217    }
218});
219
220
221$('.modal-watch .owl-carousel').owlCarousel({
222    loop: true,
223    margin: 20,
224    nav: true,
225    dots: false,
226    autoplay: true,
227    mouseDrag: true,
228    navText: ['<i class="fa fa-angle-left"></i>', '<i class="fa fa-angle-right"></i>'],
229    responsive: {
230        0: {
231            items: 1
232        },
233        600: {
234            items: 3
235        },
236        1000: {
237            items: 4
238        }
239    }
240});
241
242$('.pradesh .owl-carousel').owlCarousel({
243    loop: true,
244    margin: 20,
245    nav: true,
246    dots: false,
247    autoplay: false,
248    mouseDrag: true,
249    autoplayHoverPause: true,
250    autoplaySpeed: 5000,
251    responsive: {
252        0: {
253            items: 1
254        },
255        600: {
256            items: 2
257        },
258        1000: {
259            items: 4
260        }
261    }
262});
263
264$('.hamburger').click(function () {
265    $('#page-overlay').fadeIn();
266    $('#sidebar').addClass('toggle');
267    $('body').addClass('modal-open');
268})
269
270$('#page-overlay, #sidebar .close').click(function () {
271    $('#page-overlay').fadeOut();
272    $('#sidebar').removeClass('toggle');
273    $('body').removeClass('modal-open');
274})
275
276function fixTitle() {
277    $('.home-section').each(function () {
278        var $this = $(this);
279        var offset = $this.offset().top - 100;
280        // var elemBottom = offset + $this.height();
281
282        var scrollTop = $(window).scrollTop();
283
284        if (scrollTop >= offset) {
285
286            var target = $this.data('navigation');
287            $('#' + target).addClass('active').parent('.menu-item').siblings().find('a').removeClass('active')
288
289        }
290
291    });
292}
293
294$("img.lazyload").lazyload();
295
296// $('#mainnav li a').on('click',function(){
297//     $(this).removeAttr('href')
298//     let url = $(this).attr('link');
299//     window.location.href = url;
300// })
301
302// $("#mainnav").scrollspy(); 
303
304$(window).on('load', function () {
305    $(window).scroll(fixTitle);
306    // $('#mainnav li .home').closest('li').addClass('active')
307
308    // var limit = 1;
309    // const limitedInterval = setInterval(function(){
310    //     limit++;
311    //     console.log(limit);
312    //     $('#the-tabs .active').trigger('click');
313    //     if (limit > 5) {
314    //         clearInterval(limitedInterval);
315    //     }
316    // },500)
317    setTimeout(function(){
318        $('#mixit-artha').isotope('layout')
319        $('#mixit').isotope('layout')
320    },1000)
321}
321);
322
323
324$(function () {
325
326
327    $('[data-toggle="tooltip"]').tooltip();
328
329});
330
331$('.fixed-icon').click(function () {
332
333    $(this).parent('.fixed-info').toggleClass('toright');
334})
335
336$('.nav-icons .drop-toggle').click(function () {
337
338    $(this).find('.nav-mega-menu').slideToggle();
339})
340
341$('#trending-btn').click(function () {
342    $('#trending-div').slideToggle();
343})
344
345$(document).mouseup(function (e) {
346    e.preventDefault();
347    var container = $("#trending-div, #trending-btn");
348
349    if (!container.is(e.target) && container.has(e.target).length === 0) {
350        container.slideUp();
351    }
352});
353
354let np = new NepaliDate();
355NepaliDate.Language = 'np';
356let format = np.format('ddd, DD MMMM YYYY', 'np');
357
358document.getElementById('today_np_date').innerHTML = format;
359document.getElementById('today_np_date_top').innerHTML = format;
360

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.