Commit f48cd089 authored by imac's avatar imac

[Bugfix]JIRA : Nap-20 ->Contact footer & load CMS page

parent cd1ab84c
...@@ -3,12 +3,13 @@ var initFunction=function(){ ...@@ -3,12 +3,13 @@ var initFunction=function(){
};//END init Function };//END init Function
$(function(){ $(function(){
//Stop jump tag //Stop jump tag
$('a[href^="#"], .easyzoom a').click(function(e){ $(document).find('a[href^="#"], .easyzoom a').click(function(e){
e.preventDefault(); e.preventDefault();
}); });
$(document).find('.contact-form h2').on('click', function(){ $(document).find('.contact-form .open-filter').on('click', function(){
$('.contact-form form').slideToggle(); $('.contact-form form').slideToggle();
$(this).toggleClass('on'); $(this).parent().find('h2').toggleClass('on');
checkFilterContactWrapper();
}) })
//Open Menu //Open Menu
...@@ -27,7 +28,7 @@ $(function(){ ...@@ -27,7 +28,7 @@ $(function(){
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()); $('.main-nav .nav-content').append($('footer .footer').clone(true,true));
} }
} }
else { //Close menu else { //Close menu
...@@ -42,48 +43,51 @@ $(function(){ ...@@ -42,48 +43,51 @@ $(function(){
nav.stop().slideToggle(); nav.stop().slideToggle();
}); });
} }
$.fn.loadPageContent = function(){
//$('.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();
scrollAnchor("#load-page", true);
$("#load-page").on("scroll",{ items: "ul.phototheque li .subcat a"},onScroll);
document.getElementById('load-page').addEventListener('scroll', window.scrollAnimation.throttledEvent, false);
$('ul.phototheque').on('click',' li.parent-cat>a',function(e){
e.preventDefault();
e.stopPropagation();
$('.phototheque>li').removeClass('current');
$('.phototheque .subcat').slideUp('slow');
$(this).parent().addClass('current');
$('.phototheque .off .subcat').slideUp();
$(this).parent().find('.subcat').slideDown('slow');
});
setTimeout(function(){
$('.gallery-wrapper').removeClass('hidden-elem').addClass('animated visible-elem fadeInUp');
},0)
}
//load content page on left Panel //load content page on left Panel
$('.footer .right li:not(.nl)').on('click','a',function(e){ $(document).find('.to-slide').on('click','a',function(e){
$('html').css('overflow','hidden'); $('html').css('overflow','hidden');
e.preventDefault(); e.preventDefault();
var link = $(this).attr("href"); var link = $(this).attr("href");
$('.load-page').parent().addClass('active'); $('.load-page').parent().addClass('active');
history.pushState(null, null, link);
$('.load-page').load(link,function(){ $('.load-page').load(link,function(){
//$('.load-page').removeClass('fadeOutUp').addClass('animated fadeInUp') $.fn.loadPageContent();
$('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();
scrollAnchor("#load-page", true);
$("#load-page").on("scroll",{ items: "ul.phototheque li .subcat a"},onScroll);
document.getElementById('load-page').addEventListener('scroll', window.scrollAnimation.throttledEvent, false);
$('ul.phototheque').on('click',' li.parent-cat>a',function(e){
e.preventDefault();
e.stopPropagation();
$('.phototheque>li').removeClass('current');
$('.phototheque .subcat').slideUp('slow');
$(this).parent().addClass('current');
$('.phototheque .off .subcat').slideUp();
$(this).parent().find('.subcat').slideDown('slow');
});
setTimeout(function(){
$('.gallery-wrapper').removeClass('hidden-elem').addClass('animated visible-elem fadeInUp');
},0)
}); });
}); });
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');
} }
...@@ -219,10 +223,11 @@ $('.footer-home-content').on('click','.home-down:not(.scrolled)',function(e){ ...@@ -219,10 +223,11 @@ $('.footer-home-content').on('click','.home-down:not(.scrolled)',function(e){
} }
$.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(),
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:filterW,visibility:"visible"},0); tlFilter.fromTo('.filter-list',0.5,{opacity:0,left:'0',visibility:"hidden"},{opacity:1,left:filterW - filterBtn ,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);
...@@ -332,47 +337,47 @@ $('.footer-home-content').on('click','.home-down:not(.scrolled)',function(e){ ...@@ -332,47 +337,47 @@ $('.footer-home-content').on('click','.home-down:not(.scrolled)',function(e){
} }
}, },
}); });
$(document).on('click', '.moveDown', function(){ $(document).on('click', '.moveDown', function(){
$.fn.fullpage.moveSectionDown(); $.fn.fullpage.moveSectionDown();
}); });
}
$.fn.getMenuBg = function(){
var imgSrc = $('header .nav-content > ul').find(' > li.current').data('img'),
windowWidth = $(window).width(),
navwWidth = $('.nav-wrapper').width(),
navHeight = $('.nav-header').outerHeight();
$('.container-bg').css({
'background-image': "url("+ imgSrc +")",
'opacity' : 0,
})
tlBg = new TimelineMax();
tlBg.to('.container-bg',0.9,{opacity:1},0.5);
tlBg.from('.full-slides',1.2,{opacity:0, width:0},0.4);
if (windowWidth > 860){
tlBg.to('.container-bg',1.2,{width:navwWidth},0.4);
} }
} $.fn.getMenuBg = function(){
$.fn.appendMap = function(){ var imgSrc = $('header .nav-content > ul').find(' > li.current').data('img'),
var $this = $(this); windowWidth = $(window).width(),
if (!(this.find('.map').length)){ navwWidth = $('.nav-wrapper').width(),
this.append($('.map')); navHeight = $('.nav-header').outerHeight();
$('.container-bg').css({
'background-image': "url("+ imgSrc +")",
'opacity' : 0,
})
tlBg = new TimelineMax();
tlBg.to('.container-bg',0.9,{opacity:1},0.5);
tlBg.from('.full-slides',1.2,{opacity:0, width:0},0.4);
if (windowWidth > 860){
tlBg.to('.container-bg',1.2,{width:navwWidth},0.4);
}
} }
setTimeout(function(){ $.fn.appendMap = function(){
initMap(); var $this = $(this);
},330) if (!(this.find('.map').length)){
} this.append($('.map'));
$.fn.appendMobileMenu = function(){
var $this = $(this);
setTimeout(function(){
if (!($this.find('li.current').length)){
$('.main-nav .nav-content li.current').addClass('to-replace');
$('.main-nav .nav-content li.current').clone().find('ul').remove().end().appendTo($this);
$this.find("li.current").append($('.main-nav.nav-wrapper li.current ul'));
} }
$('.right-container').css('padding-top',$this.parent().outerHeight()); setTimeout(function(){
},2000) initMap();
},330)
}
$.fn.appendMobileMenu = function(){
var $this = $(this);
setTimeout(function(){
if (!($this.find('li.current').length)){
$('.main-nav .nav-content li.current').addClass('to-replace');
$('.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'));
}
$('.right-container').css('padding-top',$this.parent().outerHeight());
},2000)
} }
//Responsive function //Responsive function
$.fn.responsive = function(){ $.fn.responsive = function(){
var footerHeight = $('footer').height(), var footerHeight = $('footer').height(),
...@@ -390,7 +395,6 @@ $.fn.appendMobileMenu = function(){ ...@@ -390,7 +395,6 @@ $.fn.appendMobileMenu = function(){
filterWidth = $('.right-container .left-panel').outerWidth(), filterWidth = $('.right-container .left-panel').outerWidth(),
lastSectionHeight = $('#catalogue .panel-content section').last().outerHeight(), lastSectionHeight = $('#catalogue .panel-content section').last().outerHeight(),
footerContact = $('.contact-form .footer').outerHeight(); footerContact = $('.contact-form .footer').outerHeight();
console.log(footerHeight);
$('.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);
...@@ -409,9 +413,8 @@ $.fn.appendMobileMenu = function(){ ...@@ -409,9 +413,8 @@ $.fn.appendMobileMenu = function(){
$('#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);
$('.search-filter h2').removeClass('show-filter');
$('.contact-form h2').removeClass('show-comm'); $('.contact-form h2').removeClass('show-comm');
$('.filter, .left-panel .map, .details').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");
...@@ -421,7 +424,6 @@ $.fn.appendMobileMenu = function(){ ...@@ -421,7 +424,6 @@ $.fn.appendMobileMenu = function(){
$('.filter').appendMap(); $('.filter').appendMap();
$('.main').css('padding-top',navHeight); $('.main').css('padding-top',navHeight);
$('.container-bg').css({'height':navHeight}); $('.container-bg').css({'height':navHeight});
$('.search-filter h2').addClass('show-filter');
$('.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);
...@@ -430,6 +432,17 @@ $.fn.appendMobileMenu = function(){ ...@@ -430,6 +432,17 @@ $.fn.appendMobileMenu = function(){
if ($('body #home').length){ if ($('body #home').length){
$('.main').css('padding-top',0); $('.main').css('padding-top',0);
} }
if ($('.filter-wrapper .header-filter-contact h2').hasClass('on')){
$('.filter, .left-panel .map, .details').show();
}else{
$('.filter, .left-panel .map, .details').hide();
}
if($('.contact-form h2').hasClass('on')){
$('.contact-form form').show();
}else{
$('.contact-form form').hide();
}
checkFilterContactWrapper();
} }
checkFooterNavPosition(); checkFooterNavPosition();
} }
...@@ -558,6 +571,25 @@ function checkFooterNavPosition(){ ...@@ -558,6 +571,25 @@ function checkFooterNavPosition(){
$('.header .nav-content .footer').removeClass('relative'); $('.header .nav-content .footer').removeClass('relative');
} }
} }
function checkFilterContactWrapper(){
setTimeout(function(){
if (
($('.contact-form .form-wrapper').outerHeight()
+ $('.filter-wrapper').outerHeight()
+ $('nav .main-nav').outerHeight() + $('.main-nav').outerHeight()) < $(window).outerHeight()
/*&&
( $('.contact-form .form-wrapper').outerHeight() +
$('.contact-form .footer').outerHeight() +
$('.filter-wrapper').outerHeight()
> $(window).outerHeight() )*/
)
{
$('.contact-form .footer').addClass('fixed');
}else{
$('.contact-form .footer').removeClass('fixed');
}
},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(){
...@@ -592,6 +624,15 @@ $(document).ready(function(){ ...@@ -592,6 +624,15 @@ $(document).ready(function(){
$('.product-list article').each(function(){ $('.product-list article').each(function(){
$(this).showProductListColors(); $(this).showProductListColors();
}); });
$('.list-wrapper .color-list').each(function(){
var elem = $(this).find('input'),
isWhite = checkWhiteColor(elem.data('color'));
//console.log(isWhite + 'iswhite/color' + elem.data('color'));
if(isWhite != elem.data('color')){
elem.addClass('is-white');
}
});
setTimeout(function(){ setTimeout(function(){
onScrollCover(); onScrollCover();
}, 330); }, 330);
...@@ -610,6 +651,7 @@ $(document).ready(function(){ ...@@ -610,6 +651,7 @@ $(document).ready(function(){
$('.cover-wrapper').last().addClass('last'); $('.cover-wrapper').last().addClass('last');
$('.cover-wrapper').first().addClass('first'); $('.cover-wrapper').first().addClass('first');
showMap(); showMap();
$.fn.loadPageContent();
}); //end document ready }); //end document ready
$(window).resize(function() { $(window).resize(function() {
......
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