1(function ($) { 2 3 $.fn.sticky = function (options) { 4 var defaults = { 5 topSpacing: 0, 6 bottomSpacing: 0, 7 debug: false 8 }; 9 var settings = $.extend({}, defaults, options); 10 11 // var log = function (message, params) { 12 // if (typeof console == "object" && $.fn.sticky.debug) { 13 // console.log(message, params); 14 // } 15 // } 16 var scroller = function ($this, $offsetParent, $holder) { 17 18 var offset = $holder.offset(); 19 20 var windowpos = $(window).scrollTop(); 21 var stickermax = $(document).outerHeight() - settings.bottomSpacing - settings.topSpacing - $this.outerHeight(); 22 23 if (stickermax <= 0 //if sticker not has spacing to slide 24 || $this.height() <= 0 //if sticker height equal 0 25 26 ) { 27 return; 28 } 29 30 if (windowpos > (offset.top - settings.topSpacing) 31 && windowpos < stickermax 32 ) { 33 if ($this.css("position") != "fixed") { 34 $this.trigger("sticky-start"); 35 //log("event", "sticky-start"); 36 $this.css({ position: "fixed", top: settings.topSpacing }); //stick it 37 } 38 $this.trigger("sticky-bottom-unreached"); 39 //log("event", "sticky-bottom-unreached"); 40 41 } else if (windowpos > (offset.top - settings.topSpacing) 42 && windowpos >= stickermax 43 ) { 44 45 if ($this.css("position") == "fixed") { //if sticky started 46 $this.trigger("sticky-bottom-reached"); 47 //log("event", "sticky-bottom-reached"); 48 $this.css({ position: "absolute", top: (stickermax - $offsetParent.offset().top + settings.topSpacing) + "px"}); 49 }else if($this.css("position") == "absolute"){ //if sticky bottom reached 50 51 $this.css({ top: (stickermax - $offsetParent.offset().top + settings.topSpacing) + "px"}); 52 //log("event", "sticky-bottom-reaching"); 53 }else{ //if sticky not started 54 if(stickermax > offset.top){ //if have spacing to slide 55 $this.css({position: "absolute", top: (stickermax - $offsetParent.offset().top + settings.topSpacing) + "px"}); 56 //log("event", "sticky-start-bottom-reached"); 57 } 58 } 59 60 } else { //if windowpos < offset.top - settings.topSpacing 61 62 if ($this.css("position") == "fixed" || $this.css("position") == "absolute") { 63 $this.trigger("sticky-end"); 64 //log("event", "sticky-end"); 65 } 66 67 $this.css({ position: "", top: "" }); 68 } 69 70 // log("holder offset", offset); 71 // log("position", $this.position()); 72 // log("sticker offset", $this.offset()); 73 // log("windowpos", windowpos); 74 }; 75 76 return this.each(function () { 77 78 var $this = $(this); 79 var $offsetParent = $this.offsetParent(); 80 81 $this.width($this.width());//set css width for sticker 82 var $holder = $("<div class='sticky-holder' style='visibility: hidden;height:0;display:block'></div>").insertBefore($this); 83 84 scroller($this, $offsetParent, $holder); 85 86 $(window).scroll(function () { scroller($this, $offsetParent, $holder); }); 87 88 }); 89 } 90}(jQuery)); 91 92/******************************************************** 93 1. Custom mouse cursor 94 2. Animsition preloader 95 3. Swiper slider 96 4. Isotope filter 97 5. Midnight 98 6. Navigation open/close 99 7. Drop-down menu 100 8. Change menu background 101 9. ScrollAnimations 102 10. Headroom 103 11. Magnific popup 104 12. Scroll to id 105 13. Touch, no touch 106 14. fixed footer 107 15. Progress bar 108 16. Contact form 109********************************************************/ 110 111$(function() { 112 "use strict"; 113
114 /* 1. Custom mouse cursor */ 115 document.getElementsByTagName("body")[0].addEventListener("mousemove", function(n) { 116 e.style.left = n.clientX + "px", 117 e.style.top = n.clientY + "px" 118 }); 119 var 120 e = document.getElementById("pointer"); 121 122 $(document).mousemove(function(e){ 123 124 $(".red-bg") 125 .on("mouseenter", function() { 126 $('.pointer').addClass("black") 127 }) 128 .on("mouseleave", function() { 129 $('.pointer').removeClass("black") 130 }) 131 132 $(".pointer-large, .swiper-button-next, .swiper-button-prev, .mfp-arrow-left, .mfp-arrow-right, .home-slider .swiper-pagination-bullet") 133 .on("mouseenter", function() { 134 $('.pointer').addClass("large") 135 }) 136 .on("mouseleave", function() { 137 $('.pointer').removeClass("large") 138 }) 139 140 $(".pointer-small, .testimonials-slider .swiper-pagination-bullet, .portfolio-slider .swiper-pagination-bullet") 141 .on("mouseenter", function() { 142 $('.pointer').addClass("small") 143 }) 144 .on("mouseleave", function() { 145 $('.pointer').removeClass("small") 146 }) 147 148 $(".mfp-img, .pointer-right") 149 .on("mouseenter", function() { 150 $('.pointer').addClass("right") 151 }) 152 .on("mouseleave", function() { 153 $('.pointer').removeClass("right") 154 }) 155 156 $(".pointer-zoom") 157 .on("mouseenter", function() { 158 $('.pointer').addClass("zoom") 159 }) 160 .on("mouseleave", function() { 161 $('.pointer').removeClass("zoom") 162 }) 163 164 $(".pointer-open") 165 .on("mouseenter", function() { 166 $('.pointer').addClass("open") 167 }) 168 .on("mouseleave", function() { 169 $('.pointer').removeClass("open") 170 }) 171 172 }); 173 174 $(document).ready(function() { 175 if($('#firma-parallax').length > 0){ 176 177 let eventRegistered = false; 178 179 const observerOptions = { 180 root: null, 181 rootMargin: "0px", 182 threshold: 0.3 183 }; 184 185 function observerCallback(entries, observer) { 186 187 entries.forEach(entry => { 188 189 if (entry.isIntersecting) { 190 191 // fade in observed elements that are in view 192 entry.target.classList.replace('fadeOut', 'fadeIn'); 193 194 function wheel(event) { 195 var delta = 0; 196 if (event.wheelDelta) {(delta = event.wheelDelta / 120);} 197 else if (event.detail) {(delta = -event.detail / 3);} 198 199 handle(delta); 200 //if (event.preventDefault) {(event.preventDefault());} 201 //event.returnValue = false; 202 } 203 204 function handle(delta) { 205 var time = 1000; 206 var distance = 15; 207 var elStyle = getComputedStyle(entry.target); 208 var newBottom = parseInt(elStyle.bottom.replace('px', '')) - (distance*delta) + "px" 209 $(entry.target).animate({ 210 bottom:newBottom 211 }, 0); 212 } 213 214 if (window.addEventListener) { 215 window.addEventListener('DOMMouseScroll', wheel, false) 216 eventRegistered = true; 217 } 218 window.onmousewheel = document.onmousewheel = wheel; 219 } else { 220 eventRegistered = false; 221 // fade out observed elements that are not in view 222 entry.target.classList.replace('fadeIn', 'fadeOut'); 223 224 if (window.addEventListener && eventRegistered) { 225 window.removeEventListener('DOMMouseScroll') 226 } 227 window.onmousewheel = null; 228 } 229 }); 230 } 231 232 const firmaParallax = document.getElementById('firma-parallax'); 233 234 const observer = new IntersectionObserver(observerCallback, observerOptions); 235 observer.observe(firmaParallax); 236 } 237 238 /* 2. Animsition preloader */ 239 $(".animsition-overlay").animsition({ 240 inClass: 'overlay-slide-in-right', 241 outClass: 'overlay-slide-out-right', 242 inDuration: 1, 243 outDuration: 1500, 244 linkElement: '.animsition-link', 245 // e.g. linkElement: 'a:not([target="_blank"]):not([href^="#"])' 246 loading: false, 247 loadingParentElement: 'body', //animsition wrapper element 248 loadingClass: 'animsition-loading', 249 loadingInner: '', // e.g '<img src="loading.svg" />' 250 timeout: false, 251 timeoutCountdown: 5000, 252 onLoadEvent: true, 253 browser: [ 'animation-duration', '-webkit-animation-duration'], 254 // "browser" option allows you to disable the "animsition" in case the css property in the array is not supported by your browser. 255 // The default setting is to disable the "animsition" in a browser that does not support "animation-duration". 256 overlay : true, 257 overlayClass : 'animsition-overlay-slide', 258 overlayParentElement : 'body', 259 transition: function(url){ window.location.href = url; } 260 }); 261 262 $('body').on('animsition.outStart', function(){ 263 $('body').removeClass('active'); 264 $('body').addClass('out'); 265 }) 266 267 $('body').on('animsition.inEnd', function(){ 268 $('body').addClass('active'); 269 $('body').addClass('in'); 270 setTimeout(function () { 271 $("body").addClass("anim"); 272 }, 1000); 273 274 /* 3. Swiper slider */ 275 var interleaveOffset = 0.5; 276 277 var mySwiper = new Swiper ('.home-slider', { 278 spaceBetween: 0, 279 speed: 1500, 280 autoplay: { 281 delay: 5000 282 }, 283 autoHeight: true, 284 watchSlidesProgress: true, 285 pagination: { 286 el: '.swiper-pagination', 287 type: 'bullets', 288 clickable: true 289 }, 290 navigation: { 291 nextEl: ".swiper-button-next", 292 prevEl: ".swiper-button-prev" 293 }, 294 on: { 295 progress: function() { 296 var swiper = this; 297 for (var i = 0; i < swiper.slides.length; i++) { 298 var slideProgress = swiper.slides[i].progress; 299 var innerOffset = swiper.width * interleaveOffset; 300 var innerTranslate = slideProgress * innerOffset; 301 swiper.slides[i].querySelector(".slide-bg").style.transform = 302 "translate3d(" + innerTranslate + "px, 0, 0)"; 303 } 304 }, 305 touchStart: function() { 306 var swiper = this; 307 for (var i = 0; i < swiper.slides.length; i++) { 308 swiper.slides[i].style.transition = ""; 309 } 310 }, 311 setTransition: function(speed) { 312 var swiper = this; 313 for (var i = 0; i < swiper.slides.length; i++) { 314 swiper.slides[i].style.transition = speed + "ms"; 315 swiper.slides[i].querySelector(".slide-bg").style.transition = 316 speed + "ms"; 317 } 318 } 319 } 320 }); 321 322 var swiper = new Swiper ('.testimonials-slider', { 323 speed: 1200, 324 autoplay: { 325 delay: 5000 326 }, 327 spaceBetween: 30, 328 loop: true, 329 autoHeight: true, 330 pagination: { 331 el: '.swiper-pagination', 332 clickable: true 333 } 334 }); 335 336 var swiper = new Swiper ('.primadopo-slider', { 337 slidesPerView: 1, 338 spaceBetween: 30, 339 centeredSlides: true, 340 speed: 1400, 341 freeMode: true, 342 allowTouchMove: false, 343 navigation: { 344 nextEl: ".swiper-button-next", 345 prevEl: ".swiper-button-prev" 346 }, 347 breakpoints: { 348 767: { 349 slidesPerView: 1 350 } 351 } 352 }); 353 354 var swiper = new Swiper ('.about-slider', { 355 slidesPerView: 2, 356 spaceBetween: 30, 357 centeredSlides: true, 358 speed: 1400, 359 freeMode: true, 360 navigation: { 361 nextEl: ".swiper-button-next", 362 prevEl: ".swiper-button-prev" 363 }, 364 breakpoints: { 365 767: { 366 slidesPerView: 1 367 } 368 } 369 }); 370 371 var swiper = new Swiper ('.team-slider', { 372 speed: 1200, 373 /*autoplay: false,*/ 374 autoplay: { 375 delay: 2000 376 }, 377 spaceBetween: 50, 378 autoHeight: false, 379 centeredSlides:false, 380 slidesPerView:4, 381 loop: true, 382 observer: true, 383 observeParents: true, 384 breakpoints: { 385 1024: { 386 slidesPerView: 3 387 }, 388 768: { 389 slidesPerView: 3, 390 spaceBetween: 25 391 }, 392 543: { 393 slidesPerView: 2, 394 spaceBetween: 10 395 } 396 }, 397 navigation: { 398 nextEl: ".swiper-button-next.team", 399 prevEl: ".swiper-button-prev.team" 400 } 401 }); 402 403 var mySwiper = new Swiper(".portfolio-slider", { 404 direction: "vertical", 405 navigation: { 406 nextEl: ".swiper-button-next", 407 prevEl: ".swiper-button-prev" 408 }, 409 pagination: { 410 el: '.swiper-pagination', 411 clickable: true, 412 dynamicBullets: true 413 }, 414 speed: 1300, 415 parallax: true, 416 autoplay: false, 417 effect: "slide", 418 mousewheel: { 419 sensitivity: 1 420 } 421 }); 422 423 var mySwiper = new Swiper(".portfolio-column-slider", { 424 slidesPerView: 3, 425 navigation: { 426 nextEl: ".swiper-button-next", 427 prevEl: ".swiper-button-prev" 428 }, 429 speed: 1300, 430 parallax: true, 431 freeMode: true, 432 autoplay: false, 433 breakpoints: { 434 999: { 435 slidesPerView: 2 436 }, 437 767: { 438 slidesPerView: 1 439 } 440 }, 441 mousewheel: { 442 sensitivity: 1 443 } 444 }); 445 446 var swiper = new Swiper ('.portfolio-slider2', { 447 slidesPerView: 2, 448 spaceBetween: 30, 449 centeredSlides: true, 450 speed: 1400, 451 autoplay: { 452 delay: 5000 453 }, 454 freeMode: true, 455 navigation: { 456 nextEl: ".swiper-button-next", 457 prevEl: ".swiper-button-prev" 458 }, 459 breakpoints: { 460 999: { 461 slidesPerView: 1 462 } 463 } 464 }); 465 466 /* 4. Isotope filter */ 467 function projectFilter() { 468 var $gridt = $('.works'); 469 $gridt.isotope({ 470 itemSelector: '.grid-item', 471 percentPosition: true 472 }); 473 $('.filter-buttons').on('click', 'button', function () { 474 var filterValue = $(this).attr('data-filter'); 475 $gridt.isotope({ 476 filter: filterValue 477 }); 478 $(this).addClass('active').siblings().removeClass('active'); 479 }); 480 }; 481 projectFilter(); 482 483 }); 484 485 /* 5. Midnight */ 486 $('.fixed-header').midnight(); 487 488 /* 6. Navigation open/close */ 489 $( ".menu-open" ).on( "click", function() { 490 $('.menu-open, .nav-container').addClass('active'); 491 }); 492 493 $( ".menu-close" ).on( "click", function() { 494 $('.menu-open, .nav-container').removeClass('active'); 495 }); 496 497 /* 7. Drop-down menu */ 498 $('.dropdown-open').on("click",function(){ 499 $(this).find('.dropdown').addClass('active'); 500 $('.nav-link').addClass('done'); 501 $('.dropdown-close').addClass('active'); 502 }); 503 504 $('.dropdown-close').on("click",function(){ 505 $('.dropdown').removeClass('active'); 506 $('.nav-link').removeClass('done'); 507 $('.dropdown-close').removeClass('active'); 508 }); 509 510 }); 511 512 /* 8. Change menu background */
513 $(document).on('mouseover', '.nav-bg-change', function(){ 514 $(this).addClass('active').siblings().removeClass('active') 515 }); 516 517 /* 9. ScrollAnimations */ 518 var $containers = $('[data-animation]:not([data-animation-child]), [data-animation-container]'); 519 $containers.scrollAnimations(); 520 521 /* 10. Headroom */ 522 $(".fixed-header").headroom(); 523 524 /* 11. Magnific popup */ 525 $('.photo-popup').magnificPopup({ 526 type: 'image', 527 mainClass: 'mfp-with-zoom', // this class is for CSS animation below 528 gallery: { 529 // options for gallery 530 enabled: true 531 }, 532 zoom: { 533 enabled: true, // By default it's false, so don't forget to enable it 534 duration: 800, // duration of the effect, in milliseconds 535 easing: 'cubic-bezier(.858, .01, .068, .99)', // CSS transition easing function 536 // The "opener" function should return the element from which popup will be zoomed in 537 // and to which popup will be scaled down 538 // By defailt it looks for an image tag: 539 opener: function(openerElement) { 540 // openerElement is the element on which popup was initialized, in this case its <a> tag 541 // you don't need to add "opener" option if this code matches your needs, it's defailt one. 542 return openerElement.is('img') ? openerElement : openerElement.find('img'); 543 } 544 } 545 }); 546 547 $('.popup-youtube').magnificPopup({ 548 disableOn: 700, 549 type: 'iframe', 550 mainClass: 'mfp-fade', 551 removalDelay: 160, 552 preloader: false 553 }); 554 555 556 /* 12. Scroll to id */ 557 $('.to-top-btn, .scroll-btn').mPageScroll2id(); 558 559 /* 13. Touch, no touch */ 560 var supports = (function() { 561 var d = document.documentElement, 562 c = "ontouchstart" in window || navigator.msMaxTouchPoints; 563 if (c) { 564 d.className += " touch"; 565 return { 566 touch: true 567 } 568 } else { 569 d.className += " no-touch"; 570 return { 571 touch: false 572 } 573 } 574 })(); 575 576 /* 14. fixed footer */ 577 $('footer').footerReveal({ 578 shadow: false, 579 zIndex : 1 580 }); 581 582 /* 15. Progress bar */ 583 $(".progress-zero").each(function(){ 584 $(this).find(".progress-full").animate({ 585 width: $(this).attr("data-progress") 586 }); 587 }); 588 589 /* 16. Contact form */ 590 $("#send_form").on('submit', function(e){ 591 e.preventDefault(); 592 var data = $(this).serialize() 593 var sendButton = $("#send").parent('.price-btn-box'); 594 var spinIcon = $('<div class="fa-3x"><i class="fa fa-spinner fa-spin" style="color:#333333;"></i></div>'); 595 window.grecaptcha.ready(function() { 596 window.grecaptcha.execute('6LcZDiYdAAAAANw9Jph14-F9wSFPGoD0c_libXv-', {action: 'submit'}).then(function(token) { 597 // Add your logic to submit to your backend server here. 598 data+= '&g-recaptcha-response='+token; 599 $.ajax({ 600 url: '/sciuto/mail.php', 601 type: 'POST', 602 cache: false, 603 data: data, 604 dataType: 'json', 605 beforeSend: function() { 606 607 sendButton.fadeOut('fast', function(){ 608 sendButton.after(spinIcon) 609 }) 610 }, 611 success: function(data) { 612 console.log(data) 613 if(!data || data.alert == undefined || data.alert != "success"){ 614 $("#m_err").addClass("js-active"); 615 $(".form-box").addClass("js-active"); 616 setTimeout(function () { 617 $("#send").removeClass("js-active"); 618 }, 2000); 619 } 620 621 else { 622 $("#m_sent").addClass("js-active"); 623 $(".form-box").addClass("js-active"); 624 setTimeout(function () { 625 $("#send").removeClass("js-active"); 626 $("#send_form").trigger("reset"); 627 $('.email-label').removeClass("js-active"); 628 }, 2000); 629 } 630 $('.js-popup-close').click(function() { 631 $(this).parents('.js-popup-fade').removeClass("js-active"); 632 $('.form-box').removeClass("js-active"); 633 spinIcon.fadeOut('fast', function(){ 634 sendButton.fadeIn() 635 spinIcon.remove() 636 }) 637 return false; 638 }); 639 640 $(document).keydown(function(e) { 641 if (e.keyCode === 27) { 642 e.stopPropagation(); 643 $('.js-popup-fade').removeClass("js-active"); 644 $('.form-box').removeClass("js-active"); 645 } 646 }); 647 648 $('.js-popup-fade').click(function(e) { 649 if ($(e.target).closest('.js-popup').length == 0) { 650 $('.js-popup-fade').removeClass("js-active"); 651 $('.form-box').removeClass("js-active"); 652 spinIcon.fadeOut('fast', function(){ 653 sendButton.fadeIn() 654 spinIcon.remove() 655 }) 656 } 657 }); 658 }, 659 }) 660 }); 661 }); 662 return false;
663 }); 664 665 $('#email').on('keyup',function(){ 666 var $this = $(this), 667 val = $this.val(); 668 669 if(val.length >= 1){ 670 $('.email-label').addClass("js-active"); 671 } 672 else { 673 $('.email-label').removeClass("js-active"); 674 } 675 }); 676 677}); 678
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.