/** * Detect OS & browsers */ if(navigator.appVersion.indexOf("Win")!=-1) { jQuery('body').addClass('window-os'); } if(navigator.platform.toUpperCase().indexOf('MAC')>=0) { jQuery('body').addClass('mac-os'); } if(navigator.appVersion.indexOf("Linux")!=-1) { jQuery('body').addClass('linux-os'); } if(navigator.appVersion.indexOf("Edge") != -1){ jQuery('body').addClass('edge'); } var trident = !!navigator.userAgent.match(/Trident\/7.0/); var net = !!navigator.userAgent.match(/.NET4.0E/); var IE11 = trident && net; var IEold = ( navigator.userAgent.match(/MSIE/i) ? true : false ); if(IE11 || IEold){ jQuery('body').addClass('ie'); } var ua = navigator.userAgent.toLowerCase(); if (ua.indexOf('safari') != -1) { if (ua.indexOf('chrome') > -1) { jQuery('body').addClass('chrome'); } else { jQuery('body').addClass('safari'); } } var FF = !(window.mozInnerScreenX == null); if(FF) { jQuery('body').addClass('fire-fox'); } else { jQuery('body').addClass('not-fire-fox'); } /** * Detect OS & browsers */ $(window).scroll(function(){ if ($(window).scrollTop() >= 50) { $('body').addClass('header-fixed'); } else { $('body').removeClass('header-fixed'); } }); $('.scrolldown a[href*="#"]').on('click', function(e) { e.preventDefault() $('html, body').animate( { scrollTop: $($(this).attr('href')).offset().top-120, }, 500, 'linear' ) }); $(document).ready(function(){ $(".contact-btn").click(function(){ $(".contact-btn").hide(); $(".contact-form").addClass("show"); }); $(".cancel-form").click(function(){ $(".contact-btn").show(); $(".contact-form").removeClass("show"); }); }); //For Video Parallax $(document).ready(function () { $(window).on('load scroll', function () { var scrolled = $(this).scrollTop(); $('#title').css({ 'transform': 'translate3d(0, ' + -(scrolled * 0.2) + 'px, 0)', // parallax (20% scroll rate) 'opacity': 1 - scrolled / 400 // fade out at 400px from top }); $('#hero-vid').css('transform', 'translate3d(0, ' + -(scrolled * 0.25) + 'px, 0)'); // parallax (25% scroll rate) }); });