1function tourm_content_load_scripts() {� 2 var $ = jQuery;� 3 "use strict";� 4 /*=================================� 5 JS Index Here� 6 ==================================*/� 7 /*� 8 01. On Load Function� 9 02. Preloader� 10 03. Mobile Menu� 11 04. Sticky fix� 12 05. Scroll To Top� 13 06. Set Background Image Color & Mask� 14 07. Global Slider� 15 08. Ajax Contact Form� 16 09. Search Box Popup� 17 10. Popup Sidemenu� 18 11. Magnific Popup� 19 12. Section Position� 20 13. Filter� 21 14. Counter Up� 22 15. Shape Mockup� 23 16. Progress Bar Animation � 24 17. Countdown� 25 18. Image to SVG Code� 26 00. Woocommerce Toggle� 27 00. Right Click Disable� 28 */� 29 /*=================================� 30 JS Index End� 31 ==================================*/� 32 /*� 33 � 34� 35 jQuery(document).ready(function() {� 36 // Replace "Trips" with "All Trekking Regions" in the h1 element� 37 if (jQuery('.breadcumb-title').text().trim() === 'Trips') {� 38 jQuery('.breadcumb-title').text('All Regions');� 39 }� 40� 41 // Replace "Trips" with "Treks" in the breadcrumb menu� 42 jQuery('.breadcumb-menu li').each(function() {� 43 if (jQuery(this).text().trim() === 'Trips') {� 44 jQuery(this).text('Treks');� 45 }� 46 });� 47 });� 48 � 49 /*---------- 03. Mobile Menu ----------*/� 50 $.fn.thmobilemenu = function (options) {� 51 var opt = $.extend({� 52 menuToggleBtn: ".th-menu-toggle",� 53 bodyToggleClass: "th-body-visible",� 54 subMenuClass: "th-submenu",� 55 subMenuParent: "menu-item-has-children",� 56 thSubMenuParent: "th-item-has-children",� 57 subMenuParentToggle: "th-active",� 58 meanExpandClass: "th-mean-expand",� 59 // appendElement: '<span class="th-mean-expand"></span>', � 60 subMenuToggleClass: "th-open",� 61 toggleSpeed: 400,� 62 },� 63 options� 64 );� 65� 66 return this.each(function () {� 67 var menu = $(this); // Select menu� 68� 69 // Menu Show & Hide� 70 function menuToggle() {� 71 menu.toggleClass(opt.bodyToggleClass);� 72� 73 // collapse submenu on menu hide or show� 74 var subMenu = "." + opt.subMenuClass;� 75 $(subMenu).each(function () {� 76 if ($(this).hasClass(opt.subMenuToggleClass)) {� 77 $(this).removeClass(opt.subMenuToggleClass);� 78 $(this).css("display", "none");� 79 $(this).parent().removeClass(opt.subMenuParentToggle);� 80 }� 81 });� 82 }� 83� 84 // Class Set Up for every submenu� 85 menu.find("." + opt.subMenuParent).each(function () {� 86 var submenu = $(this).find("ul");� 87 submenu.addClass(opt.subMenuClass);� 88 submenu.css("display", "none");� 89 $(this).addClass(opt.subMenuParent);� 90 $(this).addClass(opt.thSubMenuParent); // Add th-item-has-children class� 91 $(this).children("a").append(opt.appendElement);� 92 });� 93� 94 // Toggle Submenu� 95 function toggleDropDown($element) {� 96 var submenu = $element.children("ul");� 97 if (submenu.length > 0) {� 98 $element.toggleClass(opt.subMenuParentToggle);� 99 submenu.slideToggle(opt.toggleSpeed);� 100 submenu.toggleClass(opt.subMenuToggleClass);� 101 }� 102 }� 103� 104 // Submenu toggle Button� 105 var itemHasChildren = "." + opt.thSubMenuParent + " > a";� 106 $(itemHasChildren).each(function () {� 107 $(this).on("click", function (e) {� 108 e.preventDefault();� 109 toggleDropDown($(this).parent());� 110 });� 111 });� 112� 113 // Menu Show & Hide On Toggle Btn click� 114 $(opt.menuToggleBtn).each(function () {� 115 $(this).on("click", function () {� 116 menuToggle();� 117 });� 118 });� 119� 120 // Hide Menu On outside click� 121 menu.on("click", function (e) {� 122 e.stopPropagation();� 123 menuToggle();� 124 });� 125� 126 // Stop Hide full menu on menu click� 127 menu.find("div").on("click", function (e) {� 128 e.stopPropagation();� 129 });� 130 });� 131 };� 132� 133� 134 $(".th-menu-wrapper").thmobilemenu();� 135� 136 /*----------- 3. One Page Nav ----------*/� 137 function onePageNav(element) {� 138 if ($(element).length > 0) {� 139 $(element).each(function () {� 140 var link = $(this).find('a');� 141 $(this).find(link).each(function () {� 142 $(this).on('click', function () {� 143 var target = $(this.getAttribute('href'));� 144 if (target.length) {� 145 event.preventDefault();� 146 $('html, body').stop().animate({� 147 scrollTop: target.offset().top - 10� 148 }, 1000);� 149 };� 150� 151 });� 152 });� 153 })� 154 }� 155 };� 156 onePageNav('.onepage-nav');� 157 onePageNav('.scroll-down');� 158 //one page sticky menu � 159 $(window).on('scroll', function () {� 160 if ($('.onepage-nav').length > 0) {};� 161 });� 162� 163 /*---------- 04. Sticky fix ----------*/� 164 $(window).scroll(function () {� 165 var topPos = $(this).scrollTop();� 166 if (topPos > 500) {� 167 $('.sticky-wrapper').addClass('sticky');� 168 $('.category-menu').addClass('close-category');� 169 } else {� 170 $('.sticky-wrapper').removeClass('sticky')� 171 $('.category-menu').removeClass('close-category');� 172 }� 173 })� 174� 175 $(".menu-expand").each(function () {� 176 $(this).on("click", function (e) {� 177 e.preventDefault();� 178 $('.category-menu').toggleClass('open-category');� 179 });� 180 });� 181� 182 /*---------- 05. Scroll To Top ----------*/� 183 if ($('.scroll-top').length > 0) {� 184� 185 var scrollTopbtn = document.querySelector('.scroll-top');� 186 var progressPath = document.querySelector('.scroll-top path');� 187 var pathLength = progressPath.getTotalLength();� 188 progressPath.style.transition = progressPath.style.WebkitTransition = '
188none';� 189 progressPath.style.strokeDasharray = pathLength + ' ' + pathLength;� 190 progressPath.style.strokeDashoffset = pathLength;� 191 progressPath.getBoundingClientRect();� 192 progressPath.style.transition = progressPath.style.WebkitTransition = 'stroke-dashoffset 10ms linear';� 193 var updateProgress = function () {� 194 var scroll = $(window).scrollTop();� 195 var height = $(document).height() - $(window).height();� 196 var progress = pathLength - (scroll * pathLength / height);� 197 progressPath.style.strokeDashoffset = progress;� 198 }� 199 updateProgress();� 200 $(window).scroll(updateProgress);� 201 var offset = 50;� 202 var duration = 750;� 203 jQuery(window).on('scroll', function () {� 204 if (jQuery(this).scrollTop() > offset) {� 205 jQuery(scrollTopbtn).addClass('show');� 206 } else {� 207 jQuery(scrollTopbtn).removeClass('show');� 208 }� 209 });� 210 jQuery(scrollTopbtn).on('click', function (event) {� 211 event.preventDefault();� 212 jQuery('html, body').animate({� 213 scrollTop: 0� 214 }, duration);� 215 return false;� 216 })� 217 }� 218� 219 /*---------- 06. Set Background Image Color & Mask ----------*/� 220 if ($("[data-bg-src]").length > 0) {� 221 $("[data-bg-src]").each(function () {� 222 var src = $(this).attr("data-bg-src");� 223 $(this).css("background-image", "url(" + src + ")");� 224 $(this).removeAttr("data-bg-src").addClass("background-image");� 225 });� 226 }� 227� 228 if ($('[data-bg-color]').length > 0) {� 229 $('[data-bg-color]').each(function () {� 230 var color = $(this).attr('data-bg-color');� 231 $(this).css('background-color', color);� 232 $(this).removeAttr('data-bg-color');� 233 });� 234 };� 235� 236 $('[data-border]').each(function () {� 237 var borderColor = $(this).data('border');� 238 $(this).css('--th-border-color', borderColor);� 239 });� 240� 241 if ($('[data-mask-src]').length > 0) {� 242 $('[data-mask-src]').each(function () {� 243 var mask = $(this).attr('data-mask-src');� 244 $(this).css({� 245 'mask-image': 'url(' + mask + ')',� 246 '-webkit-mask-image': 'url(' + mask + ')'� 247 });� 248 $(this).addClass('bg-mask');� 249 $(this).removeAttr('data-mask-src');� 250 });� 251 };� 252� 253 /*----------- 07. Global Slider ----------*/� 254� 255 $('.th-slider').each(function () {� 256 var thSlider = $(this);� 257 var settings = $(this).data('slider-options');� 258� 259 // Store references to the navigation Slider� 260 var prevArrow = thSlider.find('.slider-prev');� 261 var nextArrow = thSlider.find('.slider-next');� 262 var paginationElN = thSlider.find('.slider-pagination.pagi-number');� 263 var paginationExternel = thSlider.siblings('.slider-controller').find('.slider-pagination');� 264� 265 var paginationEl = paginationExternel.length ? paginationExternel.get(0) : thSlider.find('.slider-pagination').get(0);� 266� 267 var paginationType = settings['paginationType'] ? settings['paginationType'] : 'bullets';� 268 var autoplayconditon = settings['autoplay'];� 269� 270 var sliderDefault = {� 271 slidesPerView: 1,� 272 spaceBetween: settings['spaceBetween'] || 24,� 273 loop: settings['loop'] !== false,� 274 speed: settings['speed'] || 1000,� 275 autoplay: autoplayconditon || {� 276 delay: 6000,� 277 disableOnInteraction: false� 278 },� 279 navigation: {� 280 nextEl: nextArrow.get(0),� 281 prevEl: prevArrow.get(0),� 282 },� 283 pagination: {� 284 el: paginationEl,� 285 type: paginationType,� 286 clickable: true,� 287 renderBullet: function (index, className) {� 288 var number = index + 1;� 289 var formattedNumber = number < 10 ? '0' + number : number;� 290 if (paginationElN.length) {� 291 return '<span class="' + className + ' number">' + formattedNumber + '</span>';� 292 } else {� 293 return '<span class="' + className + '" aria-label="Go to Slide ' + formattedNumber + '"></span>';� 294 }� 295 },� 296 formatFractionCurrent: function (number) {� 297 return number < 10 ? '0' + number : number;� 298 },� 299 formatFractionTotal: function (number) {� 300 return number < 10 ? '0' + number : number;� 301 }� 302 },� 303 // on: {� 304 // slideChange: function () {� 305 // setTimeout(function () {� 306 // swiper.params.mousewheel.releaseOnEdges = false;� 307 // }, 500);� 308 // },� 309 // reachEnd: function () {� 310 // setTimeout(function () {� 311 // swiper.params.mousewheel.releaseOnEdges = true;� 312 // }, 750);� 313 // }� 314 // }� 315 };� 316� 317� 318� 319� 320 � 321�
322 // var options = JSON.parse(thSlider.attr('data-slider-options'));� 323 // options = $.extend({}, sliderDefault, options);� 324 // var swiper = new Swiper(thSlider.get(0), options); � 325� 326� 327 var options = {};� 328 var dataOptions = thSlider && thSlider.attr ? thSlider.attr('data-slider-options') : null;� 329� 330 try {� 331 if (dataOptions) {� 332 options = JSON.parse(dataOptions);� 333 }� 334 } catch (e) {� 335 console.error("Invalid JSON in data-slider-options:", e);� 336 }� 337� 338 // 2. If thumbs.swiper is a selector, convert it to a Swiper instance� 339 if (options.thumbs && typeof options.thumbs.swiper === 'string') {� 340 try {� 341 options.thumbs.swiper = new Swiper(options.thumbs.swiper, {� 342 slidesPerView: 3,� 343 spaceBetween: 10,� 344 watchSlidesProgress: true� 345 });� 346 } catch (err) {� 347 console.error("Failed to initialize thumbs swiper:", err);� 348 }� 349 }� 350� 351 // 3. Merge with default options� 352 options = $.extend({}, sliderDefault, options);� 353� 354 // 4. Initialize main Swiper� 355 if (thSlider && thSlider.length > 0 && thSlider.get(0) !== null) {� 356 try {� 357 var swiper = new Swiper(thSlider.get(0), options);� 358 } catch (e) {� 359 console.error("Swiper initialization error:", e);� 360 }� 361 }� 362� 363� 364� 365 if ($('.slider-area').length > 0) {� 366 $('.slider-area').closest(".container").parent().addClass("arrow-wrap");� 367 }� 368� 369 // Category slider specific wheel effect� 370 if (thSlider.hasClass('categorySlider')) {� 371 const multiplier = {� 372 translate: 0.1,� 373 rotate: 0.01� 374 };� 375� 376 function calculateWheel() {� 377 const slides = document.querySelectorAll('.single');� 378 slides.forEach((slide) => {� 379 const rect = slide.getBoundingClientRect();� 380 const r = window.innerWidth * 0.5 - (rect.x + rect.width * 0.5);� 381 let ty = Math.abs(r) * multiplier.translate - rect.width * multiplier.translate;� 382� 383 if (ty < 0) {� 384 ty = 0;� 385 }� 386 const transformOrigin = r < 0 ? 'left top' : 'right top';� 387 slide.style.transform = `translate(0, ${ty}px) rotate(${-r * multiplier.rotate}deg)`;� 388 slide.style.transformOrigin = transformOrigin;� 389 });� 390 }� 391� 392 function raf() {� 393 requestAnimationFrame(raf);� 394 calculateWheel();� 395 }� 396� 397 raf();� 398 }� 399 });� 400� 401� 402� 403� 404 // Function to add animation classes� 405 function animationProperties() {� 406 $('[data-ani]').each(function () {� 407 var animationName = $(this).data('ani');� 408 $(this).addClass(animationName);� 409 });� 410� 411 $('[data-ani-delay]').each(function () {� 412 var delayTime = $(this).data('ani-delay');� 413 $(this).css('animation-delay', delayTime);� 414 });� 415 }� 416 animationProperties();� 417� 418 // Add click event handlers for external slider arrows based on data attributes� 419 $('[data-slider-prev], [data-slider-next]').on('click', function () {� 420 var sliderSelector = $(this).data('slider-prev') || $(this).data('slider-next');� 421 var targetSlider = $(sliderSelector);� 422� 423 if (targetSlider.length) {� 424 var swiper = targetSlider[0].swiper;� 425� 426 if (swiper) {� 427 if ($(this).data('slider-prev')) {� 428 swiper.slidePrev();� 429 } else {� 430 swiper.slideNext();� 431 }� 432 }� 433 }� 434 });� 435� 436 // Function to add animation classes� 437 function animationProperties() {� 438 $('[data-ani]').each(function () {� 439 var animationName = $(this).data('ani');� 440 $(this).addClass(animationName);� 441 });� 442� 443 $('[data-ani-delay]').each(function () {� 444 var delayTime = $(this).data('ani-delay');� 445 $(this).css('animation-delay', delayTime);� 446 });� 447 }� 448 animationProperties();� 449� 450 // Add click event handlers for external slider arrows based on data attributes�
451 $('[data-slider-prev], [data-slider-next]').on('click', function () {� 452 var sliderSelectors = ($(this).data('slider-prev') || $(this).data('slider-next')).split(', ');� 453� 454 sliderSelectors.forEach(function (sliderSelector) {� 455 var targetSlider = $(sliderSelector);� 456� 457 if (targetSlider.length) {� 458 var swiper = targetSlider[0].swiper;� 459� 460 if (swiper) {� 461 if ($(this).data('slider-prev')) {� 462 swiper.slidePrev();� 463 } else {� 464 swiper.slideNext();� 465 }� 466 }� 467 }� 468 });� 469 });� 470� 471� 472 var swiper = new Swiper(".heroThumbs", {� 473 spaceBetween: 10,� 474 slidesPerView: 2,� 475 loop: true,� 476 watchSlidesProgress: true,� 477 slideToClickedSlide: true,� 478 watchSlidesVisibility: true,� 479 centeredSlidesBounds: true,� 480 });� 481� 482 var swiper = new Swiper('.hero-slider-2', {� 483 spaceBetween: 10,� 484 thumbs: {� 485 swiper: swiper,� 486 },� 487 effect: "fade",� 488 pagination: {� 489 el: '.swiper-pagination',� 490 clickable: true� 491 },� 492 navigation: {� 493 nextEl: '.swiper-button-next',� 494 prevEl: '.swiper-button-prev'� 495 },� 496 autoplay: {� 497 delay: 6000,� 498 disableOnInteraction: false� 499 },� 500 loop: true,� 501 watchSlidesProgress: true� 502 });� 503� 504 /* hero-3 start */� 505 var swiper = new Swiper(".hero3Thumbs", {� 506 spaceBetween: 10,� 507 slidesPerView: 1,� 508 freeMode: true,� 509 watchSlidesProgress: true,� 510 });� 511 var swiper = new Swiper('.hero-slider-3', {� 512 thumbs: {� 513 swiper: swiper,� 514 },� 515 loop: true,� 516 effect: "fade",� 517 autoplay: {� 518 delay: 6000,� 519 disableOnInteraction: false� 520 },� 521 pagination: {� 522 el: '.swiper-pagination',� 523 type: 'fraction',� 524 formatFractionCurrent: function (number) {� 525 return '0' + number;� 526 }� 527 },� 528 navigation: {� 529 nextEl: '.swiper-button-next',� 530 prevEl: '.swiper-button-prev'� 531 }� 532 });� 533� 534 /* hero-3 end */� 535� 536 /* hero-6 start */� 537 var swiper = new Swiper(".hero6Thumbs", {� 538 spaceBetween: 3,� 539 slidesPerView: 1,� 540 freeMode: true,� 541 watchSlidesProgress: true,� 542 });� 543 var swiper = new Swiper('.hero-slider-6', {� 544 thumbs: {� 545 swiper: swiper,� 546 },� 547 loop: true,� 548 effect: "fade",� 549 autoplay: {� 550 delay: 6000,� 551 disableOnInteraction: false� 552 },� 553 pagination: {� 554 el: '.swiper-pagination',� 555 type: 'fraction',� 556 formatFractionCurrent: function (number) {� 557 return '' + number;� 558 }� 559 },� 560 navigation: {� 561 nextEl: '.swiper-button-next',� 562 prevEl: '.swiper-button-prev'� 563 }� 564 });� 565� 566 /* hero-6 end */� 567� 568 /* hero-6 start */� 569 var swiper = new Swiper(".hero6Thumbs", {� 570 spaceBetween: 3,� 571 slidesPerView: 1,� 572 freeMode: true,� 573 watchSlidesProgress: true,� 574 });� 575 var swiper = new Swiper('.hero-slider-6', {� 576 thumbs: {� 577 swiper: swiper,� 578 },� 579 loop: true,� 580 effect: "fade",� 581 autoplay: {� 582 delay: 6000,� 583 disableOnInteraction: false� 584 },� 585 pagination: {� 586 el: '.swiper-pagination',� 587 type: 'fraction',� 588 formatFractionCurrent: function (number) {� 589 return '' + number;� 590 }� 591 },� 592 navigation: {� 593 nextEl: '.swiper-button-next',� 594 prevEl: '.swiper-button-prev'� 595 }� 596 });� 597� 598 /* hero-6 end */� 599 /* hero-10 start */� 600 var swiper = new Swiper(".hero9Thumbs", {� 601 spaceBetween: 10,� 602 slidesPerView: 1,� 603 freeMode: true,� 604 watchSlidesProgress: true,� 605 });� 606 var swiper = new Swiper('.hero-slider-9', {� 607 thumbs: {� 608 swiper: swiper,� 609 },� 610 loop: true,� 611 effect: "fade",� 612 autoplay: {� 613 delay: 6000,� 614 disableOnInteraction: false� 615 },� 616 pagination: {� 617 el: '.swiper-pagination',� 618 type: 'fraction',� 619 formatFractionCurrent: function (number) {� 620 return '0' + number;� 621 }� 622 },� 623 navigation: {� 624 nextEl: '.swiper-button-next',� 625 prevEl: '.swiper-button-prev'� 626 }� 627 });� 628� 629 /* hero-3 end */� 630� 631 /* hero-10 start */� 632 var swiper = new Swiper(".hero10Thumbs", {� 633 spaceBetween: 10,� 634 slidesPerView: 3,� 635 freeMode: true,� 636 watchSlidesProgress: true,� 637 });� 638� 639 var swiper = new Swiper('.hero-slider-10', {� 640 spaceBetween: 10,� 641 thumbs: {� 642 swiper: swiper,� 643 },� 644 effect: "fade",� 645 pagination: {� 646 el: '.swiper-pagination',� 647 type: 'fraction',� 648 },� 649 navigation: {� 650 nextEl: '.swiper-button-next',� 651 prevEl: '.swiper-button-prev'� 652 },� 653 autoplay: {� 654 delay: 6000,� 655 disableOnInteraction: false� 656 },� 657 loop: true,� 658 watchSlidesProgress: true� 659 });� 660 /* hero-10 end */� 661� 662 var swiperLTR = new Swiper('.ltr-slider', {� 663 slidesPerView: 3,� 664 spaceBetween: 24,� 665 loop: true,� 666 speed: 4000,� 667 autoplay: {� 668 delay: 2,� 669 enabled: true,� 670 },� 671 breakpoints: {� 672 0: {� 673 slidesPerView: 1,� 674 spaceBetween: 16,� 675 },� 676 1200: {� 677 slidesPerView: 2,� 678 spaceBetween: 24,� 679 },� 680 1600: {� 681 slidesPerView: 3,� 682 spaceBetween: 24,� 683 },� 684 },� 685 });� 686� 687 var swiperRTL = new Swiper('.rtl-slider', {� 688 slidesPerView: 3,� 689 spaceBetween: 24,� 690 loop: true,� 691 speed: 3000,� 692 autoplay: {� 693 delay: 2,� 694 enabled: true,� 695 },�
696 rtl: true, // Set this for RTL direction� 697 breakpoints: {� 698 0: {� 699 slidesPerView: 1,� 700 spaceBetween: 16,� 701 },� 702 1200: {� 703 slidesPerView: 2,� 704 spaceBetween: 24,� 705 },� 706 1600: {� 707 slidesPerView: 3,� 708 spaceBetween: 24,� 709 },� 710 },� 711 });� 712� 713 // var swiperEl = document.querySelector('.swiper-container');� 714� 715 // swiperEl.addEventListener('mouseenter', function(event) {� 716 document.addEventListener('mouseenter', event => {� 717 const el = event.target;� 718 if (el && el.matches && el.matches('.swiper-container')) {� 719 // console.log('mouseenter');� 720 // console.log('autoplay running', swiper.autoplay.running);� 721 el.swiper.autoplay.stop();� 722 el.classList.add('swiper-paused');� 723� 724 const activeNavItem = el.querySelector('.swiper-pagination-bullet-active');� 725 activeNavItem.style.animationPlayState = "paused";� 726 }� 727 }, true);� 728� 729 document.addEventListener('mouseleave', event => {� 730 // console.log('mouseleave', swiper.activeIndex, swiper.slides[swiper.activeIndex].progress);� 731 // console.log('autoplay running', swiper.autoplay.running);� 732 const el = event.target;� 733 if (el && el.matches && el.matches('.swiper-container')) {� 734 el.swiper.autoplay.start();� 735 el.classList.remove('swiper-paused');� 736� 737 const activeNavItem = el.querySelector('.swiper-pagination-bullet-active');� 738� 739 activeNavItem.classList.remove('swiper-pagination-bullet-active');�
740 // activeNavItem.style.animation = 'none';� 741� 742 setTimeout(() => {� 743 activeNavItem.classList.add('swiper-pagination-bullet-active');� 744 // activeNavItem.style.animation = '';� 745 }, 10);� 746 }� 747 }, true);� 748� 749� 750 /* category slider 2 start ---------------------*/� 751 $(document).ready(function () {� 752 $('.categorySlider2').each(function () {� 753 const multiplier = {� 754 translate: .1,� 755 rotate: .0� 756 }� 757� 758 new Swiper('.categorySlider2', {� 759 slidesPerView: 'auto',� 760 slidesPerView: 5,� 761 spaceBetween: 60,� 762 centeredSlides: true,� 763 loop: true,� 764 grabCursor: true,� 765 pagination: {� 766 el: ".swiper-pagination",� 767 clickable: true,� 768 },� 769 breakpoints: {� 770 300: {� 771 slidesPerView: 1,� 772 spaceBetween: 30� 773 },� 774 600: {� 775 slidesPerView: 2,� 776 spaceBetween: 30� 777 },� 778 768: {� 779 slidesPerView: 3,� 780 spaceBetween: 30� 781 },� 782 1024: {� 783 slidesPerView: 4,� 784 spaceBetween: 40� 785 },� 786 1280: {� 787 slidesPerView: 5,� 788 spaceBetween: 60� 789 }� 790 }� 791 });� 792� 793 function calculateWheel() {� 794 const slides = document.querySelectorAll('.single2')� 795 slides.forEach((slide, i) => {� 796 const rect = slide.getBoundingClientRect()� 797 const r = window.innerWidth * .5 - (rect.x + rect.width * .5)� 798 let ty = Math.abs(r) * multiplier.translate - rect.width * multiplier.translate� 799� 800 if (ty < 0) {� 801 ty = 0� 802 }� 803 const transformOrigin = r < 0 ? 'left top' : 'right top'� 804 slide.style.transform = `translate(0, ${ty}px) rotate(${-r * multiplier.rotate}deg)`� 805 slide.style.transformOrigin = transformOrigin� 806 })� 807 }� 808� 809 function raf() {� 810 requestAnimationFrame(raf)� 811 calculateWheel()� 812 }� 813� 814 raf();� 815 });� 816 });� 817� 818� 819� 820 /* category slider 3 start ---------------------*/� 821� 822 /* category slider 2 start ---------------------*/� 823 $(document).ready(function () {� 824 $('.categorySlider6').each(function () {� 825 const multiplier = {� 826 translate: .1,� 827 rotate: .0� 828 }� 829� 830 new Swiper('.categorySlider6', {� 831 slidesPerView: 'auto',� 832 slidesPerView: 5,� 833 spaceBetween: 30,� 834 centeredSlides: true,� 835 loop: true,� 836 grabCursor: true,� 837 pagination: {� 838 el: ".swiper-pagination",� 839 type: "progressbar",� 840 },� 841 breakpoints: {� 842 300: {� 843 slidesPerView: 1,� 844 spaceBetween: 30� 845 },� 846 575: {� 847 slidesPerView: 2,� 848 spaceBetween: 30� 849 },� 850 1024: {� 851 slidesPerView: 3,� 852 spaceBetween: 30� 853 },� 854 1200: {� 855 slidesPerView: 4,� 856 spaceBetween: 30� 857 },� 858 1380: {� 859 slidesPerView: 5,� 860 spaceBetween: 30� 861 }� 862 }� 863 });� 864� 865 function calculateWheel() {� 866 const slides = document.querySelectorAll('.single2')�
867 slides.forEach((slide, i) => {� 868 const rect = slide.getBoundingClientRect()� 869 const r = window.innerWidth * .5 - (rect.x + rect.width * .5)� 870 let ty = Math.abs(r) * multiplier.translate - rect.width * multiplier.translate� 871� 872 if (ty < 0) {� 873 ty = 0� 874 }� 875 const transformOrigin = r < 0 ? 'left top' : 'right top'� 876 slide.style.transform = `translate(0, ${ty}px) rotate(${-r * multiplier.rotate}deg)`� 877 slide.style.transformOrigin = transformOrigin� 878 })� 879 }� 880� 881 function raf() {� 882 requestAnimationFrame(raf)� 883 calculateWheel()� 884 }� 885� 886 raf();� 887 });� 888 });� 889� 890 /* category slider 2 end ---------------------*/� 891� 892 /*-------------- 09. Custom destination Slider -------------*/� 893 $('.destination-list-wrap').on('click', function () {� 894 $(this).addClass('active').siblings().removeClass('active');� 895 });� 896� 897 function showNextdestination() {� 898 var $activedestination = $('.destination-list-area .destination-list-wrap.active');� 899 if ($activedestination.next().length > 0) {� 900 $activedestination.removeClass('active');� 901 $activedestination.next().addClass('active');� 902 } else {� 903 $activedestination.removeClass('active');� 904 $('.destination-list-area .destination-list-wrap:first').addClass('active');� 905 }� 906 }� 907� 908 function showPreviousdestination() {� 909 var $activedestination = $('.destination-list-area .destination-list-wrap.active');� 910 if ($activedestination.prev().length > 0) {� 911 $activedestination.removeClass('active');� 912 $activedestination.prev().addClass('active');� 913 } else {� 914 $activedestination.removeClass('active');� 915 $('.destination-list-area .destination-list-wrap:last').addClass('active');� 916 }� 917 }� 918 $('.destination-prev').on('click', function () {� 919 showPreviousdestination();� 920 });� 921 $('.destination-next').on('click', function () {� 922 showNextdestination();� 923 });� 924� 925� 926� 927� 928 // Show the first tab and hide the rest� 929 $('.accordion-item-wrapp li:first-child').addClass('active');� 930 $('.according-img-tab').hide();� 931 $('.according-img-tab:first').show();� 932� 933 // Click function� 934 $('.accordion-item-wrapp .accordion-item-content').mouseenter(function () {� 935 $('.accordion-item-wrapp .accordion-item-content').removeClass('active');� 936 // $(this).addClass('active');� 937 $('.according-img-tab').hide();� 938� 939 var activeTab = $(this).find('.accordion-tab-item').attr('data-bs-target');� 940 $(activeTab).fadeIn();� 941 return false;� 942 });� 943� 944� 945 $(document).on('mouseover', '.hover-item', function () {� 946 $(this).addClass('item-active');� 947 $('.hover-item').removeClass('item-active');� 948 $(this).addClass('item-active');� 949 });� 950 // Function to add animation classes� 951 function animationProperties() {� 952 $('[data-ani]').each(function () {� 953 var animationName = $(this).data('ani');� 954 $(this).addClass(animationName);� 955 });� 956� 957 $('[data-ani-delay]').each(function () {� 958 var delayTime = $(this).data('ani-delay');� 959 $(this).css('animation-delay', delayTime);� 960 });� 961 }� 962 animationProperties();� 963� 964 // Add click event handlers for external slider arrows based on data attributes� 965 $('[data-slider-prev], [data-slider-next]').on('click', function () {� 966 var sliderSelector = $(this).data('slider-prev') || $(this).data('slider-next');� 967 var targetSlider = $(sliderSelector);� 968� 969 if (targetSlider.length) {� 970 var swiper = targetSlider[0].swiper;� 971� 972 if (swiper) {� 973 if ($(this).data('slider-prev')) {� 974 swiper.slidePrev();� 975 } else {� 976 swiper.slideNext();� 977 }� 978 }� 979 }� 980 });� 981� 982� 983� 984� 985 /*-------------- 08. Slider Tab -------------*/� 986 $.fn.activateSliderThumbs = function (options) {� 987 var opt = $.extend({� 988 sliderTab: false,� 989 tabButton: ".tab-btn",� 990 },� 991 options� 992 );� 993� 994 return this.each(function () {� 995 var $container = $(this);� 996 var $thumbs = $container.find(opt.tabButton);� 997 var $line = $('<span class="indicator"></span>').appendTo($container);� 998� 999 var sliderSelector = $container.data("slider-tab");� 1000 var $slider = $(sliderSelector);� 1001� 1002 var swiper = $slider[0].swiper;� 1003� 1004 $thumbs.on("click", function (e) {� 1005 e.preventDefault();� 1006 var clickedThumb = $(this);� 1007� 1008 clickedThumb.addClass("active").siblings().removeClass("active");� 1009 linePos(clickedThumb, $container);� 1010� 1011 clickedThumb.prevAll(opt.tabButton).addClass('list-active');� 1012 clickedThumb.nextAll(opt.tabButton).removeClass('list-active');� 1013� 1014 if (opt.sliderTab) {� 1015 var slideIndex = clickedThumb.index();� 1016 swiper.slideTo(slideIndex);� 1017 }� 1018 });� 1019� 1020 if (opt.sliderTab) {� 1021 swiper.on("slideChange", function () {� 1022 var activeIndex = swiper.realIndex;� 1023 var $activeThumb = $thumbs.eq(activeIndex);� 1024� 1025 $activeThumb.addClass("active").siblings().removeClass("active");� 1026 linePos($activeThumb, $container);� 1027� 1028 $activeThumb.prevAll(opt.tabButton).addClass('list-active');� 1029 $activeThumb.nextAll(opt.tabButton).removeClass('list-active');� 1030 });� 1031� 1032 var initialSlideIndex = swiper.activeIndex;� 1033 var $initialThumb = $thumbs.eq(initialSlideIndex);� 1034 $initialThumb.addClass("active").siblings().removeClass("active");� 1035 linePos($initialThumb, $container);� 1036� 1037 $initialThumb.prevAll(opt.tabButton).addClass('list-active');� 1038 $initialThumb.nextAll(opt.tabButton).removeClass('list-active');� 1039 }� 1040� 1041 function linePos($activeThumb) {� 1042 var thumbOffset = $activeThumb.position();� 1043� 1044 var marginTop = parseInt($activeThumb.css('margin-top')) || 0;� 1045 var marginLeft = parseInt($activeThumb.css('margin-left')) || 0;� 1046� 1047 $line.css("--height-set", $activeThumb.outerHeight() + "px");� 1048 $line.css("--width-set", $activeThumb.outerWidth() + "px");� 1049 $line.css("--pos-y", thumbOffset.top + marginTop + "px");� 1050 $line.css("--pos-x", thumbOffset.left + marginLeft + "px");� 1051 }� 1052 });� 1053 };� 1054� 1055 if ($(".product-thumb").length) {� 1056 $(".product-thumb").activateSliderThumbs({� 1057 sliderTab: true,� 1058 tabButton: ".tab-btn",� 1059 });� 1060 }� 1061� 1062 if ($(".team-thumb").length) {� 1063 $(".team-thumb").activateSliderThumbs({� 1064 sliderTab: true,� 1065 tabButton: ".tab-btn",� 1066 });� 1067 }� 1068� 1069 if ($(".testi-thumb").length) {� 1070 $(".testi-thumb").activateSliderThumbs({� 1071 sliderTab: true,� 1072 tabButton: ".tab-btn",� 1073 });� 1074 }� 1075 if ($(".testi-thumb2").length) {� 1076 $(".testi-thumb2").activateSliderThumbs({� 1077 sliderTab: true,� 1078 tabButton: ".tab-btn",� 1079 });� 1080 }� 1081� 1082� 1083� 1084 /*----------- 08. Ajax Contact Form ----------*/� 1085 var form = ".ajax-contact";� 1086 var invalidCls = "is-invalid";� 1087 var $email = '[name="email"]';� 1088 var $validation =� 1089 '[name="name"],[name="email"],[name="subject"],[name="number"],[name="message"]'; // Must be use (,) without any space� 1090 var formMessages = $(".form-messages");� 1091� 1092 function sendContact() {� 1093 var formData = $(form).serialize();�
1094 var valid;� 1095 valid = validateContact();� 1096 if (valid) {� 1097 jQuery� 1098 .ajax({� 1099 url: $(form).attr("action"),� 1100 data: formData,� 1101 type: "POST",� 1102 })� 1103 .done(function (response) {� 1104 // Make sure that the formMessages div has the 'success' class.� 1105 formMessages.removeClass("error");� 1106 formMessages.addClass("success");� 1107 // Set the message text.� 1108 formMessages.text(response);� 1109 // Clear the form.� 1110 $(� 1111 form +� 1112 ' input:not([type="submit"]),' +� 1113 form +� 1114 " textarea"� 1115 ).val("");� 1116 })� 1117 .fail(function (data) {� 1118 // Make sure that the formMessages div has the 'error' class.� 1119 formMessages.removeClass("success");� 1120 formMessages.addClass("error");� 1121 // Set the message text.� 1122 if (data.responseText !== "") {� 1123 formMessages.html(data.responseText);� 1124 } else {� 1125 formMessages.html(� 1126 "Oops! An error occured and your message could not be sent."� 1127 );� 1128 }� 1129 });� 1130 }� 1131 }� 1132� 1133 function validateContact() {� 1134 var valid = true;� 1135 var formInput;� 1136� 1137 function unvalid($validation) {� 1138 $validation = $validation.split(",");� 1139 for (var i = 0; i < $validation.length; i++) {� 1140 formInput = form + " " + $validation[i];� 1141 if (!$(formInput).val()) {� 1142 $(formInput).addClass(invalidCls);� 1143 valid = false;� 1144 } else {� 1145 $(formInput).removeClass(invalidCls);� 1146 valid = true;� 1147 }� 1148 }� 1149 }� 1150 unvalid($validation);� 1151� 1152 if (� 1153 !$($email).val() ||� 1154 !$($email)� 1155 .val()� 1156 .match(/^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/)� 1157 ) {� 1158 $($email).addClass(invalidCls);� 1159 valid = false;� 1160 } else {� 1161 $($email).removeClass(invalidCls);� 1162 valid = true;� 1163 }� 1164 return valid;� 1165 }� 1166� 1167 $(form).on("submit", function (element) {� 1168 element.preventDefault();� 1169 sendContact();� 1170 });� 1171� 1172 /*---------- 09. Search Box Popup ----------*/� 1173 function popupSarchBox($searchBox, $searchOpen, $searchCls, $toggleCls) {� 1174 $($searchOpen).on("click", function (e) {� 1175 e.preventDefault();� 1176 $($searchBox).addClass($toggleCls);� 1177 });� 1178 $($searchBox).on("click", function (e) {� 1179 e.stopPropagation();� 1180 $($searchBox).removeClass($toggleCls);� 1181 });� 1182 $($searchBox)� 1183 .find("form")� 1184 .on("click", function (e) {� 1185 e.stopPropagation();� 1186 $($searchBox).addClass($toggleCls);� 1187 });� 1188 $($searchCls).on("click", function (e) {� 1189 e.preventDefault();� 1190 e.stopPropagation();� 1191 $($searchBox).removeClass($toggleCls);� 1192 });� 1193 }� 1194 popupSarchBox(".popup-search-box", ".searchBoxToggler", ".searchClose", "show");� 1195� 1196 /*---------- 10. Popup Sidemenu ----------*/� 1197 function popupSideMenu($sideMenu, $sideMunuOpen, $sideMenuCls, $toggleCls) {� 1198 // Sidebar Popup� 1199 $($sideMunuOpen).on('click', function (e) {� 1200 e.preventDefault();� 1201 $($sideMenu).addClass($toggleCls);� 1202 });� 1203 $($sideMenu).on('click', function (e) {� 1204 e.stopPropagation();� 1205 $($sideMenu).removeClass($toggleCls)� 1206 });� 1207 var sideMenuChild = $sideMenu + ' > div';� 1208 $(sideMenuChild).on('click', function (e) {� 1209 e.stopPropagation();� 1210 $($sideMenu).addClass($toggleCls)� 1211 });� 1212 $($sideMenuCls).on('click', function (e) {� 1213 e.preventDefault();� 1214 e.stopPropagation();� 1215 $($sideMenu).removeClass($toggleCls);� 1216 });� 1217 };� 1218 popupSideMenu('.sidemenu-wrapper', '.sideMenuToggler', '.sideMenuCls', 'show');� 1219� 1220 /*---------- 10. Popup Sidemenu ----------*/� 1221 function popupSideMenu($sideMenu2, $sideMunuOpen2, $sideMenuCls2, $toggleCls2) {� 1222 // Sidebar Popup� 1223 $($sideMunuOpen2).on('click', function (e) {� 1224 e.preventDefault();� 1225 $($sideMenu2).addClass($toggleCls2);� 1226 });� 1227 $($sideMenu2).on('click', function (e) {� 1228 e.stopPropagation();� 1229 $($sideMenu2).removeClass($toggleCls2)� 1230 });� 1231 var sideMenuChild = $sideMenu2 + ' > div';� 1232 $(sideMenuChild).on('click', function (e) {� 1233 e.stopPropagation();� 1234 $($sideMenu2).addClass($toggleCls2)� 1235 });� 1236 $($sideMenuCls2).on('click', function (e) {� 1237 e.preventDefault();� 1238 e.stopPropagation();� 1239 $($sideMenu2).removeClass($toggleCls2);� 1240 });� 1241 };� 1242 popupSideMenu('.shopping-cart', '.sideMenuToggler2', '.sideMenuCls', 'show');� 1243� 1244� 1245 /*----------- 11. Magnific Popup ----------*/� 1246 /* magnificPopup img view */� 1247 $(".popup-image").magnificPopup({� 1248 type: "image",� 1249 mainClass: 'mfp-zoom-in',� 1250 removalDelay: 260,� 1251 gallery: {� 1252 enabled: true,� 1253 },� 1254 });� 1255� 1256 /* magnificPopup video view */� 1257 $(".popup-video").magnificPopup({� 1258 type: "iframe",� 1259 });� 1260� 1261 /* magnificPopup video view */� 1262 $(".popup-content").magnificPopup({� 1263 type: "inline",� 1264 midClick: true,� 1265 });� 1266� 1267 //Image Reveal Animation� 1268 if ($('.th-anim').length) {� 1269 gsap.registerPlugin(ScrollTrigger);� 1270 let revealContainers = document.querySelectorAll(".th-anim");�
1271 revealContainers.forEach((container) => {� 1272 let image = container.querySelector("img");� 1273 let tl = gsap.timeline({� 1274 scrollTrigger: {� 1275 trigger: container,� 1276 toggleActions: "play none none none"� 1277 }� 1278 });� 1279 tl.set(container, {� 1280 autoAlpha: 1� 1281 });� 1282 tl.from(container, 1.5, {� 1283 xPercent: -100,� 1284 ease: Power2.out� 1285 });� 1286 tl.from(image, 1.5, {� 1287 xPercent: 100,� 1288 scale: 1.3,� 1289 delay: -1.5,� 1290 ease: Power2.out� 1291 });� 1292 });� 1293 }� 1294� 1295� 1296� 1297 // /*----------- Gsap Animation ----------*/� 1298 if ($('.cursor-follower').length > 0) {� 1299 var follower = $(".cursor-follower");� 1300� 1301 var posX = 0,� 1302 posY = 0;� 1303� 1304 var mouseX = 0,� 1305 mouseY = 0;� 1306� 1307 TweenMax.to({}, 0.016, {� 1308 repeat: -1,� 1309 onRepeat: function () {� 1310 posX += (mouseX - posX) / 9;� 1311 posY += (mouseY - posY) / 9;� 1312� 1313 TweenMax.set(follower, {� 1314 css: {� 1315 left: posX - 12,� 1316 top: posY - 12� 1317 }� 1318 });� 1319 }� 1320 });� 1321� 1322 $(document).on("mousemove", function (e) {� 1323 mouseX = e.clientX;� 1324 mouseY = e.clientY;� 1325 });� 1326 //circle� 1327 $(".slider-area").on("mouseenter", function () {� 1328 follower.addClass("d-none");� 1329 });� 1330 $(".slider-area").on("mouseleave", function () {� 1331 follower.removeClass("d-none");� 1332 });� 1333 }� 1334� 1335� 1336 const cursor = document.querySelector(".slider-drag-cursor");� 1337 const pos = {� 1338 x: window.innerWidth / 2,� 1339 y: window.innerHeight / 2� 1340 };� 1341 const mouse = {� 1342 x: pos.x,� 1343 y: pos.y� 1344 };� 1345 const speed = 1;� 1346� 1347 const xSet = gsap.quickSetter(cursor, "x", "px");� 1348 const ySet = gsap.quickSetter(cursor, "y", "px");� 1349� 1350 window.addEventListener("pointermove", e => {� 1351 mouse.x = e.x;� 1352 mouse.y = e.y;� 1353 });� 1354� 1355 gsap.set(".slider-drag-cursor", {� 1356 xPercent: -50,� 1357 yPercent: -50� 1358 });� 1359 gsap.ticker.add(() => {� 1360 const dt = 1.0 - Math.pow(1.0 - speed, gsap.ticker.deltaRatio());� 1361 pos.x += (mouse.x - pos.x) * dt;� 1362 pos.y += (mouse.y - pos.y) * dt;� 1363 xSet(pos.x);� 1364 ySet(pos.y);� 1365 });� 1366� 1367� 1368 $(".slider-drag-wrap").hover(function () {� 1369 $('.slider-drag-cursor').addClass('active');� 1370 }, function () {� 1371 $('.slider-drag-cursor').removeClass('active');� 1372 });� 1373� 1374 $(".slider-drag-wrap a").hover(function () {� 1375 $('.slider-drag-cursor').removeClass('active');� 1376 }, function () {� 1377 $('.slider-drag-cursor').addClass('active');� 1378 });� 1379 /* cursor area end */� 1380� 1381 /*---------- 12. Section Position ----------*/� 1382 // Interger Converter� 1383 function convertInteger(str) {� 1384 return parseInt(str, 10);� 1385 }� 1386� 1387 $.fn.sectionPosition = function (mainAttr, posAttr) {� 1388 $(this).each(function () {� 1389 var section = $(this);� 1390� 1391 function setPosition() {� 1392 var sectionHeight = Math.floor(section.height() / 2), // Main Height of section� 1393 posData = section.attr(mainAttr), // where to position� 1394 posFor = section.attr(posAttr), // On Which section is for positioning� 1395 topMark = "top-half", // Pos top� 1396 bottomMark = "bottom-half", // Pos Bottom� 1397 parentPT = convertInteger($(posFor).css("padding-top")), // Default Padding of parent� 1398 parentPB = convertInteger($(posFor).css("padding-bottom")); // Default Padding of parent� 1399� 1400 if (posData === topMark) {� 1401 $(posFor).css(� 1402 "padding-bottom",� 1403 parentPB + sectionHeight + "px"� 1404 );� 1405 section.css("margin-top", "-" + sectionHeight + "px");� 1406 } else if (posData === bottomMark) {� 1407 $(posFor).css(� 1408 "padding-top",� 1409 parentPT + sectionHeight + "px"� 1410 );� 1411 section.css("margin-bottom", "-" + sectionHeight + "px");� 1412 }� 1413 }� 1414 setPosition(); // Set Padding On Load� 1415 });� 1416 };� 1417� 1418 var postionHandler = "[data-sec-pos]";� 1419 if ($(postionHandler).length) {� 1420 $(postionHandler).imagesLoaded(function () {� 1421 $(postionHandler).sectionPosition("data-sec-pos", "data-pos-for");� 1422 });� 1423 }� 1424� 1425 /*---------- 22. Circle Progress ----------*/� 1426 function animateElements() {� 1427 $('.feature-circle .progressbar').each(function () {� 1428 var pathColor = $(this).attr('data-path-color');� 1429 var elementPos = $(this).offset().top;� 1430 var topOfWindow = $(window).scrollTop();� 1431 var percent = $(this).find('.circle').attr('data-percent');� 1432 var percentage = parseInt(percent, 10) / parseInt(100, 10);� 1433 var animate = $(this).data('animate');� 1434 if (elementPos < topOfWindow + $(window).height() - 30 && !animate) {� 1435 $(this).data('animate', true);�
1436 $(this).find('.circle').circleProgress({� 1437 startAngle: -Math.PI / 2,� 1438 value: percent / 100,� 1439 size: 100,� 1440 thickness: 8,� 1441 emptyFill: "#E4E4E4",� 1442 lineCap: 'round',� 1443 fill: {� 1444 color: pathColor,� 1445 }� 1446 }).on('circle-animation-progress', function (event, progress, stepValue) {� 1447 $(this).find('.circle-num').text((stepValue * 100).toFixed(0) + "%");� 1448 }).stop();� 1449 }� 1450 });� 1451� 1452 $('.about-circle .progressbar').each(function () {� 1453 var elementPos = $(this).offset().top;� 1454 var topOfWindow = $(window).scrollTop();� 1455 var percent = $(this).find('.circle').attr('data-percent');� 1456 var percentage = parseInt(percent, 10) / parseInt(100, 10);� 1457 var animate = $(this).data('animate');� 1458 if (elementPos < topOfWindow + $(window).height() - 30 && !animate) {� 1459 $(this).data('animate', true);� 1460 $(this).find('.circle').circleProgress({� 1461 startAngle: -Math.PI / 2,� 1462 value: percent / 100,� 1463 size: 160,� 1464 thickness: 6,� 1465 emptyFill: "#ffffff33",� 1466 lineCap: 'round',� 1467 fill: {� 1468 gradient: ["#F8BC22", "#F8BC22"]� 1469 }� 1470 }).on('circle-animation-progress', function (event, progress, stepValue) {� 1471 $(this).find('.circle-num').text((stepValue * 100).toFixed(0) + "%");� 1472 }).stop();� 1473 }� 1474 });� 1475 }� 1476� 1477� 1478 // Show animated elements� 1479 animateElements();� 1480 $(window).scroll(animateElements);� 1481� 1482 /*----------- 15. Filter ----------*/� 1483 $(".filter-active").imagesLoaded(function () {� 1484 var $filter = ".filter-active",� 1485 $filterItem = ".filter-item",� 1486 $filterMenu = ".filter-menu-active";� 1487� 1488 if ($($filter).length > 0) {� 1489 var $grid = $($filter).isotope({� 1490 itemSelector: $filterItem,� 1491 filter: "*",� 1492 masonry: {� 1493 // use outer width of grid-sizer for columnWidth� 1494 columnWidth: 1,� 1495 },� 1496 });� 1497� 1498 // filter items on button click� 1499 $($filterMenu).on("click", "button", function () {� 1500 var filterValue = $(this).attr("data-filter");� 1501 $grid.isotope({� 1502 filter: filterValue,� 1503 });� 1504 });� 1505� 1506 // Menu Active Class� 1507 $($filterMenu).on("click", "button", function (event) {� 1508 event.preventDefault();� 1509 $(this).addClass("active");� 1510 $(this).siblings(".active").removeClass("active");� 1511 });� 1512 }� 1513 });� 1514� 1515 $(".masonary-active").imagesLoaded(function () {� 1516 var $filter = ".masonary-active",� 1517 $filterItem = ".filter-item";� 1518� 1519 if ($($filter).length > 0) {� 1520 $($filter).isotope({� 1521 itemSelector: $filterItem,� 1522 filter: "*",� 1523 masonry: {� 1524 // use outer width of grid-sizer for columnWidth� 1525 columnWidth: 1,� 1526 },� 1527 });� 1528 }� 1529 });� 1530� 1531 $(".masonary-active, .woocommerce-Reviews .comment-list").imagesLoaded(function () {� 1532 var $filter = ".masonary-active, .woocommerce-Reviews .comment-list",� 1533 $filterItem = ".filter-item, .woocommerce-Reviews .comment-list li";� 1534� 1535 if ($($filter).length > 0) {� 1536 $($filter).isotope({� 1537 itemSelector: $filterItem,� 1538 filter: "*",� 1539 masonry: {� 1540 // use outer width of grid-sizer for columnWidth� 1541 columnWidth: 1,� 1542 },� 1543 });� 1544 }� 1545 $('[data-bs-toggle="tab"]').on('shown.bs.tab', function (e) {� 1546 $($filter).isotope({� 1547 filter: "*",� 1548 });� 1549 });� 1550 });� 1551� 1552 /*----------- 14. Counter Up ----------*/� 1553 $(".counter-number").counterUp({� 1554 delay: 10,� 1555 time: 1000,� 1556 });� 1557� 1558� 1559 /*----------- 15. Shape Mockup ----------*/� 1560 $.fn.shapeMockup = function () {� 1561 var $shape = $(this);� 1562 $shape.each(function() {� 1563 var $currentShape = $(this),� 1564 shapeTop = $currentShape.data('top'),� 1565 shapeRight = $currentShape.data('right'),� 1566 shapeBottom = $currentShape.data('bottom'),� 1567 shapeLeft = $currentShape.data('left');� 1568 $currentShape.css({� 1569 top: shapeTop,� 1570 right: shapeRight,� 1571 bottom: shapeBottom,� 1572 left: shapeLeft,� 1573 }).removeAttr('data-top')� 1574 .removeAttr('data-right')� 1575 .removeAttr('data-bottom')� 1576 .removeAttr('data-left')� 1577 .closest('.elementor-widget').css('position', 'static')� 1578 .closest('.e-parent').addClass('shape-mockup-wrap');� 1579 });� 1580 };� 1581� 1582 if ($('.shape-mockup')) {� 1583 $('.shape-mockup').shapeMockup();� 1584 }� 1585� 1586 /*----------- 16. Progress Bar Animation ----------*/� 1587 $('.progress-bar').waypoint(function () {�
1588 $('.progress-bar').css({� 1589 animation: "animate-positive 1.8s",� 1590 opacity: "1"� 1591 });� 1592 }, {� 1593 offset: '75%'� 1594 });� 1595� 1596 /*----------- 17. Countdown ----------*/� 1597� 1598 $.fn.countdown = function () {� 1599 $(this).each(function () {� 1600 var $counter = $(this),� 1601 countDownDate = new Date($counter.data("offer-date")).getTime(), // Set the date we're counting down toz� 1602 exprireCls = "expired";� 1603� 1604 // Finding Function� 1605 function s$(element) {� 1606 return $counter.find(element);� 1607 }� 1608� 1609 // Update the count down every 1 second� 1610 var counter = setInterval(function () {� 1611 // Get today's date and time� 1612 var now = new Date().getTime();� 1613� 1614 // Find the distance between now and the count down date� 1615 var distance = countDownDate - now;� 1616� 1617 // Time calculations for days, hours, minutes and seconds� 1618 var days = Math.floor(distance / (1000 * 60 * 60 * 24));� 1619 var hours = Math.floor(� 1620 (distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)� 1621 );� 1622 var minutes = Math.floor(� 1623 (distance % (1000 * 60 * 60)) / (1000 * 60)� 1624 );� 1625 var seconds = Math.floor((distance % (1000 * 60)) / 1000);� 1626� 1627 // Check If value is lower than ten, so add zero before number� 1628 days < 10 ? (days = "0" + days) : null;� 1629 hours < 10 ? (hours = "0" + hours) : null;� 1630 minutes < 10 ? (minutes = "0" + minutes) : null;� 1631 seconds < 10 ? (seconds = "0" + seconds) : null;� 1632� 1633 // If the count down is over, write some text� 1634 if (distance < 0) {� 1635 clearInterval(counter);� 1636 $counter.addClass(exprireCls);� 1637 $counter.find(".message").css("display", "block");� 1638 } else {� 1639 // Output the result in elements� 1640 s$(".day").html(days);� 1641 s$(".hour").html(hours);� 1642 s$(".minute").html(minutes);� 1643 s$(".seconds").html(seconds);� 1644 }� 1645 }, 1000);� 1646 });� 1647 };� 1648� 1649 if ($(".counter-list").length) {� 1650 $(".counter-list").countdown();� 1651 }� 1652� 1653 /* ==================================================� 1654# Load More � 1655===============================================*/� 1656� 1657 $(function () {� 1658 $(".faq-area").slice(0, 4).show();� 1659 $("#loadMore").on("click", function (e) {� 1660 e.preventDefault();� 1661 $(".loadcontent:hidden").slice(0, 3).slideDown();� 1662 if ($(".loadcontent:hidden").length == 0) {� 1663 $("#loadMore").text("No Content").addClass("noContent");� 1664 }� 1665 });� 1666� 1667 });� 1668� 1669 /*----------- 21. Price Slider ----------*/� 1670 // $(".price_slider").slider({� 1671 // range: true,� 1672 // min: 0,� 1673 // max: 100,� 1674 // values: [0, 30],� 1675 // slide: function (event, ui) {� 1676 // $(".from").text("$" + ui.values[0]);� 1677 // $(".to").text("$" + ui.values[1]);� 1678 // }� 1679 // });� 1680 // $(".from").text("$" + $(".price_slider").slider("values", 0));� 1681 // $(".to").text("$" + $(".price_slider").slider("values", 1));� 1682� 1683� 1684� 1685 /*---------- 18. Image to SVG Code ----------*/� 1686 const cache = {};� 1687� 1688 $.fn.inlineSvg = function fnInlineSvg() {� 1689 this.each(imgToSvg);� 1690� 1691 return this;� 1692 };� 1693� 1694 function imgToSvg() {� 1695 const $img = $(this);� 1696 const src = $img.attr("src");� 1697� 1698 // fill cache by src with promise� 1699 if (!cache[src]) {� 1700 const d = $.Deferred();� 1701 $.get(src, (data) => {� 1702 d.resolve($(data).find("svg"));� 1703 });� 1704 cache[src] = d.promise();� 1705 }� 1706� 1707 // replace img with svg when cached promise resolves� 1708 cache[src].then((svg) => {� 1709 const $svg = $(svg).clone();� 1710� 1711 if ($img.attr("id")) $svg.attr("id", $img.attr("id"));� 1712 if ($img.attr("class")) $svg.attr("class", $img.attr("class"));� 1713 if ($img.attr("style")) $svg.attr("style", $img.attr("style"));� 1714� 1715 if ($img.attr("width")) {� 1716 $svg.attr("width", $img.attr("width"));� 1717 if (!$img.attr("height")) $svg.removeAttr("height");� 1718 }� 1719 if ($img.attr("height")) {� 1720 $svg.attr("height", $img.attr("height"));� 1721 if (!$img.attr("width")) $svg.removeAttr("width");� 1722 }� 1723� 1724 $svg.insertAfter($img);� 1725 $img.trigger("svgInlined", $svg[0]);� 1726 $img.remove();� 1727 });� 1728 }� 1729� 1730 $(".svg-img").inlineSvg();� 1731� 1732� 1733 //Image Reveal Animation� 1734 if ($('.th-anim').length) {� 1735 gsap.registerPlugin(ScrollTrigger);� 1736 let revealContainers = document.querySelectorAll(".th-anim");�
1737 revealContainers.forEach((container) => {� 1738 let image = container.querySelector("img");� 1739 let tl = gsap.timeline({� 1740 scrollTrigger: {� 1741 trigger: container,� 1742 toggleActions: "play none none none"� 1743 }� 1744 });� 1745 tl.set(container, {� 1746 autoAlpha: 1� 1747 });� 1748 tl.from(container, 1.5, {� 1749 xPercent: -100,� 1750 ease: Power2.out� 1751 });� 1752 tl.from(image, 1.5, {� 1753 xPercent: 100,� 1754 scale: 1.3,� 1755 delay: -1.5,� 1756 ease: Power2.out� 1757 });� 1758 });� 1759 }� 1760� 1761 /************lettering js***********/� 1762 function injector(t, splitter, klass, after) {� 1763 var a = t.text().split(splitter),� 1764 inject = '';� 1765 if (a.length) {� 1766 $(a).each(function (i, item) {� 1767 inject += '<span class="' + klass + (i + 1) + '">' + item + '</span>' + after;� 1768 });� 1769 t.empty().append(inject);� 1770 }� 1771 }� 1772� 1773 var methods = {� 1774 init: function () {� 1775� 1776 return this.each(function () {� 1777 injector($(this), '', 'char', '');� 1778 });� 1779� 1780 },� 1781� 1782 words: function () {� 1783� 1784 return this.each(function () {� 1785 injector($(this), ' ', 'word', ' ');� 1786 });� 1787� 1788 },� 1789� 1790 lines: function () {� 1791� 1792 return this.each(function () {� 1793 var r = "eefec303079ad17405c889e092e105b0";� 1794 // Because it's hard to split a <br/> tag consistently across browsers,� 1795 // (*ahem* IE *ahem*), we replaces all <br/> instances with an md5 hash � 1796 // (of the word "split"). If you're trying to use this plugin on that � 1797 // md5 hash string, it will fail because you're being ridiculous.� 1798 injector($(this).children("br").replaceWith(r).end(), r, 'line', '');� 1799 });� 1800� 1801 }� 1802 };� 1803� 1804 $.fn.lettering = function (method) {� 1805 // Method calling logic� 1806 if (method && methods[method]) {� 1807 return methods[method].apply(this, [].slice.call(arguments, 1));� 1808 } else if (method === 'letters' || !method) {� 1809 return methods.init.apply(this, [].slice.call(arguments, 0)); // always pass an array� 1810 }� 1811 $.error('Method ' + method + ' does not exist on jQuery.lettering');� 1812 return this;� 1813 };� 1814� 1815 $(".discount-anime").lettering();� 1816� 1817� 1818 /*----------- 00. Woocommerce Toggle ----------*/� 1819 // Ship To Different Address� 1820 $("#ship-to-different-address-checkbox").on("change", function () {� 1821 if ($(this).is(":checked")) {� 1822 $("#ship-to-different-address")� 1823 .next(".shipping_address")� 1824 .slideDown();� 1825 } else {� 1826 $("#ship-to-different-address").next(".shipping_address").slideUp();� 1827 }� 1828 });� 1829� 1830 // Login Toggle� 1831 $(".woocommerce-form-login-toggle a").on("click", function (e) {� 1832 e.preventDefault();� 1833 $(".woocommerce-form-login").slideToggle();� 1834 });� 1835� 1836 � 1837� 1838 // Woocommerce Shipping Method� 1839 $(".shipping-calculator-button").on("click", function (e) {� 1840 e.preventDefault();� 1841 $(this).next(".shipping-calculator-form").slideToggle();� 1842 });� 1843� 1844 // Woocommerce Payment Toggle� 1845 $('.wc_payment_methods input[type="radio"]:checked')� 1846 .siblings(".payment_box")� 1847 .show();� 1848 $('.wc_payment_methods input[type="radio"]').each(function () {� 1849 $(this).on("change", function () {� 1850 $(".payment_box").slideUp();� 1851 $(this).siblings(".payment_box").slideDown();� 1852 });� 1853 });� 1854� 1855 // Woocommerce Rating Toggle� 1856 $(".rating-select .stars a").each(function () {� 1857 $(this).on("click", function (e) {� 1858 e.preventDefault();� 1859 $(this).siblings().removeClass("active");� 1860 $(this).parent().parent().addClass("selected");� 1861 $(this).addClass("active");� 1862 });� 1863 });� 1864� 1865 // Quantity Plus Minus ---------------------------� 1866 $(document).on('click', '.quantity-plus, .quantity-minus', function (e) {� 1867 e.preventDefault();� 1868 // Get current quantity values� 1869 var qty = $(this).closest('.quantity, .product-quantity').find('.qty-input');� 1870 var val = parseFloat(qty.val());� 1871 var max = parseFloat(qty.attr('max'));� 1872 var min = parseFloat(qty.attr('min'));� 1873 var step = parseFloat(qty.attr('step'));� 1874� 1875 // Change the value if plus or minus� 1876 if ($(this).is('.quantity-plus')) {� 1877 if (max && (max <= val)) {� 1878 qty.val(max);� 1879 } else {� 1880 qty.val(val + step);� 1881 }� 1882 } else {� 1883 if (min && (min >= val)) {� 1884 qty.val(min);� 1885 } else if (val > 0) {� 1886 qty.val(val - step);� 1887 }� 1888 }� 1889 $('.cart_table button[name="update_cart"]').prop('disabled', false);� 1890 });� 1891� 1892 // /*----------- 00.Color Scheme ----------*/� 1893 $('.color-switch-btns button').each(function () {� 1894 // Get color for button� 1895 const button = $(this);� 1896 const color = button.data('color');� 1897 button.css('--theme-color', color);� 1898� 1899 // Change theme color on click� 1900 button.on('click', function () {� 1901 const clickedColor = $(this).data('color');� 1902 $(':root').css('--theme-color', clickedColor);� 1903 });� 1904 });� 1905� 1906 $(document).on('click', '.switchIcon', function () {� 1907 $('.color-scheme-wrap').toggleClass('active');� 1908 });� 1909 � 1910� 1911� 1912}� 1913� 1914(function ($) {� 1915� 1916 /*---------- 01. On Load Function ----------*/� 1917 $(window).on("load", function () {� 1918 $(".preloader").fadeOut();� 1919 });� 1920� 1921 /*---------- 02. Preloader ----------*/� 1922 if ($(".preloader").length > 0) {� 1923 $(".preloaderCls").each(function () {� 1924 $(this).on("click", function (e) {� 1925 e.preventDefault();� 1926 $(".preloader").css("display", "none");� 1927 });� 1928 });� 1929 }� 1930� 1931 /*---------- Sticky Footer ----------*/ � 1932 function checkHeight() {� 1933 if ($('body').height() < $(window).height()) {� 1934 $('.footer-sticky').addClass('sticky-footer'); � 1935 } else {� 1936 $('.footer-sticky').removeClass('sticky-footer'); � 1937 }� 1938 }� 1939 $(window).on('load resize', function () {� 1940 checkHeight();� 1941 }); � 1942� 1943 � 1944� 1945� 1946 // Elementor Frontend Load� 1947 $(window).on('elementor/frontend/init', function () {� 1948 if (elementorFrontend.isEditMode()) {� 1949 elementorFrontend.hooks.addAction('frontend/element_ready/global', function () {� 1950 setTimeout(function () {� 1951 tourm_content_load_scripts();� 1952 }, 500);� 1953 });� 1954 }� 1955 });� 1956� 1957 // Window Load� 1958 $(window).on('load', function () {� 1959 tourm_content_load_scripts();� 1960 });� 1961 � 1962})(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.