1//Main scripts 2 3(function($) { 4 "use strict"; 5 6 7 window.Iteck = { 8 init: function () { 9 this.body = $('body'); 10 } 11 }; 12 13 14 $.fn.changeElementType = function(newType) { 15 var attrs = {}; 16 if (!(this[0] && this[0].attributes)) 17 return; 18 19 $.each(this[0].attributes, function(idx, attr) { 20 attrs[attr.nodeName] = attr.nodeValue; 21 }); 22 this.replaceWith(function() { 23 return $("<" + newType + "/>", attrs).append($(this).contents()); 24 }); 25 } 26 27 $(window).on("load", function() { // makes sure the whole site is loaded 28 29 Splitting(); 30 31 //script for mobile menu 32 $('.mobile-wrapper').each(function() { 33 var $this = $(this); 34 $(this).find('.hamburger').on('click', function(event) { 35 $this.find('.fat-nav').fadeToggle(); 36 $this.find('.fat-nav').toggleClass('active'); 37 $(this).toggleClass('active'); 38 $('body').toggleClass('nav-active'); 39 event.preventDefault(); 40 }); 41 }); 42 43 $('.fat-list').changeElementType('ul'); 44 $('.fat-nav a').on('click', function(event) { 45 $('.fat-nav').removeClass('active'); 46 $('.fat-nav').fadeOut(); 47 $('.hamburger').removeClass('active'); 48 $('body').removeClass('nav-active'); 49 }); 50 $( '<a href="#" class="menu-item-icon"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg></a>' 51 ).insertAfter( '.fat-nav .menu-item-has-children > a, .fat-nav .page_item_has_children > a' ); 52 $('.fat-nav .menu-item-has-children .menu-item-icon, .fat-nav .page_item_has_children .menu-item-icon').on('click', function(t) { 53 t.stopPropagation(), 54 t.preventDefault(), 55 $(this).toggleClass('active'); 56 var n = $(this).next('ul'), 57 o = $(this) 58 .closest('ul') 59 .children('li'); 60 o 61 .find('.sub-menu') 62 .not(n) 63 .slideUp('fast'), 64 o 65 .find('.children') 66 .not(n) 67 .slideUp('fast'), 68 o 69 .find('.menu-item-icon') 70 .not(this) 71 .removeClass('active'), 72 n.slideToggle('fast'); 73 }) 74 75 //sticky navigation 76 $(".stuck-nav").sticky({ 77 topSpacing: 0, 78 }); 79 80 //reduce next/prev link title 81 $('.pagi-title').each(function(){ 82 $(this).text($(this).text().substring(0,38)); 83 }); 84 85 86 if (Modernizr.touch) { 87 //add class on touch device 88 $('body').addClass('no-para'); 89 } 90 }); 91 92 93 94 95 96 // script popup image 97 $('.popup-img').magnificPopup({ 98 type: 'image' 99 }); 100 101 // script fixed-sidebar 102 $('.fixed-sidebar').theiaStickySidebar({ 103 // Settings 104 additionalMarginTop: 105 105 }); 106 107 // script popup image 108 $('.blog-popup-img').magnificPopup({ 109 type: 'image', 110 gallery: { 111 enabiteck: true 112 } 113 }); 114 115 // Video responsive 116 $("body").fitVids(); 117 118 //script for navigation(superfish) 119 $('.main-menu.menu-wrapper ul').superfish({ 120 delay: 400, //delay on mouseout 121 animation: { 122 opacity: 'show', 123 height: 'show' 124 }, // fade-in and slide-down animation 125 animationOut: { 126 opacity: 'hide', 127 height: 'hide' 128 }, 129 speed: 200, // animation speed 130 speedOut: 200,
131 autoArrows: false // disable generation of arrow mark-up 132 }) 133 134 135 /*--------------------------Menu style-3---------------------------*/ 136 137 138 $('.iteck-menu.style-3 .navigation > li').on('mouseenter', function () { 139 $(this).css("opacity", "1").siblings().css("opacity", ".5"); 140 }); 141 142 $('.iteck-menu.style-3 .navigation > li').on('mouseleave', function () { 143 $(".iteck-menu.style-3 .navigation > li").css("opacity", "1"); 144 }); 145/*-------------------------------------------------------------------------------------*/ 146 var wind = $(window); 147 function iteckNoScroll() { 148 window.scrollTo(0, 0); 149 } 150 151 function iteckHeader() { 152 var open = false, 153 navDark = $(".topnav.dark"), 154 myNav = $(".topnav"), 155 logoChan = $(".topnav.dark .logo img"), 156 lastScroll = 0; 157 158 $(".sub-menu .link").removeClass("link").addClass("sub-link"); 159 myNav.addClass("no-scroll"); 160 wind.on("scroll", function () { 161 var bodyScroll = wind.scrollTop(), 162 navbar = $(".topnav"); 163 164 navbar.removeClass("no-scroll"); 165 166 if (navbar.hasClass('scroll-bt')) { 167 168 if (bodyScroll > lastScroll) { 169 navbar.removeClass("nav-scroll"); 170 } else { 171 navbar.addClass("nav-scroll"); 172 } 173 174 } else { 175 176 if (bodyScroll > 100) { 177 navbar.addClass("nav-scroll"); 178 } else { 179 navbar.removeClass("nav-scroll"); 180 } 181 } 182 lastScroll = bodyScroll; 183 if (lastScroll == 0 && navbar.hasClass('scroll-bt')) { 184 navbar.removeClass("nav-scroll").addClass("no-scroll"); 185 } 186 }); 187 188 $('.topnav .menu-icon, .topnav .hamburger').on('click', function () { 189 open = !open; 190 $('.topnav').toggleClass("open"); 191 $('.hamenu').toggleClass("open"); 192 $('.hamburger').toggleClass("is-active"); 193 if (open) { 194 $('.hamenu').animate({ left: 0 }); 195 $('.topnav .menu-icon .text').addClass('open'); 196 navDark.addClass("navlit"); 197 logoChan.attr('src', 'img/logo-light.png'); 198 window.addEventListener('scroll', witeckNoScroll); 199 } else { 200 $('.hamenu').delay(300).animate({ left: "-100%" }); 201 $('.topnav .menu-icon .text').removeClass('open'); 202 navDark.removeClass("navlit"); 203 logoChan.attr('src', 'img/logo-dark.png'); 204 window.removeEventListener('scroll', witeckNoScroll); 205 } 206 }); 207 208 $('.internal .link').on('click', function () { 209 open = !open; 210 $('.hamenu').addClass('has-internal-link').toggleClass("open").css({ left: "-100%",opacity: "0" }); 211 $('.topnav').toggleClass("open"); 212 $('.hamburger').toggleClass("is-active"); 213 214 $('.topnav .menu-icon .text').removeClass('open'); 215 navDark.removeClass("navlit"); 216 window.removeEventListener('scroll', witeckNoScroll); 217 setTimeout(function() { 218 $('.hamenu').css({ opacity: "1" }).removeClass('has-internal-link'); 219 }, 2000); 220 }); 221 222 $('.hamenu .menu-links .main-menu li').on('mouseenter', function () { 223 $(this).css("opacity", "1").siblings().css("opacity", ".5"); 224 }); 225 $('.hamenu .menu-links .main-menu li').on('mouseleave', function () { 226 $(".hamenu .menu-links .main-menu li").css("opacity", "1"); 227 }); 228 $('li .dmenu').on('click', function () { 229 $(".main-menu").addClass("gosub"); 230 $(this).parents('.sub-menu').removeClass("sub-open"); 231 $(this).parent().next().addClass("sub-open"); 232 }); 233 $('.sub-menu.depth_0 > ul > li > div > .sub-link.back').on('click', function () { 234 $(".main-menu").removeClass("gosub"); 235 var parent0 = $(this).parents('.sub-menu'); 236 parent0.removeClass("sub-open"); 237 }); 238 $('.sub-menu.depth_1 > ul > li > div > .sub-link.back').on('click', function () { 239 var parent = $(this).parents('.sub-menu.depth_1'); 240 var parparent = parent.parents('.sub-menu.depth_0'); 241 parent.removeClass("sub-open"); 242 parparent.addClass("sub-open"); 243 }); 244 $('.sub-menu.depth_2 > ul > li > div > .sub-link.back').on('click', function () { 245 var parent = $(this).parents('.sub-menu.depth_2'); 246 var parparent = parent.parents('.sub-menu.depth_1'); 247 parent.removeClass("sub-open"); 248 parparent.addClass("sub-open"); 249 }); 250 }; 251 iteckHeader(); 252 253 254 /* =============================== Data attributes =============================== */ 255 256 function iteck_data_attributes() { 257 258 /*----------------------------------------------tooltip--------------------------*/ 259 $('[data-tooltip-tit]').hover(function () { 260 $('<div class="div-tooltip-tit"></div>').text($(this).attr('data-tooltip-tit')).appendTo('.iteck-tooltip').fadeIn('slow'); 261 }, function () { 262 $('.div-tooltip-tit').remove(); 263 }).mousemove(function (e) { 264 $('.div-tooltip-tit').css({ top: e.clientY + 10, left: e.clientX + 20 }) 265 }); 266 $('[data-tooltip-sub]').hover(function () { 267 $('<div class="div-tooltip-sub"></div>').text($(this).attr('data-tooltip-sub')).appendTo('.iteck-tooltip').fadeIn('slow'); 268 }, function () { 269 $('.div-tooltip-sub').remove(); 270 }).mousemove(function (e) { 271 $('.div-tooltip-sub').css({ top: e.clientY + 60, left: e.clientX + 20 }) 272 }); 273
274 /*-------------------------------------------Background-------------------------*/ 275 276 var pageSection = $(".bg-img, section"); 277 pageSection.each(function (indx) { 278 279 if ($(this).attr("data-background")) { 280 $(this).css("background-image", "url(" + $(this).data("background") + ")"); 281 } 282 }); 283 }; 284 iteck_data_attributes(); 285 286/*===================================================isotope portfolio 1,2,3 ==============================================*/ 287 288 $(window).on("load", function() { // makes sure the whole site is loaded 289 // filter items when filter link is clicked 290 var $container = $('.portfolio-body'); 291 $('.port-filter a').on('click', function() { 292 var selector = $(this).attr('data-filter'); 293 $container.isotope({ 294 itemSelector: '.port-item', 295 filter: selector 296 }); 297 return false; 298 }); 299 300 }); 301 302 /* =============================== isotope Masonery =============================== */ 303 $(window).on("load", function() { // makes sure the whole site is loaded 304 305 $('.iteck-gallery').isotope({ 306 itemSelector: '.items' 307 }); 308 309 var $gallery = $('.iteck-gallery').isotope(); 310 311 $('.filtering').on('click', 'span', function () { 312 var filterValue = $(this).attr('data-filter'); 313 $gallery.isotope({ filter: filterValue }); 314 }); 315 316 $('.filtering').on('click', 'span', function () { 317 $(this).addClass('active').siblings().removeClass('active'); 318 }); 319 }); 320 321 322 /*------------------------------------------------------------------------------*/ 323 324 $(window).on("load", function() { // makes sure the whole site is loaded 325 // filter items when filter link is clicked 326 var $container = $('.iteck-gallery'); 327 $('.filtering span').on('click', function() { 328 var selector = $(this).attr('data-filter'); 329 $container.isotope({ 330 itemSelector: '.items', 331 filter: selector 332 }); 333 return false; 334 }); 335 336 }); 337 338 339 /* =============================== Header Search =============================== */ 340 341 342 343 $(document).on('click', '.close-black-block', function(event) { 344 event.preventDefault(); 345 $('.search-icon-header').removeClass('open'); 346 $(".focus-input").focus(); 347 }); 348 349 $(document).on('click', '.search-icon-header > a.search', function(event) { 350 event.preventDefault(); 351 $('.search-icon-header').addClass('open'); 352 $(".focus-input").focus(); 353 }); 354 355 $(document).on('click', '.iteck-search-icon a', function(event) { 356 event.preventDefault(); 357 $('.search-icon-header').addClass('open'); 358 $(".focus-input").focus(); 359 }); 360 361 362 //add image mask 363 $('.bg-with-mask').each(function() { 364 $(this).append('<div class="slider-mask"></div>'); 365 }); 366 367 //slider for blog slider 368 $('.blog-slider').slick({ 369 autoplay: true, 370 dots: false, 371 nextArrow: '<i class="fa fa-arrow-right"></i>', 372 prevArrow: '<i class="fa fa-arrow-left"></i>', 373 speed: 800, 374 fade: true, 375 pauseOnHover: false, 376 pauseOnFocus: false 377 }); 378 379 //replace the data-background into background image 380 $(".blog-img-bg").each(function() { 381 var imG = $(this).data('background'); 382 $(this).css('background-image', "url('" + imG + "') " 383 384 ); 385 }); 386 387 //change h5 class for custom footer 388 $(".iteck-custom-footer div[class*='elementor-widget-wp-'] h5").each(function() { 389 $(this).addClass("elementor-heading-title"); 390 }); 391 392 //sticky custom header 393 $('.elementor-section:has(.custom-sticky)').first().addClass('stuck-nav iteck-custom-nav'); 394 395 //adding/removing sticky menu class 396 $('.stuck-nav').on('sticky-start', function() { 397 $(this).addClass('iteck-sticky-menu'); 398 $(this).find('.iteck-nav,.mobile-wrapper').addClass('iteck-stick') 399 }); 400 $('.stuck-nav').on('sticky-end', function() { 401 $(this).removeClass('iteck-sticky-menu'); 402 $(this).find('.iteck-nav,.mobile-wrapper').removeClass('iteck-stick') 403 }); 404 405 //add class for hovering team & hovering icon 406 $('.elementor-widget-iteck-team-hover,.elementor-widget-iteck-texticon-hover').each(function() { 407 $(this).closest('.elementor-column-wrap').addClass('hovering'); 408 }); 409 410 //-----------------------------Woocommerce------------------------------------------------------// 411 412 $('<div class="quantity-nav"><div class="quantity-button quantity-up">+</div><div class="quantity-button quantity-down">-</div></div>' 413 ).insertAfter('.quantity input'); 414 415 $('.quantity').each(function() { 416 var t, n, o, i; 417 var e = $(this); 418 t = e.find('input[type="number"]'); 419 n = e.find('.quantity-up'); 420 o = e.find('.quantity-down'); 421 i = t.attr('min'); 422 n.on('click', function() { 423 var n = parseFloat(t.val()); 424 o = n + 1;
425 e.find('input').val(o), e.find('input').trigger('change'); 426 }); 427 428 o.on('click', function() { 429 var n = parseFloat(t.val()); 430 if (n <= i) var o = n; 431 else var o = n - 1; 432 e.find('input').val(o), e.find('input').trigger('change'); 433 }); 434 435 }); 436 437 $(function () { 438 var wow = new WOW({ 439 boxClass: 'wow', 440 animateClass: 'animated', 441 offset: 0, 442 mobile: false, 443 live: true, 444 scrollContainer: null, 445 }); 446 wow.init(); 447 }); 448 449//remove empty tags 450$('strong:empty').remove(); 451$('p:empty').not('[role="status"]').remove(); 452$("form.track_order").unwrap(); 453 454 //-----------------------------Cursor animation ------------------------------------------------------// 455 456 function mousecursor() { 457 if ($("body")) { 458 const e = document.querySelector(".cursor-inner"), 459 t = document.querySelector(".cursor-outer"); 460 let n, i = 0, 461 o = !1; 462 window.onmousemove = function (s) { 463 o || (t.style.transform = "translate(" + s.clientX + "px, " + s.clientY + "px)"), e.style.transform = "translate(" + s.clientX + "px, " + s.clientY + "px)", n = s.clientY, i = s.clientX 464 }, $("body").on("mouseenter", "a, .cursor-pointer", function () { 465 e.classList.add("cursor-hover"), t.classList.add("cursor-hover") 466 }), $("body").on("mouseleave", "a, .cursor-pointer", function () { 467 $(this).is("a") && $(this).closest(".cursor-pointer").length || (e.classList.remove("cursor-hover"), t.classList.remove("cursor-hover")) 468 }), e.style.visibility = "visible", t.style.visibility = "visible" 469 } 470 }; 471 472 if ($(".mouse-cursor").size()) { 473 mousecursor(); 474 } 475 476 477 478 //----------------------------Chatc Animation-------------------------------------------------------// 479 // Go through a sentence, wrap its characters with spans 480 function setUpCharacters() { 481 var $sentences = $('.iteck-fadinup-split .elementor-heading-title'); 482 483 // Run for each sentence 484 $sentences.each(function() { 485 var $sentence = $(this); 486 var newContent = ''; 487 var i=0; 488 489 // Go through all characters of the sentence 490 for (i = 0; i < $sentence.text().length; i++) { 491 var substring = $sentence.text().substr(i, 1); 492 493 // If we have a character, wrap it 494 if (substring != " ") { 495 newContent += '<span style="--char-index:'+i+';">' + substring +'</span>'; 496 } else { 497 newContent += substring; 498 } 499 } 500 501 // Replace content 502 $sentence.html(newContent); 503 }); 504 } 505 setUpCharacters(); 506 507 508 //Cache reference to window and animation items 509 var $animation_elements = $('.iteck-fadinup-split .elementor-heading-title span'); 510 var $window = $(window); 511 512 function Iteck_check_if_in_view() { 513 var window_height = $window.height(); 514 var window_top_position = $window.scrollTop(); 515 var window_bottom_position = (window_top_position + window_height); 516 517 $.each($animation_elements, function() { 518 var $element = $(this); 519 var element_height = $element.outerHeight(); 520 var element_top_position = $element.offset().top; 521 var element_bottom_position = (element_top_position + element_height); 522 523 //check to see if this current container is within viewport 524 if ((element_bottom_position >= window_top_position) && 525 (element_top_position <= window_bottom_position)) { 526 $element.addClass('active'); 527 } 528 }); 529 } 530 531 $window.on('scroll resize', Iteck_check_if_in_view); 532 $window.trigger('scroll'); 533 534 535 /* =============================== fade slideshow =============================== */ 536 $(window).scroll(function () { 537 var scrolled = $(this).scrollTop(); 538 $('.fixed-slider .caption , .fixed-slider .capt .parlx').css({ 539 'transform': 'translate3d(0, ' + -(scrolled * 0.20) + 'px, 0)', 540 'opacity': 1 - scrolled / 600 541 }); 542 }); 543 544 /* =============================== Scroll back to top =============================== */ 545 546 $(document).ready(function () { 547 "use strict"; 548 549 var progressPath = document.querySelector('.progress-wrap path'); 550 var pathLength = progressPath.getTotalLength(); 551 progressPath.style.transition = progressPath.style.WebkitTransition = '
551none'; 552 progressPath.style.strokeDasharray = pathLength + ' ' + pathLength; 553 progressPath.style.strokeDashoffset = pathLength; 554 progressPath.getBoundingClientRect(); 555 progressPath.style.transition = progressPath.style.WebkitTransition = 'stroke-dashoffset 10ms linear'; 556 var updateProgress = function () { 557 var scroll = $(window).scrollTop(); 558 var height = $(document).height() - $(window).height(); 559 var progress = pathLength - (scroll * pathLength / height); 560 progressPath.style.strokeDashoffset = progress; 561 } 562 updateProgress(); 563 $(window).scroll(updateProgress); 564 var offset = 150; 565 var duration = 550; 566 jQuery(window).on('scroll', function () { 567 if (jQuery(this).scrollTop() > offset) { 568 jQuery('.progress-wrap').addClass('active-progress'); 569 } else { 570 jQuery('.progress-wrap').removeClass('active-progress'); 571 } 572 }); 573 jQuery('.progress-wrap').on('click', function (event) { 574 event.preventDefault(); 575 jQuery('html, body').animate({ scrollTop: 0 }, duration); 576 return false; 577 }) 578 579 580 }); 581 582 /* =============================== Progress =============================== */ 583 584 585 function iteck_load_content_area_scripts($) { 586 587 /* progress circle */ 588 $('.skills.style-1').each(function () { 589 var startcolor = $(this).data('bgcolor'), 590 endcolor = $(this).data('fgcolor'), 591 num = $(this).data('num'), 592 speed = $(this).data('speed'), 593 thickness = $(this).data('thickness'), 594 suffix = $(this).data('suffix'); 595 $(this).circleProgress({ 596 value: 1, 597 fill: endcolor, 598 emptyFill: startcolor, 599 thickness: thickness, 600 size: 140, 601 animation: {duration: speed, easing: "circleProgressEasing"}, 602 }).on('circle-animation-progress', function (event, progress) { 603 $(this).find('.num').html(Math.round(num * progress) + suffix); 604 }); 605 }); 606 607 } 608 609 610 /* Circle Bars - Knob */ 611 if (typeof ($.fn.knob) !== undefined) { 612 $('.knob.knob-percent.dial').each(function () { 613 var $this = $(this), 614 knobVal = $this.attr('data-rel'); 615 $this.knob({ 616 'draw': function () { 617 }, 618 'format': function (value) { 619 return value + '%'; 620 } 621 }); 622 $this.appear(function () { 623 $({ 624 value: 0 625 }).animate({ 626 value: knobVal 627 }, { 628 duration: 2000, 629 easing: 'swing', 630 step: function () { 631 $this.val(Math.ceil(this.value)).trigger('change'); 632 } 633 }); 634 }, { 635 accX: 0, 636 accY: -150 637 }); 638 }); 639 } 640 641 /* =============================== Progress bar =============================== */ 642 var wind = $(window); 643 wind.on('scroll', function () { 644 $(".skill-progress .progres").each(function () { 645 var bottom_of_object = 646 $(this).offset().top + $(this).outerHeight(); 647 var bottom_of_window = 648 $(window).scrollTop() + $(window).height(); 649 var myVal = $(this).attr('data-value'); 650 if (bottom_of_window > bottom_of_object) { 651 $(this).css({ 652 width: myVal 653 }); 654 } 655 }); 656 }); 657 658 659 /* =============================== Intersection Observer =============================== */ 660 661 if (!!window.IntersectionObserver) { 662 let observer = new IntersectionObserver((entries, observer) => { 663 entries.forEach(entry => { 664 if (entry.isIntersecting) { 665 entry.target.classList.add("animated"); 666 observer.unobserve(entry.target); 667 } 668 }); 669 }, { 670 rootMargin: "0px 0px -100px 0px" 671 }); 672 document.querySelectorAll('.animate').forEach(block => { 673 observer.observe(block) 674 }); 675 } else { 676 document.querySelectorAll('.animate').forEach(block => { 677 block.classList.remove('animate') 678 }); 679 } 680 681 /* =============================== Swiper showcases with data =============================== */ 682 683 684 $('[data-carousel="swiper"]').each(function () { 685 686 var containe = $(this).find('[data-swiper="container"]').attr('id'); 687 var pagination = $(this).find('[data-swiper="pagination"]').attr('id'); 688 var prev = $(this).find('[data-swiper="prev"]').attr('id'); 689 var next = $(this).find('[data-swiper="next"]').attr('id'); 690 var items = $(this).data('items'); 691 var autoplay = $(this).data('autoplay'); 692 var iSlide = $(this).data('initial'); 693 var loop = $(this).data('loop'); 694 var parallax = $(this).data('parallax'); 695 var space = $(this).data('space'); 696 var speed = $(this).data('speed'); 697 var center = $(this).data('center'); 698 var effect = $(this).data('effect'); 699 var direction = $(this).data('direction'); 700 var mousewheel = $(this).data('mousewheel'); 701 702 // Configuration 703 var conf = { 704 705 }; 706 707 // Responsive 708 if ($(this).hasClass('showcase-grid')) { 709 var conf = { 710 711 navigation: { 712 nextEl: '.swiper-button-next', 713 prevEl: '.swiper-button-prev' 714 }, 715 716 breakpoints: { 717 0: { 718 slidesPerView: 1, 719 }, 720 640: { 721 slidesPerView: 2, 722 }, 723 768: { 724 slidesPerView: 2, 725 }, 726 1024: { 727 slidesPerView: 4, 728 }, 729 } 730 }; 731 }; 732 733 if ($(this).hasClass('showcase-carus')) { 734 var conf = { 735 736 navigation: { 737 nextEl: '.swiper-button-next', 738 prevEl: '.swiper-button-prev' 739 }, 740 741 breakpoints: { 742 0: { 743 slidesPerView: 1, 744 spaceBetween: 0, 745 }, 746 640: { 747 slidesPerView: 1, 748 spaceBetween: 0, 749 }, 750 768: { 751 slidesPerView: 2, 752 spaceBetween: 30, 753 }, 754 1024: { 755 slidesPerView: 2, 756 spaceBetween: 200, 757 }, 758 } 759 }; 760 }; 761 762 if (items) { 763 conf.slidesPerView = items 764 }; 765 if (autoplay) { 766 conf.autoplay = autoplay 767 }; 768 if (iSlide) { 769 conf.initialSlide = iSlide 770 }; 771 if (center) { 772 conf.centeredSlides = center 773 }; 774 if (loop) { 775 conf.loop = loop 776 }; 777 if (parallax) { 778 conf.parallax = parallax 779 }; 780 if (space) { 781 conf.spaceBetween = space 782 }; 783 if (speed) { 784 conf.speed = speed 785 }; 786 if (mousewheel) { 787 conf.mousewheel = mousewheel 788 }; 789 if (effect) { 790 conf.effect = effect 791 }; 792 if (direction) { 793 conf.direction = direction 794 }; 795 if (prev) { 796 conf.prevButton = '#' + prev 797 }; 798 if (next) { 799 conf.nextButton = '#' + next 800 }; 801 if (pagination) { 802 conf.pagination = '#' + pagination, 803 conf.paginationClickable = true 804 }; 805 806 // Initialization 807 if (containe) { 808 var initID = '#' + containe; 809 var init = new Swiper(initID, conf); 810 }; 811 }); 812 813 /* =============================== offcanvas ======================================= */ 814 var open = false; 815 816 $('.iteck-offcanvas .menu-icon').on('click', function () { 817 open = !open; 818 819 $('.side-panel').toggleClass("open"); 820 $('.iteck-offcanvas .menu-icon .text').toggleClass("open"); 821 });
822 823 /* =============================== Preloader page =============================== */ 824 825 var paceOptions = { 826 ajax: true, 827 document: true, 828 eventLag: false 829 }; 830 831 Pace.on('done', function () { 832 $('#preloader').addClass("isdone"); 833 $('.loading-text').addClass("isdone"); 834 }); 835 /* =============================== Dark/Light switcher =============================== */ 836 837 function handlePageColorSwitcher() { 838 var switcher = $('.iteck-mode-switcher'); 839 var switcherOn = $('.iteck-mode-switcher-item'); 840 var switcherDark = $('.iteck-mode-switcher-item.dark'); 841 var switcherAuto = $('.iteck-mode-switcher-item.auto'); 842 var switcherLight = $('.iteck-mode-switcher-item.light'); 843 var switcherItems = switcher.find('.iteck-mode-switcher-item, .iteck-mode-switcher-toddler'); 844 845 equalSize(switcherItems, 'width'); 846 847 if ($('body').hasClass('iteck-dark-mode')) { 848 switcher.addClass('dark'); 849 }else if ($('body').hasClass('iteck-auto-mode')) { 850 switcher.addClass('auto'); 851 } 852 853 switcherDark.on('click', function(){ 854 switcherOn.removeClass('on'); 855 switcherDark.addClass('on'); 856 switcher.removeClass('light auto'); 857 switcher.addClass('dark'); 858 $('body').removeClass('iteck-auto-mode'); 859 $('body').addClass('iteck-dark-mode'); 860 861 }); 862 switcherAuto.on('click', function(){ 863 switcherOn.removeClass('on'); 864 switcherAuto.addClass('on'); 865 switcher.removeClass('dark light'); 866 switcher.addClass('auto'); 867 $('body').removeClass('iteck-dark-mode'); 868 $('body').addClass('iteck-auto-mode'); 869 }); 870 switcherLight.on('click', function(){ 871 switcherOn.removeClass('on'); 872 switcherLight.addClass('on'); 873 switcher.removeClass('dark auto'); 874 switcher.addClass('light'); 875 $('body').removeClass('iteck-dark-mode'); 876 $('body').removeClass('iteck-auto-mode'); 877 }); 878 879 } 880 function equalSize(items, attr) { 881 var maxSize = 0; 882 var value = 0; 883 884 items.each(function(){ 885 value = $(this).css(attr).replace(/(^\d+)(.+$)/i,'$1'); 886 887 if (value > maxSize) { 888 maxSize = +($(this).css(attr).replace(/(^\d+)(.+$)/i,'$1')); 889 } 890 }); 891 892 var css = {}; 893 css[attr] = maxSize; 894 895 items.css(css); 896 } 897 898 /* =============================== Excute work =============================== */ 899 $(window).on('load', function () { 900 handlePageColorSwitcher(); 901 }); 902 /* =============================== Counter =============================== */ 903 var counterContainer = $('.counter'); 904 if (counterContainer.length) { 905 console.log(counterContainer); 906 counterContainer.countUp({ 907 delay: counterContainer.data('itecksteps'), 908 time: counterContainer.data('iteckspeed') 909 }); 910 } 911 912 /* =============================== sticky header/footer =============================== */ 913 914 $(window).on("scroll", function(){ 915 916 var site_header = $('.iteck-custom-header').outerHeight() + 1; 917 if ($(window).scrollTop() >= site_header) { 918 $('.iteck-sticky-top').addClass('is-stuck'); 919 }else { 920 $('.iteck-sticky-top').removeClass('is-stuck'); 921 } 922 923 var site_footer = $('.iteck-custom-footer').outerHeight() + 1; 924 if ($(window).scrollTop() + $(window).height() >= site_footer) { 925 $('.iteck-sticky-bottom').addClass('is-stuck'); 926 }else { 927 $('.iteck-sticky-bottom').removeClass('is-stuck'); 928 } 929 }); 930 931 /* =============================== related-postes-slider =============================== */ 932 933 var swiper = new Swiper('.related-postes-slider .swiper-container', { 934 slidesPerView: 3, 935 spaceBetween: 80, 936 centeredSlides: true, 937 speed: 1000, 938 pagination: false, 939 navigation: { 940 nextEl: '.related-postes-slider .swiper-button-next', 941 prevEl: '.related-postes-slider .swiper-button-prev', 942 }, 943 mousewheel: false, 944 keyboard: true, 945 autoplay: { 946 delay: 4000, 947 }, 948 loop: true, 949 breakpoints: { 950 0: { 951 slidesPerView: 1, 952 }, 953 480: { 954 slidesPerView: 1, 955 }, 956 787: { 957 slidesPerView: 2, 958 }, 959 991: { 960 slidesPerView: 2, 961 }, 962 1200: { 963 slidesPerView: 3, 964 } 965 } 966 });
967 968 /* =============================== Blog Slider =============================== */ 969 970 var swiper = new Swiper('.blog-details-slider .swiper-container', { 971 slidesPerView: 1, 972 spaceBetween: 0, 973 effect: "fade", 974 speed: 1000, 975 pagination: { 976 el: ".blog-details-slider .swiper-pagination", 977 clickable: "true", 978 }, 979 navigation: { 980 nextEl: '.blog-details-slider .swiper-button-next', 981 prevEl: '.blog-details-slider .swiper-button-prev', 982 }, 983 mousewheel: false, 984 keyboard: true, 985 autoplay: { 986 delay: 4000, 987 }, 988 loop: true 989 }); 990 991 992 /* =============================== The end of scripts =============================== */ 993 994})(jQuery); 995 996
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.