1;(function ($) { 2 3 "use strict"; 4 5 var pxl_scroll_top; 6 var pxl_window_height; 7 var pxl_window_width; 8 var pxl_scroll_status = ''; 9 var pxl_last_scroll_top = 0; 10 var pxl_post_slip = false; 11 12 $(window).on('load', function () { 13 $(".pxl-loader").addClass("is-loaded"); 14 $('.pxl-swiper-slider, .pxl-header-mobile-elementor').css('opacity', '1'); 15 $('.pxl-gallery-scroll').parents('body').addClass('body-overflow').addClass('body-visible-sm'); 16 pxl_window_width = $(window).width(); 17 pxl_window_height = $(window).height(); 18 aimo_header_sticky(); 19 aimo_header_mobile(); 20 aimo_scroll_to_top(); 21 aimo_footer_fixed(); 22 aimo_shop_quantity(); 23 aimo_submenu_responsive(); 24 aimo_panel_anchor_toggle(); 25 aimo_post_grid(); 26 aimo_header_left_scroll(); 27 28 }); 29 30 $(window).on('scroll', function () { 31 pxl_scroll_top = $(window).scrollTop(); 32 pxl_window_height = $(window).height(); 33 pxl_window_width = $(window).width(); 34 if (pxl_scroll_top < pxl_last_scroll_top) { 35 pxl_scroll_status = 'up'; 36 } else { 37 pxl_scroll_status = 'down'; 38 } 39 pxl_last_scroll_top = pxl_scroll_top; 40 aimo_header_sticky(); 41 aimo_scroll_to_top(); 42 aimo_footer_fixed(); 43 aimo_ptitle_scroll_opacity(); 44 aimo_header_left_scroll(); 45 if (pxl_scroll_top < 100) { 46 $('.elementor > .pin-spacer').removeClass('scroll-top-active'); 47 } 48 }); 49 50 $(window).on('resize', function () { 51 pxl_window_height = $(window).height(); 52 pxl_window_width = $(window).width(); 53 aimo_submenu_responsive(); 54 aimo_header_mobile(); 55 aimo_post_grid(); 56 }); 57 58 $(document).ready(function () { 59 aimo_el_parallax(); 60 aimo_backtotop_progess_bar(); 61 aimo_type_file_upload(); 62 aimo_zoom_point(); 63 // Custom Dots Slider Revolution 64 setTimeout(function() { 65 $('.tp-bullets.theme-style2').append('<span class="pxl-revslider-arrow-prev"></span><span class="pxl-revslider-arrow-next"></span>'); 66 $('.tp-bullets.theme-style2').parent().find('.tparrows').addClass('pxl-revslider-arrow-hide'); 67 68 $('.revslider-initialised').each(function () { 69 $(this).find('.pxl-revslider-arrow-prev').on('click', function () { 70 $(this).parents('.revslider-initialised').find('.tp-leftarrow').trigger('click'); 71 }); 72 $(this).find('.pxl-revslider-arrow-next').on('click', function () { 73 $(this).parents('.revslider-initialised').find('.tp-rightarrow').trigger('click'); 74 }); 75 }); 76 77 }, 500); 78 79 // Deactive Link 80 $('.deactive-click a').on("click", function (e) { 81 e.preventDefault(); 82 }); 83 84 /* Start Menu Mobile */ 85 $('.pxl-header-menu li.menu-item-has-children').append('<span class="pxl-menu-toggle"></span>'); 86 $('.pxl-menu-toggle').on('click', function () { 87 if( $(this).hasClass('active')){ 88 $(this).closest('ul').find('.pxl-menu-toggle.active').toggleClass('active'); 89 $(this).closest('ul').find('.sub-menu.active').toggleClass('active').slideToggle(); 90 }else{ 91 $(this).closest('ul').find('.pxl-menu-toggle.active').toggleClass('active'); 92 $(this).closest('ul').find('.sub-menu.active').toggleClass('active').slideToggle(); 93 $(this).toggleClass('active'); 94 $(this).parent().find('> .sub-menu').toggleClass('active'); 95 $(this).parent().find('> .sub-menu').slideToggle(); 96 } 97 }); 98 99 $("#pxl-nav-mobile, .pxl-anchor-mobile-menu").on('click', function () { 100 $(this).toggleClass('active'); 101 $('body').toggleClass('body-overflow'); 102 $('.pxl-header-menu').toggleClass('active'); 103 }); 104 105 $(".pxl-menu-close, .pxl-header-menu-backdrop, #pxl-header-mobile .pxl-menu-primary a.is-one-page").on('click', function () { 106 $(this).parents('.pxl-header-main').find('.pxl-header-menu').removeClass('active'); 107 $('#pxl-nav-mobile').removeClass('active'); 108 $('body').toggleClass('body-overflow'); 109 }); 110 /* End Menu Mobile */ 111 112 /* Menu Vertical */ 113 $('.pxl-nav-vertical li.menu-item-has-children > a').append('<span class="pxl-arrow-toggle"><i class="flaticon-right-arrow"></i></span>'); 114 $('.pxl-nav-vertical li.menu-item-has-children > a').on('click', function () { 115 if( $(this).hasClass('active')){ 116 $(this).next().toggleClass('active').slideToggle(); 117 }else{ 118 $(this).closest('ul').find('.sub-menu.active').toggleClass('active').slideToggle(); 119 $(this).closest('ul').find('a.active').toggleClass('active'); 120 $(this).find('.pxl-menu-toggle.active').toggleClass('active'); 121 $(this).toggleClass('active'); 122 $(this).next().toggleClass('active').slideToggle(); 123 } 124 }); 125 /*cricle svg*/ 126 $('.pxl-circle-svg svg').each(function() { 127 var linearGradient = $(this).find('.linear-dot1'); 128 if (linearGradient.length > 0) { 129 var linearGradientId = linearGradient.attr('id'); 130 } 131 var linearGradient1 = $(this).find('.linear-dot2'); 132 if (linearGradient1.length > 0) { 133 var linearGradientId1 = linearGradient1.attr('id'); 134 } 135 var linearGradient2 = $(this).find('.linear-dot3'); 136 if (linearGradient2.length > 0) { 137 var linearGradientId2 = linearGradient2.attr('id'); 138 } 139 aimo_circle_svg(this,linearGradientId,linearGradientId1,linearGradientId2); 140 }); 141 /* Menu Hidden Sidebar Popup */ 142 $('.pxl-menu-hidden-sidebar li.menu-item-has-children > a').append('<span class="pxl-arrow-toggle"><i class="flaticon-right-arrow"></i></span>'); 143 $('.pxl-menu-hidden-sidebar li.menu-item-has-children > a').on('click', function () { 144 if( $(this).hasClass('active')){ 145 $(this).next().toggleClass('active').slideToggle(); 146 }else{ 147 $(this).closest('ul').find('.sub-menu.active').toggleClass('active').slideToggle(); 148 $(this).closest('ul').find('a.active').toggleClass('active'); 149 $(this).find('.pxl-menu-toggle.active').toggleClass('active'); 150 $(this).toggleClass('active'); 151 $(this).next().toggleClass('active').slideToggle(); 152 } 153 }); 154 155 $('.pxl-menu-hidden-sidebar .pxl-menu-button').on('click', function () { 156 $(this).parents('.pxl-menu-hidden-sidebar').toggleClass('active'); 157 $(this).parents('.pxl-menu-hidden-sidebar').removeClass('boxOut'); 158 $(this).parents('body').toggleClass('body-overflow'); 159 }); 160 $('.pxl-menu-popup-overlay').on('click', function () { 161 $(this).parent().removeClass('active'); 162 $(this).parent().addClass('boxOut'); 163 $(this).parents('body').removeClass('body-overflow'); 164 }); 165 $('.pxl-menu-popup-close, .pxl-menu-hidden-sidebar .pxl-menu-hidden a.is-one-page').on('click', function () { 166 $(this).parents('.pxl-menu-hidden-sidebar').removeClass('active'); 167 $(this).parents('.pxl-menu-hidden-sidebar').addClass('boxOut'); 168 $(this).parents('body').removeClass('body-overflow'); 169 }); 170 171 172 /* Mega Menu Max Height */ 173 var m_h_mega = $('li.pxl-megamenu > .sub-menu > .pxl-mega-menu-elementor').outerHeight(); 174 var w_h_mega = $(window).height(); 175 var w_h_mega_css = w_h_mega - 120; 176 if(m_h_mega > w_h_mega) { 177 $('li.pxl-megamenu > .sub-menu > .pxl-mega-menu-elementor').css('max-height', w_h_mega_css + 'px'); 178 $('li.pxl-megamenu > .sub-menu > .pxl-mega-menu-elementor').css('overflow-x', 'scroll'); 179 } 180 /* End Mega Menu Max Height */ 181 182 /* Scroll To Top */ 183 $('.pxl-scroll-top').on('click', function () { 184 $('html, body').animate({scrollTop: 0}, 1200); 185 $(this).parents('.pxl-wapper').find('.elementor > .pin-spacer').addClass('scroll-top-active'); 186 return false;
187 }); 188 // CSS transition for smooth effect list modern 189 $(".pxl-list-modern1 .pxl--item") 190 .on("mouseenter", function() { 191 $(".pxl-list-modern1 .pxl--item").removeClass("active"); 192 $(this).addClass("active"); 193 $(".pxl-list-modern1 .pxl-list--images .pxl-list--featured").removeClass('active'); 194 var selected_item = $(this).attr("data-image"); 195 $(selected_item).addClass('active').removeClass('non-active'); 196 }); 197 198 // CSS transition for smooth effect 199 $(".pxl-list-modern1 .pxl--item, .pxl-list-modern1 .pxl-list--images .pxl-list--featured") 200 .css("transition", "all 0.3s ease"); 201 202 203 /* Login */ 204 $('.pxl-user-popup').on('click', function (e) { 205 if (e.target === this) { 206 $(this).removeClass('open').addClass('remove'); 207 $('body').removeClass('ov-hidden'); 208 } 209 }); 210 $('.pxl-modal-close').on('click', function () { 211 $(this).parent().removeClass('open').addClass('remove'); 212 $(this).parents('body').removeClass('ov-hidden'); 213 }); 214 $('.btn-sign-up').on('click', function () { 215 $('.pxl-user-register').addClass('u-open').removeClass('u-close'); 216 $('.pxl-user-login').addClass('u-close').removeClass('u-open'); 217 }); 218 $('.btn-sign-in').on('click', function () { 219 $('.pxl-user-register').addClass('u-close').removeClass('u-open'); 220 $('.pxl-user-login').addClass('u-open').removeClass('u-close'); 221 }); 222 $('.pxl-user-have-an-account').on('click', function () { 223 $(this).parents('.pxl-modal-content').find('.pxl-user-register').addClass('u-close').removeClass('u-open'); 224 $(this).parents('.pxl-modal-content').find('.pxl-user-login').addClass('u-open').removeClass('u-close'); 225 }); 226 $('.h-btn-user').on('click', function () { 227 $('.pxl-user-popup').addClass('open').removeClass('remove'); 228 $(this).find('.pxl-user-account').toggleClass('active'); 229 }); 230 231 /* Animate Time Delay */ 232 $('.pxl-grid-masonry').each(function () { 233 var eltime = 80; 234 var elt_inner = $(this).children().length; 235 var _elt = elt_inner - 1; 236 $(this).find('> .pxl-grid-item > .wow').each(function (index, obj) { 237 $(this).css('animation-delay', eltime + 'ms'); 238 if (_elt === index) { 239 eltime = 80; 240 _elt = _elt + elt_inner; 241 } else { 242 eltime = eltime + 80; 243 } 244 }); 245 }); 246 247 $('.btn-text-nina').each(function () { 248 var eltime = 0.045; 249 var elt_inner = $(this).children().length; 250 var _elt = elt_inner - 1; 251 $(this).find('> .pxl--btn-text > span').each(function (index, obj) { 252 $(this).css('transition-delay', eltime + 's'); 253 eltime = eltime + 0.045; 254 }); 255 }); 256 257 $('.btn-text-nanuk').each(function () { 258 var eltime = 0.05; 259 var elt_inner = $(this).children().length; 260 var _elt = elt_inner - 1; 261 $(this).find('> .pxl--btn-text > span').each(function (index, obj) { 262 $(this).css('animation-delay', eltime + 's'); 263 eltime = eltime + 0.05; 264 }); 265 }); 266 267 $('.btn-text-smoke').each(function () { 268 var eltime = 0.05; 269 var elt_inner = $(this).children().length; 270 var _elt = elt_inner - 1; 271 $(this).find('> .pxl--btn-text > span > span > span').each(function (index, obj) { 272 $(this).css('--d', eltime + 's'); 273 eltime = eltime + 0.05; 274 }); 275 }); 276 277 $('.btn-text-reverse .pxl-text--front, .btn-text-reverse .pxl-text--back').each(function () { 278 var eltime = 0.05; 279 var elt_inner = $(this).children().length; 280 var _elt = elt_inner - 1; 281 $(this).find('.pxl-text--inner > span').each(function (index, obj) { 282 $(this).css('transition-delay', eltime + 's'); 283 eltime = eltime + 0.05; 284 }); 285 }); 286 287 /* End Animate Time Delay */ 288 289 /* Lightbox Popup */ 290 setTimeout(function() { 291 $('.pxl-action-popup').magnificPopup({ 292 type: 'iframe', 293 mainClass: 'mfp-fade', 294 removalDelay: 160, 295 preloader: false,
296 fixedContentPos: false 297 }); 298 }, 300); 299 300 $('.pxl-gallery-lightbox').each(function () { 301 $(this).magnificPopup({ 302 delegate: 'a.lightbox', 303 type: 'image', 304 gallery: { 305 enabled: true 306 }, 307 mainClass: 'mfp-fade', 308 }); 309 }); 310 311 /* Page Title Parallax */ 312 if($('#pxl-page-title-default').hasClass('pxl--parallax')) { 313 $(this).stellar(); 314 } 315 316 /* Cart Sidebar Popup */ 317 $(".pxl-cart-sidebar-button").on('click', function () { 318 $('body').addClass('body-overflow'); 319 $('#pxl-cart-sidebar').addClass('active'); 320 }); 321 $("#pxl-cart-sidebar .pxl-popup--overlay, #pxl-cart-sidebar .pxl-item--close, #pxl-cart-sidebar .pxl-popup--close2").on('click', function () { 322 $('body').removeClass('body-overflow'); 323 $('#pxl-cart-sidebar').removeClass('active'); 324 }); 325 326 /* Start Icon Bounce */ 327 var boxEls = $('.el-bounce, .el-effect-zigzag'); 328 $.each(boxEls, function(boxIndex, boxEl) { 329 loopToggleClass(boxEl, 'active'); 330 }); 331 332 function loopToggleClass(el, toggleClass) { 333 el = $(el); 334 let counter = 0; 335 if (el.hasClass(toggleClass)) { 336 waitFor(function () { 337 counter++; 338 return counter == 2; 339 }, function () { 340 counter = 0; 341 el.removeClass(toggleClass); 342 loopToggleClass(el, toggleClass); 343 }, 'Deactivate', 1000); 344 } else { 345 waitFor(function () { 346 counter++; 347 return counter == 3; 348 }, function () { 349 counter = 0; 350 el.addClass(toggleClass); 351 loopToggleClass(el, toggleClass); 352 }, 'Activate', 1000); 353 } 354 } 355 356 function waitFor(condition, callback, message, time) { 357 if (message == null || message == '' || typeof message == 'undefined') { 358 message = 'Timeout'; 359 } 360 if (time == null || time == '' || typeof time == 'undefined') { 361 time = 100; 362 } 363 var cond = condition(); 364 if (cond) { 365 callback(); 366 } else { 367 setTimeout(function() { 368 waitFor(condition, callback, message, time); 369 }, time); 370 } 371 } 372 /* End Icon Bounce */ 373 /* Copy Link Site */ 374 const copyLinkElements = document.querySelectorAll('.btn-copy-link'); 375 376 copyLinkElements.forEach(function(element) { 377 element.addEventListener('click', function(event) { 378 event.preventDefault(); 379 const link = window.location.href; 380 navigator.clipboard.writeText(link).then(function() { 381 alert('The link has been copied!'); 382 }).catch(function(error) { 383 console.error('Error copying link: ', error); 384 }); 385 }); 386 }); 387 /* Post Feature - Image Swiper */ 388 const postfeatureSlider = $(".pxl-image--swiper"); 389 postfeatureSlider 390 .slick({ 391 dots: false, 392 infinite: true, 393 arrows: false, 394 slidesToShow: 1, 395 slidesToScroll: 1, 396 autoplay: false, 397 autoplaySpeed: 2000, 398 vertical: false, 399 }); 400 postfeatureSlider.on('wheel', (function(e) { 401 e.preventDefault(); 402 if (e.originalEvent.deltaY < 0) { 403 $(this).slick('slickNext'); 404 } else { 405 $(this).slick('slickPrev'); 406 } 407 })); 408 409 $(".pxl-swiper-arrow-prev").on(function () { 410 $(".pxl-image--swiper").slick("slickPrev"); 411 }); 412 413 $(".pxl-swiper-arrow-next").on(function () { 414 $(".pxl-image--swiper").slick("slickNext"); 415 }); 416
417 /* Image Effect */ 418 if($('.pxl-image-tilt').length){ 419 $('.pxl-image-tilt').parents('.elementor-top-section').addClass('pxl-image-tilt-active'); 420 $('.pxl-image-tilt').each(function () { 421 var pxl_maxtilt = $(this).data('maxtilt'), 422 pxl_speedtilt = $(this).data('speedtilt'), 423 pxl_perspectivetilt = $(this).data('perspectivetilt'); 424 VanillaTilt.init(this, { 425 max: pxl_maxtilt, 426 speed: pxl_speedtilt, 427 perspective: pxl_perspectivetilt 428 }); 429 }); 430 } 431 432 /* Select Theme Style */ 433 let $styledSelect = $('.pxl-select-highlight'); 434 let $list = $('ul.pxl-select-options'); 435 let $listItems = $list.find('li'); 436 $styledSelect.on('click', function(e) { 437 e.stopPropagation(); 438 let $this = $(this); 439 let $dropdown = $this.next('ul.pxl-select-options'); 440 $('div.pxl-select-higthlight.active').not($this).each(function(){ 441 $(this).removeClass('active').next('ul.pxl-select-options').slideUp(200); 442 }); 443 444 $this.toggleClass('active'); 445 $dropdown.slideToggle(200); 446 }); 447 448 $listItems.on('click', function(e) { 449 e.stopPropagation(); 450 let selectedText = $(this).text(); 451 let selectedValue = $(this).attr('rel'); 452 453 $styledSelect.text(selectedText).removeClass('active'); 454 $this.val(selectedValue).trigger('change'); 455 $list.slideUp(200); 456 }); 457 $(document).on('click', function() { 458 $styledSelect.removeClass('active'); 459 $list.slideUp(200); 460 }); 461 462 /* Nice Select */ 463 $('.woocommerce-ordering .orderby, #pxl-sidebar-area select, .variations_form.cart .variations select, .pxl-open-table select, .pxl-nice-select').each(function () { 464 $(this).niceSelect(); 465 }); 466 467 /* Typewriter */ 468 if($('.pxl-title--typewriter').length) { 469 function typewriterOut(elements, callback) 470 { 471 if (elements.length){ 472 elements.eq(0).addClass('is-active'); 473 elements.eq(0).delay( 3000 ); 474 elements.eq(0).removeClass('is-active'); 475 typewriterOut(elements.slice(1), callback); 476 } 477 else { 478 callback(); 479 } 480 } 481 482 function typewriterIn(elements, callback) 483 { 484 if (elements.length){ 485 elements.eq(0).addClass('is-active'); 486 elements.eq(0).delay( 3000 ).slideDown(3000, function(){ 487 elements.eq(0).removeClass('is-active'); 488 typewriterIn(elements.slice(1), callback); 489 }); 490 } 491 else { 492 callback(); 493 } 494 } 495 496 function typewriterInfinite(){ 497 typewriterOut($('.pxl-title--typewriter .pxl-item--text'), function(){ 498 typewriterIn($('.pxl-title--typewriter .pxl-item--text'), function(){ 499 typewriterInfinite(); 500 }); 501 }); 502 } 503 $(function(){ 504 typewriterInfinite(); 505 }); 506 } 507 /* End Typewriter */ 508 509 /* Section Particles */ 510 setTimeout(function() { 511 $(".pxl-row-particles").each(function() { 512 particlesJS($(this).attr('id'), { 513 "particles": { 514 "number": { 515 "value": $(this).data('number'), 516 }, 517 "color": { 518 "value": $(this).data('color') 519 }, 520 "shape": { 521 "type": "circle", 522 }, 523 "size": { 524 "value": $(this).data('size'), 525 "random": $(this).data('size-random'), 526 }, 527 "line_linked": { 528 "enable": false, 529 }, 530 "move": { 531 "enable": true, 532 "speed": 2, 533 "direction": $(this).data('move-direction'), 534 "random": true, 535 "out_mode": "out", 536 } 537 }, 538 "retina_detect": true 539 }); 540 }); 541 }, 400); 542 543 /* Get checked input - Mailchimpp */ 544 $('.mc4wp-form input:checkbox').change(function(){ 545 if($(this).is(":checked")) { 546 $('.mc4wp-form').addClass("pxl-input-checked"); 547 } else { 548 $('.mc4wp-form').removeClass("pxl-input-checked"); 549 } 550 }); 551 552 /* Scroll to content */ 553 $('.pxl-link-to-section .btn').on('click', function(e) { 554 var id_scroll = $(this).attr('href'); 555 var offsetScroll = $('.pxl-header-elementor-sticky').outerHeight(); 556 e.preventDefault(); 557 $("html, body").animate({ scrollTop: $(id_scroll).offset().top - offsetScroll }, 600); 558 }); 559 560 // Hover Overlay Effect 561 // $('.pxl-overlay-shake').mousemove(function(event){
562 // var offset = $(this).offset(); 563 // var W = $(this).outerWidth(); 564 // var X = (event.pageX - offset.left); 565 // var Y = (event.pageY - offset.top); 566 // $(this).find('.pxl-overlay--color').css({ 567 // 'top' : + Y + 'px', 568 // 'left' : + X + 'px' 569 // }); 570 // }); 571 572 // Hover Portfolio Effect 573 $(".pxl-portfolio-style1 .pxl-post--inner").on("mouseenter", function () { 574 $(this).addClass("active-hover").removeClass("none-hover"); 575 }); 576 577 $(".pxl-portfolio-style1 .pxl-post--inner").on("mouseleave", function () { 578 $(this).removeClass("active-hover").addClass("none-hover"); 579 }); 580 581 /* Custom One Page by theme */ 582 if($('.pxl-link-scroll1').length) { 583 $('.pxl-item--onepage').on('click', function (e) { 584 var _this = $(this); 585 var _link = $(this).attr('href'); 586 var _id_data = e.currentTarget.hash; 587 var _offset; 588 var _data_offset = $(this).attr('data-onepage-offset'); 589 if(_data_offset) { 590 _offset = _data_offset; 591 } else { 592 _offset = 0; 593 } 594 if ($(_id_data).length === 1) { 595 var _target = $(_id_data); 596 $('.pxl-onepage-active').removeClass('pxl-onepage-active'); 597 _this.addClass('pxl-onepage-active'); 598 $('html, body').stop().animate({ scrollTop: _target.offset().top - _offset }, 1000); 599 return false; 600 } else { 601 window.location.href = _link; 602 } 603 return false; 604 }); 605 $.each($('.pxl-item--onepage'), function (index, item) { 606 var target = $(item).attr('href'); 607 var el = $(target); 608 var _data_offset = $(item).attr('data-onepage-offset'); 609 var waypoint = new Waypoint({ 610 element: el[0], 611 handler: function(direction) { 612 if(direction === 'down'){ 613 $('.pxl-onepage-active').removeClass('pxl-onepage-active'); 614 $(item).addClass('pxl-onepage-active'); 615 } 616 else if(direction === 'up'){ 617 var prev = $(item).parent().prev().find('.pxl-item--onepage'); 618 $(item).removeClass('pxl-onepage-active'); 619 if(prev.length > 0) 620 prev.addClass('pxl-onepage-active'); 621 } 622 }, 623 offset: _data_offset, 624 }); 625 }); 626 } 627 628 /* Item Hover Active */ 629 $('.pxl-hover-item').each(function () { 630 $(this).on(function () { 631 $(this).parent('.pxl-hover-wrap').find('.pxl-hover-item').removeClass('pxl-active'); 632 $(this).addClass('pxl-active'); 633 }); 634 }); 635 636 // Active Mega Menu Hover 637 $('li.pxl-megamenu').on('mouseenter', function() { 638 $(this).parents('.elementor-section').addClass('section-mega-active'); 639 }).on('mouseleave', function() { 640 $(this).parents('.elementor-section').removeClass('section-mega-active'); 641 }); 642 643 644 }); 645 646 jQuery(document).ajaxComplete(function(event, xhr, settings){ 647 aimo_shop_quantity(); 648 }); 649 650 jQuery( document ).on( 'updated_wc_div', function() { 651 aimo_shop_quantity(); 652 } ); 653 /*svg */ 654 function aimo_circle_svg(element, linearGradientId, linearGradientId1, linearGradientId2) { 655 var activeWidth = window.innerWidth || document.documentElement.clientWidth; 656 if (activeWidth <= 1200) { 657 return; 658 } 659 660 var svgEl = Snap(element); 661 if (!svgEl) { 662 return; 663 } 664 665 var size = 16.5; 666 667 var filter = svgEl.filter(Snap.filter.shadow(0, 4, 30, 'rgba(0, 255, 255, 0.6)')).addClass('filter1'); 668 var filter1 = svgEl.filter(Snap.filter.shadow(0, 4, 30, 'rgba(0, 255, 255, 0.1)')).addClass('filter2'); 669 var filter2 = svgEl.filter(Snap.filter.shadow(0, 4, 30, 'rgba(0, 255, 255, 0.3)')).addClass('filter3'); 670 671 var circle1 = svgEl.circle(0, 0, size * 1); 672 circle1.attr({ id: 'circle1', class: 'dot', fill: 'url(#' + linearGradientId + ')' }); 673 circle1.attr({ filter: filter }); 674 675 var circle2 = svgEl.circle(0, 0, size - 7.5); 676 circle2.attr({ id: 'circle2', class: 'dot', fill: 'url(#' + linearGradientId1 + ')' }); 677 circle2.attr({ filter: filter1 }); 678 679 var circle3 = svgEl.circle(0, 0, size - 8); 680 circle3.attr({ id: 'circle3', class: 'dot', fill: 'url(#' + linearGradientId2 + ')' }); 681 circle3.attr({ filter: filter2 }); 682 683 var dotEl1 = svgEl.select('#circle1'); 684 var dotEl2 = svgEl.select('#circle2'); 685 var dotEl3 = svgEl.select('#circle3'); 686 687 var motionPath1 = svgEl.select('path').getTotalLength(); 688 var motionPath2 = svgEl.select('path').getTotalLength(); 689 var motionPath3 = svgEl.select('path').getTotalLength(); 690 691 dotEl1.transform('t0,0'); 692 dotEl2.transform('t0,0'); 693 dotEl3.transform('t0,0'); 694
695 var carouselInnerEl = $(".pxl-carousel-inner,.pxl-swiper-arrow"); 696 var animation1, animation2, animation3; 697 var isHovered = false; 698 699 function animateDot(dotEl, motionPath, forward, duration, callback) { 700 var fromVal = forward ? 0 : motionPath; 701 var toVal = forward ? motionPath : 0; 702 703 return Snap.animate(fromVal, toVal, function (val) { 704 var point = svgEl.select("path").getPointAtLength(val); 705 dotEl.attr({ cx: point.x, cy: point.y }); 706 }, duration, callback); 707 } 708 709 function animateDot1(forward) { 710 animation1 = animateDot(dotEl1, motionPath1, forward, 15000, function () { 711 if (!isHovered) animateDot1(!forward); 712 }); 713 } 714 715 function animateDot2(forward) { 716 animation2 = animateDot(dotEl2, motionPath2, forward, 15000, function () { 717 if (!isHovered) animateDot2(!forward); 718 }); 719 } 720 721 function animateDot3(forward) { 722 animation3 = animateDot(dotEl3, motionPath3, forward, 18000, function () { 723 if (!isHovered) animateDot3(!forward); 724 }); 725 } 726 727 animateDot1(true); 728 animateDot2(false); 729 animateDot3(true); 730 } 731 732 /// 733 /* Header Sticky */ 734 function aimo_header_sticky() { 735 if($('#pxl-header-elementor').hasClass('is-sticky')) { 736 if (pxl_scroll_top > 100) { 737 $('.pxl-header-elementor-sticky.pxl-sticky-stb').addClass('pxl-header-fixed'); 738 $('#pxl-header-mobile').addClass('pxl-header-mobile-fixed'); 739 } else { 740 $('.pxl-header-elementor-sticky.pxl-sticky-stb').removeClass('pxl-header-fixed'); 741 $('#pxl-header-mobile').removeClass('pxl-header-mobile-fixed'); 742 } 743 744 if (pxl_scroll_status == 'up' && pxl_scroll_top > 100) { 745 $('.pxl-header-elementor-sticky.pxl-sticky-stt').addClass('pxl-header-fixed'); 746 } else { 747 $('.pxl-header-elementor-sticky.pxl-sticky-stt').removeClass('pxl-header-fixed'); 748 } 749 } 750 751 $('.pxl-header-elementor-sticky').parents('body').addClass('pxl-header-sticky'); 752 } 753 754 /* Header Left Scroll */ 755 function aimo_header_left_scroll() { 756 if($('.px-header--left_sidebar').hasClass('px-header-sidebar-style2')) { 757 var h_section_top = $('.h5-section-top').outerHeight() + 50; 758 console.log(h_section_top); 759 if (pxl_scroll_top > h_section_top) { 760 $('.px-header--left_sidebar').addClass('px-header--left_shadow'); 761 } else { 762 $('.px-header--left_sidebar').removeClass('px-header--left_shadow'); 763 } 764 } 765 } 766 767 /* Header Mobile */ 768 function aimo_header_mobile() { 769 var h_header_mobile = $('#pxl-header-elementor').outerHeight(); 770 if(pxl_window_width < 1199) { 771 $('#pxl-header-elementor').css('min-height', h_header_mobile + 'px'); 772 } 773 } 774 775 /* Scroll To Top */ 776 function aimo_scroll_to_top() { 777 if (pxl_scroll_top < pxl_window_height) { 778 $('.pxl-scroll-top').addClass('pxl-off').removeClass('pxl-on'); 779 } 780 if (pxl_scroll_top > pxl_window_height) { 781 $('.pxl-scroll-top').addClass('pxl-on').removeClass('pxl-off'); 782 } 783 } 784 785 /* Footer Fixed */ 786 function aimo_footer_fixed() { 787 setTimeout(function(){ 788 var h_footer = $('.pxl-footer-fixed #pxl-footer-elementor').outerHeight() - 1; 789 $('.pxl-footer-fixed #pxl-main').css('margin-bottom', h_footer + 'px'); 790 }, 600); 791 } 792 793 /* WooComerce Quantity */ 794 function aimo_shop_quantity() { 795 "use strict"; 796 $('#pxl-wapper .quantity').append('<span class="quantity-icon quantity-down pxl-icon--caretdown pxl-icon--minus"></span><span class="quantity-icon quantity-up pxl-icon--caretup pxl-icon--plus"></span>'); 797 $('.quantity-up').on('click', function () { 798 $(this).parents('.quantity').find('input[type="number"]').get(0).stepUp(); 799 $(this).parents('.woocommerce-cart-form').find('.actions .button').removeAttr('disabled'); 800 }); 801 $('.quantity-down').on('click', function () { 802 $(this).parents('.quantity').find('input[type="number"]').get(0).stepDown(); 803 $(this).parents('.woocommerce-cart-form').find('.actions .button').removeAttr('disabled'); 804 }); 805 $('.quantity-icon').on('click', function () { 806 var quantity_number = $(this).parents('.quantity').find('input[type="number"]').val(); 807 var add_to_cart_button = $(this).parents( ".product, .woocommerce-product-inner" ).find(".add_to_cart_button"); 808 add_to_cart_button.attr('data-quantity', quantity_number); 809 add_to_cart_button.attr("href", "?add-to-cart=" + add_to_cart_button.attr("data-product_id") + "&quantity=" + quantity_number); 810 }); 811 $('.woocommerce-cart-form .actions .button').removeAttr('disabled'); 812 } 813 814 /* Menu Responsive Dropdown */ 815 function aimo_submenu_responsive() { 816 var $aimo_menu = $('.pxl-header-elementor-main, .pxl-header-elementor-sticky'); 817 $aimo_menu.find('.pxl-menu-primary li').each(function () { 818 var $aimo_submenu = $(this).find('> ul.sub-menu'); 819 if ($aimo_submenu.length == 1) {
820 if ( ($aimo_submenu.offset().left + $aimo_submenu.width() + 0 ) > $(window).width()) { 821 $aimo_submenu.addClass('pxl-sub-reverse'); 822 } 823 } 824 }); 825 } 826 827 function aimo_panel_anchor_toggle(){ 828 'use strict'; 829 $(document).on('click','.pxl-anchor-button',function(e){ 830 e.preventDefault(); 831 e.stopPropagation(); 832 var target = $(this).attr('data-target'); 833 $(target).toggleClass('active'); 834 $('body').addClass('body-overflow'); 835 $('.pxl-popup--conent .wow').addClass('animated').removeClass('aniOut'); 836 $('.pxl-popup--conent .fadeInPopup').removeClass('aniOut'); 837 if($(target).find('.pxl-search-form').length > 0){ 838 setTimeout(function(){ 839 $(target).find('.pxl-search-form .pxl-search-field').focus(); 840 },1000); 841 } 842 }); 843 844 $('.pxl-anchor-button').each(function () { 845 var t_target = $(this).attr('data-target'); 846 var t_delay = $(this).attr('data-delay-hover'); 847 $(t_target).find('.pxl-popup--conent').css('transition-delay', t_delay + 'ms'); 848 $(t_target).find('.pxl-popup--overlay').css('transition-delay', t_delay + 'ms'); 849 }); 850 851 $(".pxl-hidden-panel-popup .pxl-popup--overlay, .pxl-hidden-panel-popup .pxl-close-popup").on('click', function () { 852 $('body').removeClass('body-overflow'); 853 $('.pxl-hidden-panel-popup').removeClass('active'); 854 $('.pxl-popup--conent .wow').addClass('aniOut').removeClass('animated'); 855 $('.pxl-popup--conent .fadeInPopup').addClass('aniOut'); 856 }); 857 858 $(".pxl-button.pxl-atc-popup").on('click', function () { 859 $('body').addClass('body-overflow'); 860 $(this).parents('.pxl-wapper').find('.pxl-page-popup').addClass('active'); 861 }); 862 $(".pxl-popup--close").on('click', function () { 863 $('body').removeClass('body-overflow'); 864 $(this).parent().removeClass('active'); 865 }); 866 867 /* Custom Theme Style */ 868 $('blockquote:not(.pxl-blockquote)').append('<i class="pxl-blockquote-icon flaticon-quote-1 text-gradient"></i>'); 869 } 870 871 /* Post Grid */ 872 function aimo_post_grid() { 873 setTimeout(function(){ 874 $('.pxl-item--inner').each(function () { 875 var item_w = $(this).outerWidth(); 876 var item_h = $(this).outerHeight(); 877 $(this).find('.pxl-item--imgfilter').css('width', item_w + 'px'); 878 $(this).find('.pxl-item--imgfilter').css('height', item_h + 'px'); 879 }); 880 }, 300); 881 } 882 883 /* Page Title Scroll Opacity */ 884 function aimo_ptitle_scroll_opacity() { 885 var divs = $('#pxl-page-title-elementor.pxl-scroll-opacity .elementor-widget'), 886 limit = $('#pxl-page-title-elementor.pxl-scroll-opacity').outerHeight(); 887 if (pxl_scroll_top <= limit) { 888 divs.css({ 'opacity' : (1 - pxl_scroll_top/limit)}); 889 } 890 } 891 892 /* Preloader Default */ 893 $.fn.extend({ 894 jQueryImagesLoaded: function () { 895 var $imgs = this.find('img[src!=""]') 896 897 if (!$imgs.length) { 898 return $.Deferred() 899 .resolve() 900 .promise() 901 } 902 903 var dfds = [] 904 905 $imgs.each(function () { 906 var dfd = $.Deferred() 907 dfds.push(dfd) 908 var img = new Image() 909 img.onload = function () { 910 dfd.resolve() 911 } 912 img.onerror = function () { 913 dfd.resolve() 914 } 915 img.src = this.src 916 }) 917 918 return $.when.apply($, dfds) 919 } 920 }) 921 922 /* Button Parallax */ 923 function aimo_el_parallax() { 924 $('.btn-text-parallax').on('mouseenter', function() { 925 $(this).addClass('hovered'); 926 }); 927 $('.btn-text-parallax').on('mouseleave', function() { 928 $(this).removeClass('hovered'); 929 }); 930 $('.btn-text-parallax').on('mousemove', function(e) { 931 const bounds = this.getBoundingClientRect(); 932 const centerX = bounds.left + bounds.width / 2; 933 const centerY = bounds.top + bounds.height; 934 const deltaX = Math.floor((centerX - e.clientX)) * 0.172; 935 const deltaY = Math.floor((centerY - e.clientY)) * 0.273; 936 $(this).find('.pxl--btn-text').css({ 937 transform: 'translate3d('+ deltaX * 0.32 +'px, '+ deltaY * 0.32 +'px, 0px)' 938 }); 939 $(this).css({ 940 transform: 'translate3d('+ deltaX * 0.25 +'px, '+ deltaY * 0.25 +'px, 0px)' 941 }); 942 }); 943 944 $('.el-parallax-wrap').each(function () { 945 $(this).on('mouseenter', function() { 946 $(this).addClass('hovered'); 947 }); 948 949 $(this).on('mouseleave', function() { 950 $(this).removeClass('hovered'); 951 }); 952 953 $(this).on('mousemove', function(e) { 954 const bounds = this.getBoundingClientRect(); 955 const centerX = bounds.left + bounds.width / 2; 956 const centerY = bounds.top + bounds.height; 957 const deltaX = Math.floor((centerX - e.clientX)) * 0.222; 958 const deltaY = Math.floor((centerY - e.clientY)) * 0.333; 959 $(this).find('.el-parallax-item').css({ 960 transform: 'translate3d('+ deltaX * 0.32 +'px, '+ deltaY * 0.32 +'px, 0px)' 961 }); 962 }); 963 }); 964 965 $('.pxl-hover-parallax').on('mousemove', function(e) { 966 const bounds = this.getBoundingClientRect(); 967 const centerX = bounds.left + bounds.width / 2; 968 const centerY = bounds.top + bounds.height; 969 const deltaX = Math.floor((centerX - e.clientX)) * 0.222; 970 const deltaY = Math.floor((centerY - e.clientY)) * 0.333; 971 $(this).find('.pxl-item-parallax').css({ 972 transform: 'translate3d('+ deltaX * 0.32 +'px, '+ deltaY * 0.32 +'px, 0px)' 973 }); 974 }); 975 } 976 977 978 /* Back To Top Progress Bar */ 979 function aimo_backtotop_progess_bar() { 980 if($('.pxl-scroll-top').length > 0) { 981 var progressPath = document.querySelector('.pxl-scroll-top path'); 982 var pathLength = progressPath.getTotalLength(); 983 progressPath.style.transition = progressPath.style.WebkitTransition = '
983none'; 984 progressPath.style.strokeDasharray = pathLength + ' ' + pathLength; 985 progressPath.style.strokeDashoffset = pathLength; 986 progressPath.getBoundingClientRect(); 987 progressPath.style.transition = progressPath.style.WebkitTransition = 'stroke-dashoffset 10ms linear'; 988 var updateProgress = function () { 989 var scroll = $(window).scrollTop(); 990 var height = $(document).height() - $(window).height(); 991 var progress = pathLength - (scroll * pathLength / height); 992 progressPath.style.strokeDashoffset = progress; 993 } 994 updateProgress(); 995 $(window).scroll(updateProgress); 996 var offset = 50; 997 var duration = 550; 998 $(window).on('scroll', function() { 999 if ($(this).scrollTop() > offset) { 1000 $('.pxl-scroll-top').addClass('active-progress'); 1001 } else { 1002 $('.pxl-scroll-top').removeClass('active-progress'); 1003 } 1004 }); 1005 } 1006 } 1007 /* Custom Type File Upload*/ 1008 function aimo_type_file_upload() { 1009 1010 var multipleSupport = typeof $('<input/>')[0].multiple !== 'undefined', 1011 isIE = /msie/i.test( navigator.userAgent ); 1012 1013 $.fn.pxl_custom_type_file = function() { 1014 1015 return this.each(function() { 1016 1017 var $file = $(this).addClass('pxl-file-upload-hidden'), 1018 $wrap = $('<div class="pxl-file-upload-wrapper">'), 1019 $button = $('<button type="button" class="pxl-file-upload-button">Choose File</button>'), 1020 $input = $('<input type="text" class="pxl-file-upload-input" placeholder="No File Choose" />'), 1021 $label = $('<label class="pxl-file-upload-button" for="'+ $file[0].id +'">Choose File</label>'); 1022 $file.css({ 1023 position: 'absolute', 1024 opacity: '0', 1025 visibility: 'hidden' 1026 }); 1027 1028 $wrap.insertAfter( $file ) 1029 .append( $file, $input, ( isIE ? $label : $button ) ); 1030 1031 $file.attr('tabIndex', -1); 1032 $button.attr('tabIndex', -1); 1033 1034 $button.on('click', function () { 1035 $file.focus().on(); 1036 }); 1037 1038 $file.change(function() { 1039 1040 var files = [], fileArr, filename; 1041 1042 if ( multipleSupport ) { 1043 fileArr = $file[0].files; 1044 for ( var i = 0, len = fileArr.length; i < len; i++ ) { 1045 files.push( fileArr[i].name ); 1046 } 1047 filename = files.join(', '); 1048 } else { 1049 filename = $file.val().split('\\').pop(); 1050 } 1051 1052 $input.val( filename ) 1053 .attr('title', filename) 1054 .focus(); 1055 }); 1056 1057 $input.on({ 1058 blur: function() { $file.trigger('blur'); }, 1059 keydown: function( e ) { 1060 if ( e.which === 13 ) { 1061 if ( !isIE ) { 1062 $file.trigger('click'); 1063 } 1064 } else if ( e.which === 8 || e.which === 46 ) { 1065 $file.replaceWith( $file = $file.clone( true ) ); 1066 $file.trigger('change'); 1067 $input.val(''); 1068 } else if ( e.which === 9 ){ 1069 return; 1070 } else { 1071 return false; 1072 } 1073 } 1074 }); 1075 1076 }); 1077 1078 }; 1079 $('.wpcf7-file[type=file]').pxl_custom_type_file(); 1080 } 1081 1082 // Zoom Point 1083 function aimo_zoom_point() { 1084 $(".pxl-zoom-point").each(function () { 1085 1086 let scaleOffset = $(this).data('offset'); 1087 let scaleAmount = $(this).data('scale-mount'); 1088 1089 function scrollZoom() { 1090 const images = document.querySelectorAll("[data-scroll-zoom]"); 1091 let scrollPosY = 0; 1092 scaleAmount = scaleAmount / 100; 1093 1094 const observerConfig = { 1095 rootMargin: "0% 0% 0% 0%", 1096 threshold: 0 1097 }; 1098
1099 images.forEach(image => { 1100 let isVisible = false; 1101 const observer = new IntersectionObserver((elements, self) => { 1102 elements.forEach(element => { 1103 isVisible = element.isIntersecting; 1104 }); 1105 }, observerConfig); 1106 1107 observer.observe(image); 1108 1109 image.style.transform = `scale(${1 + scaleAmount * percentageSeen(image)})`; 1110 1111 window.addEventListener("scroll", () => { 1112 if (isVisible) { 1113 scrollPosY = window.pageYOffset; 1114 image.style.transform = `scale(${1 + 1115 scaleAmount * percentageSeen(image)})`; 1116 } 1117 }); 1118 }); 1119 1120 function percentageSeen(element) { 1121 const parent = element.parentNode; 1122 const viewportHeight = window.innerHeight; 1123 const scrollY = window.scrollY; 1124 const elPosY = parent.getBoundingClientRect().top + scrollY + scaleOffset; 1125 const borderHeight = parseFloat(getComputedStyle(parent).getPropertyValue('border-bottom-width')) + parseFloat(getComputedStyle(element).getPropertyValue('border-top-width')); 1126 const elHeight = parent.offsetHeight + borderHeight; 1127 1128 if (elPosY > scrollY + viewportHeight) { 1129 return 0; 1130 } else if (elPosY + elHeight < scrollY) { 1131 return 100; 1132 } else { 1133 const distance = scrollY + viewportHeight - elPosY; 1134 let percentage = distance / ((viewportHeight + elHeight) / 100); 1135 percentage = Math.round(percentage); 1136 1137 return percentage; 1138 } 1139 } 1140 } 1141 1142 scrollZoom(); 1143 1144 }); 1145 } 1146 /* Pricing Hover */ 1147 $('.pxl-pricing1').each(function () { 1148 $(this).on(function () { 1149 $(this).parents('.elementor-element').find('.pxl-pricing1').removeClass('is-popular'); 1150 $(this).addClass('is-popular'); 1151 }); 1152 }); 1153 ///img slip hover 1154 $(document).ready(function() { 1155 $('.pxl-image-split1 .pxl--item').on('click', function () { 1156 var parentSection = $(this).closest('.pxl-image-split1'); 1157 parentSection.find('.pxl--item').not(this).removeClass('active'); 1158 $(this).toggleClass('active'); 1159 }); 1160 }); 1161 1162 1163 ///// 1164 const buttonClass = '.pxl-icon2 .pxl-item--icon'; 1165 const $button = document.querySelector(buttonClass); 1166 1167 if ($button) { 1168 document.addEventListener('DOMContentLoaded', function () { 1169 gsap.set($button, { 1170 opacity: 1 1171 }); 1172 1173 const rotate = gsap.timeline({ 1174 scrollTrigger: { 1175 trigger: 'html', 1176 scrub: 0.5, 1177 start: 'top top', 1178 end: '+=10000', 1179 } 1180 }).to($button, { 1181 rotation: 360 * 7, 1182 duration: 1, 1183 ease: 'none' 1184 }); 1185 }); 1186 } 1187 1188 /// 1189 1190 1191 ///////button video cover cursor 1192 const videoWidget = document.querySelector('.pxl-video-style3 .pxl-video--inner'); 1193 const videoButton = document.querySelector('.btn-video-wrap'); 1194 1195 if (videoWidget && videoButton) { 1196 const widgetWidth = videoWidget.offsetWidth; 1197 const widgetHeight = videoWidget.offsetHeight; 1198 const buttonWidth = videoButton.offsetWidth; 1199 const buttonHeight = videoButton.offsetHeight; 1200 1201 videoButton.style.transform = `translate(${(widgetWidth - buttonWidth) / 2}px, ${(widgetHeight - buttonHeight) / 2}px)`; 1202 1203 videoWidget.addEventListener('mousemove', (e) => { 1204 const rect = videoWidget.getBoundingClientRect(); 1205 const mouseX = e.clientX - rect.left; 1206 const mouseY = e.clientY - rect.top; 1207 const buttonX = Math.min(Math.max(0, mouseX - buttonWidth / 2), widgetWidth - buttonWidth); 1208 const buttonY = Math.min(Math.max(0, mouseY - buttonHeight / 2), widgetHeight - buttonHeight); 1209 videoButton.style.transform = `translate(${buttonX}px, ${buttonY}px)`; 1210 }); 1211 1212 videoWidget.addEventListener('mouseleave', () => { 1213 videoButton.style.transform = `translate(${(widgetWidth - buttonWidth) / 2}px, ${(widgetHeight - buttonHeight) / 2}px)`; 1214 }); 1215 } 1216 1217 1218
1219 /////////////////////////////////////// 1220 // CSS transition for smooth effect process 1221 $(document).ready(function() { 1222 $(".pxl-process .pxl-list-modern1 .pxl--item").eq(1).addClass("active"); 1223 updateBackgroundHeight(); 1224 startAutoRotate(); 1225 }); 1226 1227 let autoRotateInterval; 1228 1229 function updateBackgroundHeight() { 1230 var activeHeight = 0; 1231 1232 $(".pxl-process .pxl-list-modern1 .pxl--item").each(function() { 1233 if ($(this).hasClass('active')) { 1234 return false; 1235 } 1236 activeHeight += $(this).outerHeight(true); 1237 }); 1238 1239 activeHeight += 87; 1240 1241 $(".pxl-process .pxl-bacground-gradien").height(activeHeight); 1242 } 1243 1244 function startAutoRotate() { 1245 let items = $(".pxl-process .pxl-list-modern1 .pxl--item"); 1246 let currentIndex = items.index($(".pxl-process .pxl-list-modern1 .pxl--item.active")); 1247 const totalItems = items.length; 1248 1249 autoRotateInterval = setInterval(function() { 1250 items.removeClass("active"); 1251 items.eq(currentIndex).addClass("active"); 1252 $(".pxl-process .pxl-list-modern1 .pxl-list--images .pxl-list--featured").removeClass('active'); 1253 var selected_item = items.eq(currentIndex).attr("data-image"); 1254 $(selected_item).addClass('active').removeClass('non-active'); 1255
1256 updateBackgroundHeight(); 1257 1258 currentIndex = (currentIndex + 1) % totalItems; 1259 }, 3000); 1260 } 1261 1262 $(".pxl-process .pxl-list-modern1 .pxl--item").on("mouseenter", function() { 1263 clearInterval(autoRotateInterval); 1264 $(".pxl-process .pxl-list-modern1 .pxl--item").removeClass("active"); 1265 $(this).addClass("active"); 1266 1267 $(".pxl-process .pxl-list-modern1 .pxl-list--images .pxl-list--featured").removeClass('active'); 1268 var selected_item = $(this).attr("data-image"); 1269 $(selected_item).addClass('active').removeClass('non-active'); 1270 updateBackgroundHeight(); 1271 }); 1272 1273 $(".pxl-process .pxl-list-modern1 .pxl--item").on("mouseleave", function() { 1274 startAutoRotate(); 1275 }); 1276 1277 1278 // CSS transition for smooth effect 1279 $(".pxl-process .pxl-list-modern1 .pxl--item, .pxl-process .pxl-list-modern1 .pxl-list--images .pxl-list--featured") 1280 .css("transition", "all 0.3s ease"); 1281 1282 1283 1284 1285 /* text scroll ver2 */ 1286 $(document).ready(function() { 1287 if (document.querySelectorAll('.pxl-text-editor2 .pxl-text-content').length === 0) { 1288 return; 1289 } 1290 1291 gsap.config({ trialWarn: false }); 1292 console.clear(); 1293 gsap.registerPlugin(ScrollTrigger, SplitText); 1294 1295 let split = new SplitText(".pxl-text-editor2 .pxl-text-content", { type: "lines" }); 1296 1297 function makeItHappen() { 1298 $.each(split.lines, function(_, target) { 1299 gsap.to(target, { 1300 backgroundPositionX: 0, 1301 ease: "none", 1302 scrollTrigger: { 1303 trigger: target, 1304 markers: false, 1305 scrub: 0.75, 1306 start: "top center", 1307 end: "bottom center" 1308 } 1309 }); 1310 }); 1311 } 1312 1313 let someDelay = gsap.delayedCall(0.2, newTriggers).pause(); 1314 1315 $(window).on("resize", function() { 1316 someDelay.restart(true); 1317 }); 1318 1319 function newTriggers() { 1320 ScrollTrigger.getAll().forEach(function(trigger) { 1321 trigger.kill(); 1322 }); 1323 split.split(); 1324 makeItHappen(); 1325 } 1326 1327 makeItHappen(); 1328 }); 1329 /* Text Hover Silde */ 1330 if ($('.pxl-nav-menu1:not(.fr-gradient) .pxl-menu-primary .sub-menu li a span, .pxl-nav-menu1:not(.fr-gradient) .pxl-menu-primary .children li a span').length > 0) { 1331 $('.pxl-nav-menu1:not(.fr-gradient) .pxl-menu-primary .sub-menu li a span, .pxl-nav-menu1:not(.fr-gradient) .pxl-menu-primary .children li a span').each(function () { 1332 var text = $(this).text().trim(); 1333 var html = $.map(text.split(''), function(char, index) { 1334 return '<span class="char" style="--char-index:' + index + ';">' + char + '</span>'; 1335 }).join(''); 1336 $(this).html(html); 1337 }); 1338 } 1339 // Line animation 1340 if (document.querySelectorAll(".pxl-line .pxl-item--inner").length > 0) { 1341 gsap.from(".pxl-line .pxl-item--inner", { 1342 x: "-100%", 1343 duration: 1.5, 1344 ease: "power2.out", 1345 scrollTrigger: { 1346 trigger: ".pxl-line .pxl-item--inner", 1347 start: "top 70%", 1348 toggleActions: "play none none none" 1349 } 1350 }); 1351 } 1352 1353 1354 // Line icon animation 1355 if (document.querySelectorAll(".pxl-line-icon1")) { 1356 const tl = gsap.timeline({ 1357 scrollTrigger: { 1358 trigger: ".pxl-line-icon1", 1359 start: "top 105%", 1360 toggleActions: "play none none none" 1361 } 1362 }); 1363 tl.from(".pxl-line-icon1 .pxl-line", { 1364 width: 0, 1365 duration: 1.5, 1366 ease: "power2.out" 1367 }); 1368 tl.from(".pxl-line-icon1 .pxl-item--icon", { 1369 rotation: -360, 1370 duration: 3, 1371 ease: "power2.out" 1372 }, "<"); 1373 } 1374 ///svg 1375 const svgIcons = document.querySelectorAll(".pxl-line-icon2 svg"); 1376 1377 if (document.querySelector(".pxl-line-icon2")) { 1378 gsap.registerPlugin(ScrollTrigger); 1379 1380 svgIcons.forEach((svg) => { 1381 const paths = svg.querySelectorAll("path"); 1382 1383 paths.forEach((path) => { 1384 const lineLength = path.getTotalLength(); 1385 path.style.strokeDasharray = lineLength; 1386 path.style.strokeDashoffset = lineLength; 1387 1388 gsap.to(path, {
1389 strokeDashoffset: 0, 1390 duration: 2, 1391 scrollTrigger: { 1392 trigger: svg, 1393 start: "top 50%", 1394 toggleActions: "play none none none", 1395 }, 1396 }); 1397 }); 1398 }); 1399 } 1400 1401 ////// 1402 if (jQuery('.pxl-image-box1').length > 0) { 1403 var imgs = jQuery.makeArray(jQuery('.pxl-image-box-animation .pxl-box-inner .img-counter img')); 1404 imgs.reverse(); 1405 1406 if (imgs.length > 0) { 1407 function crossfade() { 1408 jQuery(imgs).each(function (index, img) { 1409 jQuery(img).css({ 1410 zIndex: index === 0 ? 0 : 1 1411 }); 1412 1413 gsap.to(img, { 1414 duration: 1.8, 1415 autoAlpha: index === 0 ? 0 : 1, 1416 scale: index === 0 ? 0.85 : 1, 1417 rotationY: index === 0 ? 120 : 0, 1418 x: index === 0 ? "0%" : "0%", 1419 filter: index === 0 ? "blur(8px)" : "blur(0px)", 1420 ease: "power3.inOut" 1421 }); 1422 }); 1423 1424 imgs.push(imgs.shift()); 1425 } 1426 1427 var cycle = setInterval(crossfade, 1300); 1428 1429 jQuery(window).on('unload', function () { 1430 clearInterval(cycle); 1431 }); 1432 } 1433 } 1434 1435 //////////////// 1436 document.querySelectorAll('a[href^="#"]').forEach(anchor => { 1437 anchor.addEventListener('click', function (e) { 1438 e.preventDefault(); 1439 const targetId = this.getAttribute('href').substring(1); 1440 const targetElement = document.getElementById(targetId); 1441 1442 if (targetElement) { 1443 const offset = parseInt(targetElement.getAttribute('data-onepage-offset') || 0, 10); 1444 1445 const offsetTop = targetElement.getBoundingClientRect().top + window.scrollY; 1446 1447 gsap.to(window, { 1448 scrollTo: offsetTop - offset, 1449 duration: 1, 1450 ease: 'power2.inOut' 1451 }); 1452 } 1453 }); 1454 }); 1455 1456 1457 /// 1458 $('.water-effect').ripples({ 1459 resolution: 512, 1460 dropRadius: 20, 1461 perturbance: 0.04, 1462 }); 1463 1464 1465 // gsap.registerPlugin(ScrollTrigger); 1466 1467 // let panels = gsap.utils.toArray(".pxl-portfolio-grid-layout3 .pxl-grid-item"); 1468 // let tops = panels.map(panel => ScrollTrigger.create({trigger: panel, start: "top top"})); 1469 1470 // panels.forEach((panel, i) => { 1471 // ScrollTrigger.create({ 1472 // trigger: panel, 1473 // start: () => panel.offsetHeight < window.innerHeight ? "top top" : "bottom bottom", 1474 // pin: true, 1475 // pinSpacing: false 1476 // }); 1477 // }); 1478 1479 // $(window).on('scroll', function() { 1480 // $('.pxl-portfolio-grid-layout3 .pxl-grid-item').each(function() { 1481 // const offsetTop = $(this).offset().top; 1482 // const scrollTop = $(window).scrollTop(); 1483 // const height = $(this).outerHeight(); 1484 1485 // if (scrollTop >= offsetTop && scrollTop < offsetTop + height) { 1486 // $(this).addClass('active'); 1487 // } else { 1488 // $(this).removeClass('active'); 1489 // } 1490 // }); 1491 // }); 1492 1493 1494 1495 document.addEventListener('DOMContentLoaded', function () { 1496 const links = document.querySelectorAll('.pxl-image-2d .pxl-item--image a'); 1497 1498 links.forEach(link => { 1499 let moved = false; 1500 let startX = 0; 1501 let startY = 0; 1502 1503 link.addEventListener('pointerdown', (e) => { 1504 moved = false; 1505 startX = e.clientX; 1506 startY = e.clientY; 1507 }); 1508 1509 link.addEventListener('pointerup', (e) => { 1510 const dx = Math.abs(e.clientX - startX); 1511 const dy = Math.abs(e.clientY - startY); 1512 if (dx > 5 || dy > 5) { 1513 moved = true; 1514 } 1515 }); 1516 1517 link.addEventListener('click', (e) => { 1518 if (moved) { 1519 e.preventDefault(); 1520 } 1521 }); 1522 }); 1523}); 1524 1525 1526 1527 1528 1529 1530 1531})(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.