function setDimensions() { var windowsHeight = jQuery(window).height(); var windowsWidth = jQuery(window).width(); if (jQuery(window).width() > 1200 ) { jQuery('.heightr').css('height', (windowsHeight) + 'px'); } else { jQuery('.heightr').css('height', (windowsHeight) + 'px'); } var footerHeight = jQuery('.bottom').height(); jQuery('.bottomon').css('height', (footerHeight) + 'px'); } function setActivs() { var windowtop = jQuery(window).scrollTop(), windowheight = jQuery(window).height(), windowwidth = jQuery(window).width(), windowheightone = (windowheight/1.5), windowheighthalf = (windowheight/2), windowheightthird = (windowheight/3), windowheightfourth = (windowheight/4); if (jQuery('.topmenu').length) { setTimeout(function(){ jQuery('.topmenu').addClass('done'); }, 300); } if (jQuery('.lang').length) { setTimeout(function(){ jQuery('.lang').addClass('done'); }, 300); } if (jQuery('.my-parallax').length) { setTimeout(function(){ jQuery('.my-parallax .are-you').addClass('done'); }, 1000); setTimeout(function(){ jQuery('.my-parallax .are-you').addClass('kill'); }, 1750); } if (jQuery('.my-parallax .spoon').length) { setTimeout(function(){ jQuery('.my-parallax .spoon').addClass('done'); }, 1000); setTimeout(function(){ jQuery('.my-parallax .spoon').addClass('kill'); }, 2000); setTimeout(function(){ jQuery('.my-parallax .a-check').addClass('done-rel'); }, 1000); setTimeout(function(){ jQuery('.my-parallax .a-check').addClass('kill'); }, 2000); setTimeout(function(){ jQuery('.my-parallax .caviar1').addClass('done'); }, 1600); setTimeout(function(){ jQuery('.my-parallax .caviar1').addClass('kill'); }, 2100); setTimeout(function(){ jQuery('.my-parallax .caviar3').addClass('done'); }, 1800); setTimeout(function(){ jQuery('.my-parallax .caviar3').addClass('kill'); }, 2300); setTimeout(function(){ jQuery('.my-parallax .caviar2').addClass('done'); }, 2000); setTimeout(function(){ jQuery('.my-parallax .caviar2').addClass('kill'); }, 2500); setTimeout(function(){ jQuery('.my-parallax .caviar8').addClass('done-rel'); }, 2100); setTimeout(function(){ jQuery('.my-parallax .caviar8').addClass('kill'); }, 2600); setTimeout(function(){ jQuery('.my-parallax .caviar5').addClass('done-rel'); }, 2200); setTimeout(function(){ jQuery('.my-parallax .caviar5').addClass('kill'); }, 2700); setTimeout(function(){ jQuery('.my-parallax .caviar6').addClass('done-rel'); }, 2300); setTimeout(function(){ jQuery('.my-parallax .caviar6').addClass('kill'); }, 2800); setTimeout(function(){ jQuery('.my-parallax .caviar4').addClass('done-rel'); }, 2400); setTimeout(function(){ jQuery('.my-parallax .caviar4').addClass('kill'); }, 2900); setTimeout(function(){ jQuery('.my-parallax .caviar7').addClass('done-rel'); }, 2500); setTimeout(function(){ jQuery('.my-parallax .caviar7').addClass('kill'); }, 3000); setTimeout(function(){ jQuery('.my-parallax .caviar9').addClass('done-rel'); }, 2600); setTimeout(function(){ jQuery('.my-parallax .caviar9').addClass('kill'); }, 3100); } // ---------- display 2 ---------- jQuery(".go050-rel").each(function() { var current = jQuery(this); var startline = jQuery(this).offset().top; if (windowtop >= (startline-windowheight)) { setTimeout(function(){current.addClass('done-rel'); }, 500); } }); jQuery(".go050").each(function() { var current = jQuery(this); var startline = jQuery(this).offset().top; if (windowtop >= (startline-windowheight)) { setTimeout(function(){ current.addClass('done'); }, 500); } }); jQuery(".go025").each(function() { var current = jQuery(this); var startline = jQuery(this).offset().top; if (windowtop >= (startline-windowheight)) { setTimeout(function(){ current.addClass('done'); }, 250); } }); if (jQuery('.display-4').length) { var startline4 = jQuery('.display-4 .box-33:nth-child(1)').offset().top; if (windowtop >= (startline4-windowheight)) { setTimeout(function(){ jQuery('.display-4 .box-33:nth-child(1)').addClass('done'); }, 300); setTimeout(function(){ jQuery('.display-4 .box-33:nth-child(2)').addClass('done'); }, 400); setTimeout(function(){ jQuery('.display-4 .box-33:nth-child(3)').addClass('done'); }, 500); } var startline42 = jQuery('.display-4 .box-33:nth-child(4)').offset().top; if (windowtop >= (startline42-windowheight)) { setTimeout(function(){ jQuery('.display-4 .box-33:nth-child(4)').addClass('done'); }, 300); setTimeout(function(){ jQuery('.display-4 .box-33:nth-child(5)').addClass('done'); }, 400); setTimeout(function(){ jQuery('.display-4 .box-33:nth-child(6)').addClass('done'); }, 500); } } if (jQuery('.display-5').length) { var startline5 = jQuery('.display-5 .box-33:nth-child(1)').offset().top; if (windowtop >= (startline5-windowheight)) { setTimeout(function(){ jQuery('.display-5 .box-33:nth-child(1)').addClass('done'); }, 300); setTimeout(function(){ jQuery('.display-5 .box-33:nth-child(2)').addClass('done'); }, 400); setTimeout(function(){ jQuery('.display-5 .box-33:nth-child(3)').addClass('done'); }, 500); } var startline52 = jQuery('.display-5 .box-33:nth-child(4)').offset().top; if (windowtop >= (startline52-windowheight)) { setTimeout(function(){ jQuery('.display-5 .box-33:nth-child(4)').addClass('done'); }, 300); setTimeout(function(){ jQuery('.display-5 .box-33:nth-child(5)').addClass('done'); }, 400); setTimeout(function(){ jQuery('.display-5 .box-33:nth-child(6)').addClass('done'); }, 500); } } if (jQuery('.display-10').length) { var startline10 = jQuery('.display-10 .s-box:nth-child(1)').offset().top; if (windowtop >= (startline10-windowheight)) { setTimeout(function(){ jQuery('.display-10 .s-box:nth-child(1)').addClass('done'); }, 300); setTimeout(function(){ jQuery('.display-10 .s-box:nth-child(2)').addClass('done'); }, 400); setTimeout(function(){ jQuery('.display-10 .s-box:nth-child(3)').addClass('done'); }, 500); setTimeout(function(){ jQuery('.display-10 .s-box:nth-child(4)').addClass('done'); }, 600); } } if (jQuery('.slider-12').length) { var startline12 = jQuery('.slider-12 .s-box:nth-child(1)').offset().top; if (windowtop >= (startline12-windowheight)) { setTimeout(function(){ jQuery('.slider-12 .s-box:nth-child(1)').addClass('done'); }, 500); setTimeout(function(){ jQuery('.slider-12 .s-box:nth-child(2)').addClass('done'); }, 600); setTimeout(function(){ jQuery('.slider-12 .s-box:nth-child(3)').addClass('done'); }, 700); } } var scroll = jQuery(window).scrollTop(); if (scroll >= windowheight) { jQuery(".topp .topmenu").addClass("sticks"); } else { jQuery(".topp .topmenu").removeClass("sticks"); } } if ('scrollRestoration' in history) { // Back off, browser, I got this... //history.scrollRestoration = 'manual'; } jQuery(document).ready(function($) { setDimensions(); setActivs(); // anchor animation $('a[href*="#"]').click(function () { var data = $.attr(this, 'href'); arr = data.split('#'), named = $('[name="' + arr[1] + '"]'); if (named.length) { $('html, body').animate({ scrollTop: named.offset().top }, 800); window.location.hash = this.hash; } }); /*if(location.hash){ var hash = window.location.hash.substring(1); $('html, body').animate({ scrollTop: $('[name="' + hash + '"]').offset().top }, 400); }*/ jQuery('.jarallax').jarallax({ speed: 0.2 }); // menu button $('.topmenu-button').click(function(){ $('.topmenu-button').toggleClass('show'); $('.topp .topmenu > ul').toggleClass('show'); }); // meu close $('.topmenu a[href*="#"]').click(function () { windowwidth = $(window).width(); if (windowwidth < 992 ) { $(".topmenu-button").trigger("click"); } }); // Get the modal var modal = document.getElementById('consultModal'); // Get the button that opens the modal var btn = document.getElementById("consultBtn"); // Get the element that closes the modal var span = document.getElementsByClassName("consultclose")[0]; // When the user clicks on the button, open the modal btn.onclick = function() { modal.style.display = "flex"; setDimensions(); jQuery('body').addClass('overhidden'); } // When the user clicks on (x), close the modal span.onclick = function() { modal.style.display = "none"; jQuery('body').removeClass('overhidden'); //history.back(-1); //$('.description-in').html(' '); $('#pagetitle').val(''); $(document).find('#consultModal .rsform').html(''); //window.location.href.split('#')[0] } // When the user clicks anywhere outside of the modal, close it window.onclick = function(event) { if (event.target == modal) { modal.style.display = "none"; jQuery('body').removeClass('overhidden'); //history.back(-1); //$('.description-in').html(' '); $('#pagetitle').val(''); $(document).find('#consultModal .rsform').html(''); //window.location.href.split('#')[0] } } //consultation if ("onhashchange" in window) { function locationHashChanged() { var consul='off'; if (location.hash === "#signin") { consul='on'; } else { var modal = document.getElementById('consultModal'); modal.style.display = "none"; $(document).find('#consultModal .rsform').html(''); jQuery('body').removeClass('overhidden'); consul='off'; } } window.onhashchange = locationHashChanged; } /* $('.my-parallax2 .a-2').click(function(event) { $("#consultBtn").trigger("click"); }); $('.display-5 .a-1').click(function(event) { $("#consultBtn").trigger("click"); }); $('.yButton').click(function(event) { $("#consultBtn").trigger("click"); }); $('.display-7 .product .p-texts .p-cart').click(function(event) { $("#consultBtn").trigger("click"); var texth3 = $(this).parent().find('h3').text(); $('#pagetitle').val(texth3); //$('.description-in').html(texth3); }); */ $(".my-parallax").mousemove(function(e){ var myp = $(".my-parallax"), windowwidth = $(window).width(), moffset = myp.offset(), mypWidth = myp.width(), mypHeight = myp.height(), mypWcenter = moffset.left+(mypWidth/2), mypHcenter = moffset.top+(mypHeight/2), y = mypHcenter - e.pageY, x = mypWcenter - e.pageX, aconf = {queue: false, duration: 50, easing: "linear"}; if (windowwidth >= 992 ) { $("*[data-mouse-react]").each(function() { var dmr = $(this).data("mouse-react"); $(this).animate({'margin-top': y/dmr},aconf); }); } }); $(".product .p-price").html(function(){ var text= $(this).text().trim().split(" "); var last = text.pop(); return text.join(" ") + (text.length > 0 ? " " + last + "" : last); }); // '.display-7 .product .p-texts h3' $(".display-7 .product .p-texts h3").each(function() { $(this).html( $(this).html().replace('/', '/
') ); }); // anchor animation $('.arrow-svg').click(function () { $('html, body').animate({ scrollTop: $('.component-top').offset().top }, 500); }); }); jQuery(window).load(function () { setDimensions(); }); jQuery(window).resize(function () { setDimensions(); setActivs(); }); jQuery(window).on( "orientationchange", function() { setDimensions(); setActivs(); }); jQuery(window).scroll(function() { setActivs(); });