1(function ($) { 2 "use strict";// All functions ------------------ 3 function initTheroof() { 4 "use strict"; 5 $(".loader-holder").fadeOut(500, function () { 6 $("#main-theme").animate({ 7 opacity: "1" 8 }, 500); 9 }); 10 if ($('#topnav-menu').length) { 11 $('#topnav-menu li.menu-item-has-children > a').append(' <i class="fas fa-caret-down"></i>') 12 } 13 // 14 if ($('.has-hex').length > 0) { 15 $('.has-hex').each(function () { 16 $(this).append('<div class="hex-bg"><span class="hex hex1"></span><span class="hex hex2"></span><span class="hex hex3"></span></div>') 17 }) 18 } 19 if ($('.has-hex2').length > 0) { 20 $('.has-hex2').each(function () { 21 $(this).append('<div class="hex-bg hex-bg2"><span class="hex hex1"></span><span class="hex hex2"></span><span class="hex hex3"></span></div>') 22 }) 23 } 24 if ($('.notifer-block').length > 0) { 25 $('.notifer-block').each(function () { 26 $(this).append('<div class="hero-canvas-wrap"><div class="dots gallery__dots" data-dots=""></div></div>') 27 }) 28 } 29 if ($('.has-square').length > 0) { 30 $('.has-square').each(function () { 31 $(this).append('<div class="sq-secdec"></div>') 32 }) 33 } 34 if ($('.has-map-bg').length > 0) { 35 $('.has-map-bg').each(function () { 36 $(this).append('<div class="footer-bg" data-ran="4"></div>') 37 }) 38 } 39 $(".style-select").niceSelect(); 40 // lightGallery------------------ 41 function lightGalleryInit() { 42 $(".image-popup").lightGallery({ 43 selector: "this", 44 cssEasing: "cubic-bezier(0.25, 0, 0.25, 1)", 45 download: false, 46 counter: false 47 }); 48 var o = $(".lightgallery"), 49 p = o.data("looped"); 50 o.lightGallery({ 51 selector: ".lightgallery a.popup-gal", 52 cssEasing: "cubic-bezier(0.25, 0, 0.25, 1)", 53 download: false, 54 loop: false, 55 counter: false 56 }); 57 $('.html5-videos').lightGallery({ 58 selector: 'this', 59 counter: false, 60 download: false, 61 zoom: false 62 }); 63 } 64 lightGalleryInit(); 65 // tabs ------------------ 66 $(".tabs-menu a").on("click", function (a) { 67 a.preventDefault(); 68 $(this).parent().addClass("current"); 69 $(this).parent().siblings().removeClass("current"); 70 var b = $(this).attr("href"); 71 $(this).parents(".tabs-act").find(".tab-content").not(b).css("display", "none"); 72 $(b).fadeIn(); 73 }); 74 // accordion ------------------ 75 $(".accordion-lite-header").on("click", function () { 76 $(this).parent(".accordion-lite-container").find(".accordion-lite_content").slideToggle(400); 77 $(this).toggleClass("acc_open"); 78 }); 79 //scroll animation------------------ 80 $(".stats").appear(function () { 81 $(".num").countTo(); 82 }); 83 84 $(".show-hidden-filters").on("click", function () { 85 $(this).toggleClass("shf_btn_active"); 86 $(".hidden-filter").toggleClass("vis_hiddenfilter"); 87 }); 88 // Other functions ------------------ 89 var n = $(".bg"); 90 n.each(function (a) { 91 if ($(this).attr("data-bg")) $(this).css("background-image", "url(" + $(this).data("bg") + ")"); 92 }); 93 if ($('.elementor-column.col-fixed').length > 0) { 94 $('.elementor-column.col-fixed').each(function () { 95 $(this).children().addClass('fix-bar') 96 }) 97 } 98 $(".fix-bar").scrollToFixed({ 99 // minWidth: 1064, 100 minWidth: 1024, 101 marginTop: 90, 102 removeOffsets: true, 103 limit: function () { 104 var a = $(".limit-box").offset().top - $(".fix-bar").outerHeight(true) + 36; 105 return a; 106 } 107 }); 108 if ($(".fixed-bar").outerHeight(true) < $(".post-container").outerHeight(true)) { 109 $(".fixed-bar").addClass("fixbar-action"); 110 $(".fixbar-action").scrollToFixed({ 111 // minWidth: 1064, 112 minWidth: 1024, 113 marginTop: function () { 114 var a = $(window).height() - $(".fixed-bar").outerHeight(true) - 120; 115 if (a >= 0) return 20; 116 return a; 117 }, 118 removeOffsets: true, 119 limit: function () { 120 var a = $(".limit-box").offset().top - $(".fixed-bar").outerHeight(); 121 return a; 122 } 123 }); 124 } else $(".fixed-bar").removeClass("fixbar-action"); 125 126 function o() { 127 if ($("form[name=cart]").length > 0) { 128 $("form[name=cart]").jAutoCalc("destroy"); 129 $("form[name=cart]").jAutoCalc({ 130 keyEventsFire: true, 131 decimalPlaces: 2, 132 emptyAsZero: true 133 }); 134 } 135 136 } 137 o(); 138 if ($(".rage-slider").length > 0) { 139 $(".rage-slider").ionRangeSlider(); 140 } 141 if ($(".shop-price").length > 0) { 142 $(".shop-price").ionRangeSlider({ 143 keyboard: true, 144 prefix: "$" 145 }); 146 } 147 148 var maxL = 90; 149 $(".dbig p").each(function (i, div) { 150 var text = $(div).text(); 151 if (text.length > maxL) { 152 var begin = text.substr(0, maxL), 153 end = text.substr(maxL); 154 $(div).html(begin).append($('<div class="hidden" />').html(end)); 155 } 156 }); 157 $(".custom-scroll-link").on("click", function () { 158 var a = 50; 159 if (location.pathname.replace(/^\//, "") == this.pathname.replace(/^\//, "") || location.hostname == this.hostname) { 160 var b = $(this.hash); 161 b = b.length ? b : $("[name=" + this.hash.slice(1) + "]"); 162 if (b.length) { 163 $("html,body").animate({ 164 scrollTop: b.offset().top - a 165 }, { 166 queue: false, 167 duration: 1200, 168 easing: "easeInOutExpo" 169 }); 170 return false; 171 } 172 } 173 }); 174 175 $('.cf_btn').on("click", function (e) { 176 e.preventDefault(); 177 $('.contact-form-wrap').fadeIn(400); 178 $("html, body").addClass("hid-body"); 179 $("#message").slideUp(100); 180 $(".custom-form").find("input[type=text], textarea").val(""); 181 }); 182 $('.contact-form-overlay , .close-contact-form').on("click", function () { 183 $('.contact-form-wrap').hide(); 184 $("html, body").removeClass("hid-body"); 185 }); 186 187 // Video------------------ 188 // function videoint() { 189 // // var v = $(".background-youtube-wrapper").data("vid"); 190 // // var f = $(".background-youtube-wrapper").data("mv"); 191 // // $(".background-youtube-wrapper").YTPlayer({
192 // // fitToBackground: true, 193 // // videoId: v, 194 // // pauseOnScroll: true, 195 // // mute: f, 196 // // callback: function () { 197 // // var a = $(".background-youtube-wrapper").data("ytPlayer").player; 198 // // } 199 // // }); 200 // var w = $(".background-vimeo").data("vim"), 201 // bvc = $(".background-vimeo"), 202 // bvmc = $(".media-container"), 203 // bvfc = $(".background-vimeo iframe "), 204 // vch = $(".video-container"); 205 // bvc.append('<iframe src="//player.vimeo.com/video/' + w + '?background=1" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen ></iframe>'); 206 // $(".video-holder").height(bvmc.height()); 207 // if ($(window).width() > 1024) { 208 // if ($(".video-holder").length > 0) 209 // if (bvmc.height() / 9 * 16 > bvmc.width()) { 210 // bvfc.height(bvmc.height()).width(bvmc.height() / 9 * 16); 211 // bvfc.css({ 212 // "margin-left": -1 * $("iframe").width() / 2 + "px", 213 // top: "-75px", 214 // "margin-top": "0px" 215 // }); 216 // } 217 // else { 218 // bvfc.width($(window).width()).height($(window).width() / 16 * 9); 219 // bvfc.css({ 220 // "margin-left": -1 * $("iframe").width() / 2 + "px", 221 // "margin-top": -1 * $("iframe").height() / 2 + "px", 222 // top: "50%" 223 // }); 224 // } 225 // } else if ($(window).width() < 760) { 226 // $(".video-holder").height(bvmc.height()); 227 // bvfc.height(bvmc.height()); 228 // } else { 229 // $(".video-holder").height(bvmc.height()); 230 // bvfc.height(bvmc.height()); 231 // } 232 // vch.css("width", $(window).width() + "px"); 233 // vch.css("height", Number(720 / 1280 * $(window).width()) + "px"); 234 // if (vch.height() < $(window).height()) { 235 // vch.css("height", $(window).height() + "px"); 236 // vch.css("width", Number(1280 / 720 * $(window).height()) + "px"); 237 // } 238 // } 239 // videoint(); 240 $(".to-top").on("click", function (a) { 241 a.preventDefault(); 242 $("html, body").animate({ 243 scrollTop: 0 244 }, 800); 245 return false; 246 }); 247 // if ($(".header-cart_wrap_container").length > 0) { 248 // var aps = new PerfectScrollbar('.header-cart_wrap_container', { 249 // swipeEasing: true, 250 // minScrollbarLength: 20 251 // }); 252 // } 253 var scwrp = $(".header-search-wrap"), 254 swlink = $(".show_search-btn"); 255 function showSearch() { 256 scwrp.fadeIn(1).addClass("vis-search").removeClass("novis_sarch") 257 swlink.addClass("scwllink2"); 258 hideCart(); 259 hideShare(); 260 } 261 function hideSearch() { 262 scwrp.fadeOut(1).removeClass("vis-search").addClass("novis_sarch"); 263 swlink.removeClass("scwllink2"); 264 } 265 swlink.on("click", function () { 266 if (scwrp.hasClass("novis_sarch")) showSearch(); 267 else hideSearch(); 268 }); 269 var wlwrp = $(".header-cart_wrap"), 270 wllink = $(".sc_btn"); 271 function showCart() { 272 wlwrp.fadeIn(1).addClass("vis-cart").removeClass("novis_cart") 273 aps.update(); 274 wllink.addClass("scwllink"); 275 hideShare(); 276 hideSearch(); 277 } 278 function hideCart() { 279 wlwrp.fadeOut(1).removeClass("vis-cart").addClass("novis_cart"); 280 wllink.removeClass("scwllink"); 281 } 282 wllink.on("click", function () { 283 if (wlwrp.hasClass("novis_cart")) showCart(); 284 else hideCart(); 285 }); 286 // // Share ------------------ 287 // $(".share-container").share({ 288 // networks: ['facebook', 'pinterest', 'twitter', 'linkedin', 'tumblr'] 289 // }); 290 // var swra = $(".share-wrapper"), 291 // clsh = $(".close-share-btn"), 292 // ssbtn = $(".showshare"); 293 // function showShare() { 294 // ssbtn.addClass("uncl-share"); 295 // swra.removeClass("isShare").addClass("share-wrapper_vis"); 296 // hideSearch(); 297 // hideCart(); 298 // } 299 // function hideShare() { 300 // ssbtn.removeClass("uncl-share"); 301 // swra.addClass("isShare").removeClass("share-wrapper_vis"); 302 // } 303 // clsh.on("click", function () { 304 // hideShare(); 305 // }); 306 // ssbtn.on("click", function () { 307 // if (swra.hasClass("isShare")) showShare(); 308 // else hideShare(); 309 // }); 310 // $(".show-reg-form").on("click", function () { 311 // showModal(); 312 // }); 313 // function showModal() { 314 // $(".main-register-container").fadeIn(1); 315 // $(".main-register").addClass("vis_mr"); 316 // } 317 // function hideModal() { 318 // $(".main-register-container").fadeOut(1);
319 // $(".main-register").removeClass("vis_mr"); 320 // } 321 // $(".close-reg-form").on("click", function () { 322 // hideModal(); 323 // }); 324 // duplicate ----------------- 325 $.fn.duplicate = function (a, b) { 326 var c = []; 327 for (var d = 0; d < a; d++) $.merge(c, this.clone(b).get()); 328 return this.pushStack(c); 329 }; 330 var cr = $(".star-rating"); 331 cr.each(function (cr) { 332 // var starcount = $(this).attr("data-starrating"); 333 // $("<i class='fas fa-star'></i>").duplicate(starcount).prependTo(this); 334 335 var rating = Math.round(parseFloat($(this).attr("data-rating"))), 336 stars = $(this).attr('data-stars') 337 if ($(this).children('.stars-wrapper').length) $(this).children('.stars-wrapper').remove() 338 if (rating > 0) { 339 $(this).prepend('<span class="stars-wrapper"></span>') 340 if (rating < parseFloat(stars)) { 341 var sub = parseInt(stars - rating); 342 $("<i class='far fa-star'></i>").duplicate(sub).prependTo($(this).children('.stars-wrapper')); 343 $("<i class='fas fa-star'></i>").duplicate(rating).prependTo($(this).children('.stars-wrapper')); 344 } else { 345 $("<i class='fas fa-star'></i>").duplicate(rating).prependTo($(this).children('.stars-wrapper')); 346 } 347 } 348 }); 349 $(window).on("scroll", function () { 350 if ($(".progress-bar").length > 0) { 351 var a = $(document).height(); 352 var b = $(window).height(); 353 var c = $(window).scrollTop(); 354 var d = c / (a - b) * 100; 355 $(".progress-bar").css({ 356 width: d + "%" 357 }); 358 } 359 if ($(this).scrollTop() > 150) { 360 $(".top-bar, .top-hide-on-scroll").addClass("scroll-sticky"); 361 } else { 362 $(".top-bar, .top-hide-on-scroll").removeClass("scroll-sticky"); 363 } 364 if ($(this).scrollTop() > 46) { 365 $('body').addClass("adbar-scroll"); 366 } else { 367 $('body').removeClass("adbar-scroll"); 368 } 369 }); 370 $("<span class='footer-bg-pin'></span>").duplicate(4).prependTo(".footer-bg"); 371 function heroAnim() { 372 function a(a) { 373 var b = a.length, 374 c, d; 375 while (b) { 376 d = Math.floor(Math.random() * b--); 377 c = a[b]; 378 a[b] = a[d]; 379 a[d] = c; 380 } 381 return a; 382 } 383 var b = $(".footer-bg-pin"); 384 $(a(b).slice(0, $(".footer-bg").data("ran"))).each(function (a) { 385 var bc = $(this); 386 b.removeClass("footer-bg-pin-vis") 387 bc.addClass("footer-bg-pin-vis"); 388 }); 389 } 390 setInterval(function () { 391 heroAnim(); 392 }, 2000); 393 if ($(".hero-slider").length > 0) { 394 var hs = new Swiper(".hero-slider .swiper-container", { 395 preloadImages: false, 396 loop: true, 397 grabCursor: true, 398 speed: 2400, 399 spaceBetween: 0, 400 effect: "slide", 401 mousewheel: false, 402 slidesPerView: '1', 403 parallax: true, 404 pagination: { 405 el: '.hero-slider-pagination', 406 clickable: true, 407 }, 408 navigation: { 409 nextEl: '.hero-slider-cont-next', 410 prevEl: '.hero-slider-cont-prev', 411 }, 412 autoplay: { 413 delay: 4000, 414 disableOnInteraction: false 415 } 416 }); 417 hs.on("slideChangeTransitionStart", function () { 418 $(".slider-progress-bar").removeClass("act-slider"); 419 }); 420 hs.on("slideChangeTransitionEnd", function () { 421 $(".slider-progress-bar").addClass("act-slider"); 422 }); 423 var autobtn = $(".play-pause_slider"); 424 425 function autoEnd() { 426 autobtn.removeClass("auto_actslider"); 427 hs.autoplay.stop(); 428 } 429 function autoStart() { 430 autobtn.addClass("auto_actslider"); 431 hs.autoplay.start(); 432 } 433 autobtn.on("click", function () { 434 if (autobtn.hasClass("auto_actslider")) autoEnd(); 435 else autoStart(); 436 return false; 437 }); 438 } 439 if ($(".fw-carousel").length > 0) { 440 var totalSlides2 = $(".fw-carousel .swiper-slide").length; 441 var mouseContr = $(".fw-carousel").data("mousecontrol"); 442 var j2 = new Swiper(".fw-carousel .swiper-container", { 443 preloadImages: false, 444 loop: true, 445 freeMode: false, 446 slidesPerView: 'auto', 447 spaceBetween: 10, 448 grabCursor: true, 449 mousewheel: mouseContr, 450 speed: 1400, 451 centeredSlides: true, 452 effect: "slide", 453 pagination: {
454 el: '.ss-slider-pagination', 455 clickable: true, 456 }, 457 navigation: { 458 nextEl: '.fw-carousel-button-next', 459 prevEl: '.fw-carousel-button-prev', 460 }, 461 }); 462 } 463 if ($(".single-slider").length > 0) { 464 var j2 = new Swiper(".single-slider .swiper-container", { 465 preloadImages: false, 466 slidesPerView: 1, 467 spaceBetween: 0, 468 loop: true, 469 autoHeight: true, 470 grabCursor: true, 471 mousewheel: false, 472 pagination: { 473 el: '.ss-slider-pagination', 474 clickable: true, 475 }, 476 navigation: { 477 nextEl: '.ss-slider-cont-next', 478 prevEl: '.ss-slider-cont-prev', 479 }, 480 }); 481 } 482 if ($(".clients-carousel").length > 0) { 483 var j2 = new Swiper(".clients-carousel .swiper-container", { 484 preloadImages: false, 485 freeMode: false, 486 slidesPerView: 5, 487 spaceBetween: 10, 488 loop: true, 489 grabCursor: true, 490 mousewheel: false, 491 navigation: { 492 nextEl: '.cc-next', 493 prevEl: '.cc-prev', 494 }, 495 breakpoints: { 496 320: { 497 slidesPerView: 1, 498 }, 499 768: { 500 slidesPerView: 2, 501 }, 502 // 1064: { 503 1024: { 504 slidesPerView: 3, 505 }, 506 1280: { 507 slidesPerView: 5, 508 }, 509 } 510 }); 511 } 512 if ($(".testimonials-carousel").length > 0) { 513 var j2 = new Swiper(".testimonials-carousel .swiper-container", { 514 preloadImages: false, 515 slidesPerView: 4, 516 spaceBetween: 10, 517 loop: true, 518 grabCursor: true, 519 mousewheel: false, 520 centeredSlides: true, 521 pagination: { 522 el: '.tc-pagination', 523 clickable: true, 524 }, 525 navigation: { 526 nextEl: '.tc-button-next', 527 prevEl: '.tc-button-prev', 528 }, 529 breakpoints: { 530 320: { 531 slidesPerView: 1, 532 }, 533 768: { 534 slidesPerView: 2, 535 }, 536 // 1064: { 537 1024: { 538 slidesPerView: 3, 539 }, 540 1280: { 541 slidesPerView: 4, 542 }, 543 } 544 }); 545 } 546 if ($(".team-slider ").length > 0) { 547 var teamCarousel = new Swiper(".team-slider .swiper-container", { 548 preloadImages: true, 549 loop: true, 550 centeredSlides: false, 551 freeMode: false, 552 slidesPerView: 3, 553 spaceBetween: 20, 554 grabCursor: true, 555 mousewheel: false, 556 parallax: false, 557 speed: 1400, 558 navigation: { 559 nextEl: '.ts-cont-next', 560 prevEl: '.ts-cont-prev', 561 }, 562 breakpoints: { 563 564 320: { 565 slidesPerView: 1, 566 centeredSlides: false, 567 }, 568 768: { 569 slidesPerView: 2, 570 centeredSlides: true, 571 }, 572 // 1064: { 573 // 1024: { 574 // slidesPerView: 2, 575 // centeredSlides: true, 576 // }, 577 1280: { 578 slidesPerView: 3, 579 centeredSlides: true, 580 }, 581 } 582 }); 583 } 584 if ($(".hero-counter-slider").length > 0) { 585 var teamCarousel = new Swiper(".hero-counter-slider .swiper-container", { 586 preloadImages: true, 587 loop: true, 588 centeredSlides: false, 589 freeMode: false, 590 slidesPerView: 3, 591 spaceBetween: 0, 592 grabCursor: true, 593 mousewheel: false, 594 parallax: false, 595 speed: 1400, 596 autoplay: { 597 delay: 3000, 598 disableOnInteraction: false 599 }, 600 navigation: { 601 nextEl: '.hcc-next', 602 prevEl: '.hcc-prev', 603 }, 604 breakpoints: { 605 320: { 606 slidesPerView: 1, 607 }, 608 768: { 609 slidesPerView: 2, 610 }, 611 1280: { 612 slidesPerView: 3, 613 }, 614 } 615 }); 616 } 617 if ($(".slideshow-container_wrap").length > 0) { 618 var ms1 = new Swiper(".slideshow-container_wrap .swiper-container", { 619 preloadImages: false, 620 loop: true, 621 speed: 1400, 622 spaceBetween: 0, 623 effect: "fade", 624 init: false, 625 autoplay: { 626 delay: 2500, 627 disableOnInteraction: false 628 }, 629 pagination: { 630 el: '.hero-slider-pagination', 631 clickable: true, 632 }, 633 }); 634 setTimeout(function () { 635 ms1.init(); 636 }, 1000); 637 ms1.on("slideChangeTransitionStart", function () { 638 $(".slider-progress-bar").removeClass("act-slider"); 639 }); 640 ms1.on("slideChangeTransitionEnd", function () { 641 $(".slider-progress-bar").addClass("act-slider"); 642 }); 643 } 644 if ($(".half-carousel-conatiner").length > 0) { 645 var teamCarousel = new Swiper(".half-carousel .swiper-container", { 646 preloadImages: true, 647 loop: true, 648 centeredSlides: true, 649 freeMode: false, 650 slidesPerView: 3, 651 spaceBetween: 0, 652 grabCursor: true, 653 mousewheel: false, 654 parallax: true, 655 speed: 1400, 656 navigation: { 657 nextEl: '.hcw-cont-next', 658 prevEl: '.hcw-cont-prev', 659 }, 660 breakpoints: { 661 320: { 662 slidesPerView: 1, 663 }, 664 768: { 665 slidesPerView: 2, 666 }, 667 1280: { 668 slidesPerView: 3, 669 // centeredSlides: true, 670 }, 671 } 672 }); 673 } 674 $(".scroll-init").singlePageNav({ 675 filter: ":not(.external)", 676 updateHash: false, 677 offset: 80, 678 threshold: 120, 679 speed: 1200, 680 currentClass: "act-scrlink" 681 }); 682 683 684 685 var dotsCanvas = { 686 init: function () { 687 var $blocks = $('[data-dots]'); 688 $blocks.each(function () { 689 var $block = $(this); 690 var block = $block[0]; 691 var $canvas = $("<canvas/>").appendTo($block); 692 var canvas = $canvas[0]; 693 var width = $block.width(); 694 var height = $block.height(); 695 var ctx = canvas.getContext('2d'); 696 ctx.width = width; 697 ctx.height = height; 698 var devicePixelRatio = window.devicePixelRatio || 1, 699 backingStoreRatio = ctx.webkitBackingStorePixelRatio || ctx.mozBackingStorePixelRatio || ctx.msBackingStorePixelRatio || ctx.oBackingStorePixelRatio || ctx.backingStorePixelRatio || 1; 700 var ratio = devicePixelRatio / backingStoreRatio; 701 canvas.width = width * ratio; 702 canvas.height = height * ratio; 703 ctx.scale(ratio, ratio); 704 var mouseX = undefined; 705 var mouseY = undefined; 706 707 function Circle(x, y) { 708 this.x = x; 709 this.y = y; 710 this.distance = 10; 711 this.radians = 0; 712 this.draw = function () { 713 ctx.beginPath(); 714 ctx.strokeStyle = 'rgba(151, 151, 151, .5)'; 715 ctx.moveTo(this.x + 3, this.y); 716 ctx.lineTo(this.x + 3, this.y + 6); 717 ctx.moveTo(this.x, this.y + 3); 718 ctx.lineTo(this.x + 6, this.y + 3); 719 ctx.stroke(); 720 }; 721 this.update = function () { 722 if (mouseX > -1) { 723 var k1 = mouseY - y; 724 var k2 = mouseX - x; 725 var tan = k1 / k2; 726 var yrad = Math.atan(tan);
727 if (mouseX < x) { 728 yrad = Math.PI - Math.atan(-tan); 729 } 730 this.x = x + Math.cos(yrad) * this.distance; 731 this.y = y + Math.sin(yrad) * this.distance; 732 } 733 this.draw(); 734 }; 735 }; 736 var circlesArray = []; 737 var gutter = 40; 738 var countW = Math.floor(width / gutter); 739 var countH = Math.floor(height / gutter); 740 var len = countW * countH; 741 for (var i = 0; i < countH; i++) { 742 for (var t = 0; t < countW; t++) { 743 var x = gutter * t; 744 var y = gutter * i; 745 circlesArray.push(new Circle(x, y)); 746 } 747 } 748 var loop = function () { 749 ctx.clearRect(0, 0, ctx.width, ctx.height); 750 for (var i = 0; i < circlesArray.length; i++) { 751 circlesArray[i].update(); 752 } 753 }; 754 document.addEventListener('mousemove', function (e) { 755 var parentOffset = $(canvas).parent().offset(); 756 var relX = e.pageX - parentOffset.left; 757 var relY = e.pageY - parentOffset.top; 758 mouseX = relX; 759 mouseY = relY; 760 ctx.clearRect(0, 0, ctx.width, ctx.height); 761 for (var i = 0; i < circlesArray.length; i++) { 762 circlesArray[i].update(); 763 } 764 loop();
765 }); 766 loop(); 767 }); 768 } 769 }; 770 window.requestAnimationFrame = (function () { 771 return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function (callback) { 772 window.setTimeout(callback, 1000 / 60); 773 }; 774 })(); 775 window.cancelAnimationFrame = (function () { 776 return window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || function (timPtr) { 777 window.clearTimeout(timPtr); 778 }; 779 })(); 780 dotsCanvas.init(); 781 782 function csselem() { 783 $(".slideshow-container .slideshow-item").css({ 784 height: $(".slideshow-container").outerHeight(true) 785 }); 786 if ($(".main-footer").length > 0 && $(".height-emulator").length > 0) { 787 $(".height-emulator").css({ 788 height: $(".main-footer").outerHeight(true) 789 }); 790 } 791 $(".fs-slider-item").css({ 792 height: $(".hero-wrap").outerHeight(true) 793 }); 794 } 795 csselem(); 796 // Mob Menu------------------ 797 $(".nav-button-wrap").on("click", function () { 798 $(".main-menu").toggleClass("vismobmenu"); 799 }); 800 801 function mobMenuInit() { 802 var ww = $(window).width(); 803 if (ww <= 1024) { 804 $(".menusb").remove(); 805 $(".main-menu nav").clone().addClass("menusb").appendTo(".main-menu"); 806 $(".menusb").slidingMenu(); 807 } else { 808 $(".menusb").remove(); 809 } 810 } 811 mobMenuInit(); 812 // css ------------------ 813 var $window = $(window); 814 $window.on("resize", function () { 815 csselem(); 816 mobMenuInit(); 817 }); 818 $(".show-hidd-filters").on("click", function (w) { 819 w.preventDefault(); 820 $(".mob-hid_filters").slideToggle(300); 821 }); 822 } 823 // parallax------------------ 824 function initparallax() { 825 var a = { 826 Android: function () { 827 return navigator.userAgent.match(/Android/i); 828 }, 829 BlackBerry: function () { 830 return navigator.userAgent.match(/BlackBerry/i); 831 }, 832 iOS: function () { 833 return navigator.userAgent.match(/iPhone|iPad|iPod/i); 834 }, 835 Opera: function () { 836 return navigator.userAgent.match(/Opera Mini/i); 837 }, 838 Windows: function () { 839 return navigator.userAgent.match(/IEMobile/i); 840 }, 841 any: function () { 842 return a.Android() || a.BlackBerry() || a.iOS() || a.Opera() || a.Windows(); 843 } 844 }; 845 var trueMobile = a.any(); 846 if (null === trueMobile) { 847 var b = new Scrollax(); 848 b.reload(); 849 b.init(); 850 } 851 if (trueMobile) $(".background-vimeo").remove(); 852 } 853 document.addEventListener('gesturestart', function (e) { 854 e.preventDefault(); 855 }); 856 // Init all functions------------------ 857 $(function () { 858 initTheroof(); 859 initparallax(); 860 }) 861 862})(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.