Commit 76e735c6 authored by Nahla Shiri's avatar Nahla Shiri

menu fixe

parent 4ac0e8a6
var initFunction=function(){ var initFunction = function() {
};//END init Function };//END init Function
(function($) { (function($) {
$(function(){ $(function() {
//Stop jump tag //Stop jump tag
$(document).find('a[href^="#"], .easyzoom a').click(function(e){ $(document).find('a[href^="#"], .easyzoom a').click(function(e) {
e.preventDefault(); e.preventDefault();
}); });
$(document).find('.contact-form .open-filter').on('click', function(){ $(document).find('.contact-form .open-filter').on('click', function() {
$('.contact-form form').slideToggle(); $('.contact-form form').slideToggle();
$(this).parent().toggleClass('on'); $(this).parent().toggleClass('on');
checkFilterContactWrapper(); checkFilterContactWrapper();
}) })
//Open Menu //Open Menu
var toggles = document.querySelectorAll(".c-hamburger"); var toggles = document.querySelectorAll(".c-hamburger");
for (var i = toggles.length - 1; i >= 0; i--) { for (var i = toggles.length - 1; i >= 0; i--) {
var toggle = toggles[i]; var toggle = toggles[i];
toggleHandler(toggle); toggleHandler(toggle);
}; }
function toggleHandler(toggle) { ;
toggle.addEventListener( "click", function(e) { function toggleHandler(toggle) {
var nav = $('.main-nav .nav-content'); toggle.addEventListener("click", function(e) {
//(this.classList.contains("is-active") === true) ? this.classList.remove("is-active") : this.classList.add("is-active"); var nav = $('.main-nav .nav-content');
$(".c-hamburger").toggleClass('is-active'); //(this.classList.contains("is-active") === true) ? this.classList.remove("is-active") : this.classList.add("is-active");
if ($(".c-hamburger").hasClass('is-active')) { //Open menu $(".c-hamburger").toggleClass('is-active');
nav.removeClass('OFF').addClass("ON"); if ($(".c-hamburger").hasClass('is-active')) { //Open menu
nav.parent().addClass("show-nav transition"); nav.removeClass('OFF').addClass("ON");
$('body').addClass('fixed'); nav.parent().addClass("show-nav transition");
if (!($('.main-nav .nav-content .footer').length)){ $('body').addClass('fixed');
$('.main-nav .nav-content').append($('footer .footer').clone(true,true)); if (!($('.main-nav .nav-content .footer').length)) {
} $('.main-nav .nav-content').append($('footer .footer').clone(true, true));
$('.right-panel-wrapper').css('z-index','9999'); }
} $('.right-panel-wrapper').css('z-index', '9999');
else { //Close menu }
nav.removeClass('ON').addClass("OFF"); else { //Close menu
$('body').removeClass('fixed'); nav.removeClass('ON').addClass("OFF");
nav.parent().removeClass("show-nav"); $('body').removeClass('fixed');
$('.main-nav .nav-content .footer').remove(); nav.parent().removeClass("show-nav");
setTimeout(function(){ $('.main-nav .nav-content .footer').remove();
$('.right-panel-wrapper').css('z-index','9999999'); setTimeout(function() {
},500) $('.right-panel-wrapper').css('z-index', '9999999');
}, 500)
}
setTimeout(function(){ }
checkFooterNavPosition(); setTimeout(function() {
},330) checkFooterNavPosition();
nav.stop().slideToggle(); }, 330)
}); nav.stop().slideToggle();
}
$.fn.loadPageContent = function(){
if ($('body').find('header').length > 1){
$('body').find('header').last().parent().remove();
$('.right-panel-wrapper').css('top', $('.nav-header').outerHeight());
$('html').css('overflow','auto');
}
//$('.load-page').removeClass('fadeOutUp').addClass('animated fadeInUp')
$('ul.phototheque').find('li').first().addClass('current');
$('ul.phototheque').find('li').first().find('.subcat').slideDown('slow');
var product = $('.list-animation article');
// TODO: Remove init classes , init attr on html
product.find('figure img,ul,h3,.new,.download-btn').attr( { 'data-animate':"", 'data-animation-classes':"animated fadeIn" } );
animateOnScroll();
if ($(document).find('#load-page').children().length){
scrollAnchor("#load-page", true);
elemToScroll = $(document).find("#load-page");
}else{
elemToScroll = $(document).find(".main");
scrollAnchor('body', true);
}
elemToScroll.on("scroll",onScroll);
document.getElementById('load-page').addEventListener('scroll', window.scrollAnimation.throttledEvent, false);
$(document).find('ul.main-list-nav').on('click',' li.parent-cat>a',function(e){
var windowWidth = $(window).width();
e.preventDefault();
e.stopPropagation();
$('.main-list-nav>li').removeClass('current');
$(this).parent().addClass('current');
//if (windowWidth < 860){
//$('.nav-phototeque .nav-content>ul>li').addClass('animated fadeOutLeft');
//$('.nav-phototeque .nav-content li.current').removeClass('fadeOutLeft').addClass('fadeInRight');
//$('.nav-phototeque .nav-content li.current ul').removeClass('fadeOutLeft').addClass('fadeInRight');
//$('.nav-phototeque .nav-content li.current ul').css('display','inline-block !important');
//.phototheque-content nav li
//}else{
$('.main-list-nav .subcat').stop().slideUp('slow');
// $('.main-list-nav .off .subcat').slideUp();
$(this).parent().find('.subcat').stop().slideDown('slow');
//}
});
setTimeout(function(){
$('.gallery-wrapper').removeClass('hidden-elem').addClass('animated visible-elem fadeInUp');
$.fn.responsive();
},100);
}
function appendLoading() {
$('.load-page').append($('#loading-container-subpage').clone());
$('#loading-container-subpage').show();
}
//load content page on left Panel
$(document).find('.to-slide').on('click','a',function(e){
$('html').css('overflow','hidden');
appendLoading();
e.preventDefault();
var link = $(this).attr("href"),
windowWidth = $(window).width();
if ($(this).parent().parent().hasClass('nav-page')){
$(document).find('.right-container').first().remove();
$('.load-page').parent().css({
'left':$('.nav-wrapper').outerWidth()
}); });
$('.load-page').css('opacity',1); }
$(document).find('#loading-container-subpage').css({ $.fn.loadPageContent = function() {
'left': $('.nav-wrapper').outerWidth(),
'width': 'calc(100% - ' + $('.nav-wrapper').outerWidth()+'px)', if ($('body').find('header').length > 1) {
}) $('body').find('header').last().parent().remove();
/**/ $('.right-panel-wrapper').css('top', $('.nav-header').outerHeight());
$('nav ul li').removeClass('current').addClass('off'); $('html').css('overflow', 'auto');
$(this).parent().addClass('current'); }
$(window)
/**/ //$('.load-page').removeClass('fadeOutUp').addClass('animated fadeInUp')
}else{ $('ul.phototheque').find('li').first().addClass('current');
$('.load-page').parent().css({ $('ul.phototheque').find('li').first().find('.subcat').slideDown('slow');
'left':0, var product = $('.list-animation article');
}); // TODO: Remove init classes , init attr on html
$('.load-page').parent().addClass('active'); product.find('figure img,ul,h3,.new,.download-btn').attr({'data-animate': "", 'data-animation-classes': "animated fadeIn"});
} animateOnScroll();
history.pushState(null, null, link); if ($(document).find('#load-page').children().length) {
$('.load-page').load(link,{'ajax' : 1},function(){ scrollAnchor("#load-page", true);
$.fn.loadPageContent(); elemToScroll = $(document).find("#load-page");
}); } else {
if (windowWidth < 860){ elemToScroll = $(document).find(".main");
$( ".c-hamburger" ).trigger( "click" ); scrollAnchor('body', true);
} }
}); elemToScroll.on("scroll", onScroll);
var div = $('.nav-content'); document.getElementById('load-page').addEventListener('scroll', window.scrollAnimation.throttledEvent, false);
$('.footer-home-content').on('click','.home-down:not(.scrolled)',function(e){ $(document).find('ul.main-list-nav').on('click', ' li.parent-cat>a', function(e) {
TweenMax.killTweensOf('.nav-content'); var windowWidth = $(window).width();
var mainHeight = $('.main').outerHeight(); e.preventDefault();
$(this).addClass('scrolled'); e.stopPropagation();
if (!($('.footer-home-content .nav-content').length)){ $('.main-list-nav>li').removeClass('current');
$('.footer-home-content').append($('.nav-content').clone()); $(this).parent().addClass('current');
$('.main').outerHeight(mainHeight + $('.footer-home-content').outerHeight()); //if (windowWidth < 860){
$('.home-down-wrapper').css('top', - ($('.home-down-wrapper').outerHeight())); //$('.nav-phototeque .nav-content>ul>li').addClass('animated fadeOutLeft');
$('.home-down').css('top', -($('.home-down').outerHeight())); //$('.nav-phototeque .nav-content li.current').removeClass('fadeOutLeft').addClass('fadeInRight');
//$('.nav-phototeque .nav-content li.current ul').removeClass('fadeOutLeft').addClass('fadeInRight');
//$('.home-down-wrapper').css('top','121px'); //$('.nav-phototeque .nav-content li.current ul').css('display','inline-block !important');
} //.phototheque-content nav li
//scroll to bottom //}else{
$('body').animate({ $('.main-list-nav .subcat').stop().slideUp('slow');
scrollTop: div.outerHeight() // $('.main-list-nav .off .subcat').slideUp();
}, 1000,'swing',function(){ $(this).parent().find('.subcat').stop().slideDown('slow');
}); //}
}).on('click','.scrolled',function(){ });
$(this).removeClass('scrolled'); setTimeout(function() {
$("html, body").animate({ scrollTop: 0 }, "slow"); $('.gallery-wrapper').removeClass('hidden-elem').addClass('animated visible-elem fadeInUp');
setTimeout(function(){ $.fn.responsive();
$('.footer-home-content').find('.nav-content').remove(); }, 100);
$('.home-down-wrapper').css('top','initial'); }
$('.footer-home-content').removeClass('fixed'); function appendLoading() {
$('.main').height($(window).innerHeight()); $('.load-page').append($('#loading-container-subpage').clone());
},600) $('#loading-container-subpage').show();
return false; }
}); //load content page on left Panel
$(document).find('.to-slide').on('click', 'a', function(e) {
$('html').css('overflow', 'hidden');
appendLoading();
e.preventDefault();
var link = $(this).attr("href"),
windowWidth = $(window).width();
if ($(this).parent().parent().hasClass('nav-page')) {
$(document).find('.right-container').first().remove();
$('.load-page').parent().css({
'left': $('.nav-wrapper').outerWidth()
});
$('.load-page').css('opacity', 1);
$(document).find('#loading-container-subpage').css({
'left': $('.nav-wrapper').outerWidth(),
'width': 'calc(100% - ' + $('.nav-wrapper').outerWidth() + 'px)',
})
/**/
$('nav ul li').removeClass('current').addClass('off');
$(this).parent().addClass('current');
/**/
} else {
$('.load-page').parent().css({
'left': 0,
});
$('.load-page').parent().addClass('active');
}
history.pushState(null, null, link);
$('.load-page').load(link, {'ajax': 1}, function() {
$.fn.loadPageContent();
$.fn.responsive();
$.fn.animation();
});
if (windowWidth < 860) {
$(".c-hamburger").trigger("click");
}
});
var div = $('.nav-content');
$('.footer-home-content').on('click', '.home-down:not(.scrolled)', function(e) {
TweenMax.killTweensOf('.nav-content');
var mainHeight = $('.main').outerHeight();
$(this).addClass('scrolled');
if (!($('.footer-home-content .nav-content').length)) {
$('.footer-home-content').append($('.nav-content').clone());
$('.main').outerHeight(mainHeight + $('.footer-home-content').outerHeight());
$('.home-down-wrapper').css('top', -($('.home-down-wrapper').outerHeight()));
$('.home-down').css('top', -($('.home-down').outerHeight()));
//$('.home-down-wrapper').css('top','121px');
}
//scroll to bottom
$('body').animate({
scrollTop: div.outerHeight()
}, 1000, 'swing', function() {
});
}).on('click', '.scrolled', function() {
$(this).removeClass('scrolled');
$("html, body").animate({scrollTop: 0}, "slow");
setTimeout(function() {
$('.footer-home-content').find('.nav-content').remove();
$('.home-down-wrapper').css('top', 'initial');
$('.footer-home-content').removeClass('fixed');
$('.main').height($(window).innerHeight());
}, 600)
return false;
});
//Get file name of uploaded file //Get file name of uploaded file
$('#file-p').on('change',function(e){ $('#file-p').on('change', function(e) {
var fileName = e.target.files[0].name; var fileName = e.target.files[0].name;
$('.upload-btn').after($('<p class="loaded-file">' + fileName + '</p>')); $('.upload-btn').after($('<p class="loaded-file">' + fileName + '</p>'));
}) })
//END get file name //END get file name
//END load content page on left Panel //END load content page on left Panel
$(document).on('click','.int-link',function(e){ $(document).on('click', '.int-link', function(e) {
e.preventDefault(); e.preventDefault();
$('.load-page').parent().removeClass('active'); $('.load-page').parent().removeClass('active');
$('.load-page').parent().css('left','100%'); $('.load-page').parent().css('left', '100%');
history.pushState(null, null, $(this).find('a').attr('href')); history.pushState(null, null, $(this).find('a').attr('href'));
$('html').css('overflow','auto'); $('html').css('overflow', 'auto');
tlProduct.reverse(); tlProduct.reverse();
//$('.load-page').removeClass('fadeInUp').addClass('animated fadeOutUp'); //$('.load-page').removeClass('fadeInUp').addClass('animated fadeOutUp');
}); });
$(document).on('click','.acces li .login, .login-user',function(e){ $(document).on('click', '.acces li .login, .login-user', function(e) {
e.stopImmediatePropagation(); e.stopImmediatePropagation();
var windowWidth = $(window).width(); var windowWidth = $(window).width();
$('.popup-container').fadeIn(); $('.popup-container').fadeIn();
if (windowWidth < 860){ if (windowWidth < 860) {
$( ".c-hamburger" ).trigger( "click" ); $(".c-hamburger").trigger("click");
} }
// $('#user_login').attr('placeholder', 'Identifiant'); // $('#user_login').attr('placeholder', 'Identifiant');
// $('#user_pass').attr('placeholder', 'Mot de passe'); // $('#user_pass').attr('placeholder', 'Mot de passe');
$('.popup-first').removeClass('fadeOutDown ').addClass('animated visible-elem pulse'); $('.popup-first').removeClass('fadeOutDown ').addClass('animated visible-elem pulse');
}); });
//Close popup //Close popup
$('.popup-first .close-btn').click( $('.popup-first .close-btn').click(
function(){ function() {
$('.popup-first').removeClass('visible-elem pulse').addClass('fadeOutDown'); $('.popup-first').removeClass('visible-elem pulse').addClass('fadeOutDown');
setTimeout(function(){ setTimeout(function() {
$('.popup-container').fadeOut('slow'); $('.popup-container').fadeOut('slow');
},0); }, 0);
}); });
checkWhiteColor = function(color) { checkWhiteColor = function(color) {
var white = ["#fff","#ffffff","white" ]; var white = ["#fff", "#ffffff", "white"];
if ($.inArray(color, white) != -1){ if ($.inArray(color, white) != -1) {
color = '#999999'; color = '#999999';
} }
return color; return color;
} }
//checkWhiteColor = function(item) { //checkWhiteColor = function(item) {
$.fn.setColorToWhite = function(item){ $.fn.setColorToWhite = function(item) {
//$('.list-wrapper .color-list') //$('.list-wrapper .color-list')
$(this).each(function(){ $(this).each(function() {
elem = item ? $(this).find(item) : $(this), elem = item ? $(this).find(item) : $(this),
isWhite = checkWhiteColor(elem.data('color')); isWhite = checkWhiteColor(elem.data('color'));
if(isWhite != elem.data('color')){ if (isWhite != elem.data('color')) {
elem.addClass('is-white'); elem.addClass('is-white');
} }
}); });
} }
$.fn.setBgColorList = function(){ $.fn.setBgColorList = function() {
$(this).each(function(){ $(this).each(function() {
$(this).css({ $(this).css({
'background-color' : $(this).data('color'), 'background-color': $(this).data('color'),
'border' : '1px solid' + checkWhiteColor($(this).data('color')) 'border': '1px solid' + checkWhiteColor($(this).data('color'))
}) })
}) })
} }
$.fn.showProductListColors = function(){ $.fn.showProductListColors = function() {
var articleWrapper = $(this), var articleWrapper = $(this),
firstPellet = articleWrapper.find('li').first(), firstPellet = articleWrapper.find('li').first(),
articleColor = checkWhiteColor(firstPellet.data('color')); articleColor = checkWhiteColor(firstPellet.data('color'));
articleLink = firstPellet.data('link'); articleLink = firstPellet.data('link');
articleWrapper.find('.article-bg').css('background-color',articleColor); articleWrapper.find('.article-bg').css('background-color', articleColor);
articleWrapper.find('figure img').attr({ articleWrapper.find('figure img').attr({
'src' : firstPellet.data('image'), 'src': firstPellet.data('image'),
'data-link' : articleLink 'data-link': articleLink
}); });
$('.product-list article ul li').setBgColorList(); $('.product-list article ul li').setBgColorList();
} }
//FadeIn Image on home page //FadeIn Image on home page
$.fn.fadeImage= function(){ $.fn.fadeImage = function() {
var srcImage = $(this).data('img'); var srcImage = $(this).data('img');
if (srcImage == 'undefined' || !srcImage) if (srcImage == 'undefined' || !srcImage)
{ {
srcImage = $('#home .img-wrapper').data('defaultimg'); srcImage = $('#home .img-wrapper').data('defaultimg');
} }
$('.img-wrapper').removeClass('animate'); $('.img-wrapper').removeClass('animate');
$('.img-wrapper').stop().animate({ $('.img-wrapper').stop().animate({
opacity:0, opacity: 0,
}, 500, function() {}); }, 500, function() {
$('.img-wrapper').stop().animate({ });
opacity:1, $('.img-wrapper').stop().animate({
},500, function() { opacity: 1,
$('.img-wrapper').addClass('animate'); }, 500, function() {
$('.img-wrapper').css({ $('.img-wrapper').addClass('animate');
'background-image': "url("+ srcImage +")", $('.img-wrapper').css({
}); 'background-image': "url(" + srcImage + ")",
}); });
} });
$.fn.showSubmenu = function(){ }
var currentPage = $('.container').data('page'); $.fn.showSubmenu = function() {
$('header nav').find('ul li').find("[data-page="+currentPage+"]").slideDown(); var currentPage = $('.container').data('page');
$('header nav').find('ul').find("[data-page="+currentPage+"]").addClass('current'); $('header nav').find('ul li').find("[data-page=" + currentPage + "]").slideDown();
} $('header nav').find('ul').find("[data-page=" + currentPage + "]").addClass('current');
}
//animate menu nav //animate menu nav
$.fn.open_nav = function(){ $.fn.open_nav = function() {
TweenLite.set(".nav-content", {visibility : "visible"}); TweenLite.set(".nav-content", {visibility: "visible"});
var tl = new TimelineMax(); var tl = new TimelineMax();
tl.staggerFrom('.nav-content >ul>li, .phototheque-content nav >ul > li',0.5,{opacity:0,x:200},0.1,0.5); tl.staggerFrom('.nav-content >ul>li, .phototheque-content nav >ul > li', 0.5, {opacity: 0, x: 200}, 0.1, 0.5);
tl.staggerFromTo('nav ul ul li ',0.5,{opacity:0,x:200},{opacity:1,x:0},0.1,1.2); tl.staggerFromTo('nav ul ul li ', 0.5, {opacity: 0, x: 200}, {opacity: 1, x: 0}, 0.1, 1.2);
tl.fromTo('.news-btn',0.9,{autoAlpha:0,scale:'0'},{autoAlpha:1,scale:'1'},0); tl.fromTo('.news-btn', 0.9, {autoAlpha: 0, scale: '0'}, {autoAlpha: 1, scale: '1'}, 0);
} }
$.fn.openPanelAnimation = function(){ $.fn.openPanelAnimation = function() {
$(this).addClass('animated slideInRight').removeClass('slideOutRight').show(); $(this).addClass('animated slideInRight').removeClass('slideOutRight').show();
} }
$.fn.closePanelAnimation = function(){ $.fn.closePanelAnimation = function() {
$(this).removeClass('slideInRight').addClass('slideOutRight'); $(this).removeClass('slideInRight').addClass('slideOutRight');
} }
$.fn.open_news = function(){ $.fn.open_news = function() {
$(this).on('click',function(){ $(this).on('click', function() {
$('.news-wrapper').openPanelAnimation(); $('.news-wrapper').openPanelAnimation();
}) })
} }
$.fn.close_news = function(){ $.fn.close_news = function() {
$(this).on('click',function(){ $(this).on('click', function() {
$('.news-wrapper').closePanelAnimation(); $('.news-wrapper').closePanelAnimation();
}) })
} }
$.fn.reinitFilter = function(){ $.fn.reinitFilter = function() {
$(this).removeClass('selected-filter selected'); $(this).removeClass('selected-filter selected');
} }
$.fn.open_filter = function(){ $.fn.open_filter = function() {
$(this).on('click','.filter-btn',function(){ $(this).on('click', '.filter-btn', function() {
var filterW = $('.filter-list').outerWidth(), var filterW = $('.filter-list').outerWidth(),
mainW = $('.main-nav').outerWidth(), mainW = $('.main-nav').outerWidth(),
filterBtn = $('.filter-btn .btn-container').outerWidth(); filterBtn = $('.filter-btn .btn-container').outerWidth();
tlFilter = new TimelineMax(); tlFilter = new TimelineMax();
tlFilter.staggerFromTo('.filter-bloc',0.5,{opacity:0,y:100},{opacity:1,y:0},0.1,0); tlFilter.staggerFromTo('.filter-bloc', 0.5, {opacity: 0, y: 100}, {opacity: 1, y: 0}, 0.1, 0);
tlFilter.fromTo('.filter-list',0.5,{opacity:0,left:'0',visibility:"hidden"},{opacity:1,left:mainW,visibility:"visible"},0); tlFilter.fromTo('.filter-list', 0.5, {opacity: 0, left: '0', visibility: "hidden"}, {opacity: 1, left: mainW, visibility: "visible"}, 0);
tlFilter.to('.filter-btn .btn-container',0.5,{opacity:0,left:filterW, width:"0px"},0); tlFilter.to('.filter-btn .btn-container', 0.5, {opacity: 0, left: filterW, width: "0px"}, 0);
//tl.fromTo('#slides',0.5,{opacity:1},{opacity:0},0); //tl.fromTo('#slides',0.5,{opacity:1},{opacity:0},0);
//tl.fromTo('.nav-slider',0.5,{opacity:1},{opacity:0},0); //tl.fromTo('.nav-slider',0.5,{opacity:1},{opacity:0},0);
}).on('click','.close-btn',function(){ }).on('click', '.close-btn', function() {
tlFilter.reverse(); tlFilter.reverse();
}).on('click','.filter-bloc .header',function(){ }).on('click', '.filter-bloc .header', function() {
var $this = $(this).parent(); var $this = $(this).parent();
if (!$this.hasClass('active')){ if (!$this.hasClass('active')) {
$('.filter-bloc').removeClass('active'); $('.filter-bloc').removeClass('active');
$this.addClass('active'); $this.addClass('active');
$('.filter-bloc .bloc-content').slideUp('slow'); $('.filter-bloc .bloc-content').slideUp('slow');
$this.find('.bloc-content').slideDown('slow'); $this.find('.bloc-content').slideDown('slow');
$('.commercial').slideUp('slow'); $('.commercial').slideUp('slow');
}else{ } else {
$this.removeClass('active'); $this.removeClass('active');
$this.find('.bloc-content').slideUp('slow'); $this.find('.bloc-content').slideUp('slow');
} }
}).on('click','.filter-bloc li:not(.disabled,.reinit)',function(e){ }).on('click', '.filter-bloc li:not(.disabled,.reinit)', function(e) {
e.stopPropagation(); e.stopPropagation();
$(this).toggleClass('selected'); $(this).toggleClass('selected');
var e = $(this).parent().find('.selected').length, var e = $(this).parent().find('.selected').length,
parentFilter = $(this).parent().parent().parent(); parentFilter = $(this).parent().parent().parent();
if (e){ if (e) {
parentFilter.addClass('selected-filter'); parentFilter.addClass('selected-filter');
$('.filter-btn').addClass('selected-filter'); $('.filter-btn').addClass('selected-filter');
}else{ } else {
parentFilter.removeClass('selected-filter') ; parentFilter.removeClass('selected-filter');
$('.filter-btn').removeClass('selected-filter'); $('.filter-btn').removeClass('selected-filter');
} }
//e ? parentFilter.addClass('selected-filter') : parentFilter.removeClass('selected-filter') ; //e ? parentFilter.addClass('selected-filter') : parentFilter.removeClass('selected-filter') ;
}).on('click','.filter-bloc .reinit',function(){ }).on('click', '.filter-bloc .reinit', function() {
selector = $(this).parent().parent(); selector = $(this).parent().parent();
selector.parent().reinitFilter(); selector.parent().reinitFilter();
selector.find('li').reinitFilter(); selector.find('li').reinitFilter();
}).on('click','.reinit-all',function(){ }).on('click', '.reinit-all', function() {
$('.filter-bloc , .filter-bloc li').reinitFilter(); $('.filter-bloc , .filter-bloc li').reinitFilter();
$('.filter-btn').removeClass('selected-filter'); $('.filter-btn').removeClass('selected-filter');
}); });
} }
$.fn.checkSelectedFilter = function(){ $.fn.checkSelectedFilter = function() {
if ($('.filter-content .filter-bloc.selected-filter').length){ if ($('.filter-content .filter-bloc.selected-filter').length) {
$('.filter-btn').addClass('selected-filter'); $('.filter-btn').addClass('selected-filter');
} }
} }
$.fn.changeProductImageBg = function(){ $.fn.changeProductImageBg = function() {
var var
selectedColor = checkWhiteColor($(this).data("color")), selectedColor = checkWhiteColor($(this).data("color")),
selectedImage = $(this).data("image"), selectedImage = $(this).data("image"),
linkProduct = $(this).data("link"), linkProduct = $(this).data("link"),
tl = new TimelineMax(), tl = new TimelineMax(),
container = $(this).parent().parent(); container = $(this).parent().parent();
container.find('.article-bg').css({"background-color": selectedColor, opacity:'0.1'}); container.find('.article-bg').css({"background-color": selectedColor, opacity: '0.1'});
container.find('img').attr({'src' : selectedImage , 'data-link' : linkProduct}); container.find('img').attr({'src': selectedImage, 'data-link': linkProduct});
tl.fromTo(container.find('img'),1,{opacity:0,visibility:"hidden"},{opacity:1,visibility:"visible"},0); tl.fromTo(container.find('img'), 1, {opacity: 0, visibility: "hidden"}, {opacity: 1, visibility: "visible"}, 0);
} }
$.fn.animatePageScroll = function(element, duration) { $.fn.animatePageScroll = function(element, duration) {
return $(this).fromTo(element,duration, return $(this).fromTo(element, duration,
{opacity:0,visibility:"hidden",marginBottom:'80px'}, {opacity: 0, visibility: "hidden", marginBottom: '80px'},
{opacity:1,visibility:"visible",marginBottom:'0px'},0.7); {opacity: 1, visibility: "visible", marginBottom: '0px'}, 0.7);
} }
$.fn.fullpageSlide = function(){ $.fn.fullpageSlide = function() {
var var
timeout = 1.7, timeout = 1.7,
duration = 1.2; duration = 1.2;
setTimeout(function(){ setTimeout(function() {
$('.moveDown').removeClass('hidden-elem').addClass('visible-elem animated rollIn'); $('.moveDown').removeClass('hidden-elem').addClass('visible-elem animated rollIn');
}, 2000); }, 2000);
$("#fullpage .section").first().addClass('first'); $("#fullpage .section").first().addClass('first');
$(this).fullpage({ $(this).fullpage({
verticalCentered: false, verticalCentered: false,
css3:false, css3: false,
scrollingSpeed: 1500, scrollingSpeed: 1500,
lazyLoading: false , lazyLoading: false,
fixedElements: 'footer', fixedElements: 'footer',
controlArrows: true, controlArrows: true,
fitToSectionDelay: 800000, fitToSectionDelay: 800000,
fadingEffect: true, fadingEffect: true,
normalScrollElements : ".section .bloc", normalScrollElements: ".section .bloc",
afterLoad: function(anchor, index){ afterLoad: function(anchor, index) {
tl1 = new TimelineMax(); tl1 = new TimelineMax();
var firstSection = $("#fullpage .section.first"); var firstSection = $("#fullpage .section.first");
//tl1.animatePageScroll(firstSection,duration); //tl1.animatePageScroll(firstSection,duration);
//console.log(animation); //console.log(animation);
tl1.fromTo(firstSection.find('.bloc .header-bloc'),1.5, tl1.fromTo(firstSection.find('.bloc .header-bloc'), 1.5,
{opacity:0,visibility:"hidden",marginBottom:'80px'}, {opacity: 0, visibility: "hidden", marginBottom: '80px'},
{opacity:1,visibility:"visible",marginBottom:'0px'},timeout); {opacity: 1, visibility: "visible", marginBottom: '0px'}, timeout);
tl1.fromTo(firstSection.find('.bloc .desc-content'),1, tl1.fromTo(firstSection.find('.bloc .desc-content'), 1,
{opacity:0,visibility:"hidden",marginLeft:'-100px'}, {opacity: 0, visibility: "hidden", marginLeft: '-100px'},
{opacity:1,visibility:"visible",marginLeft:'0px'},timeout); {opacity: 1, visibility: "visible", marginLeft: '0px'}, timeout);
}, },
onLeave: function(index, nextIndex, direction){ onLeave: function(index, nextIndex, direction) {
var var
activeSection = $(this), activeSection = $(this),
nextSection = $(this).next(); nextSection = $(this).next();
tl2 = new TimelineMax(); tl2 = new TimelineMax();
timeout = 0.7; timeout = 0.7;
activeSection.removeClass('first'); activeSection.removeClass('first');
if ( nextIndex === $('#fullpage .section').length){ if (nextIndex === $('#fullpage .section').length) {
$('.moveDown').removeClass('hidden-elem').addClass('visible-elem animated rollOut'); $('.moveDown').removeClass('hidden-elem').addClass('visible-elem animated rollOut');
}else { } else {
$('.moveDown').removeClass('rollOut'); $('.moveDown').removeClass('rollOut');
} }
tl2.fromTo(nextSection.find('.bloc .header-bloc'),1.5, tl2.fromTo(nextSection.find('.bloc .header-bloc'), 1.5,
{opacity:0,visibility:"hidden",marginBottom:'80px'}, {opacity: 0, visibility: "hidden", marginBottom: '80px'},
{opacity:1,visibility:"visible",marginBottom:'0px'},timeout); {opacity: 1, visibility: "visible", marginBottom: '0px'}, timeout);
tl2.fromTo(nextSection.find('.bloc .desc-content'),1, tl2.fromTo(nextSection.find('.bloc .desc-content'), 1,
{opacity:0,visibility:"hidden",marginLeft:'-100px'}, {opacity: 0, visibility: "hidden", marginLeft: '-100px'},
{opacity:1,visibility:"visible",marginLeft:'0px'},timeout); {opacity: 1, visibility: "visible", marginLeft: '0px'}, timeout);
if (direction === 'up') { if (direction === 'up') {
tl3 = new TimelineMax(); tl3 = new TimelineMax();
prevSection = $(this).prev(); prevSection = $(this).prev();
tl3.fromTo(prevSection.find('.bloc .header-bloc'),1.5, tl3.fromTo(prevSection.find('.bloc .header-bloc'), 1.5,
{opacity:0,visibility:"hidden",marginBottom:'80px'}, {opacity: 0, visibility: "hidden", marginBottom: '80px'},
{opacity:1,visibility:"visible",marginBottom:'0px'},timeout); {opacity: 1, visibility: "visible", marginBottom: '0px'}, timeout);
tl3.fromTo(prevSection.find('.bloc .desc-content'),1, tl3.fromTo(prevSection.find('.bloc .desc-content'), 1,
{opacity:0,visibility:"hidden",marginLeft:'-100px'}, {opacity: 0, visibility: "hidden", marginLeft: '-100px'},
{opacity:1,visibility:"visible",marginLeft:'0px'},timeout); {opacity: 1, visibility: "visible", marginLeft: '0px'}, timeout);
} }
}, },
}); });
$(document).on('click', '.moveDown', function(){ $(document).on('click', '.moveDown', function() {
$.fn.fullpage.moveSectionDown(); $.fn.fullpage.moveSectionDown();
}); });
} }
$.fn.getMenuBg = function(){ $.fn.getMenuBg = function() {
var imgSrc = $('header .nav-content > ul').find(' > li.current').data('img'), var imgSrc = $('header .nav-content > ul').find(' > li.current').data('img'),
windowWidth = $(window).width(), windowWidth = $(window).width(),
navwWidth = $('.nav-wrapper').width(), navwWidth = $('.nav-wrapper').width(),
navHeight = $('.nav-header').outerHeight(); navHeight = $('.nav-header').outerHeight();
$('.container-bg').css({ $('.container-bg').css({
'background-image': "url("+ imgSrc +")", 'background-image': "url(" + imgSrc + ")",
'opacity' : 0, 'opacity': 0,
}) })
tlBg = new TimelineMax(); tlBg = new TimelineMax();
tlBg.to('.container-bg',0.9,{opacity:1},0.5); tlBg.to('.container-bg', 0.9, {opacity: 1}, 0.5);
tlBg.from('.full-slides',1.2,{opacity:0, width:0},0.4); tlBg.from('.full-slides', 1.2, {opacity: 0, width: 0}, 0.4);
if (windowWidth > 860){ if (windowWidth > 860) {
tlBg.to('.container-bg',1.2,{width:navwWidth},0.4); tlBg.to('.container-bg', 1.2, {width: navwWidth}, 0.4);
} }
} }
$.fn.appendMap = function(){ $.fn.appendMap = function() {
var $this = $(this); var $this = $(this);
if (!(this.find('.map').length)){ if (!(this.find('.map').length)) {
this.append($('.map')); this.append($('.map'));
} }
setTimeout(function(){ setTimeout(function() {
initMap(); initMap();
},330) }, 330)
} }
$.fn.appendMobileMenu = function(){ $.fn.appendMobileMenu = function() {
var $this = $(this); var $this = $(this);
setTimeout(function(){ setTimeout(function() {
if (!($this.find('li.current').length)){ if (!($this.find('li.current').length)) {
$('.main-nav .nav-content li.current').addClass('to-replace'); $('.main-nav .nav-content li.current').addClass('to-replace');
$('.main-nav .nav-content li.current').clone(true).find('ul').remove().end().appendTo($this); $('.main-nav .nav-content li.current').clone(true).find('ul').remove().end().appendTo($this);
$this.find("li.current").append($('.main-nav.nav-wrapper li.current ul')); $this.find("li.current").append($('.main-nav.nav-wrapper li.current ul'));
} }
$('.right-container').css('padding-top',$this.parent().outerHeight()); $('.right-container').css('padding-top', $this.parent().outerHeight());
},2000) }, 2000)
} }
//Responsive function //Responsive function
$.fn.responsive = function(){ $.fn.responsive = function() {
$(".product-details").css('height','auto'); $(".product-details").css('height', 'auto');
var footerHeight = $('footer').height(), var footerHeight = $('footer').height(),
productHeight = $(".product-details").outerHeight(), productHeight = $(".product-details").outerHeight(),
productWidth = $(".product-details").outerWidth(), productWidth = $(".product-details").outerWidth(),
windowHeight = $(window).innerHeight(), windowHeight = $(window).innerHeight(),
windowWidth = $(window).width(), windowWidth = $(window).width(),
navMenuWidth = $('.nav-wrapper').outerWidth(), navMenuWidth = $('.nav-wrapper').outerWidth(),
navHeight = $('.nav-header').outerHeight(), navHeight = $('.nav-header').outerHeight(),
navHeader = $('.nav-header').outerHeight(), navHeader = $('.nav-header').outerHeight(),
containerHeight = windowHeight - footerHeight , containerHeight = windowHeight - footerHeight,
navPhototequeWidth = $('.nav-phototeque').outerWidth(), navPhototequeWidth = $('.nav-phototeque').outerWidth(),
navPhototequeHeight = $('.nav-phototeque').height(), navPhototequeHeight = $('.nav-phototeque').height(),
maxHeight = productHeight > windowHeight ? productHeight : containerHeight, maxHeight = productHeight > windowHeight ? productHeight : containerHeight,
galleryWidth = windowWidth - navPhototequeWidth, galleryWidth = windowWidth - navPhototequeWidth,
filterWidth = $('.right-container .left-panel').outerWidth(), filterWidth = $('.right-container .left-panel').outerWidth(),
footerContact = $('.contact-form .footer').outerHeight(); footerContact = $('.contact-form .footer').outerHeight();
$('.gallery-wrapper').outerWidth(galleryWidth).css('margin-left',navPhototequeWidth) ; $('.gallery-wrapper').outerWidth(galleryWidth).css('margin-left', navPhototequeWidth);
$('.main,.load-page').outerHeight(containerHeight); $('.main,.load-page').outerHeight(containerHeight);
$('.full-height').outerHeight(maxHeight); $('.full-height').outerHeight(maxHeight);
$('.nav-content').outerHeight( windowHeight - navHeader - footerHeight); $('.nav-content').outerHeight(windowHeight - navHeader - footerHeight);
$('.product-images').outerWidth(windowWidth - productWidth -10); $('.product-images').outerWidth(windowWidth - productWidth - 10);
$('.right-container').outerWidth(windowWidth - navMenuWidth); $('.right-container').outerWidth(windowWidth - navMenuWidth);
$('.position--after-menu').css('left',navMenuWidth); $('.position--after-menu').css('left', navMenuWidth);
$('.right-panel').outerWidth(windowWidth - (navMenuWidth + filterWidth)); $('.right-panel').outerWidth(windowWidth - (navMenuWidth + filterWidth));
$('.contact-form').height(windowHeight - footerHeight); $('.contact-form').height(windowHeight - footerHeight);
$('.contact-form .inner-form').outerHeight(windowHeight - footerContact); $('.contact-form .inner-form').outerHeight(windowHeight - footerContact);
$('#catalogue .panel-content section').last().css('height','auto'); $('#catalogue .panel-content section').last().css('height', 'auto');
setTimeout(function(){ setTimeout(function() {
var lastSection = $('#catalogue .panel-content section').last(); var lastSection = $('#catalogue .panel-content section').last();
var lastSectionHeight = lastSection.outerHeight() + 50; var lastSectionHeight = lastSection.outerHeight() + 50;
if (lastSectionHeight < windowHeight - footerHeight){ if (lastSectionHeight < windowHeight - footerHeight) {
lastSection.height(2 * windowHeight/3 + lastSection.find('h2').outerHeight() - footerHeight ); lastSection.height(2 * windowHeight / 3 + lastSection.find('h2').outerHeight() - footerHeight);
}else{ } else {
lastSection.css('height','auto'); lastSection.css('height', 'auto');
} }
},1000) }, 1000)
$('.nav-phototeque .nav-content').outerHeight(navPhototequeHeight - $('.circle-btn').outerHeight()- $('.phototheque-content .header h2').outerHeight() - footerHeight); $('.nav-phototeque .nav-content').outerHeight(navPhototequeHeight - $('.circle-btn').outerHeight() - $('.phototheque-content .header h2').outerHeight() - footerHeight);
if (windowWidth > 860){ if (windowWidth > 860) {
$('#fullpage .chevron').css('left',navMenuWidth); $('#fullpage .chevron').css('left', navMenuWidth);
$('.container-bg').css({'height':'100%' , 'width' : navMenuWidth}); $('.container-bg').css({'height': '100%', 'width': navMenuWidth});
$('.main').css('padding-top',0); $('.main').css('padding-top', 0);
$('.contact-form h2').removeClass('show-comm'); $('.contact-form h2').removeClass('show-comm');
$('.filter, .left-panel .map, .details, .contact-form form').show(); $('.filter, .left-panel .map, .details, .contact-form form').show();
$('.left-panel').appendMap(); $('.left-panel').appendMap();
$('.filter-list,#home').css('margin-top',0); $('.filter-list,#home').css('margin-top', 0);
$('.filter-list .top-header').css('top',"initial"); $('.filter-list .top-header').css('top', "initial");
$('.header .nav-wrapper li.to-replace').append($('.mobile-nav .nav-wrapper li.current ul')); $('.header .nav-wrapper li.to-replace').append($('.mobile-nav .nav-wrapper li.current ul'));
$('.mobile-nav .nav-wrapper ul').find('li').remove(); $('.mobile-nav .nav-wrapper ul').find('li').remove();
}else{ } else {
$('.filter').appendMap(); $('.filter').appendMap();
$('.main').css('padding-top',navHeight); $('.main').css('padding-top', navHeight);
$('.container-bg').css({'height':navHeight}); $('.container-bg').css({'height': navHeight});
$('.contact-form h2').addClass('show-comm'); $('.contact-form h2').addClass('show-comm');
$('.filter-list').css('margin-top',navHeight); $('.filter-list').css('margin-top', navHeight);
$('.filter-list .top-header, .mobile-nav').css('top',navHeight); $('.filter-list .top-header, .mobile-nav').css('top', navHeight);
$('.mobile-nav .nav-wrapper ul').appendMobileMenu(); $('.mobile-nav .nav-wrapper ul').appendMobileMenu();
$('#slides').height($('.slides-wrapper').width()); $('#slides').height($('.slides-wrapper').width());
if ($('body #home').length){ if ($('body #home').length) {
$('.main').css('padding-top',0); $('.main').css('padding-top', 0);
} }
if ($('.filter-wrapper .header-filter-contact').hasClass('on')){ if ($('.filter-wrapper .header-filter-contact').hasClass('on')) {
$('.filter, .left-panel .map, .details').show(); $('.filter, .left-panel .map, .details').show();
}else{ } else {
$('.filter, .left-panel .map, .details').hide(); $('.filter, .left-panel .map, .details').hide();
} }
if($('.contact-form .header-filter-contact').hasClass('on')){ if ($('.contact-form .header-filter-contact').hasClass('on')) {
$('.contact-form form').show(); $('.contact-form form').show();
}else{ } else {
$('.contact-form form').hide(); $('.contact-form form').hide();
} }
checkFilterContactWrapper(); checkFilterContactWrapper();
} }
checkFooterNavPosition(); checkFooterNavPosition();
} }
//Wordpress js login //Wordpress js login
$('#user_login').attr('placeholder', 'Identifiant'); $('#user_login').attr('placeholder', 'Identifiant');
$('#user_pass').attr('placeholder', 'Mot de passe'); $('#user_pass').attr('placeholder', 'Mot de passe');
$("#user_login").addClass("my-login-username"); $("#user_login").addClass("my-login-username");
$("#wp-submit").addClass("btn rounded white-btn"); $("#wp-submit").addClass("btn rounded white-btn");
});//END Function });//END Function
function animateOnScroll(){ function animateOnScroll() {
var animate = new Animate({ var animate = new Animate({
target: '[data-animate]', target: '[data-animate]',
animatedClass: 'visible', animatedClass: 'visible',
offset: [0.1,0.1], offset: [0.1, 0.1],
delay: 3, delay: 3,
remove: false, remove: false,
reverse: true, reverse: true,
scrolled: false, scrolled: false,
debug: true, debug: true,
onLoad: true, onLoad: true,
onScroll: true, onScroll: true,
onResize: false, onResize: false,
callbackOnInit: function() { callbackOnInit: function() {
}, },
callbackOnAnimate: function(element) { callbackOnAnimate: function(element) {
} }
}); });
window.scrollAnimation = animate; window.scrollAnimation = animate;
animate.init(); animate.init();
setTimeout(animate.render.bind(animate), 2000); setTimeout(animate.render.bind(animate), 2000);
} }
$.fn.animation = function(){ $.fn.animation = function() {
//Catalog page //Catalog page
var product = $('.list-animation article'); var product = $('.list-animation article');
product.find('figure img,ul,h3,.new,.download-btn').attr( { 'data-animate':"", 'data-animation-classes':"animated fadeIn" } ); product.find('figure img,ul,h3,.new,.download-btn').attr({'data-animate': "", 'data-animation-classes': "animated fadeIn"});
var tlCata = new TimelineMax(); var tlCata = new TimelineMax();
tlCata.from('.right-container .right-panel',0.9,{autoAlpha:0,right:'-100%'},1); tlCata.from('.right-container .right-panel', 0.9, {autoAlpha: 0, right: '-100%'}, 1);
tlCata.from('.right-container .left-panel',0.9,{autoAlpha:0,left:'0'},1); tlCata.from('.right-container .left-panel', 0.9, {autoAlpha: 0, left: '0'}, 1);
tlCata.from('.btn-container',0.9,{autoAlpha:0,left:'-50'},1.7); tlCata.from('.btn-container', 0.9, {autoAlpha: 0, left: '-50'}, 1.7);
tlCata.from('.floated-bloc h2',0.9,{autoAlpha:0,marginTop:'-100px'},1.4); tlCata.from('.floated-bloc h2', 0.9, {autoAlpha: 0, marginTop: '-100px'}, 1.4);
tlCata.from('.floated-bloc .text-content',0.9,{autoAlpha:0,marginLeft:'-40px'},2.2); tlCata.from('.floated-bloc .text-content', 0.9, {autoAlpha: 0, marginLeft: '-40px'}, 2.2);
setTimeout(function(){$('.form-wrapper').removeClass('hidden-elem').addClass('animated fadeInUp')},1000) setTimeout(function() {
animateOnScroll(); $('.form-wrapper').removeClass('hidden-elem').addClass('animated fadeInUp')
} }, 1000)
function onScrollCover(){ animateOnScroll();
cover = $('.subcat.current a.active').attr("href"); }
$('.cover-wrapper').each(function () { function onScrollCover() {
coverWrapper = $(this).data('cat'); cover = $('.subcat.current a.active').attr("href");
if (coverWrapper == cover && !($(this).hasClass('current-cover'))) { $('.cover-wrapper').each(function() {
$('.cover-wrapper').removeClass('last-current-cover'); coverWrapper = $(this).data('cat');
$('.cover-desc-wrapper').removeClass('fadeInDown').addClass('animated fadeOutDown') if (coverWrapper == cover && !($(this).hasClass('current-cover'))) {
$('.current-cover').addClass('last-current-cover'); $('.cover-wrapper').removeClass('last-current-cover');
$('.cover-wrapper').removeClass('prev next current-cover'); $('.cover-desc-wrapper').removeClass('fadeInDown').addClass('animated fadeOutDown')
$(this).prevAll('.cover-wrapper').addClass('prev'); $('.current-cover').addClass('last-current-cover');
$(this).nextAll('.cover-wrapper').addClass('next'); $('.cover-wrapper').removeClass('prev next current-cover');
$(this).addClass('current-cover '); $(this).prevAll('.cover-wrapper').addClass('prev');
setTimeout(function(){ $(this).nextAll('.cover-wrapper').addClass('next');
$('.current-cover .cover-desc-wrapper').removeClass('fadeOutDown').addClass('animated fadeInDown'); $(this).addClass('current-cover ');
}, 600); setTimeout(function() {
} $('.current-cover .cover-desc-wrapper').removeClass('fadeOutDown').addClass('animated fadeInDown');
}); }, 600);
}; }
var lastScrollTop = 0; });
function onScroll(event){ }
var scrollPos = $(this).scrollTop(), ;
titleHeight = ($('.panel section > h2').outerHeight()/2) ; var lastScrollTop = 0;
//items = event.data.items; function onScroll(event) {
items = "li .subcat a"; var scrollPos = $(this).scrollTop(),
if ( timer ) clearTimeout(timer); titleHeight = ($('.panel section > h2').outerHeight() / 2);
//items = event.data.items;
timer = setTimeout(function(){ items = "li .subcat a";
onScrollCover(); if (timer)
}, 330); clearTimeout(timer);
$(items).each(function () {
var currLink = $(this); timer = setTimeout(function() {
var refElement = $(currLink.attr("href")); onScrollCover();
//console.log(currLink); }, 330);
var windowWidth = $(window).width(); $(items).each(function() {
var margin_top = 0; var currLink = $(this);
if(windowWidth > 1920) var refElement = $(currLink.attr("href"));
margin_top = 150; //console.log(currLink);
else var windowWidth = $(window).width();
margin_top = 50; var margin_top = 0;
if (refElement.length && refElement.position().top - ( $(".main").outerHeight() / 2 - titleHeight - $(".footer").outerHeight()- margin_top ) <= scrollPos && refElement.position().top + refElement.height() > scrollPos) { if (windowWidth > 1920)
margin_top = 150;
$('.subcat a').removeClass("active"); else
currLink.addClass("active"); margin_top = 50;
if ($('nav ul ul').find('li.active')){ if (refElement.length && refElement.position().top - ($(".main").outerHeight() / 2 - titleHeight - $(".footer").outerHeight() - margin_top) <= scrollPos && refElement.position().top + refElement.height() > scrollPos) {
$('nav ul li').removeClass('current').addClass('off');
parent = currLink.parent().parent().parent(); $('.subcat a').removeClass("active");
parent.addClass('current').removeClass('off'); currLink.addClass("active");
if ( timer2 ) clearTimeout(timer2); if ($('nav ul ul').find('li.active')) {
timer2 = setTimeout(function(){ $('nav ul li').removeClass('current').addClass('off');
$('.phototheque .off .subcat').stop().slideUp(); parent = currLink.parent().parent().parent();
parent.find('ul').stop().slideDown(); parent.addClass('current').removeClass('off');
}, 330); if (timer2)
} clearTimeout(timer2);
timer2 = setTimeout(function() {
} $('.phototheque .off .subcat').stop().slideUp();
else{ parent.find('ul').stop().slideDown();
currLink.removeClass("active"); }, 330);
} }
});
} }
function scrollAnchor(elemId, skipZero){ else {
$('.subcat').each(function(){ currLink.removeClass("active");
$(this).find('a[href^="#"]').on('click', function (e) { }
e.preventDefault(); });
e.stopPropagation(); }
$('a').each(function () { function scrollAnchor(elemId, skipZero) {
$(this).removeClass('active'); $('.subcat').each(function() {
}) $(this).find('a[href^="#"]').on('click', function(e) {
$(this).addClass('active'); e.preventDefault();
var target = this.hash, e.stopPropagation();
menu = target, $('a').each(function() {
temp = 0; $(this).removeClass('active');
$target = $(target); })
//$parent = $('#load-page'); $(this).addClass('active');
$(elemId).stop().animate({ var target = this.hash,
'scrollTop': $target.position().top //- $parent.offset().top menu = target,
}, 1000, 'swing', function () { temp = 0;
window.location.hash = target; $target = $(target);
}); //$parent = $('#load-page');
}); $(elemId).stop().animate({
}) 'scrollTop': $target.position().top //- $parent.offset().top
}, 1000, 'swing', function() {
} window.location.hash = target;
function checkFooterNavPosition(){ });
var mainHeight = $('.main-nav .nav-content').height(), });
nav = $('.main-nav .nav-content .arrow-white').height() + $('.main-nav .nav-content .arrow-pink').height(), })
footerNav = $('.header .nav-content .footer').outerHeight();
footerSpace = mainHeight - (nav + 40) ; }
if (footerSpace <= footerNav ){ function checkFooterNavPosition() {
$('.header .nav-content .footer').addClass('relative'); var mainHeight = $('.main-nav .nav-content').height(),
}else{ nav = $('.main-nav .nav-content .arrow-white').height() + $('.main-nav .nav-content .arrow-pink').height(),
$('.header .nav-content .footer').removeClass('relative'); footerNav = $('.header .nav-content .footer').outerHeight();
} footerSpace = mainHeight - (nav + 40);
} if (footerSpace <= footerNav) {
function checkFilterContactWrapper(){ $('.header .nav-content .footer').addClass('relative');
setTimeout(function(){ } else {
if ( $('.header .nav-content .footer').removeClass('relative');
($('.contact-form .form-wrapper').outerHeight() }
+ $('.filter-wrapper').outerHeight() }
+ $('nav .main-nav').outerHeight() + $('.main-nav').outerHeight()) < $(window).outerHeight() function checkFilterContactWrapper() {
/*&& setTimeout(function() {
( $('.contact-form .form-wrapper').outerHeight() + if (
$('.contact-form .footer').outerHeight() + ($('.contact-form .form-wrapper').outerHeight()
$('.filter-wrapper').outerHeight() + $('.filter-wrapper').outerHeight()
> $(window).outerHeight() )*/ + $('nav .main-nav').outerHeight() + $('.main-nav').outerHeight()) < $(window).outerHeight()
) /*&&
{ ( $('.contact-form .form-wrapper').outerHeight() +
$('.contact-form .footer').addClass('fixed'); $('.contact-form .footer').outerHeight() +
}else{ $('.filter-wrapper').outerHeight()
$('.contact-form .footer').removeClass('fixed'); > $(window).outerHeight() )*/
} )
},500) {
} $('.contact-form .footer').addClass('fixed');
$(window).load( function() { } else {
initFunction(); $('.contact-form .footer').removeClass('fixed');
$('.header .nav-wrapper .nav-content > ul > li').each(function(){ }
url = $(this).data('img'); }, 500)
$('.img-wrapper').append('<img src='+ url +'>'); }
}) $(window).load(function() {
});//END document load initFunction();
var timer; $('.header .nav-wrapper .nav-content > ul > li').each(function() {
var timer2; url = $(this).data('img');
$(window).scroll(function(e) { $('.img-wrapper').append('<img src=' + url + '>');
onScroll(e); })
var elem = $('.home-down-wrapper'); });//END document load
if (elem.length){ var timer;
var downBTN = $('.home-down-wrapper').offset().top; var timer2;
if ($(window).scrollTop() > downBTN - $('.nav-header').outerHeight()) { $(window).scroll(function(e) {
$('.home-footer-nav .nav-wrapper').addClass('fixed'); onScroll(e);
} var elem = $('.home-down-wrapper');
else { if (elem.length) {
$('.home-footer-nav .nav-wrapper').removeClass('fixed'); var downBTN = $('.home-down-wrapper').offset().top;
} if ($(window).scrollTop() > downBTN - $('.nav-header').outerHeight()) {
} $('.home-footer-nav .nav-wrapper').addClass('fixed');
}
}); else {
$('.home-footer-nav .nav-wrapper').removeClass('fixed');
}
}
});
//$(window).bind("scrollStop",onScroll) //$(window).bind("scrollStop",onScroll)
$(document).ready(function(){ $(document).ready(function() {
$(document).on('mouseover','.nav-content li',function(){ $(document).on('mouseover', '.nav-content li', function() {
$(this).stop(false,true).fadeImage(); $(this).stop(false, true).fadeImage();
}); });
// Catalog Page : Change product image depending on selected color // Catalog Page : Change product image depending on selected color
$('.product-list article ul li').on('mouseover',function(){ $('.product-list article ul li').on('mouseover', function() {
$(this).changeProductImageBg(); $(this).changeProductImageBg();
}); });
$('.product-list article').each(function(){ $('.product-list article').each(function() {
$(this).showProductListColors(); $(this).showProductListColors();
}); });
$('.filter-bloc .list-color-filter li').setColorToWhite(); $('.filter-bloc .list-color-filter li').setColorToWhite();
setTimeout(function(){ setTimeout(function() {
onScrollCover(); onScrollCover();
}, 330); }, 330);
$.fn.open_nav(); $.fn.open_nav();
if ($(document).find('#load-page').children().length){ if ($(document).find('#load-page').children().length) {
scrollAnchor("#load-page", true); scrollAnchor("#load-page", true);
}else{ } else {
scrollAnchor('html,body', false); scrollAnchor('html,body', false);
} }
$('.news-btn').open_news(); $('.news-btn').open_news();
$('.close-btn').close_news(); $('.close-btn').close_news();
$('.filter-wrapper').open_filter(); $('.filter-wrapper').open_filter();
$.fn.checkSelectedFilter(); $.fn.checkSelectedFilter();
$.fn.showSubmenu(); //Catalog subMenu $.fn.showSubmenu(); //Catalog subMenu
$('#fullpage').fullpageSlide(); //Stories $('#fullpage').fullpageSlide(); //Stories
$.fn.responsive(); $.fn.responsive();
$('.list-color-filter li').setBgColorList(); $('.list-color-filter li').setBgColorList();
$.fn.animation(); //Global animation for entire site $.fn.animation(); //Global animation for entire site
$.fn.getMenuBg(); //Animation BG Menu $.fn.getMenuBg(); //Animation BG Menu
//TODO //TODO
$('.cover-wrapper').last().addClass('last'); $('.cover-wrapper').last().addClass('last');
$('.cover-wrapper').first().addClass('first'); $('.cover-wrapper').first().addClass('first');
showMap(); showMap();
$.fn.loadPageContent(); $.fn.loadPageContent();
}); //end document ready }); //end document ready
$(window).resize(function() { $(window).resize(function() {
$.fn.responsive(); $.fn.responsive();
}); //end document resize }); //end document resize
window.addEventListener("load", function(){ window.addEventListener("load", function() {
var load_screen = document.getElementById("loading-container"); var load_screen = document.getElementById("loading-container");
document.body.removeChild(load_screen); document.body.removeChild(load_screen);
}); });
......
...@@ -110,6 +110,14 @@ jQuery(document).ready(function() { ...@@ -110,6 +110,14 @@ jQuery(document).ready(function() {
jQuery(window).bind("popstate", function(e) {
var state = e.originalEvent.state;
if ( state === null ) {
var back_link = jQuery('.close-panel .circle-btn a').attr('href');
window.location.href = back_link;
}
});
}); });
jQuery.urlParam = function(name) { jQuery.urlParam = function(name) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment