1(function ($) { 2 "use strict"; 3 4 $(".bytf-trigger-open").on("click", function () { 5 $(".bytf__search-wrapper").addClass("opened"); 6 $(".bytf__body-overlay").addClass("opened"); 7 }); 8 $(".bytf__search-close-btn").on("click", function () { 9 $(".bytf__search-wrapper").removeClass("opened"); 10 $(".bytf__body-overlay").removeClass("opened"); 11 }); 12 $(".bytf__body-overlay").on("click", function () { 13 $(".bytf__search-wrapper").removeClass("opened"); 14 $(".bytf__body-overlay").removeClass("opened"); 15 }); 16 17 /** 18 * Sticky Header 19 */ 20 var e = "", 21 g = 0, 22 d, 23 b, 24 c; 25 26 if ($('.bytf-sticky-header').length) { 27 $('.bytf-sticky-header').addClass('original').clone(true).insertAfter('.bytf-sticky-header').addClass('main-header-sticky rr-sticky-stt').removeClass('original'); 28 } 29 30 $(window).on("scroll", function () { 31 (b = $(window).scrollTop()), (c = $(window).height()), (d = $(window).width()), b < g ? (e = "up") : (e = "down"), (g = b), h(); 32 }); 33 34 35 36 function h() { 37 $(".main-header").hasClass("is-sticky") && 38 (b > 300 39 ? ($(".main-header-sticky.rr-sticky-stb").addClass("bytf-sticky-header-fixed"), $("#bytf-sticky-header-mobile").addClass("bytf-sticky-header-mobile-fixed")) 40 : ($(".main-header-sticky.rr-sticky-stb").removeClass("bytf-sticky-header-fixed"), $("#bytf-sticky-header-mobile").removeClass("bytf-sticky-header-mobile-fixed")), 41 e == "up" && b > 300 ? $(".main-header-sticky.rr-sticky-stt").addClass("bytf-sticky-header-fixed") : $(".main-header-sticky.rr-sticky-stt").removeClass("bytf-sticky-header-fixed")), 42 $(".main-header-sticky").parents("body").addClass("bytf-sticky-header-sticky"); 43 } 44 //End Sticky Header 45 46 /** 47 * post Gallery Thumb 48 */ 49 jQuery('.post__single-gallery-wrapper').marquee({ 50 gap: 15, 51 speed: 80, 52 delayBeforeStart: 0, 53 direction: 'left', 54 duplicated: true, 55 pauseOnHover: true, 56 startVisible:true, 57 }); 58 59 60 $(window).on("load", function () { 61 $("#bytf__loader").fadeOut(1000); 62 }); 63 64 /** 65 * MObile Menu 66 */ 67 $('#empath-mobile-menu').metisMenu(); 68 69 $('#empath-mobile-menu .dropdown > a').on('click', function (e) { 70 e.preventDefault(); 71 }); 72 73 $(".hamburger_menu").on("click", function (e) { 74 e.preventDefault(); 75 $(".slide-bar").toggleClass("show"); 76 $("body").addClass("on-side"); 77 $('.body-overlay').addClass('active'); 78 $(this).addClass('active'); 79 }); 80 81 $(".close-mobile-menu > a").on("click", function (e) { 82 e.preventDefault(); 83 $(".slide-bar").removeClass("show"); 84 $("body").removeClass("on-side"); 85 $('.body-overlay').removeClass('active'); 86 $('.hamburger_menu > a').removeClass('active'); 87 }); 88 89 $('.body-overlay').on('click', function () { 90 $(this).removeClass('active'); 91 $(".slide-bar").removeClass("show"); 92 $("body").removeClass("on-side"); 93 $('.hamburger-menu > a').removeClass('active'); 94 }); 95 if ($('.hidden-bar').length){ 96 //Menu Toggle Btn 97 $('.toggle-hidden-bar').on('click', function() { 98 $('body').addClass('active-hidden-bar'); 99 }); 100 101 //Menu Toggle Btn 102 $('.hidden-bar-back-drop, .hidden-bar .close-btn').on('click', function() { 103 $('body').removeClass('active-hidden-bar'); 104 }); 105 } 106 107 // Back to top 108 $(window).on('scroll', function() { 109 var scrolled = $(window).scrollTop(); 110 if (scrolled > 300) $('.back-top-btn').addClass('active'); 111 if (scrolled < 300) $('.back-top-btn').removeClass('active'); 112 }); 113 $('.back-top-btn').on('click', function() { 114 $('html, body').animate( 115 { 116 scrollTop: '0' 117 }, 118 1200 119 ); 120 }); 121 122 123 function ajax_active($scope, $) { 124 //One 125 var $container = $scope.find('.empath-post-grid-loadmore'); 126 if ($container.length > 0) { 127 $container.on('click',function(event){ 128 event.preventDefault(); 129 130 var $that = $(this); 131 var ajaxjsondata = $that.data('json_grid_meta'); 132 var empath_json_data = Object (ajaxjsondata); 133 134 var contentwrap = $scope.find('.grid-loadmore-content'), // item contentwrap 135 postperpage = parseInt(empath_json_data.posts_per_page), // post per page number 136 showallposts = parseInt(empath_json_data.total_post); // total posts count 137 138 var items = contentwrap.find('.pfy-grid-item'), 139 totalpostnumber = parseInt(items.length), 140 paged = parseInt( totalpostnumber / postperpage ) + 1; // paged number 141 142 $.ajax({ 143 url: empath_ajax.ajax_url, 144 type: 'POST', 145 data: { 146 action: 'empath_post_ajax_loading', 147 ajax_json_data: ajaxjsondata, 148 paged:paged 149 }, 150 beforeSend: function(){ 151 152 $('<i class="fa fa-spinner fa-spin" style="margin-left:10px"></i>').appendTo( "#empath-post-grid-loadmore" ).fadeIn(100); 153 }, 154 complete:function(){ 155 $scope.find('.empath-post-grid-loadmore .fa-spinner ').remove(); 156 } 157 }) 158 159 .done(function(data) { 160 161 var $pstitems = $(data); 162 $scope.find('.grid-loadmore-content').append( $pstitems ); 163 var newLenght = contentwrap.find('.pfy-grid-item').length; 164 165 if(showallposts <= newLenght){ 166 $scope.find('.empath-post-grid-loadmore').fadeOut(300,function(){ 167 $scope.find('.empath-post-grid-loadmore').remove(); 168 }); 169 } 170 171 }) 172 173 .fail(function() { 174 $scope.find('.empath-post-grid-loadmore').remove(); 175 }); 176 177 }); 178 } 179 180 //two 181 var $container = $scope.find('.empath-post-grid-loadmore-two'); 182 if ($container.length > 0) { 183 $container.on('click',function(event){ 184 event.preventDefault(); 185 186 var $that = $(this); 187 var ajaxjsondata = $that.data('json_grid_meta'); 188 var empath_json_data = Object (ajaxjsondata); 189 190 var contentwrap = $scope.find('.grid-loadmore-content-two'), // item contentwrap 191 postperpage = parseInt(empath_json_data.posts_per_page), // post per page number 192 showallposts = parseInt(empath_json_data.total_post); // total posts count 193 194 var items = contentwrap.find('.pfy-grid-item'), 195 totalpostnumber = parseInt(items.length), 196 paged = parseInt( totalpostnumber / postperpage ) + 1; // paged number 197 198 $.ajax({ 199 url: empath_ajax.ajax_url, 200 type: 'POST', 201 data: { 202 action: 'empath_post_ajax_loading_2', 203 ajax_json_data: ajaxjsondata, 204 paged:paged 205 }, 206 beforeSend: function(){ 207 208 $('<i class="fa fa-spinner fa-spin" style="margin-left:10px"></i>').appendTo( "#empath-post-grid-loadmore-two" ).fadeIn(100); 209 }, 210 complete:function(){ 211 $scope.find('.empath-post-grid-loadmore-two .fa-spinner ').remove(); 212 } 213 }) 214 215 .done(function(data) { 216 217 var $pstitems = $(data); 218 $scope.find('.grid-loadmore-content-two').append( $pstitems ); 219 var newLenght = contentwrap.find('.pfy-grid-item').length; 220 221 if(showallposts <= newLenght){ 222 $scope.find('.empath-post-grid-loadmore-two').fadeOut(300,function(){ 223 $scope.find('.empath-post-grid-loadmore-two').remove(); 224 }); 225 } 226 227 }) 228 229 .fail(function() { 230 $scope.find('.empath-post-grid-loadmore-two').remove(); 231 }); 232 233 }); 234 } 235 236 237 } 238 239 240 241 function testimonialActive($scope, $) { 242 243 var slider = new Swiper('.testimonial__active', { 244 "slidesPerView": 1, 245 "loop": true, 246 "speed": 2000, 247 "autoplay": { 248 "delay": 5000 249 }, 250 navigation: { 251 nextEl: ".testi-sl-nxt", 252 prevEl: ".testi-sl-prev" 253 }, 254 }); 255 } 256 257 258 function postSliderTwoActive($scope, $) { 259 var slider = new Swiper('.post_slider_two__active', { 260 "slidesPerView": 1, 261 "loop": true, 262 "speed": 2000, 263 "autoplay": { 264 "delay": 5000 265 }, 266 speed: 2000,
267 navigation: { 268 nextEl: ".testi-sl-nxt", 269 prevEl: ".testi-sl-prev" 270 }, 271 }); 272 } 273 function quoteSliderTwoActive($scope, $) { 274 var slider = new Swiper('.quoteslide__active', { 275 "slidesPerView": 1, 276 "loop": true, 277 "speed": 2000, 278 spaceBetween: 30, 279 "autoplay": { 280 "delay": 5000 281 }, 282 speed: 2000, 283 284 }); 285 } 286 287 /** 288 * Post Gallery Slider Active 289 * @param {Post gallery} $scope 290 * @param {*} $ 291 */ 292 function postGallerySliderActive($scope, $) { 293 $('.bytf__post__gallery-for').slick({ 294 slidesToShow: 1, 295 slidesToScroll: 1, 296 arrows: false, 297 fade: true, 298 asNavFor: '.bytf__post__gallery-nav' 299 }); 300 $('.bytf__post__gallery-nav').slick({ 301 slidesToShow: 4, 302 padding:10, 303 slidesToScroll: 1, 304 arrows: false, 305 asNavFor: '.bytf__post__gallery-for', 306 dots: false, 307 focusOnSelect: true, 308 responsive: [ 309 { 310 breakpoint: 991, 311 settings: { 312 slidesToShow: 3, 313 } 314 }, 315 { 316 breakpoint: 767, 317 settings: { 318 slidesToShow: 1, 319 } 320 } 321 ] 322 323 }); 324 } 325 326 function sliderThumbActive($scope, $) { 327 var sliderThumbnail = new Swiper('.post_slider_three__thumb', { 328 slidesPerView: 3, 329 freeMode: true, 330 spaceBetween: 36, 331 watchSlidesVisibility: true, 332 watchSlidesProgress: true, 333 334 // Add breakpoints for responsiveness 335 breakpoints: { 336 // When window width is >= 320px 337 320: { 338 slidesPerView: 1, 339 spaceBetween: 10, 340 }, 341 // When window width is >= 480px 342 480: { 343 slidesPerView: 1, 344 spaceBetween: 20, 345 }, 346 // When window width is >= 768px 347 768: { 348 slidesPerView: 2, 349 spaceBetween: 30, 350 }, 351 // When window width is >= 1024px 352 1024: { 353 slidesPerView: 3, 354 spaceBetween: 36, 355 } 356 } 357 }); 358 359 360 var slider = new Swiper('.post_slider_three__active', { 361 effect: "slide", 362 parallax: true, 363 speed: 1600, 364 autoplay: { 365 delay: 10000, 366 disableOnInteraction: false 367 }, 368 navigation: { 369 nextEl: '.swiper-button-next', 370 prevEl: '.swiper-button-prev', 371 }, 372 thumbs: { 373 swiper: sliderThumbnail 374 } 375 }); 376 377 //Slider Two 378 379 $('.slider-for').slick({ 380 slidesToShow: 1, 381 slidesToScroll: 1, 382 arrows: false, 383 fade: true, 384 asNavFor: '.slider-nav' 385 }); 386 $('.slider-nav').slick({ 387 slidesToShow: 5, 388 slidesToScroll: 1, 389 vertical:true, 390 arrows: false, 391 infinite: true, 392 centerMode: true, 393 asNavFor: '.slider-for', 394 dots: false, 395 focusOnSelect: true, 396 verticalSwiping:true, 397 responsive: [ 398 { 399 breakpoint: 992, 400 settings: { 401 vertical: false, 402 slidesToShow: 3, 403 } 404 }, 405 { 406 breakpoint: 768, 407 settings: { 408 vertical: false, 409 slidesToShow: 3, 410 } 411 }, 412 { 413 breakpoint: 580, 414 settings: { 415 vertical: false, 416 slidesToShow: 2, 417 } 418 }, 419 { 420 breakpoint: 380, 421 settings: { 422 vertical: false, 423 slidesToShow: 2, 424 } 425 } 426 ] 427 }); 428 429 } 430 431 $('.bytf_breaking_active').slick({ 432 slidesToScroll: 1, 433 arrows: true, 434 dots: false, 435 vertical: true, 436 verticalSwiping: true, 437 nextArrow: '', 438 prevArrow: '<i class="fal fa-angle-down"></i>', 439 }); 440 441 442 443 $('.bookmark-icon').on('click', function(e) { 444 e.preventDefault(); 445 446 var post_id = $(this).data('post-id'); 447 var $this = $(this); 448 449 $.ajax({ 450 type: 'POST', 451 url: bookmarkAjax.ajaxurl, 452 data: { 453 action: 'handle_bookmark', 454 post_id: post_id, 455 nonce: bookmarkAjax.nonce 456 }, 457 success: function(response) { 458 if (response.success) { 459 if (response.data === 'Bookmark added') { 460 $this.addClass('bookmarked'); 461 showToast(` 462 <div class="bookmark__content-wrp"> 463 <i class="fas fa-solid fa-check check"></i> 464 <div class="bokmark_msg_">
465 <span>Bookmark added</span> 466 </div> 467 </div> 468 `); 469 } else if (response.data === 'Bookmark removed') { 470 $this.removeClass('bookmarked'); 471 showToast( ` 472 <div class="bookmark__content-wrp"> 473 <i class="far fa-trash"></i> 474 <div class="bokmark_msg_"> 475 <span>Bookmark Removed</span> 476 </div> 477 </div> 478 `); 479 } 480 updateBookmarkCount(); 481 } else { 482 showToast(` 483 <div class="bookmark__content-wrp"> 484 <i class="fal fa-lock"></i> 485 <div class="bokmark_msg_"> 486 <span>Please login to add bookmark</span> 487 </div> 488 </div> 489 `); 490 } 491 } 492 }); 493 }); 494 495 function showToast(message) { 496 var $toast = $(` 497 <div class="toast"> ${message} </div> 498 `); 499 $('body').append($toast); 500 $toast.fadeIn(400).delay(2000).fadeOut(400, function() { 501 $(this).remove(); 502 }); 503 } 504 505 /** 506 * Dark Mode 507 */ 508 window.onload = function () { 509 // Dark 510 const toggleSwitch = document.querySelector( 511 '.empath-switch-box__input' 512 ); 513 const currentTheme = localStorage.getItem("theme"); 514 if (currentTheme) { 515 document.documentElement.setAttribute("data-theme", currentTheme); 516 if (currentTheme === "dark") { 517 toggleSwitch.checked = true; 518 } 519 } 520 function switchTheme(e) { 521 if (e.target.checked) { 522 document.documentElement.setAttribute("data-theme", "dark"); 523 localStorage.setItem("theme", "dark"); 524 } else { 525 document.documentElement.setAttribute("data-theme", "light"); 526 localStorage.setItem("theme", "light"); 527 } 528 } 529 if (toggleSwitch) { 530 toggleSwitch.addEventListener("change", switchTheme, false); 531 } 532 }; 533 534 $(function () { 535 /*var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-toggle="tooltip"]')) 536 var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) { 537 return new bootstrap.Tooltip(tooltipTriggerEl); 538 }); 539 */ 540 541 $('[data-toggle="tooltip"]').tooltip(); 542}) 543 function movingPost($scope, $) {
544 $(".post-ov-sroller").marquee({ 545 gap: 0, 546 speed: 80, 547 delayBeforeStart: 0, 548 direction: "left", 549 duplicated: true, 550 pauseOnHover: true, 551 startVisible: true, 552 }); 553 } 554 555 jQuery(function(){ 556 jQuery("#bgndVideo").YTPlayer(); 557 }); 558 559 560 561 562 $(window).on('elementor/frontend/init', function () { 563 elementorFrontend.hooks.addAction('frontend/element_ready/empath-post-ajax.default', ajax_active); 564 elementorFrontend.hooks.addAction('frontend/element_ready/empath-testimonial.default', testimonialActive); 565 elementorFrontend.hooks.addAction('frontend/element_ready/empath-post-slider.default', postSliderTwoActive); 566 elementorFrontend.hooks.addAction('frontend/element_ready/empath-post-galley.default', postGallerySliderActive); 567 elementorFrontend.hooks.addAction('frontend/element_ready/empath-post-slider-tw.default', sliderThumbActive); 568 elementorFrontend.hooks.addAction('frontend/element_ready/empath-post-moving.default', movingPost); 569 elementorFrontend.hooks.addAction('frontend/element_ready/empath-quote.default', quoteSliderTwoActive); 570 571 }); 572 573 574 575})(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.