( function ( $ ) { $(function() { $(document).ready(function(){ $('.m-bellows').bellows(); $(".video").fitVids(); //Portfolio item //================================================================== //================================================================== $(".portfolio-item-block").click(function() { var current_portfolio_item = this; if ($("body").width() >= 734) { if ($(this).is(".open")) { $(".portfolio-item-block").css("margin-bottom", 0); $(".details").fadeOut(); $(".portfolio-item-block").removeClass("open"); } else { $(".portfolio-item-block").css("margin-bottom", 0); $(".portfolio-item-block").removeClass("open"); $(".details").fadeOut(); $(".portfolio-list").addClass("static"); $(current_portfolio_item).addClass("open"); $("html, body").animate({scrollTop: $(current_portfolio_item).position().top + $(current_portfolio_item).height() + 700 }, 500); if($(current_portfolio_item).attr("data-item") == 1) { $(current_portfolio_item).css("margin-bottom", $(".details", current_portfolio_item).height() + 120); $(current_portfolio_item).next(".portfolio-item-block").css("margin-bottom", $(".details", current_portfolio_item).height() + 120); $(current_portfolio_item).next(".portfolio-item-block").next(".portfolio-item-block").css("margin-bottom", $(".details", current_portfolio_item).height() + 120); } if($(current_portfolio_item).attr("data-item") == 2) { $(current_portfolio_item).css("margin-bottom", $(".details", current_portfolio_item).height() + 120); $(current_portfolio_item).prev(".portfolio-item-block").css("margin-bottom", $(".details", current_portfolio_item).height() + 120); $(current_portfolio_item).next(".portfolio-item-block").css("margin-bottom", $(".details", current_portfolio_item).height() + 120); } if($(current_portfolio_item).attr("data-item") == 3) { $(current_portfolio_item).css("margin-bottom", $(".details", current_portfolio_item).height() + 120); $(current_portfolio_item).prev(".portfolio-item-block").css("margin-bottom", $(".details", current_portfolio_item).height() + 120); $(current_portfolio_item).prev(".portfolio-item-block").prev(".portfolio-item-block").css("margin-bottom", $(".details", current_portfolio_item).height() + 120); } $(".details", current_portfolio_item).fadeIn(50); } } else { if ($(this).is(".open")) { $(".portfolio-item-block").css("margin-bottom", 0).removeClass("open"); $(".details").fadeOut(); } else { $(".portfolio-item-block").css("margin-bottom", 0).removeClass("open"); $(".details").fadeOut(); $(".portfolio-list").addClass("static"); $(current_portfolio_item).addClass("open"); $(current_portfolio_item).css("margin-bottom", $(".details", current_portfolio_item).height() + 120); $(".details", current_portfolio_item).fadeIn(); } } }); $(".btn-close").click(function(e) { e.stopPropagation(); e.preventDefault(); $(".portfolio-item-block").css("margin-bottom", 0); $(".details").fadeOut(); $(".portfolio-item-block").removeClass("open"); }); $(".details").click(function(e) { e.stopPropagation(); return false; }); //shrink top header //================================================================== //================================================================== var topHeader = (function() { var docElem = document.documentElement, header = document.querySelector( '.top-header' ), didScroll = false, changeHeaderOn = 480, visibleHeaderOn = 300; function init() { window.addEventListener( 'scroll', function( event ) { if( !didScroll ) { didScroll = true; setTimeout( scrollPage, 5 ); } }, false ); } function scrollPage() { var sy = scrollY(); if ( sy >= visibleHeaderOn ) $(".top-header").addClass('active-header'); else $(".top-header").removeClass('active-header'); if ( sy >= changeHeaderOn ) { $(".top-header").addClass('top-header-shrink'); $(".logo").addClass("logopos"); $(".menuwrapper").addClass("menupos"); $("select").addClass("dw-menu"); } else { $(".top-header").removeClass('top-header-shrink'); $(".logo").removeClass("logopos"); $(".menuwrapper").removeClass("menupos"); $("select").removeClass("dw-menu"); } didScroll = false; } function scrollY() { return window.pageYOffset || docElem.scrollTop; } init(); })(); //header text visibility //=================================================================== //=================================================================== $(window).scroll( function() { var value = $(this).scrollTop(); if ( value > 150 ){ $(".home-inner-wrap").addClass("read"); $(".jms-arrows-prev").addClass("jms-arrows-prev-disable"); $(".jms-arrows-next").addClass("jms-arrows-next-disable"); } else{ $(".home-inner-wrap").removeClass("read"); $(".jms-arrows-prev").removeClass("jms-arrows-prev-disable"); $(".jms-arrows-next").removeClass("jms-arrows-next-disable"); } }); //Mobile menu //================================================================= //================================================================= $(document).ready(function() { // Create the dropdown bases $("