Commit 2fc92e00 authored by imac's avatar imac

[Update]Redmine #649 : Structural change + fixed menu

parent 76e735c6
...@@ -954,9 +954,7 @@ footer{ ...@@ -954,9 +954,7 @@ footer{
/* ========================================================================== /* ==========================================================================
VII/ Pages...............ALL pages VII/ Pages...............ALL pages
========================================================================== */ ========================================================================== */
/* --------------*/ /* ---------->>> HOME <<<-----------*/ /* --------------*/ /* --------------*/ /* ---------->>> HOME <<<-----------*/ /* --------------*/
#home { #home {
position: relative; position: relative;
height: 100%; height: 100%;
...@@ -970,6 +968,10 @@ VII/ Pages...............ALL pages ...@@ -970,6 +968,10 @@ VII/ Pages...............ALL pages
.img-wrapper img{ .img-wrapper img{
display: none; display: none;
} }
#home .img-wrapper.fixed{
position: fixed;
left: 0;
}
.news-btn{ .news-btn{
position: absolute; position: absolute;
top: 50px; top: 50px;
...@@ -1782,7 +1784,7 @@ label.chevron.bottom::first-letter { ...@@ -1782,7 +1784,7 @@ label.chevron.bottom::first-letter {
} }
.container-bg{ .container-bg{
position: fixed; position: fixed;
z-index: 99; z-index: 9999999;
background-size: cover; background-size: cover;
opacity: 0; opacity: 0;
} }
...@@ -2169,6 +2171,9 @@ label.chevron.bottom::first-letter { ...@@ -2169,6 +2171,9 @@ label.chevron.bottom::first-letter {
padding: 0px 10px 0px 15px; padding: 0px 10px 0px 15px;
padding-bottom: 100px; padding-bottom: 100px;
} }
.right-container .contact-wrapper .right-panel{
padding: 0px;
}
.panel section > h2{ .panel section > h2{
padding-top: 80px; padding-top: 80px;
} }
...@@ -2295,10 +2300,10 @@ label.chevron.bottom::first-letter { ...@@ -2295,10 +2300,10 @@ label.chevron.bottom::first-letter {
padding-top: 30px; padding-top: 30px;
} }
/* --------------*/ /* ---------->>> Uniqpaper <<<-----------*/ /* --------------*/ /* --------------*/ /* ---------->>> Uniqpaper <<<-----------*/ /* --------------*/
#uniqpaper .cover-wrapper{ #cat-151 .cover-wrapper{
top: 0; top: 0;
} }
#uniqpaper .right-container .left-panel { #cat-151 .right-container .left-panel {
width: 47.2%; width: 47.2%;
} }
.floated-bloc{ .floated-bloc{
......
...@@ -201,7 +201,7 @@ ...@@ -201,7 +201,7 @@
padding: 65px 20px; padding: 65px 20px;
} }
/*Uniqpaper*/ /*Uniqpaper*/
#uniqpaper .right-container .left-panel { #cat-151 .right-container .left-panel {
width: 34%; width: 34%;
} }
.floated-bloc{ .floated-bloc{
...@@ -219,6 +219,9 @@ ...@@ -219,6 +219,9 @@
.contact-form .footer{ .contact-form .footer{
padding: 30px 22px 32px; padding: 30px 22px 32px;
} }
.right-container .contact-wrapper .right-panel{
padding: 0px;
}
/* Catalogue */ /* Catalogue */
.right-container .left-panel{ .right-container .left-panel{
width: 37%; width: 37%;
...@@ -288,6 +291,9 @@ ...@@ -288,6 +291,9 @@
.right-panel-wrapper{ .right-panel-wrapper{
top: 0px !important; top: 0px !important;
} }
.container-bg{
height: auto !important;
}
} }
@media screen and (max-width: 860px) { @media screen and (max-width: 860px) {
/* general */ /* general */
...@@ -317,6 +323,12 @@ ...@@ -317,6 +323,12 @@
.rounded{ .rounded{
padding: 8px 22px 11px; padding: 8px 22px 11px;
} }
.mobile-nav{
display: none;
}
#catalogue .mobile-nav{
display: block;
}
/* Helper */ /* Helper */
.close-btn{ .close-btn{
top: 15px; top: 15px;
...@@ -388,12 +400,12 @@ ...@@ -388,12 +400,12 @@
letter-spacing: 0px; letter-spacing: 0px;
} }
/*Uniqpaper*/ /*Uniqpaper*/
#uniqpaper .right-container .left-panel { #cat-151 .right-container .left-panel {
position: relative; position: relative;
width: 100%; width: 100%;
left: initial !important; left: initial !important;
} }
#uniqpaper .cover-wrapper{ #cat-151 .cover-wrapper{
display: block; display: block;
} }
.floated-bloc{ .floated-bloc{
......
...@@ -3,788 +3,827 @@ var initFunction = function() { ...@@ -3,788 +3,827 @@ 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) {
var nav = $('.main-nav .nav-content');
//(this.classList.contains("is-active") === true) ? this.classList.remove("is-active") : this.classList.add("is-active");
$(".c-hamburger").toggleClass('is-active');
if ($(".c-hamburger").hasClass('is-active')) { //Open menu
nav.removeClass('OFF').addClass("ON");
nav.parent().addClass("show-nav transition");
$('body').addClass('fixed');
if (!($('.main-nav .nav-content .footer').length)) {
$('.main-nav .nav-content').append($('footer .footer').clone(true, true));
}
$('.right-panel-wrapper').css('z-index', '9999');
} }
; else { //Close menu
function toggleHandler(toggle) { nav.removeClass('ON').addClass("OFF");
toggle.addEventListener("click", function(e) { $('body').removeClass('fixed');
var nav = $('.main-nav .nav-content'); nav.parent().removeClass("show-nav");
//(this.classList.contains("is-active") === true) ? this.classList.remove("is-active") : this.classList.add("is-active"); $('.main-nav .nav-content .footer').remove();
$(".c-hamburger").toggleClass('is-active'); setTimeout(function() {
if ($(".c-hamburger").hasClass('is-active')) { //Open menu $('.right-panel-wrapper').css('z-index', '9999999');
nav.removeClass('OFF').addClass("ON"); }, 500)
nav.parent().addClass("show-nav transition");
$('body').addClass('fixed');
if (!($('.main-nav .nav-content .footer').length)) {
$('.main-nav .nav-content').append($('footer .footer').clone(true, true));
}
$('.right-panel-wrapper').css('z-index', '9999');
}
else { //Close menu
nav.removeClass('ON').addClass("OFF");
$('body').removeClass('fixed');
nav.parent().removeClass("show-nav");
$('.main-nav .nav-content .footer').remove();
setTimeout(function() {
$('.right-panel-wrapper').css('z-index', '9999999');
}, 500)
}
setTimeout(function() {
checkFooterNavPosition();
}, 330)
nav.stop().slideToggle();
});
} }
$.fn.loadPageContent = function() { setTimeout(function() {
checkFooterNavPosition();
if ($('body').find('header').length > 1) { }, 330)
$('body').find('header').last().parent().remove(); nav.stop().slideToggle();
$('.right-panel-wrapper').css('top', $('.nav-header').outerHeight()); });
$('html').css('overflow', 'auto'); }
} $.fn.loadPageContent = function() {
if ($('body').find('header').length > 1) {
//$('.load-page').removeClass('fadeOutUp').addClass('animated fadeInUp') $('body').find('header').last().parent().remove();
$('ul.phototheque').find('li').first().addClass('current'); $('.right-panel-wrapper').css('top', $('.nav-header').outerHeight());
$('ul.phototheque').find('li').first().find('.subcat').slideDown('slow'); $('html').css('overflow', 'auto');
var product = $('.list-animation article'); }
// TODO: Remove init classes , init attr on html //$('.load-page').removeClass('fadeOutUp').addClass('animated fadeInUp')
product.find('figure img,ul,h3,.new,.download-btn').attr({'data-animate': "", 'data-animation-classes': "animated fadeIn"}); $('ul.phototheque').find('li').first().addClass('current');
animateOnScroll(); $('ul.phototheque').find('li').first().find('.subcat').slideDown('slow');
if ($(document).find('#load-page').children().length) { var product = $('.list-animation article');
scrollAnchor("#load-page", true); // TODO: Remove init classes , init attr on html
elemToScroll = $(document).find("#load-page"); product.find('figure img,ul,h3,.new,.download-btn').attr({'data-animate': "", 'data-animation-classes': "animated fadeIn"});
} else { animateOnScroll();
elemToScroll = $(document).find(".main"); if ($(document).find('#load-page').children().length) {
scrollAnchor('body', true); scrollAnchor("#load-page", true);
} elemToScroll = $(document).find("#load-page");
elemToScroll.on("scroll", onScroll); } else {
document.getElementById('load-page').addEventListener('scroll', window.scrollAnimation.throttledEvent, false); elemToScroll = $(document).find(".main");
$(document).find('ul.main-list-nav').on('click', ' li.parent-cat>a', function(e) { scrollAnchor('body', true);
var windowWidth = $(window).width(); }
e.preventDefault(); elemToScroll.on("scroll", onScroll);
e.stopPropagation(); document.getElementById('load-page').addEventListener('scroll', window.scrollAnimation.throttledEvent, false);
$('.main-list-nav>li').removeClass('current'); $(document).find('ul.main-list-nav').on('click', ' li.parent-cat>a', function(e) {
$(this).parent().addClass('current'); var windowWidth = $(window).width();
//if (windowWidth < 860){ if (windowWidth > 860) {
//$('.nav-phototeque .nav-content>ul>li').addClass('animated fadeOutLeft'); e.preventDefault();
//$('.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 e.stopPropagation();
$(document).find('.to-slide').on('click', 'a', function(e) { $('.main-list-nav>li').removeClass('current');
$('html').css('overflow', 'hidden'); $(this).parent().addClass('current');
appendLoading(); $('.main-list-nav .subcat').stop().slideUp('slow');
e.preventDefault(); $(this).parent().find('.subcat').stop().slideDown('slow');
var link = $(this).attr("href"), });
windowWidth = $(window).width(); setTimeout(function() {
if ($(this).parent().parent().hasClass('nav-page')) { $('.gallery-wrapper').removeClass('hidden-elem').addClass('animated visible-elem fadeInUp');
$(document).find('.right-container').first().remove(); $.fn.responsive();
$('.load-page').parent().css({ }, 100);
'left': $('.nav-wrapper').outerWidth() }
}); function appendLoading() {
$('.load-page').css('opacity', 1); if (!($('body #loading-container-subpage').length)) {
$(document).find('#loading-container-subpage').css({ $('.load-page, .right-container').append($('#loading-container-subpage').clone());
'left': $('.nav-wrapper').outerWidth(), }
'width': 'calc(100% - ' + $('.nav-wrapper').outerWidth() + 'px)', $('#loading-container-subpage').show();
}) }
/**/ //load content page on left Panel
$('nav ul li').removeClass('current').addClass('off'); $(document).find('.to-slide').on('click', 'a', function(e) {
$(this).parent().addClass('current'); if (!($('.load #loading-container-subpage').length)) {
$('.load-page').append($('#loading-container-subpage').clone());
/**/ }
} else { $('#loading-container-subpage').show();
$('.load-page').parent().css({
'left': 0, e.preventDefault();
}); var link = $(this).attr("href"),
$('.load-page').parent().addClass('active'); windowWidth = $(window).width();
} if ($(this).parent().parent().hasClass('nav-page')) {
history.pushState(null, null, link); $(document).find('.right-container').first().remove();
$('.load-page').load(link, {'ajax': 1}, function() { $('.load-page').parent().css({
$.fn.loadPageContent(); 'left': $('.nav-wrapper').outerWidth()
$.fn.responsive();
$.fn.animation();
});
if (windowWidth < 860) {
$(".c-hamburger").trigger("click");
}
}); });
var div = $('.nav-content'); $('.load-page').css('opacity', 1);
$('.footer-home-content').on('click', '.home-down:not(.scrolled)', function(e) { } else {
TweenMax.killTweensOf('.nav-content'); $('.load-page').parent().css({
var mainHeight = $('.main').outerHeight(); 'left': 0,
$(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 $('.load-page').parent().addClass('active');
$('#file-p').on('change', function(e) { }
var fileName = e.target.files[0].name; $('.load-page').load(link, {'ajax': 1}, function() {
$('.upload-btn').after($('<p class="loaded-file">' + fileName + '</p>')); $.fn.loadPageContent();
$.fn.responsive();
$.fn.animation();
$('.loading-container-subpage').hide();
});
history.pushState(null, null, link);
$('html').css('overflow', 'hidden');
if (windowWidth < 860) {
$(".c-hamburger").trigger("click");
}
});
//function slideContentPage(){
$(document).find('.to-slide-cat').on('click', 'a', function(e) {
var windowWidth = $(window).width();
if (windowWidth > 860){
e.preventDefault();
}
var link = $(this).attr("href");
if (!($('.right-container #loading-container-subpage').length)) {
$('.right-container').append($('#loading-container-subpage').clone());
}
$('#loading-container-subpage').show();
$('.right-container').find('#loading-container-subpage').css({
'left': $('.nav-wrapper').outerWidth(),
'width': 'calc(100% - ' + $('.nav-wrapper').outerWidth() + 'px)',
})
$(this).parent().find('.subcat').addClass('current');
$('.img-wrapper').hide();
/* $('nav ul').each(function(){
$(this).find('li').removeClass('current').addClass('off');
})*/
var clickedElem = $(this).parent();
$('.right-container').load(link, {'ajax': 1}, function() {
// $('#fullpage').fullpageSlide(); //Stories
// $('.filter-wrapper').open_filter();
var dataElem = $(document).find(".data-elem");
var postId = dataElem.data('postid');
var page = dataElem.data('page');
$('.main .container').attr({
'id':postId,
'data-page': page,
});
$('.right-container').addClass(dataElem.data('class'));
$('.main').on("scroll", onScroll);
loadCatalogContainer();
$('nav ul li').removeClass('current').addClass('off');
$('.subcat').removeClass('current');
$('.subcat').hide();
clickedElem.addClass('current');
clickedElem.find('.subcat').addClass('current');
clickedElem.find('.subcat').slideDown();
$.fn.getMenuBg(); //Animation BG Menu
//Load on home page
if ($('body #home').length) {
$('#home').find('.img-wrapper').addClass('fixed');
$('#home').find('.img-wrapper').css({
'width' : $('.nav-wrapper').outerWidth(),
}) })
//END get file name $('#home').addClass('container clearfix');
//END load content page on left Panel if ($('body .catlog-panel').length) {
$(document).on('click', '.int-link', function(e) { $('#home').attr('id','catalogue');
e.preventDefault(); }else{
$('.load-page').parent().removeClass('active'); $('#home').attr('id','');
$('.load-page').parent().css('left', '100%');
history.pushState(null, null, $(this).find('a').attr('href'));
$('html').css('overflow', 'auto');
tlProduct.reverse();
//$('.load-page').removeClass('fadeInUp').addClass('animated fadeOutUp');
});
$(document).on('click', '.acces li .login, .login-user', function(e) {
e.stopImmediatePropagation();
var windowWidth = $(window).width();
$('.popup-container').fadeIn();
if (windowWidth < 860) {
$(".c-hamburger").trigger("click");
}
// $('#user_login').attr('placeholder', 'Identifiant');
// $('#user_pass').attr('placeholder', 'Mot de passe');
$('.popup-first').removeClass('fadeOutDown ').addClass('animated visible-elem pulse');
});
//Close popup
$('.popup-first .close-btn').click(
function() {
$('.popup-first').removeClass('visible-elem pulse').addClass('fadeOutDown');
setTimeout(function() {
$('.popup-container').fadeOut('slow');
}, 0);
});
checkWhiteColor = function(color) {
var white = ["#fff", "#ffffff", "white"];
if ($.inArray(color, white) != -1) {
color = '#999999';
}
return color;
} }
//checkWhiteColor = function(item) { $('.main .container-bg').removeClass('hidden');
$.fn.setColorToWhite = function(item) { //$('.main').css('padding-top', $('.nav-header').outerHeight());
//$('.list-wrapper .color-list') }
$(this).each(function() { $('.loading-container-subpage').hide();
elem = item ? $(this).find(item) : $(this), });
isWhite = checkWhiteColor(elem.data('color')); history.pushState(null, null, link);
});
if (isWhite != elem.data('color')) { //}
elem.addClass('is-white');
} var div = $('.nav-content');
}); $('.footer-home-content').on('click', '.home-down:not(.scrolled)', function(e) {
} TweenMax.killTweensOf('.nav-content');
var mainHeight = $('.main').outerHeight();
$.fn.setBgColorList = function() { $(this).addClass('scrolled');
$(this).each(function() { if (!($('.footer-home-content .nav-content').length)) {
$(this).css({ $('.footer-home-content').append($('.nav-content').clone());
'background-color': $(this).data('color'), $('.main').outerHeight(mainHeight + $('.footer-home-content').outerHeight());
'border': '1px solid' + checkWhiteColor($(this).data('color')) $('.home-down-wrapper').css('top', -($('.home-down-wrapper').outerHeight()));
}) $('.home-down').css('top', -($('.home-down').outerHeight()));
}) }
} //scroll to bottom
$.fn.showProductListColors = function() { $('body').animate({
var articleWrapper = $(this), scrollTop: div.outerHeight()
firstPellet = articleWrapper.find('li').first(), }, 1000, 'swing', function() {});
articleColor = checkWhiteColor(firstPellet.data('color')); }).on('click', '.scrolled', function() {
articleLink = firstPellet.data('link'); $(this).removeClass('scrolled');
articleWrapper.find('.article-bg').css('background-color', articleColor); $("html, body").animate({scrollTop: 0}, "slow");
articleWrapper.find('figure img').attr({ setTimeout(function() {
'src': firstPellet.data('image'), $('.footer-home-content').find('.nav-content').remove();
'data-link': articleLink $('.home-down-wrapper').css('top', 'initial');
}); $('.footer-home-content').removeClass('fixed');
$('.product-list article ul li').setBgColorList(); $('.main').height($(window).innerHeight());
} }, 600)
//FadeIn Image on home page return false;
$.fn.fadeImage = function() { });
var srcImage = $(this).data('img'); //Get file name of uploaded file
if (srcImage == 'undefined' || !srcImage) $('#file-p').on('change', function(e) {
{ var fileName = e.target.files[0].name;
srcImage = $('#home .img-wrapper').data('defaultimg'); $('.upload-btn').after($('<p class="loaded-file">' + fileName + '</p>'));
} })
$('.img-wrapper').removeClass('animate'); //END get file name
$('.img-wrapper').stop().animate({ //END load content page on left Panel
opacity: 0, $(document).on('click', '.int-link', function(e) {
}, 500, function() { e.preventDefault();
}); $('.load-page').parent().removeClass('active');
$('.img-wrapper').stop().animate({ $('.load-page').parent().css('left', '100%');
opacity: 1, history.pushState(null, null, $(this).find('a').attr('href'));
}, 500, function() { $('html').css('overflow', 'auto');
$('.img-wrapper').addClass('animate'); tlProduct.reverse();
$('.img-wrapper').css({ //$('.load-page').removeClass('fadeInUp').addClass('animated fadeOutUp');
'background-image': "url(" + srcImage + ")", });
}); $(document).on('click', '.acces li .login, .login-user', function(e) {
}); e.stopImmediatePropagation();
} var windowWidth = $(window).width();
$.fn.showSubmenu = function() { $('.popup-container').fadeIn();
var currentPage = $('.container').data('page'); if (windowWidth < 860) {
$('header nav').find('ul li').find("[data-page=" + currentPage + "]").slideDown(); $(".c-hamburger").trigger("click");
$('header nav').find('ul').find("[data-page=" + currentPage + "]").addClass('current'); }
} // $('#user_login').attr('placeholder', 'Identifiant');
//animate menu nav // $('#user_pass').attr('placeholder', 'Mot de passe');
$.fn.open_nav = function() { $('.popup-first').removeClass('fadeOutDown ').addClass('animated visible-elem pulse');
TweenLite.set(".nav-content", {visibility: "visible"}); });
var tl = new TimelineMax(); //Close popup
tl.staggerFrom('.nav-content >ul>li, .phototheque-content nav >ul > li', 0.5, {opacity: 0, x: 200}, 0.1, 0.5); $('.popup-first .close-btn').click(
tl.staggerFromTo('nav ul ul li ', 0.5, {opacity: 0, x: 200}, {opacity: 1, x: 0}, 0.1, 1.2); function() {
tl.fromTo('.news-btn', 0.9, {autoAlpha: 0, scale: '0'}, {autoAlpha: 1, scale: '1'}, 0); $('.popup-first').removeClass('visible-elem pulse').addClass('fadeOutDown');
} setTimeout(function() {
$.fn.openPanelAnimation = function() { $('.popup-container').fadeOut('slow');
$(this).addClass('animated slideInRight').removeClass('slideOutRight').show(); }, 0);
} });
$.fn.closePanelAnimation = function() { checkWhiteColor = function(color) {
$(this).removeClass('slideInRight').addClass('slideOutRight'); var white = ["#fff", "#ffffff", "white"];
} if ($.inArray(color, white) != -1) {
$.fn.open_news = function() { color = '#999999';
$(this).on('click', function() { }
$('.news-wrapper').openPanelAnimation(); return color;
}) }
} //checkWhiteColor = function(item) {
$.fn.close_news = function() { $.fn.setColorToWhite = function(item) {
$(this).on('click', function() { //$('.list-wrapper .color-list')
$('.news-wrapper').closePanelAnimation(); $(this).each(function() {
}) elem = item ? $(this).find(item) : $(this),
isWhite = checkWhiteColor(elem.data('color'));
if (isWhite != elem.data('color')) {
elem.addClass('is-white');
} }
$.fn.reinitFilter = function() { });
$(this).removeClass('selected-filter selected'); }
$.fn.setBgColorList = function() {
$(this).each(function() {
$(this).css({
'background-color': $(this).data('color'),
'border': '1px solid' + checkWhiteColor($(this).data('color'))
})
})
}
$.fn.showProductListColors = function() {
var articleWrapper = $(this),
firstPellet = articleWrapper.find('li').first(),
articleColor = checkWhiteColor(firstPellet.data('color'));
articleLink = firstPellet.data('link');
articleWrapper.find('.article-bg').css('background-color', articleColor);
articleWrapper.find('figure img').attr({
'src': firstPellet.data('image'),
'data-link': articleLink
});
$('.product-list article ul li').setBgColorList();
}
//FadeIn Image on home page
$.fn.fadeImage = function() {
var srcImage = $(this).data('img');
if (srcImage == 'undefined' || !srcImage)
{
srcImage = $('#home .img-wrapper').data('defaultimg');
}
$('.img-wrapper').removeClass('animate');
$('.img-wrapper').stop().animate({
opacity: 0,
}, 500, function() {
});
$('.img-wrapper').stop().animate({
opacity: 1,
}, 500, function() {
$('.img-wrapper').addClass('animate');
$('.img-wrapper').css({
'background-image': "url(" + srcImage + ")",
});
});
}
$.fn.showSubmenu = function() {
var currentPage = $('.container').data('page');
$('header nav').find('ul li').find("[data-page=" + currentPage + "]").slideDown();
$('header nav').find('ul').find("[data-page=" + currentPage + "]").addClass('current');
}
//animate menu nav
$.fn.open_nav = function() {
TweenLite.set(".nav-content", {visibility: "visible"});
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.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);
}
$.fn.openPanelAnimation = function() {
$(this).addClass('animated slideInRight').removeClass('slideOutRight').show();
}
$.fn.closePanelAnimation = function() {
$(this).removeClass('slideInRight').addClass('slideOutRight');
}
$.fn.open_news = function() {
$(this).on('click', function() {
$('.news-wrapper').openPanelAnimation();
})
}
$.fn.close_news = function() {
$(this).on('click', function() {
$('.news-wrapper').closePanelAnimation();
})
}
$.fn.reinitFilter = function() {
$(this).removeClass('selected-filter selected');
}
$.fn.open_filter = function() {
$(this).on('click', '.filter-btn', function() {
var filterW = $('.filter-list').outerWidth(),
mainW = $('.main-nav').outerWidth(),
filterBtn = $('.filter-btn .btn-container').outerWidth();
tlFilter = new TimelineMax();
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.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('.nav-slider',0.5,{opacity:1},{opacity:0},0);
}).on('click', '.close-btn', function() {
tlFilter.reverse();
}).on('click', '.filter-bloc .header', function() {
var $this = $(this).parent();
if (!$this.hasClass('active')) {
$('.filter-bloc').removeClass('active');
$this.addClass('active');
$('.filter-bloc .bloc-content').slideUp('slow');
$this.find('.bloc-content').slideDown('slow');
$('.commercial').slideUp('slow');
} else {
$this.removeClass('active');
$this.find('.bloc-content').slideUp('slow');
} }
$.fn.open_filter = function() {
$(this).on('click', '.filter-btn', function() {
var filterW = $('.filter-list').outerWidth(),
mainW = $('.main-nav').outerWidth(),
filterBtn = $('.filter-btn .btn-container').outerWidth();
tlFilter = new TimelineMax();
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.to('.filter-btn .btn-container', 0.5, {opacity: 0, left: filterW, width: "0px"}, 0);
//tl.fromTo('#slides',0.5,{opacity:1},{opacity:0},0); }).on('click', '.filter-bloc li:not(.disabled,.reinit)', function(e) {
//tl.fromTo('.nav-slider',0.5,{opacity:1},{opacity:0},0); e.stopPropagation();
}).on('click', '.close-btn', function() { $(this).toggleClass('selected');
tlFilter.reverse(); var e = $(this).parent().find('.selected').length,
}).on('click', '.filter-bloc .header', function() { parentFilter = $(this).parent().parent().parent();
var $this = $(this).parent(); if (e) {
if (!$this.hasClass('active')) { parentFilter.addClass('selected-filter');
$('.filter-bloc').removeClass('active'); $('.filter-btn').addClass('selected-filter');
$this.addClass('active'); } else {
$('.filter-bloc .bloc-content').slideUp('slow'); parentFilter.removeClass('selected-filter');
$this.find('.bloc-content').slideDown('slow'); $('.filter-btn').removeClass('selected-filter');
$('.commercial').slideUp('slow');
} else {
$this.removeClass('active');
$this.find('.bloc-content').slideUp('slow');
}
}).on('click', '.filter-bloc li:not(.disabled,.reinit)', function(e) {
e.stopPropagation();
$(this).toggleClass('selected');
var e = $(this).parent().find('.selected').length,
parentFilter = $(this).parent().parent().parent();
if (e) {
parentFilter.addClass('selected-filter');
$('.filter-btn').addClass('selected-filter');
} else {
parentFilter.removeClass('selected-filter');
$('.filter-btn').removeClass('selected-filter');
}
//e ? parentFilter.addClass('selected-filter') : parentFilter.removeClass('selected-filter') ;
}).on('click', '.filter-bloc .reinit', function() {
selector = $(this).parent().parent();
selector.parent().reinitFilter();
selector.find('li').reinitFilter();
}).on('click', '.reinit-all', function() {
$('.filter-bloc , .filter-bloc li').reinitFilter();
$('.filter-btn').removeClass('selected-filter');
});
}
$.fn.checkSelectedFilter = function() {
if ($('.filter-content .filter-bloc.selected-filter').length) {
$('.filter-btn').addClass('selected-filter');
}
}
$.fn.changeProductImageBg = function() {
var
selectedColor = checkWhiteColor($(this).data("color")),
selectedImage = $(this).data("image"),
linkProduct = $(this).data("link"),
tl = new TimelineMax(),
container = $(this).parent().parent();
container.find('.article-bg').css({"background-color": selectedColor, opacity: '0.1'});
container.find('img').attr({'src': selectedImage, 'data-link': linkProduct});
tl.fromTo(container.find('img'), 1, {opacity: 0, visibility: "hidden"}, {opacity: 1, visibility: "visible"}, 0);
} }
$.fn.animatePageScroll = function(element, duration) { //e ? parentFilter.addClass('selected-filter') : parentFilter.removeClass('selected-filter') ;
return $(this).fromTo(element, duration, }).on('click', '.filter-bloc .reinit', function() {
{opacity: 0, visibility: "hidden", marginBottom: '80px'}, selector = $(this).parent().parent();
{opacity: 1, visibility: "visible", marginBottom: '0px'}, 0.7); selector.parent().reinitFilter();
selector.find('li').reinitFilter();
}).on('click', '.reinit-all', function() {
$('.filter-bloc , .filter-bloc li').reinitFilter();
$('.filter-btn').removeClass('selected-filter');
});
}
$.fn.checkSelectedFilter = function() {
if ($('.filter-content .filter-bloc.selected-filter').length) {
$('.filter-btn').addClass('selected-filter');
}
}
$.fn.changeProductImageBg = function() {
var
selectedColor = checkWhiteColor($(this).data("color")),
selectedImage = $(this).data("image"),
linkProduct = $(this).data("link"),
tl = new TimelineMax(),
container = $(this).parent().parent();
container.find('.article-bg').css({"background-color": selectedColor, opacity: '0.1'});
container.find('img').attr({'src': selectedImage, 'data-link': linkProduct});
tl.fromTo(container.find('img'), 1, {opacity: 0, visibility: "hidden"}, {opacity: 1, visibility: "visible"}, 0);
}
$.fn.animatePageScroll = function(element, duration) {
return $(this).fromTo(element, duration,
{opacity: 0, visibility: "hidden", marginBottom: '80px'},
{opacity: 1, visibility: "visible", marginBottom: '0px'}, 0.7);
}
$.fn.fullpageSlide = function() {
var
timeout = 1.7,
duration = 1.2;
setTimeout(function() {
$('.moveDown').removeClass('hidden-elem').addClass('visible-elem animated rollIn');
}, 2000);
$("#fullpage .section").first().addClass('first');
//destroying
if (typeof $.fn.fullpage.destroy == 'function') {
$.fn.fullpage.destroy('all');
} }
$.fn.fullpageSlide = function() { $(this).fullpage({
verticalCentered: false,
css3: false,
scrollingSpeed: 1500,
lazyLoading: false,
fixedElements: 'footer',
controlArrows: true,
fitToSectionDelay: 800000,
fadingEffect: true,
normalScrollElements: ".section .bloc",
afterLoad: function(anchor, index) {
tl1 = new TimelineMax();
var firstSection = $("#fullpage .section.first");
//tl1.animatePageScroll(firstSection,duration);
//console.log(animation);
tl1.fromTo(firstSection.find('.bloc .header-bloc'), 1.5,
{opacity: 0, visibility: "hidden", marginBottom: '80px'},
{opacity: 1, visibility: "visible", marginBottom: '0px'}, timeout);
tl1.fromTo(firstSection.find('.bloc .desc-content'), 1,
{opacity: 0, visibility: "hidden", marginLeft: '-100px'},
{opacity: 1, visibility: "visible", marginLeft: '0px'}, timeout);
},
onLeave: function(index, nextIndex, direction) {
var var
timeout = 1.7, activeSection = $(this),
duration = 1.2; nextSection = $(this).next();
setTimeout(function() { tl2 = new TimelineMax();
$('.moveDown').removeClass('hidden-elem').addClass('visible-elem animated rollIn'); timeout = 0.7;
}, 2000); activeSection.removeClass('first');
$("#fullpage .section").first().addClass('first'); if (nextIndex === $('#fullpage .section').length) {
$(this).fullpage({ $('.moveDown').removeClass('hidden-elem').addClass('visible-elem animated rollOut');
verticalCentered: false, } else {
css3: false, $('.moveDown').removeClass('rollOut');
scrollingSpeed: 1500,
lazyLoading: false,
fixedElements: 'footer',
controlArrows: true,
fitToSectionDelay: 800000,
fadingEffect: true,
normalScrollElements: ".section .bloc",
afterLoad: function(anchor, index) {
tl1 = new TimelineMax();
var firstSection = $("#fullpage .section.first");
//tl1.animatePageScroll(firstSection,duration);
//console.log(animation);
tl1.fromTo(firstSection.find('.bloc .header-bloc'), 1.5,
{opacity: 0, visibility: "hidden", marginBottom: '80px'},
{opacity: 1, visibility: "visible", marginBottom: '0px'}, timeout);
tl1.fromTo(firstSection.find('.bloc .desc-content'), 1,
{opacity: 0, visibility: "hidden", marginLeft: '-100px'},
{opacity: 1, visibility: "visible", marginLeft: '0px'}, timeout);
},
onLeave: function(index, nextIndex, direction) {
var
activeSection = $(this),
nextSection = $(this).next();
tl2 = new TimelineMax();
timeout = 0.7;
activeSection.removeClass('first');
if (nextIndex === $('#fullpage .section').length) {
$('.moveDown').removeClass('hidden-elem').addClass('visible-elem animated rollOut');
} else {
$('.moveDown').removeClass('rollOut');
}
tl2.fromTo(nextSection.find('.bloc .header-bloc'), 1.5,
{opacity: 0, visibility: "hidden", marginBottom: '80px'},
{opacity: 1, visibility: "visible", marginBottom: '0px'}, timeout);
tl2.fromTo(nextSection.find('.bloc .desc-content'), 1,
{opacity: 0, visibility: "hidden", marginLeft: '-100px'},
{opacity: 1, visibility: "visible", marginLeft: '0px'}, timeout);
if (direction === 'up') {
tl3 = new TimelineMax();
prevSection = $(this).prev();
tl3.fromTo(prevSection.find('.bloc .header-bloc'), 1.5,
{opacity: 0, visibility: "hidden", marginBottom: '80px'},
{opacity: 1, visibility: "visible", marginBottom: '0px'}, timeout);
tl3.fromTo(prevSection.find('.bloc .desc-content'), 1,
{opacity: 0, visibility: "hidden", marginLeft: '-100px'},
{opacity: 1, visibility: "visible", marginLeft: '0px'}, timeout);
}
},
});
$(document).on('click', '.moveDown', function() {
$.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);
} }
} tl2.fromTo(nextSection.find('.bloc .header-bloc'), 1.5,
$.fn.appendMap = function() { {opacity: 0, visibility: "hidden", marginBottom: '80px'},
var $this = $(this); {opacity: 1, visibility: "visible", marginBottom: '0px'}, timeout);
if (!(this.find('.map').length)) { tl2.fromTo(nextSection.find('.bloc .desc-content'), 1,
this.append($('.map')); {opacity: 0, visibility: "hidden", marginLeft: '-100px'},
{opacity: 1, visibility: "visible", marginLeft: '0px'}, timeout);
if (direction === 'up') {
tl3 = new TimelineMax();
prevSection = $(this).prev();
tl3.fromTo(prevSection.find('.bloc .header-bloc'), 1.5,
{opacity: 0, visibility: "hidden", marginBottom: '80px'},
{opacity: 1, visibility: "visible", marginBottom: '0px'}, timeout);
tl3.fromTo(prevSection.find('.bloc .desc-content'), 1,
{opacity: 0, visibility: "hidden", marginLeft: '-100px'},
{opacity: 1, visibility: "visible", marginLeft: '0px'}, timeout);
} }
setTimeout(function() { },
initMap(); });
}, 330) $(document).on('click', '.moveDown', function() {
$.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.appendMobileMenu = function() { }
var $this = $(this); $.fn.appendMap = function() {
setTimeout(function() { var $this = $(this);
if (!($this.find('li.current').length)) { if (!(this.find('.map').length)) {
$('.main-nav .nav-content li.current').addClass('to-replace'); this.append($('.map'));
$('.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 setTimeout(function() {
$.fn.responsive = function() { initMap();
$(".product-details").css('height', 'auto'); }, 330)
var footerHeight = $('footer').height(), }
productHeight = $(".product-details").outerHeight(), $.fn.appendMobileMenu = function() {
productWidth = $(".product-details").outerWidth(), var $this = $(this);
windowHeight = $(window).innerHeight(), setTimeout(function() {
windowWidth = $(window).width(), if (!($this.find('li.current').length)) {
navMenuWidth = $('.nav-wrapper').outerWidth(), $('.main-nav .nav-content li.current').addClass('to-replace');
navHeight = $('.nav-header').outerHeight(), $('.main-nav .nav-content li.current').clone(true).find('ul').remove().end().appendTo($this);
navHeader = $('.nav-header').outerHeight(), $this.find("li.current").append($('.main-nav.nav-wrapper li.current ul'));
containerHeight = windowHeight - footerHeight, }
navPhototequeWidth = $('.nav-phototeque').outerWidth(), $('.right-container').css('padding-top', $this.parent().outerHeight());
navPhototequeHeight = $('.nav-phototeque').height(), }, 2000)
maxHeight = productHeight > windowHeight ? productHeight : containerHeight,
galleryWidth = windowWidth - navPhototequeWidth, }
filterWidth = $('.right-container .left-panel').outerWidth(), //Responsive function
footerContact = $('.contact-form .footer').outerHeight(); $.fn.responsive = function() {
$('.gallery-wrapper').outerWidth(galleryWidth).css('margin-left', navPhototequeWidth); $(".product-details").css('height', 'auto');
$('.main,.load-page').outerHeight(containerHeight); var footerHeight = $('footer').height(),
$('.full-height').outerHeight(maxHeight); productHeight = $(".product-details").outerHeight(),
$('.nav-content').outerHeight(windowHeight - navHeader - footerHeight); productWidth = $(".product-details").outerWidth(),
$('.product-images').outerWidth(windowWidth - productWidth - 10); windowHeight = $(window).innerHeight(),
$('.right-container').outerWidth(windowWidth - navMenuWidth); windowWidth = $(window).width(),
$('.position--after-menu').css('left', navMenuWidth); navMenuWidth = $('.nav-wrapper').outerWidth(),
$('.right-panel').outerWidth(windowWidth - (navMenuWidth + filterWidth)); navHeight = $('.nav-header').outerHeight(),
$('.contact-form').height(windowHeight - footerHeight); navHeader = $('.nav-header').outerHeight(),
$('.contact-form .inner-form').outerHeight(windowHeight - footerContact); containerHeight = windowHeight - footerHeight,
$('#catalogue .panel-content section').last().css('height', 'auto'); navPhototequeWidth = $('.nav-phototeque').outerWidth(),
setTimeout(function() { navPhototequeHeight = $('.nav-phototeque').height(),
var lastSection = $('#catalogue .panel-content section').last(); maxHeight = productHeight > windowHeight ? productHeight : containerHeight,
var lastSectionHeight = lastSection.outerHeight() + 50; galleryWidth = windowWidth - navPhototequeWidth,
if (lastSectionHeight < windowHeight - footerHeight) { filterWidth = $('.right-container .left-panel').outerWidth(),
lastSection.height(2 * windowHeight / 3 + lastSection.find('h2').outerHeight() - footerHeight); footerContact = $('.contact-form .footer').outerHeight();
} else { $('.gallery-wrapper').outerWidth(galleryWidth).css('margin-left', navPhototequeWidth);
lastSection.css('height', 'auto'); $('.main,.load-page').outerHeight(containerHeight);
} $('.full-height').outerHeight(maxHeight);
}, 1000) $('.nav-content').outerHeight(windowHeight - navHeader - footerHeight);
$('.product-images').outerWidth(windowWidth - productWidth - 10);
$('.right-container').outerWidth(windowWidth - navMenuWidth);
$('.position--after-menu').css('left', navMenuWidth);
$('.right-panel').outerWidth(windowWidth - (navMenuWidth + filterWidth));
$('.contact-form').height(windowHeight - footerHeight);
$('.contact-form .inner-form').outerHeight(windowHeight - footerContact);
$('#catalogue .panel-content section').last().css('height', 'auto');
setTimeout(function() {
var lastSection = $('#catalogue .panel-content section').last();
var lastSectionHeight = lastSection.outerHeight() + 50;
if (lastSectionHeight < windowHeight - footerHeight) {
lastSection.height(2 * windowHeight / 3 + lastSection.find('h2').outerHeight() - footerHeight);
} else {
lastSection.css('height', 'auto');
}
}, 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); // $.fn.getMenuBg();
$('.contact-form h2').removeClass('show-comm'); $('.main').css('padding-top', 0);
$('.filter, .left-panel .map, .details, .contact-form form').show(); $('.contact-form h2').removeClass('show-comm');
$('.left-panel').appendMap(); $('.filter, .left-panel .map, .details, .contact-form form').show();
$('.filter-list,#home').css('margin-top', 0); $('.left-panel').appendMap();
$('.filter-list .top-header').css('top', "initial"); $('.filter-list,#home').css('margin-top', 0);
$('.header .nav-wrapper li.to-replace').append($('.mobile-nav .nav-wrapper li.current ul')); $('.filter-list .top-header').css('top', "initial");
$('.mobile-nav .nav-wrapper ul').find('li').remove(); $('.header .nav-wrapper li.to-replace').append($('.mobile-nav .nav-wrapper li.current ul'));
} else { $('.mobile-nav .nav-wrapper ul').find('li').remove();
$('.filter').appendMap(); } else {
$('.main').css('padding-top', navHeight); $('.filter').appendMap();
$('.container-bg').css({'height': navHeight}); $('.main').css('padding-top', navHeight);
$('.contact-form h2').addClass('show-comm'); $('.container-bg').css({'height': navHeight});
$('.filter-list').css('margin-top', navHeight); $('.contact-form h2').addClass('show-comm');
$('.filter-list .top-header, .mobile-nav').css('top', navHeight); $('.filter-list').css('margin-top', navHeight);
$('.mobile-nav .nav-wrapper ul').appendMobileMenu(); $('.filter-list .top-header, .mobile-nav').css('top', navHeight);
$('#slides').height($('.slides-wrapper').width()); $('.mobile-nav .nav-wrapper ul').appendMobileMenu();
if ($('body #home').length) { $('#slides').height($('.slides-wrapper').width());
$('.main').css('padding-top', 0); if ($('body #home').length) {
} $('.main').css('padding-top', 0);
if ($('.filter-wrapper .header-filter-contact').hasClass('on')) { }
$('.filter, .left-panel .map, .details').show(); if ($('.filter-wrapper .header-filter-contact').hasClass('on')) {
} else { $('.filter, .left-panel .map, .details').show();
$('.filter, .left-panel .map, .details').hide(); } else {
} $('.filter, .left-panel .map, .details').hide();
if ($('.contact-form .header-filter-contact').hasClass('on')) { }
$('.contact-form form').show(); if ($('.contact-form .header-filter-contact').hasClass('on')) {
} else { $('.contact-form form').show();
$('.contact-form form').hide(); } else {
} $('.contact-form form').hide();
checkFilterContactWrapper(); }
} checkFilterContactWrapper();
checkFooterNavPosition();
} }
//Wordpress js login checkFooterNavPosition();
$('#user_login').attr('placeholder', 'Identifiant'); }
$('#user_pass').attr('placeholder', 'Mot de passe'); //Wordpress js login
$("#user_login").addClass("my-login-username"); $('#user_login').attr('placeholder', 'Identifiant');
$("#wp-submit").addClass("btn rounded white-btn"); $('#user_pass').attr('placeholder', 'Mot de passe');
$("#user_login").addClass("my-login-username");
$("#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() { setTimeout(function() {
$('.form-wrapper').removeClass('hidden-elem').addClass('animated fadeInUp') $('.form-wrapper').removeClass('hidden-elem').addClass('animated fadeInUp')
}, 1000) }, 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');
$('.cover-desc-wrapper').removeClass('fadeInDown').addClass('animated fadeOutDown') $('.cover-desc-wrapper').removeClass('fadeInDown').addClass('animated fadeOutDown')
$('.current-cover').addClass('last-current-cover'); $('.current-cover').addClass('last-current-cover');
$('.cover-wrapper').removeClass('prev next current-cover'); $('.cover-wrapper').removeClass('prev next current-cover');
$(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; var lastScrollTop = 0;
function onScroll(event) { 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) if (timer)
clearTimeout(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)
if (timer2) clearTimeout(timer2);
clearTimeout(timer2); timer2 = setTimeout(function() {
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');
var target = this.hash, var target = this.hash,
menu = target, menu = target,
temp = 0; temp = 0;
$target = $(target); $target = $(target);
//$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 {
$('.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 { } else {
$('.header .nav-content .footer').removeClass('relative'); $('.contact-form .footer').removeClass('fixed');
} }
}, 500)
} }
function checkFilterContactWrapper() { function loadCatalogContainer(){
setTimeout(function() { // Catalog Page : Change product image depending on selected color
if ( $('.product-list article ul li').on('mouseover', function() {
($('.contact-form .form-wrapper').outerHeight() $(this).changeProductImageBg();
+ $('.filter-wrapper').outerHeight() });
+ $('nav .main-nav').outerHeight() + $('.main-nav').outerHeight()) < $(window).outerHeight() $('.product-list article').each(function() {
/*&& $(this).showProductListColors();
( $('.contact-form .form-wrapper').outerHeight() + });
$('.contact-form .footer').outerHeight() + $('.filter-bloc .list-color-filter li').setColorToWhite();
$('.filter-wrapper').outerHeight() $('.filter-wrapper').open_filter();
> $(window).outerHeight() )*/ $.fn.checkSelectedFilter();
) $.fn.showSubmenu(); //Catalog subMenu
{ setTimeout(function() {
$('.contact-form .footer').addClass('fixed'); onScrollCover();
} else { }, 500);
$('.contact-form .footer').removeClass('fixed'); $('#fullpage').fullpageSlide(); //Stories
} $.fn.responsive();
}, 500) $('.list-color-filter li').setBgColorList();
$.fn.animation(); //Global animation for entire site
//TODO
$('.cover-wrapper').last().addClass('last');
$('.cover-wrapper').first().addClass('first');
showMap();
} }
$(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');
}
else {
$('.home-footer-nav .nav-wrapper').removeClass('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 $.fn.open_nav();
$('.product-list article ul li').on('mouseover', function() { if ($(document).find('#load-page').children().length) {
$(this).changeProductImageBg(); scrollAnchor("#load-page", true);
}); } else {
$('.product-list article').each(function() { scrollAnchor('html,body', false);
$(this).showProductListColors(); }
}); $('.news-btn').open_news();
$('.filter-bloc .list-color-filter li').setColorToWhite(); $('.close-btn').close_news();
setTimeout(function() { loadCatalogContainer(); // Load functions catalog page
onScrollCover(); $.fn.getMenuBg(); //Animation BG Menu
}, 330); $.fn.loadPageContent();
$.fn.open_nav();
if ($(document).find('#load-page').children().length) {
scrollAnchor("#load-page", true);
} else {
scrollAnchor('html,body', false);
}
$('.news-btn').open_news();
$('.close-btn').close_news();
$('.filter-wrapper').open_filter();
$.fn.checkSelectedFilter();
$.fn.showSubmenu(); //Catalog subMenu
$('#fullpage').fullpageSlide(); //Stories
$.fn.responsive();
$('.list-color-filter li').setBgColorList();
$.fn.animation(); //Global animation for entire site
$.fn.getMenuBg(); //Animation BG Menu
//TODO
$('.cover-wrapper').last().addClass('last');
$('.cover-wrapper').first().addClass('first');
showMap();
$.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);
}); });
}(jQuery));
}(jQuery));
jQuery(document).ready(function() { jQuery(document).ready(function() {
jQuery('p').each(function() { jQuery('p').each(function() {
var $this = jQuery(this); var $this = jQuery(this);
if($this.html().replace(/\s|&nbsp;/g, '').length == 0) { if($this.html().replace(/\s|&nbsp;/g, '').length == 0) {
$this.remove(); $this.remove();
} }
}); });
jQuery(document).on('click', ".download_file", function() { jQuery(document).on('click', ".download_file", function() {
var id; var id;
var download_link = jQuery('.download_file_link').attr('href'); var download_link = jQuery('.download_file_link').attr('href');
...@@ -17,9 +17,9 @@ jQuery(document).ready(function() { ...@@ -17,9 +17,9 @@ jQuery(document).ready(function() {
else else
id = variation_id; id = variation_id;
var link = download_link + 'variation_id=' + id; var link = download_link + 'variation_id=' + id;
window.open(link, '_blank'); window.open(link, '_blank');
return false; return false;
}); });
...@@ -29,7 +29,7 @@ jQuery(document).ready(function() { ...@@ -29,7 +29,7 @@ jQuery(document).ready(function() {
jQuery('.list-animation section').show(); jQuery('.list-animation section').show();
jQuery('article').removeClass('selected'); jQuery('article').removeClass('selected');
jQuery('article').removeClass('hidden'); jQuery('article').removeClass('hidden');
var tabcolor = []; var tabcolor = [];
i = 0; i = 0;
...@@ -54,7 +54,7 @@ jQuery(document).ready(function() { ...@@ -54,7 +54,7 @@ jQuery(document).ready(function() {
jQuery("#pa_univers .selected").each(function() { jQuery("#pa_univers .selected").each(function() {
tabunivers[i++] = jQuery(this).text(); tabunivers[i++] = jQuery(this).text();
}); });
var sku = jQuery("#sku-search").val(); var sku = jQuery("#sku-search").val();
var selected_colors = tabcolor.join(','); var selected_colors = tabcolor.join(',');
...@@ -74,9 +74,9 @@ jQuery(document).ready(function() { ...@@ -74,9 +74,9 @@ jQuery(document).ready(function() {
jQuery(this).hide(); jQuery(this).hide();
} }
}); });
}); });
jQuery(window).on('load',function() { jQuery(window).on('load',function() {
jQuery('.filter-bloc').removeClass('active'); jQuery('.filter-bloc').removeClass('active');
jQuery('.filter-bloc ').each(function() { jQuery('.filter-bloc ').each(function() {
...@@ -99,8 +99,8 @@ jQuery(document).ready(function() { ...@@ -99,8 +99,8 @@ jQuery(document).ready(function() {
jQuery(this).hide(); jQuery(this).hide();
} }
}); });
if(result_found == false) if(result_found == false)
{jQuery('.search_notfound').text(' Aucun produit ne correspond à votre recherche'); {jQuery('.search_notfound').text(' Aucun produit ne correspond à votre recherche');
console.log(result_found); console.log(result_found);
...@@ -110,13 +110,13 @@ jQuery(document).ready(function() { ...@@ -110,13 +110,13 @@ jQuery(document).ready(function() {
jQuery(window).bind("popstate", function(e) { /*jQuery(window).bind("popstate", function(e) {
var state = e.originalEvent.state; var state = e.originalEvent.state;
if ( state === null ) { if ( state === null ) {
var back_link = jQuery('.close-panel .circle-btn a').attr('href'); var back_link = jQuery('.close-panel .circle-btn a').attr('href');
window.location.href = back_link; window.location.href = back_link;
} }
}); });*/
}); });
......
<?php <?php
/** /**
* Template Name: Contact * Template Name: Contact
* *
*/ */
get_header();
$post_ID = 157; $post_ID = 157;
if (!(isset($_POST['ajax']))) {
get_template_part( 'header', 'page-content' );
}
?> ?>
<div class="hidden data-elem" data-postid ="cat-<?php echo $post_ID ?>" data-page = "<?php echo $post_ID ?>"></div>
<div class="contact-wrapper">
<div class="left-panel fixed-full position--after-menu ">
<div class="map">
<object id="map" type="image/svg+xml" data="<?php echo home_url('wp-content/themes/nap/assets/css/img/departements2.svg') ?>"></object>
</div>
</div>
<div class="right-panel full-height right">
<div class="filter-wrapper search-filter fixed full-height form-wrapper border-l row">
<div class="header-filter-contact">
<h2>Trouver mon contact commercial</h2>
<span class="open-filter abs-full display--only-mobile"></span>
</div>
<div class="filter">
<form id="map-search" method="get" action='contact.php'>
<p class="form-element">
<span class = "chevron bottom"></span>
<select id="selectCountry" >
<?php
if (get_field('contact_pays', $post_ID)):
<div class="container clearfix" id="contact" data-page = "contact"> while (has_sub_field('contact_pays', $post_ID)) :
<div class="container-bg abs-full"></div> ?>
<?php get_sidebar(); ?> <option value="<?php the_sub_field('pays_code'); ?>" ><?php the_sub_field('pays_nom'); ?></option>
<div class="contact-wrapper">
<div class="right-container">
<div class="left-panel fixed-full position--after-menu ">
<div class="map">
<object id="map" type="image/svg+xml" data="<?php echo home_url('wp-content/themes/nap/assets/css/img/departements2.svg') ?>"></object>
</div>
</div>
</div>
<div class="right-panel full-height right">
<div class="filter-wrapper search-filter fixed full-height form-wrapper border-l row">
<div class="header-filter-contact">
<h2>Trouver mon contact commercial</h2>
<span class="open-filter abs-full display--only-mobile"></span>
</div>
<div class="filter">
<form id="map-search" method="get" action='contact.php'>
<p class="form-element">
<span class = "chevron bottom"></span>
<select id="selectCountry" >
<?php
if (get_field('contact_pays', $post_ID)):
while (has_sub_field('contact_pays', $post_ID)) :
?>
<option value="<?php the_sub_field('pays_code'); ?>" ><?php the_sub_field('pays_nom'); ?></option>
<?php
endwhile;
endif;
?>
</select>
</p>
<p class="form-element cp">
<input placeholder="Code postal" class="search" id="search" type="text" name="search">
<input class ="search-btn" type="submit" />
</p>
</form>
</div>
<?php
if (get_field('zones_commerciaux', $post_ID)):
$i = 0;
while (has_sub_field('zones_commerciaux', $post_ID)) :
?>
<div class="commercial commercial-details" data-zone = "zone<?php echo $i; ?>">
<figure style="background-image:url(<?php the_sub_field('photo_commercial'); ?>)"></figure>
<?php the_sub_field('infos_commercial'); ?>
</div>
<?php
// list zones par commercial
if (get_sub_field('list_zones', $post_ID)):
$list_zone = array();
while (has_sub_field('list_zones', $post_ID)) :
$list_zone[]= get_sub_field('num_zone');
endwhile;
endif;
$i++;
endwhile;
endif;
?>
<span class="separation"></span>
<div class="details">
<div class="filter-bloc">
<div class="header">
<p><span>GMS</span></p>
</div>
<div class="bloc-content commercial-details">
<figure style="background-image:url(<?php echo get_field('photo_gms', $post_ID) ?>)"></figure>
<?php echo get_field('contact_gms', $post_ID) ?>
</div>
</div>
<div class="filter-bloc">
<div class="header">
<p><span>Groupement</span></p>
</div>
<div class="bloc-content commercial-details">
<figure style="background-image:url(<?php echo get_field('photo_groupement', $post_ID) ?>)"></figure>
<?php echo get_field('contact_groupement', $post_ID) ?>
</div>
</div>
</div>
</div>
<div class="contact-form right border-l row gray-bg">
<div class="form-wrapper inner-form">
<div class="header-filter-contact on">
<h2>Je souhaite être <br> contacté</h2>
<span class="open-filter abs-full display--only-mobile"></span>
</div>
<!--<form method="POST">
<div class="clearfix">
<div class="row left half-col">
<input placeholder = "Nom" type="text" name="name" id="name" value="" />
<input placeholder = "Prénom" type="text" name="fname" id="fname" value="" />
</div>
<div class="row right half-col">
<input placeholder = "Mail" type="text" name="mail" id="mail" value="" />
<input placeholder = "Téléphone" type="text" name="phone" id="phone" value="" />
</div>
<textarea name="message" id="message" title="Message" placeholder="Message"></textarea>
</div>
<input type = "submit" class="btn pink-btn rounded" value = 'Envoyer'>
</form>--> <?php
<?php echo do_shortcode( '[contact-form-7 id="558" title="Contact form"]' ); ?> endwhile;
</div> endif;
<div class="footer blue-bg abs font-small"> ?>
<h3 class="crete marker">Siège</h3> </select>
<div class="content clearfix"> </p>
<div class="row left half-col"> <p class="form-element cp">
<?php echo get_field('contact_adresse', $post_ID); ?> <input placeholder="Code postal" class="search" id="search" type="text" name="search">
</div> <input class ="search-btn" type="submit" />
<div class="row right half-col"> </p>
<?php echo get_field('contact_tel_fax', $post_ID); ?> </form>
</div> </div>
</div> <?php
</div> if (get_field('zones_commerciaux', $post_ID)):
</div> $i = 0;
</div> while (has_sub_field('zones_commerciaux', $post_ID)) :
?>
<div class="commercial commercial-details" data-zone = "zone<?php echo $i; ?>">
<figure style="background-image:url(<?php the_sub_field('photo_commercial'); ?>)"></figure>
<?php the_sub_field('infos_commercial'); ?>
</div>
<?php
// list zones par commercial
if (get_sub_field('list_zones', $post_ID)):
$list_zone = array();
while (has_sub_field('list_zones', $post_ID)) :
$list_zone[]= get_sub_field('num_zone');
endwhile;
endif;
$i++;
endwhile;
endif;
?>
<span class="separation"></span>
<div class="details">
<div class="filter-bloc">
<div class="header">
<p><span>GMS</span></p>
</div>
<div class="bloc-content commercial-details">
<figure style="background-image:url(<?php echo get_field('photo_gms', $post_ID) ?>)"></figure>
<?php echo get_field('contact_gms', $post_ID) ?>
</div>
</div>
<div class="filter-bloc">
<div class="header">
<p><span>Groupement</span></p>
</div>
<div class="bloc-content commercial-details">
<figure style="background-image:url(<?php echo get_field('photo_groupement', $post_ID) ?>)"></figure>
<?php echo get_field('contact_groupement', $post_ID) ?>
</div>
</div>
</div>
</div> </div>
<div class="contact-form right border-l row gray-bg">
<div class="form-wrapper inner-form">
<div class="header-filter-contact on">
<h2>Je souhaite être <br> contacté</h2>
<span class="open-filter abs-full display--only-mobile"></span>
</div>
<?php echo do_shortcode( '[contact-form-7 id="558" title="Contact form"]' ); ?>
</div>
<div class="footer blue-bg abs font-small">
<h3 class="crete marker">Siège</h3>
<div class="content clearfix">
<div class="row left half-col">
<?php echo get_field('contact_adresse', $post_ID); ?>
</div>
<div class="row right half-col">
<?php echo get_field('contact_tel_fax', $post_ID); ?>
</div>
</div>
</div>
</div>
</div>
</div> </div>
<?php get_footer(); ?> <?php
\ No newline at end of file if (!(isset($_POST['ajax']))) {
get_template_part( 'footer', 'page-content' );
}
?>
</div> <!-- END right-container -->
<?php
if (!(isset($_POST['ajax']))) {
get_footer();
} ?>
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<li class="<?php if( !is_user_logged_in() ) echo " login-user"; else echo " to-slide";?>"><?php if ( is_user_logged_in() ) {?><a href="<?php echo get_permalink(3364);?>">photothèque</a><?php } else echo "<a>photothèque</a>"; ?></li> <li class="<?php if( !is_user_logged_in() ) echo " login-user"; else echo " to-slide";?>"><?php if ( is_user_logged_in() ) {?><a href="<?php echo get_permalink(3364);?>">photothèque</a><?php } else echo "<a>photothèque</a>"; ?></li>
<li class="to-slide"><a href="<?php echo get_permalink(171)?>">mentions légales</a></li> <li class="to-slide"><a href="<?php echo get_permalink(171)?>">mentions légales</a></li>
</ul> </ul>
</div> </div>
</div> </div>
</footer> </footer>
<div class="popup-container"> <div class="popup-container">
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<input type="password" name="pwd" id="pwd" placeholder = "Mot de passe" /> <input type="password" name="pwd" id="pwd" placeholder = "Mot de passe" />
<button class="btn rounded white-btn" type="submit" class="nl-btn">Se connecter</button> <button class="btn rounded white-btn" type="submit" class="nl-btn">Se connecter</button>
</form>--> </form>-->
<?php <?php
$popoup = array( $popoup = array(
'echo' => true, 'echo' => true,
// Default 'redirect' value takes the user back to the request URI. // Default 'redirect' value takes the user back to the request URI.
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
</div> </div>
</div> </div>
</div> </div>
<div id="loading-container-subpage"> <div id="loading-container-subpage" class = "loading-container-subpage">
<div class="loading-wrapper"> <div class="loading-wrapper">
<div class="loading"> <div class="loading">
<div id="loading-center-absolute"> <div id="loading-center-absolute">
......
<?php <?php
get_header(); get_header();
get_sidebar();
$url = nap_attachment_image($ID); $url = nap_attachment_image($ID);
?> ?>
<div id="home"> <div id="home">
<div class="container-bg abs-full hidden"></div>
<?php get_sidebar(); ?>
<div data-defaultimg ='<?php echo $url ;?>' class="transition img-wrapper" style ="background-image: url('<?php echo $url ;?>')"></div> <div data-defaultimg ='<?php echo $url ;?>' class="transition img-wrapper" style ="background-image: url('<?php echo $url ;?>')"></div>
<div class="header mobile-nav display--only-mobile blue-bg fixed">
<div class="nav-wrapper blue-bg">
<ul></ul>
</div>
</div>
<div class="right-container">
<div class="news-btn circle-btn add-icon font-small animated zoomIn"><span>Nouveautés</span></div> <div class="news-btn circle-btn add-icon font-small animated zoomIn"><span>Nouveautés</span></div>
<aside class="news-wrapper container "> <aside class="news-wrapper container ">
<div class="news-header crete"> <div class="news-header crete">
...@@ -17,34 +30,34 @@ $url = nap_attachment_image($ID); ...@@ -17,34 +30,34 @@ $url = nap_attachment_image($ID);
while ( has_sub_field('nap_nouveautes',135) ) : while ( has_sub_field('nap_nouveautes',135) ) :
?> ?>
<article class = "row <?php the_sub_field('nv_taille');?>"> <article class = "row <?php the_sub_field('nv_taille');?>">
<a href="<?php echo the_sub_field('nv_lien');?>"> <a href="<?php echo the_sub_field('nv_lien');?>">
<figure> <figure>
<img src="<?php the_sub_field('nv_image');?>" alt="Nouveautés"> <img src="<?php the_sub_field('nv_image');?>" alt="Nouveautés">
<figcaption> <figcaption>
<?php htmlspecialchars(the_sub_field('nv_titre'));?> <?php htmlspecialchars(the_sub_field('nv_titre'));?>
</figcaption> </figcaption>
</figure> </figure>
</a> </a>
</article> </article>
<?php <?php
endwhile; endwhile;
endif; endif;
?> ?>
</div>
</div> </aside>
</aside> <!--Menu for mobile-->
<!--Menu for mobile--> <div class="home-footer-nav display--only-mobile">
<div class="home-footer-nav display--only-mobile"> <div class="header">
<div class="header"> <div class="nav-wrapper footer-home-content">
<div class="nav-wrapper footer-home-content"> <div class="home-down-wrapper blue-bg"></div>
<div class="home-down-wrapper blue-bg"></div> <span class = "home-down chevron bottom hidden-elem pink-btn abs-center"></span>
<span class = "home-down chevron bottom hidden-elem pink-btn abs-center"></span>
</div>
</div> </div>
</div> </div>
</div><!--END home --> </div>
<?php </div><!--END home -->
</div>
<?php
get_footer(); get_footer();
...@@ -310,7 +310,7 @@ function nap_menu() { ...@@ -310,7 +310,7 @@ function nap_menu() {
} else { } else {
$nappe_sets = false; $nappe_sets = false;
} }
$menu.= '<li class ="parent-cat to-slide" data-page = "' . $category_id . '" data-img = "' . nap_category_image($category_id) . '"><a href="' . get_term_link($cat->slug, 'product_cat') . '">' . $cat->name . '</a>'; $menu.= '<li class ="parent-cat to-slide-cat" data-page = "' . $category_id . '" data-img = "' . nap_category_image($category_id) . '"><a href="' . get_term_link($cat->slug, 'product_cat') . '">' . $cat->name . '</a>';
$args2 = array( $args2 = array(
'taxonomy' => $taxonomy, 'taxonomy' => $taxonomy,
......
<?php
if (!defined('ABSPATH')) {
exit; // Exit if accessed directly
}
if (!(isset($_POST['ajax']))) {
get_header();
}
$product;
$cate = get_queried_object();
$extClass = "";
if (is_product_category()){
$cateID = $cate->term_id;
$id = "catalogue";
}else{
$cateID = get_the_ID();
$id = 'cat-'.$cateID;
}
if ($cateID == 154){ //page stories
$extClass = "full-slides right";
}
?>
<div class="container clearfix" id="<?php echo $id ?>" data-page = "<?php echo $cateID; ?>">
<?php if (!(isset($_POST['ajax']))) { ?>
<?php if ($cateID == 154){ //page stories ?>
<div class="container-bg abs-full" style="background-image: url('<?php echo nap_attachment_image(154);?>')"></div>
<?php } else { ?>
<div class="container-bg abs-full"></div>
<?php } ?>
<?php get_sidebar(); } ?>
<?php if (is_product_category()){ ?>
<div class="header mobile-nav display--only-mobile blue-bg fixed">
<div class="nav-wrapper blue-bg">
<ul></ul>
</div>
</div>
<?php } // is_product_category ?>
<div class="right-container <?php echo $extClass ?>">
...@@ -32,4 +32,3 @@ ...@@ -32,4 +32,3 @@
</div> </div>
</div> </div>
<div class="main"> <div class="main">
<div class="nav-content font-big"> <div class="nav-content font-big">
<?php <?php
$arrow = 'arrow-white nav-page'; $arrow = 'arrow-white nav-page';
if (isset($current_page) and $current_page == 'phototheque') { if (isset($current_page) and $current_page == 'phototheque') {
$arrow = 'arrow-blue phototheque'; $arrow = 'arrow-blue phototheque';
} }
?> ?>
<ul class = "main-list-nav <?php echo $arrow ?>">
<ul class = "main-list-nav <?php echo $arrow ?>"> <?php echo nap_menu(); ?>
<li class="to-slide-cat" data-page = "151" data-img = "<?php echo nap_attachment_image(151);?>"><a href="<?php echo get_permalink(151);?>">Personnalisation</a></li>
<?php echo nap_menu(); ?> </ul>
<?php if (!(isset($current_page) and $current_page == 'phototheque')) { ?>
<li class="to-slide" data-page = "uniqpaper" data-img = "<?php echo nap_attachment_image(151);?>"><a href="<?php echo get_permalink(151);?>">Personnalisation</a></li> <ul class= "font-medium arrow-pink pink-list">
<li class="to-slide-cat" data-page = "154" data-img = "<?php echo nap_attachment_image(154);?>"><a href="<?php echo get_permalink(154);?>">Stories</a></li>
<li class="to-slide-cat" data-page = "157" data-img = "<?php echo nap_attachment_image(157);?>" ><a href="<?php echo get_permalink(157);?>">Contact</a></li>
</ul> </ul>
<?php if (!(isset($current_page) and $current_page == 'phototheque')) { ?> <?php } ?>
<ul class= "font-medium arrow-pink pink-list">
<li class="to-slide" data-page = "stories" data-img = "<?php echo nap_attachment_image(154);?>"><a href="<?php echo get_permalink(154);?>">Stories</a></li>
<li class="to-slide" data-page = "contact" data-img = "<?php echo nap_attachment_image(157);?>" ><a href="<?php echo get_permalink(157);?>">Contact</a></li>
</ul>
<?php } ?>
</div> </div>
<?php <?php
/** /**
* Template Name: Stories * Template Name: Stories
* *
*/ */
get_header(); $post_ID = get_the_ID();
if (!(isset($_POST['ajax']))) {
get_template_part( 'header', 'page-content' );
}
?> ?>
<div class="container clearfix" data-page = "stories"> <div class="hidden data-elem" data-postid ="cat-<?php echo $post_ID ?>" data-page = "<?php echo $post_ID ?>" data-class="full-slides right"></div>
<div class="container-bg abs-full" style="background-image: url('<?php echo nap_attachment_image(154);?>')"></div> <div id="fullpage">
<?php get_sidebar(); ?> <span class = "moveDown chevron bottom hidden-elem"></span>
<div class="full-slides right-container right"> <?php
<div id="fullpage"> if (get_field('stories', 154)):
<span class = "moveDown chevron bottom hidden-elem"></span> while (has_sub_field('stories', 154)) :
<?php ?>
if (get_field('stories', 154)): <div class="section " style = "background-image:url('<?php the_sub_field('st_image'); ?>')">
<div class="bloc">
while (has_sub_field('stories', 154)) : <div class="header-bloc">
?> <span>01</span>
<div class="section " style = "background-image:url('<?php the_sub_field('st_image'); ?>')"> <h2><?php the_sub_field('st_titre'); ?></h2>
<div class="bloc"> </div>
<div class="header-bloc"> <div class="desc-content">
<span>01</span> <h3><?php the_sub_field('st_citation'); ?></h3>
<h2><?php the_sub_field('st_titre'); ?></h2> <?php htmlspecialchars(the_sub_field('st_texte')); ?>
</div> </div>
<div class="desc-content">
<h3><?php the_sub_field('st_citation'); ?></h3>
<?php htmlspecialchars(the_sub_field('st_texte')); ?>
</div>
</div>
</div>
<?php
endwhile;
endif;
?>
</div> </div>
</div> </div>
<?php
endwhile;
endif;
?>
</div> </div>
<?php <?php
get_footer(); if (!(isset($_POST['ajax']))) {
get_template_part( 'footer', 'page-content' );
}
?>
<?php <?php
/** /**
* Template Name: Personnalisation * Template Name: Personnalisation
* *
*/ */
get_header(); ?> $post_ID = get_the_ID();
<div class="container clearfix" id="uniqpaper" data-page = "uniqpaper"> if (!(isset($_POST['ajax']))) {
<div class="container-bg abs-full"></div> get_template_part( 'header', 'page-content' );
<?php get_sidebar(); ?> }
<div class="right-container"> ?>
<div class="left-panel fixed-full position--after-menu "> <div class="hidden data-elem" data-postid ="cat-<?php echo $post_ID ?>" data-page = "<?php echo $post_ID ?>"></div>
<div class="cover-wrapper abs-full transition" style = "background-image: url('<?php echo get_field('pers_image',151)?>')"></div> <div class="left-panel fixed-full position--after-menu ">
<div class="abs floated-bloc"> <div class="cover-wrapper abs-full transition" style = "background-image: url('<?php echo get_field('pers_image',151)?>')"></div>
<h2><?php echo get_field('pers_titre',151)?></h2> <div class="abs floated-bloc">
<div class="text-content"><?php echo get_field('pers_texte',151)?></div> <h2><?php echo get_field('pers_titre',151)?></h2>
</div> <div class="text-content"><?php echo get_field('pers_texte',151)?></div>
</div>
</div> </div>
<div class="right-panel right"> </div>
<div class="form-wrapper clearfix"> <div class="right-panel right">
<!--<form action="#" method="POST"> <div class="form-wrapper clearfix">
<h2>Information sur le produit</h2> <?php echo do_shortcode( '[contact-form-7 id="663" title="Personnalisation form"]' ); ?>
<textarea name = "description" placeholder="Describe yourself here..."> </textarea>
<h2>Vos coordonnées</h2>
<div class="clearfix">
<div class="row left half-col">
<input placeholder = "Nom" type="text" name="name" id="name" value="" />
<input placeholder = "Prénom" type="text" name="fname" id="fname" value="" />
<input placeholder = "Société" type="text" name="soc" id="soc" value="" />
</div>
<div class="row right half-col">
<input placeholder = "Mail" type="text" name="mail" id="mail" value="" />
<input placeholder = "Téléphone" type="text" name="phone" id="phone" value="" />
</div>
</div>
<div class="center">
<input type = "submit" class="btn pink-btn rounded" value = 'Envoyer'>
</div>
</form>-->
<?php echo do_shortcode( '[contact-form-7 id="663" title="Personnalisation form"]' ); ?>
</div>
</div> </div>
</div> </div>
<?php get_footer(); <?php
\ No newline at end of file if (!(isset($_POST['ajax']))) {
get_template_part( 'footer', 'page-content' );
}
?>
<?php <?php
//print_r($_GET); //print_r($_GET);
/** /**
* The Template for displaying product archives, including the main shop page which is a post type archive * The Template for displaying product archives, including the main shop page which is a post type archive
* *
* This template can be overridden by copying it to yourtheme/woocommerce/archive-product.php. * This template can be overridden by copying it to yourtheme/woocommerce/archive-product.php.
* *
* HOWEVER, on occasion WooCommerce will need to update template files and you * HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to * (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does * maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and * happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes. * the readme will list any important changes.
* *
* @see https://docs.woocommerce.com/document/template-structure/ * @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes * @author WooThemes
* @package WooCommerce/Templates * @package WooCommerce/Templates
* @version 2.0.0 * @version 2.0.0
*/ */
if (!defined('ABSPATH')) { ?>
exit; // Exit if accessed directly <?php
} $product;
$current_page = 'catalogue'; $cate = get_queried_object();
if (!(isset($_POST['ajax']))) { if (!(isset($_POST['ajax']))) {
get_header(); set_query_var( 'cateID',$cate->term_id);
get_template_part( 'header', 'page-content' );
} }
$current_page = 'catalogue';
$product; $product;
$cate = get_queried_object(); $cate = get_queried_object();
$cateID = $cate->term_id; $cateID = $cate->term_id;
//SubCats //SubCats
# JC 20170901 # JC 20170901
#$child_category = get_terms('product_cat', array('parent' => $cateID, 'child_of' => the_category_ID(), 'exclude' => $cateID, 'orderby' => 'title', 'order' => 'ASC')); #$child_category = get_terms('product_cat', array('parent' => $cateID, 'child_of' => the_category_ID(), 'exclude' => $cateID, 'orderby' => 'title', 'order' => 'ASC'));
$child_category = get_terms('product_cat', array('parent' => $cateID, 'child_of' => the_category_ID(), 'exclude' => $cateID, 'orderby' => 'meta_value_num', 'meta_key' => 'order', 'order' => 'ASC')); $child_category = get_terms('product_cat', array('parent' => $cateID, 'child_of' => the_category_ID(), 'exclude' => $cateID, 'orderby' => 'meta_value_num', 'meta_key' => 'order', 'order' => 'ASC'));
# JC 20170901 end # JC 20170901 end
?> ?>
<div class="left-panel fixed-full position--after-menu catlog-panel">
<?php if ($cateID != 20): ?>
<div class="filter-wrapper">
<div class="filter-btn fixed position--after-menu">
<div class="btn-container"><span class="abs-center font-small">Filtres</span></div>
</div>
<div class="filter-content">
<div class="filter-list fixed position--after-menu">
<div class="top-header">
<span>Filtres</span>
<span class="close-btn"></span>
</div>
<input type="text" name ="sku-search" placeholder="Référence" id="sku-search"/>
<?php
$attributes = array('Univers' => 'pa_univers', 'Matiére' => 'pa_matiere', 'Format' => 'pa_format', 'Couleurs' => 'pa_couleur');
foreach ($attributes as $key => $value) :
?>
<div class="filter-bloc <?php if ($_GET[$value] != '') echo 'active selected-filter'; ?>">
<div class="header">
<p><span><?php echo $key ?></span></p>
</div>
<div class="container clearfix" id="catalogue" data-page = "<?php echo $cateID; ?>"> <?php
<?php if (!(isset($_POST['ajax']))) { ?> $terms = nap_attribute_by_category($cateID, $value);
<div class="container-bg abs-full"></div> if ($value == 'pa_couleur') {
<?php get_sidebar(); } ?> $all_terms = get_terms($value);
<div class="header mobile-nav display--only-mobile blue-bg fixed">
<div class="nav-wrapper blue-bg">
<ul></ul>
</div>
</div>
<div class="right-container">
<div class="left-panel fixed-full position--after-menu ">
<?php if ($cateID != 20): ?>
<div class="filter-wrapper">
<div class="filter-btn fixed position--after-menu">
<div class="btn-container"><span class="abs-center font-small">Filtres</span></div>
</div>
<div class="filter-content">
<div class="filter-list fixed position--after-menu">
<div class="top-header">
<span>Filtres</span>
<span class="close-btn"></span>
</div>
<input type="text" name ="sku-search" placeholder="Référence" id="sku-search"/>
<?php
$attributes = array('Univers' => 'pa_univers', 'Matiére' => 'pa_matiere', 'Format' => 'pa_format', 'Couleurs' => 'pa_couleur');
foreach ($attributes as $key => $value) :
?>
<div class="filter-bloc <?php if ($_GET[$value] != '') echo 'active selected-filter'; ?>">
<div class="header">
<p><span><?php echo $key ?></span></p>
</div>
<?php
$terms = nap_attribute_by_category($cateID, $value);
if ($value == 'pa_couleur') {
$all_terms = get_terms($value);
$colors_ids = array();
foreach($all_terms as $k => $v) {
$colors_ids[$v->name] = $v->term_id;
}
$color_by_category = array_intersect($colors_ids, $terms);
}
if (!empty($terms) && !is_wp_error($terms)):
?>
<div class="bloc-content">
<ul <?php if ($value == 'pa_couleur') echo 'class = "list-color-filter clearfix"'; ?> id="<?php echo $value; ?>">
<?php
$colors = array();
foreach ( $terms as $term) :
if ($value == 'pa_couleur'):
// var_dump($color_by_category);
$name_color = array_search($term,$color_by_category);
$colors[$name_color] = get_field('couleurs', 'pa_couleur_' . $term);
//print_r($colors);
else :
$filter_format = nap_selected_filter($_GET['pa_format'], $term);
$filter_matiere = nap_selected_filter($_GET['pa_matiere'], $term);
$filter_univers = nap_selected_filter($_GET['pa_univers'], $term);
?>
<li class="<?php echo $filter_format . ' ' . $filter_matiere .' '.$filter_univers ?>"><?php echo $term; ?></li>
<?php
endif;
endforeach;
foreach (array_unique($colors) as $name => $code) {
if (isset($code) && strlen($code) > 0):
$filter_class = nap_selected_filter($_GET['pa_couleur'], $code);
?>
<li data-color = "<?php echo $code; ?>" class="<?php echo $name . ' ' . $filter_class; ?>"></li>
<?php
endif;
}
if ($value == 'pa_couleur'):
?>
<li class="reinit">Tout déselectionner</li>
<?php endif; ?>
</ul>
</div>
<?php endif; ?>
</div>
<?php endforeach; ?>
$colors_ids = array();
foreach($all_terms as $k => $v) {
$colors_ids[$v->name] = $v->term_id;
}
$color_by_category = array_intersect($colors_ids, $terms);
<div class="center filter-btn-list"> }
<div class="btn pink-btn rounded" id="search-btn">Rechercher</div> if (!empty($terms) && !is_wp_error($terms)):
<span class = "reinit-all">Effacer les filtres</span>
</div>
</div>
</div>
</div>
<?php endif; ?>
<?php
foreach ($child_category as $key => $value) :
?> ?>
<div class="cover-wrapper abs-full transition" data-cat = "#cat<?php echo $value->term_id ?>" style = "background-image: url('<?php echo nap_category_image($value->term_id) ?>')"> <div class="bloc-content">
<div class="cover-desc-wrapper"> <ul <?php if ($value == 'pa_couleur') echo 'class = "list-color-filter clearfix"'; ?> id="<?php echo $value; ?>">
<?php if ($value->description){ ?> <?php
<p><?php echo $value->description; ?></p> $colors = array();
<?php } ?>
</div> foreach ( $terms as $term) :
</div>
<?php if ($value == 'pa_couleur'):
endforeach; // var_dump($color_by_category);
?> $name_color = array_search($term,$color_by_category);
</div> $colors[$name_color] = get_field('couleurs', 'pa_couleur_' . $term);
<div class="right-panel right"> //print_r($colors);
<div class="panel panel-content list-animation"> else :
<?php if ($_GET['pa_couleur'] != '' || $_GET['pa_format'] != '' || $_GET['pa_matiere'] != '' || $_GET['pa_univers'] != '' || $_GET['sku'] != ''): ?> $filter_format = nap_selected_filter($_GET['pa_format'], $term);
<span class="search_result">Résultat de votre recherche :<span class="search_notfound" style="color:#ff6a5f"></span></span> $filter_matiere = nap_selected_filter($_GET['pa_matiere'], $term);
$filter_univers = nap_selected_filter($_GET['pa_univers'], $term);
?>
<li class="<?php echo $filter_format . ' ' . $filter_matiere .' '.$filter_univers ?>"><?php echo $term; ?></li>
<?php
endif;
endforeach;
foreach (array_unique($colors) as $name => $code) {
if (isset($code) && strlen($code) > 0):
$filter_class = nap_selected_filter($_GET['pa_couleur'], $code);
?>
<li data-color = "<?php echo $code; ?>" class="<?php echo $name . ' ' . $filter_class; ?>"></li>
<?php
endif;
}
if ($value == 'pa_couleur'):
?>
<li class="reinit">Tout déselectionner</li>
<?php endif; ?>
</ul>
</div>
<?php endif; ?> <?php endif; ?>
</div>
<?php foreach ($child_category as $key => $value) : ?> <?php endforeach; ?>
<div class="center filter-btn-list">
<section id = "cat<?php echo $value->term_id ?>"> <div class="btn pink-btn rounded" id="search-btn">Rechercher</div>
<h2 class="crete small-title"><?php echo $value->name ?></h2> <span class = "reinit-all">Effacer les filtres</span>
<div class="cover-mobile display--only-mobile animated fadeInUp" style = "background-image: url('<?php echo nap_category_image($value->term_id) ?>')">
<div class="cover-desc-wrapper">
<p><?php echo $value->description; ?></p>
</div>
</div>
<div class="product-list">
<?php
# JC 20170901
#$args = array('post_type' => 'product', 'stock' => 1, 'posts_per_page' => -1, 'product_cat' => $value->name, 'orderby' => 'title' 'order' => 'ASC');
$args = array('post_type' => 'product', 'stock' => 1, 'posts_per_page' => -1, 'product_cat' => $value->name, 'orderby' => array('menu_order' => 'ASC', title => 'ASC')); #, 'order' => 'ASC');
# JC 20170901 end
$naps_posts = new WP_Query($args);
$options = array();
while ($naps_posts->have_posts()) : $naps_posts->the_post();
$id = get_the_ID();
$list_att = array();
$options['size'] = (get_field('produit_affichage', $id)) ? get_field('produit_affichage', $id) : 'small';
$args = array(
'post_type' => array('product', 'product_variation'),
'post_status' => array('publish'),
'numberposts' => -1,
'orderby' => 'menu_order',
'order' => 'asc',
'post_parent' => $id
);
$attribute_value['pa_couleur'] = get_the_terms($id, 'pa_couleur');
$attribute_value['pa_format'] = get_the_terms($id, 'pa_format');
$attribute_value['pa_matiere'] = get_the_terms($id, 'pa_matiere');
$attribute_value['pa_univers'] = get_the_terms($id, 'pa_univers');
//var_dump($attribute_value['pa_format']);
if (is_array($attribute_value['pa_format'])) {
$list_formats ='';
foreach ($attribute_value['pa_format'] as $key => $value) {
$list_formats .= $value->name.',';
}
$list_att['pa_format'] = explode(',',$list_formats);
}
if ($_GET) {
if (is_array($attribute_value['pa_couleur'])) {
$list_couleurs ='';
foreach ($attribute_value['pa_couleur'] as $key => $value) {
// $list_att['pa_couleur'] = nap_color_attribute($value->slug);
$list_couleurs .= nap_color_attribute($value->slug).',';
}
$list_att['pa_couleur'] = explode(',',$list_couleurs);
}
if (is_array($attribute_value['pa_format'])) {
$list_formats ='';
foreach ($attribute_value['pa_format'] as $key => $value) {
$list_formats .= $value->name.',';
}
$list_att['pa_format'] = explode(',',$list_formats);
}
if (is_array($attribute_value['pa_matiere'])) {
foreach ($attribute_value['pa_matiere'] as $key => $value) {
$list_att['pa_matiere'] = $value->name;
}
}
if (is_array($attribute_value['pa_univers'])) {
foreach ($attribute_value['pa_univers'] as $key => $value) {
$list_att['pa_univers'] = $value->name;
}
}
nap_filter_attribute($id, $args, $options, $list_att, $_GET);
} else {
echo nap_get_item($id, $args, $current_page, $options);
}
endwhile;
wp_reset_query();
?>
</div>
</section>
<?php endforeach; ?>
</div> </div>
</div>
</div>
</div>
<?php endif; ?>
<?php
foreach ($child_category as $key => $value) :
?>
<div class="cover-wrapper abs-full transition" data-cat = "#cat<?php echo $value->term_id ?>" style = "background-image: url('<?php echo nap_category_image($value->term_id) ?>')">
<div class="cover-desc-wrapper">
<?php if ($value->description){ ?>
<p><?php echo $value->description; ?></p>
<?php } ?>
</div> </div>
</div> </div>
<?php
endforeach;
?>
</div>
<div class="right-panel right">
<div class="panel panel-content list-animation">
<?php if ($_GET['pa_couleur'] != '' || $_GET['pa_format'] != '' || $_GET['pa_matiere'] != '' || $_GET['pa_univers'] != '' || $_GET['sku'] != ''): ?>
<span class="search_result">Résultat de votre recherche :<span class="search_notfound" style="color:#ff6a5f"></span></span>
<?php endif; ?>
<?php foreach ($child_category as $key => $value) : ?>
<section id = "cat<?php echo $value->term_id ?>">
<h2 class="crete small-title"><?php echo $value->name ?></h2>
<div class="cover-mobile display--only-mobile animated fadeInUp" style = "background-image: url('<?php echo nap_category_image($value->term_id) ?>')">
<div class="cover-desc-wrapper">
<p><?php echo $value->description; ?></p>
</div>
</div>
<div class="product-list">
<?php
# JC 20170901
#$args = array('post_type' => 'product', 'stock' => 1, 'posts_per_page' => -1, 'product_cat' => $value->name, 'orderby' => 'title' 'order' => 'ASC');
$args = array('post_type' => 'product', 'stock' => 1, 'posts_per_page' => -1, 'product_cat' => $value->name, 'orderby' => array('menu_order' => 'ASC', title => 'ASC')); #, 'order' => 'ASC');
# JC 20170901 end
$naps_posts = new WP_Query($args);
$options = array();
while ($naps_posts->have_posts()) : $naps_posts->the_post();
$id = get_the_ID();
$list_att = array();
$options['size'] = (get_field('produit_affichage', $id)) ? get_field('produit_affichage', $id) : 'small';
$args = array(
'post_type' => array('product', 'product_variation'),
'post_status' => array('publish'),
'numberposts' => -1,
'orderby' => 'menu_order',
'order' => 'asc',
'post_parent' => $id
);
$attribute_value['pa_couleur'] = get_the_terms($id, 'pa_couleur');
$attribute_value['pa_format'] = get_the_terms($id, 'pa_format');
$attribute_value['pa_matiere'] = get_the_terms($id, 'pa_matiere');
$attribute_value['pa_univers'] = get_the_terms($id, 'pa_univers');
//var_dump($attribute_value['pa_format']);
if (is_array($attribute_value['pa_format'])) {
$list_formats ='';
foreach ($attribute_value['pa_format'] as $key => $value) {
$list_formats .= $value->name.',';
}
$list_att['pa_format'] = explode(',',$list_formats);
}
if ($_GET) {
if (is_array($attribute_value['pa_couleur'])) {
$list_couleurs ='';
foreach ($attribute_value['pa_couleur'] as $key => $value) {
// $list_att['pa_couleur'] = nap_color_attribute($value->slug);
$list_couleurs .= nap_color_attribute($value->slug).',';
}
$list_att['pa_couleur'] = explode(',',$list_couleurs);
}
if (is_array($attribute_value['pa_format'])) {
$list_formats ='';
foreach ($attribute_value['pa_format'] as $key => $value) {
$list_formats .= $value->name.',';
}
$list_att['pa_format'] = explode(',',$list_formats);
}
if (is_array($attribute_value['pa_matiere'])) {
foreach ($attribute_value['pa_matiere'] as $key => $value) {
$list_att['pa_matiere'] = $value->name;
}
}
if (is_array($attribute_value['pa_univers'])) {
foreach ($attribute_value['pa_univers'] as $key => $value) {
$list_att['pa_univers'] = $value->name;
}
}
nap_filter_attribute($id, $args, $options, $list_att, $_GET);
} else {
echo nap_get_item($id, $args, $current_page, $options);
}
endwhile;
wp_reset_query();
?>
</div>
</section>
<?php endforeach; ?>
</div>
</div> </div>
<?php <?php
if (!(isset($_POST['ajax']))) { if (!(isset($_POST['ajax']))) {
get_footer(); get_template_part( 'footer', 'page-content' );
} ?> }
?>
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