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();
...@@ -19,9 +19,10 @@ var initFunction=function(){ ...@@ -19,9 +19,10 @@ var initFunction=function(){
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) { function toggleHandler(toggle) {
toggle.addEventListener( "click", function(e) { toggle.addEventListener("click", function(e) {
var nav = $('.main-nav .nav-content'); var nav = $('.main-nav .nav-content');
//(this.classList.contains("is-active") === true) ? this.classList.remove("is-active") : this.classList.add("is-active"); //(this.classList.contains("is-active") === true) ? this.classList.remove("is-active") : this.classList.add("is-active");
$(".c-hamburger").toggleClass('is-active'); $(".c-hamburger").toggleClass('is-active');
...@@ -29,33 +30,33 @@ var initFunction=function(){ ...@@ -29,33 +30,33 @@ var initFunction=function(){
nav.removeClass('OFF').addClass("ON"); nav.removeClass('OFF').addClass("ON");
nav.parent().addClass("show-nav transition"); nav.parent().addClass("show-nav transition");
$('body').addClass('fixed'); $('body').addClass('fixed');
if (!($('.main-nav .nav-content .footer').length)){ if (!($('.main-nav .nav-content .footer').length)) {
$('.main-nav .nav-content').append($('footer .footer').clone(true,true)); $('.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 else { //Close menu
nav.removeClass('ON').addClass("OFF"); nav.removeClass('ON').addClass("OFF");
$('body').removeClass('fixed'); $('body').removeClass('fixed');
nav.parent().removeClass("show-nav"); nav.parent().removeClass("show-nav");
$('.main-nav .nav-content .footer').remove(); $('.main-nav .nav-content .footer').remove();
setTimeout(function(){ setTimeout(function() {
$('.right-panel-wrapper').css('z-index','9999999'); $('.right-panel-wrapper').css('z-index', '9999999');
},500) }, 500)
} }
setTimeout(function(){ setTimeout(function() {
checkFooterNavPosition(); checkFooterNavPosition();
},330) }, 330)
nav.stop().slideToggle(); nav.stop().slideToggle();
}); });
} }
$.fn.loadPageContent = function(){ $.fn.loadPageContent = function() {
if ($('body').find('header').length > 1){ if ($('body').find('header').length > 1) {
$('body').find('header').last().parent().remove(); $('body').find('header').last().parent().remove();
$('.right-panel-wrapper').css('top', $('.nav-header').outerHeight()); $('.right-panel-wrapper').css('top', $('.nav-header').outerHeight());
$('html').css('overflow','auto'); $('html').css('overflow', 'auto');
} }
//$('.load-page').removeClass('fadeOutUp').addClass('animated fadeInUp') //$('.load-page').removeClass('fadeOutUp').addClass('animated fadeInUp')
...@@ -63,18 +64,18 @@ var initFunction=function(){ ...@@ -63,18 +64,18 @@ var initFunction=function(){
$('ul.phototheque').find('li').first().find('.subcat').slideDown('slow'); $('ul.phototheque').find('li').first().find('.subcat').slideDown('slow');
var product = $('.list-animation article'); var product = $('.list-animation article');
// TODO: Remove init classes , init attr on html // 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" } ); product.find('figure img,ul,h3,.new,.download-btn').attr({'data-animate': "", 'data-animation-classes': "animated fadeIn"});
animateOnScroll(); animateOnScroll();
if ($(document).find('#load-page').children().length){ if ($(document).find('#load-page').children().length) {
scrollAnchor("#load-page", true); scrollAnchor("#load-page", true);
elemToScroll = $(document).find("#load-page"); elemToScroll = $(document).find("#load-page");
}else{ } else {
elemToScroll = $(document).find(".main"); elemToScroll = $(document).find(".main");
scrollAnchor('body', true); scrollAnchor('body', true);
} }
elemToScroll.on("scroll",onScroll); elemToScroll.on("scroll", onScroll);
document.getElementById('load-page').addEventListener('scroll', window.scrollAnimation.throttledEvent, false); document.getElementById('load-page').addEventListener('scroll', window.scrollAnimation.throttledEvent, false);
$(document).find('ul.main-list-nav').on('click',' li.parent-cat>a',function(e){ $(document).find('ul.main-list-nav').on('click', ' li.parent-cat>a', function(e) {
var windowWidth = $(window).width(); var windowWidth = $(window).width();
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
...@@ -94,104 +95,106 @@ var initFunction=function(){ ...@@ -94,104 +95,106 @@ var initFunction=function(){
//} //}
}); });
setTimeout(function(){ setTimeout(function() {
$('.gallery-wrapper').removeClass('hidden-elem').addClass('animated visible-elem fadeInUp'); $('.gallery-wrapper').removeClass('hidden-elem').addClass('animated visible-elem fadeInUp');
$.fn.responsive(); $.fn.responsive();
},100); }, 100);
} }
function appendLoading() { function appendLoading() {
$('.load-page').append($('#loading-container-subpage').clone()); $('.load-page').append($('#loading-container-subpage').clone());
$('#loading-container-subpage').show(); $('#loading-container-subpage').show();
} }
//load content page on left Panel //load content page on left Panel
$(document).find('.to-slide').on('click','a',function(e){ $(document).find('.to-slide').on('click', 'a', function(e) {
$('html').css('overflow','hidden'); $('html').css('overflow', 'hidden');
appendLoading(); appendLoading();
e.preventDefault(); e.preventDefault();
var link = $(this).attr("href"), var link = $(this).attr("href"),
windowWidth = $(window).width(); windowWidth = $(window).width();
if ($(this).parent().parent().hasClass('nav-page')){ if ($(this).parent().parent().hasClass('nav-page')) {
$(document).find('.right-container').first().remove(); $(document).find('.right-container').first().remove();
$('.load-page').parent().css({ $('.load-page').parent().css({
'left':$('.nav-wrapper').outerWidth() 'left': $('.nav-wrapper').outerWidth()
}); });
$('.load-page').css('opacity',1); $('.load-page').css('opacity', 1);
$(document).find('#loading-container-subpage').css({ $(document).find('#loading-container-subpage').css({
'left': $('.nav-wrapper').outerWidth(), 'left': $('.nav-wrapper').outerWidth(),
'width': 'calc(100% - ' + $('.nav-wrapper').outerWidth()+'px)', 'width': 'calc(100% - ' + $('.nav-wrapper').outerWidth() + 'px)',
}) })
/**/ /**/
$('nav ul li').removeClass('current').addClass('off'); $('nav ul li').removeClass('current').addClass('off');
$(this).parent().addClass('current'); $(this).parent().addClass('current');
$(window)
/**/ /**/
}else{ } else {
$('.load-page').parent().css({ $('.load-page').parent().css({
'left':0, 'left': 0,
}); });
$('.load-page').parent().addClass('active'); $('.load-page').parent().addClass('active');
} }
history.pushState(null, null, link); history.pushState(null, null, link);
$('.load-page').load(link,{'ajax' : 1},function(){ $('.load-page').load(link, {'ajax': 1}, function() {
$.fn.loadPageContent(); $.fn.loadPageContent();
$.fn.responsive();
$.fn.animation();
}); });
if (windowWidth < 860){ if (windowWidth < 860) {
$( ".c-hamburger" ).trigger( "click" ); $(".c-hamburger").trigger("click");
} }
}); });
var div = $('.nav-content'); var div = $('.nav-content');
$('.footer-home-content').on('click','.home-down:not(.scrolled)',function(e){ $('.footer-home-content').on('click', '.home-down:not(.scrolled)', function(e) {
TweenMax.killTweensOf('.nav-content'); TweenMax.killTweensOf('.nav-content');
var mainHeight = $('.main').outerHeight(); var mainHeight = $('.main').outerHeight();
$(this).addClass('scrolled'); $(this).addClass('scrolled');
if (!($('.footer-home-content .nav-content').length)){ if (!($('.footer-home-content .nav-content').length)) {
$('.footer-home-content').append($('.nav-content').clone()); $('.footer-home-content').append($('.nav-content').clone());
$('.main').outerHeight(mainHeight + $('.footer-home-content').outerHeight()); $('.main').outerHeight(mainHeight + $('.footer-home-content').outerHeight());
$('.home-down-wrapper').css('top', - ($('.home-down-wrapper').outerHeight())); $('.home-down-wrapper').css('top', -($('.home-down-wrapper').outerHeight()));
$('.home-down').css('top', -($('.home-down').outerHeight())); $('.home-down').css('top', -($('.home-down').outerHeight()));
//$('.home-down-wrapper').css('top','121px'); //$('.home-down-wrapper').css('top','121px');
} }
//scroll to bottom //scroll to bottom
$('body').animate({ $('body').animate({
scrollTop: div.outerHeight() scrollTop: div.outerHeight()
}, 1000,'swing',function(){ }, 1000, 'swing', function() {
}); });
}).on('click','.scrolled',function(){ }).on('click', '.scrolled', function() {
$(this).removeClass('scrolled'); $(this).removeClass('scrolled');
$("html, body").animate({ scrollTop: 0 }, "slow"); $("html, body").animate({scrollTop: 0}, "slow");
setTimeout(function(){ setTimeout(function() {
$('.footer-home-content').find('.nav-content').remove(); $('.footer-home-content').find('.nav-content').remove();
$('.home-down-wrapper').css('top','initial'); $('.home-down-wrapper').css('top', 'initial');
$('.footer-home-content').removeClass('fixed'); $('.footer-home-content').removeClass('fixed');
$('.main').height($(window).innerHeight()); $('.main').height($(window).innerHeight());
},600) }, 600)
return false; 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');
...@@ -199,55 +202,55 @@ $(document).on('click','.acces li .login, .login-user',function(e){ ...@@ -199,55 +202,55 @@ $(document).on('click','.acces li .login, .login-user',function(e){
}); });
//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)
{ {
...@@ -255,223 +258,224 @@ $.fn.fadeImage= function(){ ...@@ -255,223 +258,224 @@ $.fn.fadeImage= function(){
} }
$('.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() {
$.fn.showSubmenu = function(){
var currentPage = $('.container').data('page'); var currentPage = $('.container').data('page');
$('header nav').find('ul li').find("[data-page="+currentPage+"]").slideDown(); $('header nav').find('ul li').find("[data-page=" + currentPage + "]").slideDown();
$('header nav').find('ul').find("[data-page="+currentPage+"]").addClass('current'); $('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(),
...@@ -480,119 +484,121 @@ $.fn.responsive = function(){ ...@@ -480,119 +484,121 @@ $.fn.responsive = function(){
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() {
$('.form-wrapper').removeClass('hidden-elem').addClass('animated fadeInUp')
}, 1000)
animateOnScroll(); animateOnScroll();
} }
function onScrollCover(){ function onScrollCover() {
cover = $('.subcat.current a.active').attr("href"); cover = $('.subcat.current a.active').attr("href");
$('.cover-wrapper').each(function () { $('.cover-wrapper').each(function() {
coverWrapper = $(this).data('cat'); coverWrapper = $(this).data('cat');
if (coverWrapper == cover && !($(this).hasClass('current-cover'))) { if (coverWrapper == cover && !($(this).hasClass('current-cover'))) {
$('.cover-wrapper').removeClass('last-current-cover'); $('.cover-wrapper').removeClass('last-current-cover');
...@@ -602,60 +608,63 @@ function onScrollCover(){ ...@@ -602,60 +608,63 @@ function onScrollCover(){
$(this).prevAll('.cover-wrapper').addClass('prev'); $(this).prevAll('.cover-wrapper').addClass('prev');
$(this).nextAll('.cover-wrapper').addClass('next'); $(this).nextAll('.cover-wrapper').addClass('next');
$(this).addClass('current-cover '); $(this).addClass('current-cover ');
setTimeout(function(){ setTimeout(function() {
$('.current-cover .cover-desc-wrapper').removeClass('fadeOutDown').addClass('animated fadeInDown'); $('.current-cover .cover-desc-wrapper').removeClass('fadeOutDown').addClass('animated fadeInDown');
}, 600); }, 600);
} }
}); });
}; }
var lastScrollTop = 0; ;
function onScroll(event){ var lastScrollTop = 0;
function onScroll(event) {
var scrollPos = $(this).scrollTop(), var scrollPos = $(this).scrollTop(),
titleHeight = ($('.panel section > h2').outerHeight()/2) ; titleHeight = ($('.panel section > h2').outerHeight() / 2);
//items = event.data.items; //items = event.data.items;
items = "li .subcat a"; items = "li .subcat a";
if ( timer ) clearTimeout(timer); if (timer)
clearTimeout(timer);
timer = setTimeout(function(){ timer = setTimeout(function() {
onScrollCover(); onScrollCover();
}, 330); }, 330);
$(items).each(function () { $(items).each(function() {
var currLink = $(this); var currLink = $(this);
var refElement = $(currLink.attr("href")); var refElement = $(currLink.attr("href"));
//console.log(currLink); //console.log(currLink);
var windowWidth = $(window).width(); var windowWidth = $(window).width();
var margin_top = 0; var margin_top = 0;
if(windowWidth > 1920) if (windowWidth > 1920)
margin_top = 150; margin_top = 150;
else else
margin_top = 50; margin_top = 50;
if (refElement.length && refElement.position().top - ( $(".main").outerHeight() / 2 - titleHeight - $(".footer").outerHeight()- margin_top ) <= scrollPos && refElement.position().top + refElement.height() > scrollPos) { if (refElement.length && refElement.position().top - ($(".main").outerHeight() / 2 - titleHeight - $(".footer").outerHeight() - margin_top) <= scrollPos && refElement.position().top + refElement.height() > scrollPos) {
$('.subcat a').removeClass("active"); $('.subcat a').removeClass("active");
currLink.addClass("active"); currLink.addClass("active");
if ($('nav ul ul').find('li.active')){ if ($('nav ul ul').find('li.active')) {
$('nav ul li').removeClass('current').addClass('off'); $('nav ul li').removeClass('current').addClass('off');
parent = currLink.parent().parent().parent(); parent = currLink.parent().parent().parent();
parent.addClass('current').removeClass('off'); parent.addClass('current').removeClass('off');
if ( timer2 ) clearTimeout(timer2); if (timer2)
timer2 = setTimeout(function(){ clearTimeout(timer2);
timer2 = setTimeout(function() {
$('.phototheque .off .subcat').stop().slideUp(); $('.phototheque .off .subcat').stop().slideUp();
parent.find('ul').stop().slideDown(); parent.find('ul').stop().slideDown();
}, 330); }, 330);
} }
} }
else{ else {
currLink.removeClass("active"); currLink.removeClass("active");
} }
}); });
} }
function scrollAnchor(elemId, skipZero){ function scrollAnchor(elemId, skipZero) {
$('.subcat').each(function(){ $('.subcat').each(function() {
$(this).find('a[href^="#"]').on('click', function (e) { $(this).find('a[href^="#"]').on('click', function(e) {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
$('a').each(function () { $('a').each(function() {
$(this).removeClass('active'); $(this).removeClass('active');
}) })
$(this).addClass('active'); $(this).addClass('active');
...@@ -666,26 +675,26 @@ function scrollAnchor(elemId, skipZero){ ...@@ -666,26 +675,26 @@ function scrollAnchor(elemId, skipZero){
//$parent = $('#load-page'); //$parent = $('#load-page');
$(elemId).stop().animate({ $(elemId).stop().animate({
'scrollTop': $target.position().top //- $parent.offset().top 'scrollTop': $target.position().top //- $parent.offset().top
}, 1000, 'swing', function () { }, 1000, 'swing', function() {
window.location.hash = target; window.location.hash = target;
}); });
}); });
}) })
} }
function checkFooterNavPosition(){ function checkFooterNavPosition() {
var mainHeight = $('.main-nav .nav-content').height(), var mainHeight = $('.main-nav .nav-content').height(),
nav = $('.main-nav .nav-content .arrow-white').height() + $('.main-nav .nav-content .arrow-pink').height(), nav = $('.main-nav .nav-content .arrow-white').height() + $('.main-nav .nav-content .arrow-pink').height(),
footerNav = $('.header .nav-content .footer').outerHeight(); footerNav = $('.header .nav-content .footer').outerHeight();
footerSpace = mainHeight - (nav + 40) ; footerSpace = mainHeight - (nav + 40);
if (footerSpace <= footerNav ){ if (footerSpace <= footerNav) {
$('.header .nav-content .footer').addClass('relative'); $('.header .nav-content .footer').addClass('relative');
}else{ } else {
$('.header .nav-content .footer').removeClass('relative'); $('.header .nav-content .footer').removeClass('relative');
} }
} }
function checkFilterContactWrapper(){ function checkFilterContactWrapper() {
setTimeout(function(){ setTimeout(function() {
if ( if (
($('.contact-form .form-wrapper').outerHeight() ($('.contact-form .form-wrapper').outerHeight()
+ $('.filter-wrapper').outerHeight() + $('.filter-wrapper').outerHeight()
...@@ -698,24 +707,24 @@ function checkFilterContactWrapper(){ ...@@ -698,24 +707,24 @@ function checkFilterContactWrapper(){
) )
{ {
$('.contact-form .footer').addClass('fixed'); $('.contact-form .footer').addClass('fixed');
}else{ } else {
$('.contact-form .footer').removeClass('fixed'); $('.contact-form .footer').removeClass('fixed');
} }
},500) }, 500)
} }
$(window).load( function() { $(window).load(function() {
initFunction(); initFunction();
$('.header .nav-wrapper .nav-content > ul > li').each(function(){ $('.header .nav-wrapper .nav-content > ul > li').each(function() {
url = $(this).data('img'); url = $(this).data('img');
$('.img-wrapper').append('<img src='+ url +'>'); $('.img-wrapper').append('<img src=' + url + '>');
}) })
});//END document load });//END document load
var timer; var timer;
var timer2; var timer2;
$(window).scroll(function(e) { $(window).scroll(function(e) {
onScroll(e); onScroll(e);
var elem = $('.home-down-wrapper'); var elem = $('.home-down-wrapper');
if (elem.length){ if (elem.length) {
var downBTN = $('.home-down-wrapper').offset().top; var downBTN = $('.home-down-wrapper').offset().top;
if ($(window).scrollTop() > downBTN - $('.nav-header').outerHeight()) { if ($(window).scrollTop() > downBTN - $('.nav-header').outerHeight()) {
$('.home-footer-nav .nav-wrapper').addClass('fixed'); $('.home-footer-nav .nav-wrapper').addClass('fixed');
...@@ -727,26 +736,26 @@ $(window).scroll(function(e) { ...@@ -727,26 +736,26 @@ $(window).scroll(function(e) {
}); });
//$(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();
...@@ -764,12 +773,12 @@ $(document).ready(function(){ ...@@ -764,12 +773,12 @@ $(document).ready(function(){
$('.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