(function($,window,document,undefined){"use strict";$(document).on('ready',function(){$('.preloader-svg').fadeOut(300)});$(window).on('load',function(){if($('.loader__svg pattern').length){setTimeout(stopPreloader,900)}});$('.sanjose-video-banner, .sanjose-banner').each(function(){var videoWrap=$(this),videoPopUp=videoWrap.find('.video_popup'),buttonPlay=videoWrap.find('.button-play, .link-video'),videoIframe=videoPopUp.find('iframe'),iframeSrc=videoIframe.attr('src'),iframeDataSrc=videoIframe.attr('data-src'),closePlayButton=videoPopUp.find('.close-btn');buttonPlay.on('click',function(e){e.preventDefault();videoPopUp.addClass('active');videoIframe.attr('src',iframeDataSrc)});closePlayButton.on('click',function(){videoPopUp.removeClass('active');videoIframe.attr('src',iframeSrc)})});function addVideo(){$('.sanjose-banner').each(function(){var $this=$(this);$this.find('.video-iframe').show();var $video=$this.find('.video-iframe iframe'),w=$video.width(),h=$video.outerHeight(),videoRatio=(w/h).toFixed(2),minW=parseInt($this.width()),minH=parseInt($this.outerHeight()),widthRatio=minW/w,heightRatio=minH/h,newWidth,newHeight;if(widthRatio>heightRatio){newWidth=minW;newHeight=Math.ceil(newWidth/videoRatio)}else{newHeight=minH;newWidth=Math.ceil(newHeight*videoRatio)} $video.width(newWidth+'px').height(newHeight+'px');if(newHeight>minH){$video.css('top',-(newHeight-minH)/2)}else{$video.css('top','0')}})} if($("#particles-js").length){if($(window).width()>960){particlesJS("particles-js",{"particles":{"number":{"value":120,"density":{"enable":!0,"value_area":1800}},"color":{"value":"#ffffff"},"shape":{"type":"circle","stroke":{"width":0,"color":"#000000"},"polygon":{"nb_sides":3},"image":{"src":"img/github.svg","width":100,"height":100}},"opacity":{"value":0.5,"random":!1,"anim":{"enable":!1,"speed":1,"opacity_min":0.2,"sync":!1}},"size":{"value":3,"random":!0,"anim":{"enable":!1,"speed":20,"size_min":0.1,"sync":!1}},"line_linked":{"enable":!0,"distance":250,"color":"#ffffff","opacity":0.2,"width":1},"move":{"enable":!0,"speed":1,"direction":"none","random":!1,"straight":!1,"out_mode":"out","bounce":!1,"attract":{"enable":!1,"rotateX":600,"rotateY":1200}}},"interactivity":{"detect_on":"window","events":{"onhover":{"enable":!1,"mode":"grab"},"onclick":{"enable":!1,"mode":"push"},"resize":!0},"modes":{"grab":{"distance":180,"line_linked":{"opacity":1}},"bubble":{"distance":400,"size":40,"duration":2,"opacity":8,"speed":3},"repulse":{"distance":200,"duration":0.4},"push":{"particles_nb":4},"remove":{"particles_nb":2}}},"retina_detect":!0})}} var navigation=$('.navigation');$('.nav-menu-icon').click(function(e){$(this).toggleClass('active');navigation.find('.main-menu').slideToggle()});$('.scroll-top-arrow').on('click',function(){$('html, body').animate({scrollTop:0},800);return!1});var swiper=new Swiper('.swiper-container.presentation',{slidesPerView:4,centeredSlides:!0,spaceBetween:30,autoplay:3000,autoplayDisableOnInteraction:!0,preventClicks:!0,loop:!0,loopedSlides:4,breakpoints:{991:{spaceBetween:20,slidesPerView:2,autoplay:3000},550:{spaceBetween:15,slidesPerView:1,autoplay:3000}}});var wow=new WOW({boxClass:'wow',animateClass:'animated',offset:100,mobile:!1,live:!0}).init();var popupGallery=$('.zoom-gallery');popupGallery.magnificPopup({delegate:'a',type:'image',closeOnContentClick:!1,closeBtnInside:!1,gallery:{enabled:!0},zoom:{enabled:!0,duration:300,opener:function(element){return element.find('img')}}});var menuItem=$('.menu-item a:not(.url)');function scrollTo(e){var idPage=$(e).attr('href');$('html, body').animate({scrollTop:$(idPage).offset().top-50},1000)} menuItem.click(function(e){e.preventDefault();scrollTo(this)});function stellarParallax(){if($(window).width()>1024){$.stellar()}else{$.stellar('destroy');$('.parallax').css('background-position','center')}} function bannerHeight(){var winHeight=$(window).height();$('.home-banner').height(winHeight)} $(window).on('load',function(){stellarParallax();bannerHeight()});$(window).on('resize',function(){bannerHeight()});var fixHeadPosition=$('.fix-header').offset().top;$(window).scroll(function(){if($(this).scrollTop()>300){$('.scroll-top-arrow').fadeIn('slow')}else{$('.scroll-top-arrow').fadeOut('slow')} if($(this).scrollTop()>=fixHeadPosition){$('.fix-header').addClass('sticky')}else if($(this).scrollTop()<=fixHeadPosition){$('.fix-header').removeClass('sticky')}});$(window).on('load resize',function(){var bc=$('section.home-banner .banner-content').outerHeight();var bh=$('.home-banner').outerHeight();if($(window).width()<767){if(bh<(bc+120)){$('.home-banner').css('min-height',bc+70)}}else if($(window).width()<992){if(bh<(bc+170)){$('.home-banner').css('min-height',bc+170)}}else{$('.home-banner').css('min-height','900px')}});})(jQuery,window,document) /* ------------------------------------------- */ /* BACKGROUND */ /* ------------------------------------------- */ function wpcAddImgBg(imgSelector, parentSelector) { var $parent, $neighbor, $imgDataHidden, $imgDataSibling, $this; if (!imgSelector) { return false; } $(imgSelector).each(function () { $this = $(this); $imgDataHidden = $this.data('s-hidden'); $imgDataSibling = $this.data('s-sibling'); $parent = $this.closest(parentSelector); $parent = $parent.length ? $parent : $this.parent(); $dataSrc = $(this).attr('data-src'); if ($imgDataSibling) { $parent.addClass('s-back-sibling-switch'); $neighbor = $this.next(); $neighbor = $neighbor.length ? $neighbor : $this.next(); $neighbor.css('background-image', 'url(' + $dataSrc + ')').addClass('s-sibling-switch'); } else { $parent.css('background-image', 'url(' + $dataSrc + ')').addClass('s-back-switch'); } if ($imgDataHidden) { $this.css('visibility', 'hidden'); } else { $this.hide(); } }); } $(window).on('load', function() { wpcAddImgBg('.s-img-switch'); })