Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
N
NAP-wordpress
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Marwa Sfari
NAP-wordpress
Commits
2fc92e00
Commit
2fc92e00
authored
Sep 20, 2017
by
imac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update]Redmine #649 : Structural change + fixed menu
parent
76e735c6
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
1272 additions
and
1240 deletions
+1272
-1240
main.css
wp-content/themes/nap/assets/css/main.css
+10
-5
responsive.css
wp-content/themes/nap/assets/css/responsive.css
+15
-3
main.js
wp-content/themes/nap/assets/js/main.js
+768
-729
nap.js
wp-content/themes/nap/assets/js/nap.js
+14
-14
contact.php
wp-content/themes/nap/contact.php
+109
-133
footer-page-content.php
wp-content/themes/nap/footer-page-content.php
+5
-0
footer.php
wp-content/themes/nap/footer.php
+3
-3
front-page.php
wp-content/themes/nap/front-page.php
+40
-27
functions.php
wp-content/themes/nap/functions.php
+1
-1
header-page-content.php
wp-content/themes/nap/header-page-content.php
+38
-0
header.php
wp-content/themes/nap/header.php
+0
-1
nav-list.php
wp-content/themes/nap/nav-list.php
+15
-18
stories.php
wp-content/themes/nap/stories.php
+33
-35
uniqpaper.php
wp-content/themes/nap/uniqpaper.php
+24
-41
archive-product.php
wp-content/themes/nap/woocommerce/archive-product.php
+197
-230
No files found.
wp-content/themes/nap/assets/css/main.css
View file @
2fc92e00
...
...
@@ -954,9 +954,7 @@ footer{
/* ==========================================================================
VII/ Pages...............ALL pages
========================================================================== */
/* --------------*/
/* ---------->>> HOME <<<-----------*/
/* --------------*/
#home
{
position
:
relative
;
height
:
100%
;
...
...
@@ -970,6 +968,10 @@ VII/ Pages...............ALL pages
.img-wrapper
img
{
display
:
none
;
}
#home
.img-wrapper.fixed
{
position
:
fixed
;
left
:
0
;
}
.news-btn
{
position
:
absolute
;
top
:
50px
;
...
...
@@ -1782,7 +1784,7 @@ label.chevron.bottom::first-letter {
}
.container-bg
{
position
:
fixed
;
z-index
:
99
;
z-index
:
99
99999
;
background-size
:
cover
;
opacity
:
0
;
}
...
...
@@ -2169,6 +2171,9 @@ label.chevron.bottom::first-letter {
padding
:
0px
10px
0px
15px
;
padding-bottom
:
100px
;
}
.right-container
.contact-wrapper
.right-panel
{
padding
:
0px
;
}
.panel
section
>
h2
{
padding-top
:
80px
;
}
...
...
@@ -2295,10 +2300,10 @@ label.chevron.bottom::first-letter {
padding-top
:
30px
;
}
/* --------------*/
/* ---------->>> Uniqpaper <<<-----------*/
/* --------------*/
#
uniqpaper
.cover-wrapper
{
#
cat-151
.cover-wrapper
{
top
:
0
;
}
#
uniqpaper
.right-container
.left-panel
{
#
cat-151
.right-container
.left-panel
{
width
:
47.2%
;
}
.floated-bloc
{
...
...
wp-content/themes/nap/assets/css/responsive.css
View file @
2fc92e00
...
...
@@ -201,7 +201,7 @@
padding
:
65px
20px
;
}
/*Uniqpaper*/
#
uniqpaper
.right-container
.left-panel
{
#
cat-151
.right-container
.left-panel
{
width
:
34%
;
}
.floated-bloc
{
...
...
@@ -219,6 +219,9 @@
.contact-form
.footer
{
padding
:
30px
22px
32px
;
}
.right-container
.contact-wrapper
.right-panel
{
padding
:
0px
;
}
/* Catalogue */
.right-container
.left-panel
{
width
:
37%
;
...
...
@@ -288,6 +291,9 @@
.right-panel-wrapper
{
top
:
0px
!important
;
}
.container-bg
{
height
:
auto
!important
;
}
}
@media
screen
and
(
max-width
:
860px
)
{
/* general */
...
...
@@ -317,6 +323,12 @@
.rounded
{
padding
:
8px
22px
11px
;
}
.mobile-nav
{
display
:
none
;
}
#catalogue
.mobile-nav
{
display
:
block
;
}
/* Helper */
.close-btn
{
top
:
15px
;
...
...
@@ -388,12 +400,12 @@
letter-spacing
:
0px
;
}
/*Uniqpaper*/
#
uniqpaper
.right-container
.left-panel
{
#
cat-151
.right-container
.left-panel
{
position
:
relative
;
width
:
100%
;
left
:
initial
!important
;
}
#
uniqpaper
.cover-wrapper
{
#
cat-151
.cover-wrapper
{
display
:
block
;
}
.floated-bloc
{
...
...
wp-content/themes/nap/assets/js/main.js
View file @
2fc92e00
...
...
@@ -3,788 +3,827 @@ var initFunction = function() {
};
//END init Function
(
function
(
$
)
{
$
(
function
()
{
//Stop jump tag
$
(
document
).
find
(
'a[href^="#"], .easyzoom a'
).
click
(
function
(
e
)
{
e
.
preventDefault
();
});
$
(
document
).
find
(
'.contact-form .open-filter'
).
on
(
'click'
,
function
()
{
$
(
'.contact-form form'
).
slideToggle
();
$
(
this
).
parent
().
toggleClass
(
'on'
);
checkFilterContactWrapper
();
})
//Open Menu
var
toggles
=
document
.
querySelectorAll
(
".c-hamburger"
);
for
(
var
i
=
toggles
.
length
-
1
;
i
>=
0
;
i
--
)
{
var
toggle
=
toggles
[
i
];
toggleHandler
(
toggle
);
$
(
function
()
{
//Stop jump tag
$
(
document
).
find
(
'a[href^="#"], .easyzoom a'
).
click
(
function
(
e
)
{
e
.
preventDefault
();
});
$
(
document
).
find
(
'.contact-form .open-filter'
).
on
(
'click'
,
function
()
{
$
(
'.contact-form form'
).
slideToggle
();
$
(
this
).
parent
().
toggleClass
(
'on'
);
checkFilterContactWrapper
();
})
//Open Menu
var
toggles
=
document
.
querySelectorAll
(
".c-hamburger"
);
for
(
var
i
=
toggles
.
length
-
1
;
i
>=
0
;
i
--
)
{
var
toggle
=
toggles
[
i
];
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'
);
}
;
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
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
)
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
()
{
if
(
$
(
'body'
).
find
(
'header'
).
length
>
1
)
{
$
(
'body'
).
find
(
'header'
).
last
().
parent
().
remove
();
$
(
'.right-panel-wrapper'
).
css
(
'top'
,
$
(
'.nav-header'
).
outerHeight
());
$
(
'html'
).
css
(
'overflow'
,
'auto'
);
}
//$('.load-page').removeClass('fadeOutUp').addClass('animated fadeInUp')
$
(
'ul.phototheque'
).
find
(
'li'
).
first
().
addClass
(
'current'
);
$
(
'ul.phototheque'
).
find
(
'li'
).
first
().
find
(
'.subcat'
).
slideDown
(
'slow'
);
var
product
=
$
(
'.list-animation article'
);
// TODO: Remove init classes , init attr on html
product
.
find
(
'figure img,ul,h3,.new,.download-btn'
).
attr
({
'data-animate'
:
""
,
'data-animation-classes'
:
"animated fadeIn"
});
animateOnScroll
();
if
(
$
(
document
).
find
(
'#load-page'
).
children
().
length
)
{
scrollAnchor
(
"#load-page"
,
true
);
elemToScroll
=
$
(
document
).
find
(
"#load-page"
);
}
else
{
elemToScroll
=
$
(
document
).
find
(
".main"
);
scrollAnchor
(
'body'
,
true
);
}
elemToScroll
.
on
(
"scroll"
,
onScroll
);
document
.
getElementById
(
'load-page'
).
addEventListener
(
'scroll'
,
window
.
scrollAnimation
.
throttledEvent
,
false
);
$
(
document
).
find
(
'ul.main-list-nav'
).
on
(
'click'
,
' li.parent-cat>a'
,
function
(
e
)
{
var
windowWidth
=
$
(
window
).
width
();
e
.
preventDefault
();
e
.
stopPropagation
();
$
(
'.main-list-nav>li'
).
removeClass
(
'current'
);
$
(
this
).
parent
().
addClass
(
'current'
);
//if (windowWidth < 860){
//$('.nav-phototeque .nav-content>ul>li').addClass('animated fadeOutLeft');
//$('.nav-phototeque .nav-content li.current').removeClass('fadeOutLeft').addClass('fadeInRight');
//$('.nav-phototeque .nav-content li.current ul').removeClass('fadeOutLeft').addClass('fadeInRight');
//$('.nav-phototeque .nav-content li.current ul').css('display','inline-block !important');
//.phototheque-content nav li
//}else{
$
(
'.main-list-nav .subcat'
).
stop
().
slideUp
(
'slow'
);
// $('.main-list-nav .off .subcat').slideUp();
$
(
this
).
parent
().
find
(
'.subcat'
).
stop
().
slideDown
(
'slow'
);
//}
});
setTimeout
(
function
()
{
$
(
'.gallery-wrapper'
).
removeClass
(
'hidden-elem'
).
addClass
(
'animated visible-elem fadeInUp'
);
$
.
fn
.
responsive
();
},
100
);
}
function
appendLoading
()
{
$
(
'.load-page'
).
append
(
$
(
'#loading-container-subpage'
).
clone
());
$
(
'#loading-container-subpage'
).
show
();
setTimeout
(
function
()
{
checkFooterNavPosition
();
},
330
)
nav
.
stop
().
slideToggle
();
});
}
$
.
fn
.
loadPageContent
=
function
()
{
if
(
$
(
'body'
).
find
(
'header'
).
length
>
1
)
{
$
(
'body'
).
find
(
'header'
).
last
().
parent
().
remove
();
$
(
'.right-panel-wrapper'
).
css
(
'top'
,
$
(
'.nav-header'
).
outerHeight
());
$
(
'html'
).
css
(
'overflow'
,
'auto'
);
}
//$('.load-page').removeClass('fadeOutUp').addClass('animated fadeInUp')
$
(
'ul.phototheque'
).
find
(
'li'
).
first
().
addClass
(
'current'
);
$
(
'ul.phototheque'
).
find
(
'li'
).
first
().
find
(
'.subcat'
).
slideDown
(
'slow'
);
var
product
=
$
(
'.list-animation article'
);
// TODO: Remove init classes , init attr on html
product
.
find
(
'figure img,ul,h3,.new,.download-btn'
).
attr
({
'data-animate'
:
""
,
'data-animation-classes'
:
"animated fadeIn"
});
animateOnScroll
();
if
(
$
(
document
).
find
(
'#load-page'
).
children
().
length
)
{
scrollAnchor
(
"#load-page"
,
true
);
elemToScroll
=
$
(
document
).
find
(
"#load-page"
);
}
else
{
elemToScroll
=
$
(
document
).
find
(
".main"
);
scrollAnchor
(
'body'
,
true
);
}
elemToScroll
.
on
(
"scroll"
,
onScroll
);
document
.
getElementById
(
'load-page'
).
addEventListener
(
'scroll'
,
window
.
scrollAnimation
.
throttledEvent
,
false
);
$
(
document
).
find
(
'ul.main-list-nav'
).
on
(
'click'
,
' li.parent-cat>a'
,
function
(
e
)
{
var
windowWidth
=
$
(
window
).
width
();
if
(
windowWidth
>
860
)
{
e
.
preventDefault
();
}
//load content page on left Panel
$
(
document
).
find
(
'.to-slide'
).
on
(
'click'
,
'a'
,
function
(
e
)
{
$
(
'html'
).
css
(
'overflow'
,
'hidden'
);
appendLoading
();
e
.
preventDefault
();
var
link
=
$
(
this
).
attr
(
"href"
),
windowWidth
=
$
(
window
).
width
();
if
(
$
(
this
).
parent
().
parent
().
hasClass
(
'nav-page'
))
{
$
(
document
).
find
(
'.right-container'
).
first
().
remove
();
$
(
'.load-page'
).
parent
().
css
({
'left'
:
$
(
'.nav-wrapper'
).
outerWidth
()
});
$
(
'.load-page'
).
css
(
'opacity'
,
1
);
$
(
document
).
find
(
'#loading-container-subpage'
).
css
({
'left'
:
$
(
'.nav-wrapper'
).
outerWidth
(),
'width'
:
'calc(100% - '
+
$
(
'.nav-wrapper'
).
outerWidth
()
+
'px)'
,
})
/**/
$
(
'nav ul li'
).
removeClass
(
'current'
).
addClass
(
'off'
);
$
(
this
).
parent
().
addClass
(
'current'
);
/**/
}
else
{
$
(
'.load-page'
).
parent
().
css
({
'left'
:
0
,
});
$
(
'.load-page'
).
parent
().
addClass
(
'active'
);
}
history
.
pushState
(
null
,
null
,
link
);
$
(
'.load-page'
).
load
(
link
,
{
'ajax'
:
1
},
function
()
{
$
.
fn
.
loadPageContent
();
$
.
fn
.
responsive
();
$
.
fn
.
animation
();
});
if
(
windowWidth
<
860
)
{
$
(
".c-hamburger"
).
trigger
(
"click"
);
}
e
.
stopPropagation
();
$
(
'.main-list-nav>li'
).
removeClass
(
'current'
);
$
(
this
).
parent
().
addClass
(
'current'
);
$
(
'.main-list-nav .subcat'
).
stop
().
slideUp
(
'slow'
);
$
(
this
).
parent
().
find
(
'.subcat'
).
stop
().
slideDown
(
'slow'
);
});
setTimeout
(
function
()
{
$
(
'.gallery-wrapper'
).
removeClass
(
'hidden-elem'
).
addClass
(
'animated visible-elem fadeInUp'
);
$
.
fn
.
responsive
();
},
100
);
}
function
appendLoading
()
{
if
(
!
(
$
(
'body #loading-container-subpage'
).
length
))
{
$
(
'.load-page, .right-container'
).
append
(
$
(
'#loading-container-subpage'
).
clone
());
}
$
(
'#loading-container-subpage'
).
show
();
}
//load content page on left Panel
$
(
document
).
find
(
'.to-slide'
).
on
(
'click'
,
'a'
,
function
(
e
)
{
if
(
!
(
$
(
'.load #loading-container-subpage'
).
length
))
{
$
(
'.load-page'
).
append
(
$
(
'#loading-container-subpage'
).
clone
());
}
$
(
'#loading-container-subpage'
).
show
();
e
.
preventDefault
();
var
link
=
$
(
this
).
attr
(
"href"
),
windowWidth
=
$
(
window
).
width
();
if
(
$
(
this
).
parent
().
parent
().
hasClass
(
'nav-page'
))
{
$
(
document
).
find
(
'.right-container'
).
first
().
remove
();
$
(
'.load-page'
).
parent
().
css
({
'left'
:
$
(
'.nav-wrapper'
).
outerWidth
()
});
var
div
=
$
(
'.nav-content'
);
$
(
'.footer-home-content'
).
on
(
'click'
,
'.home-down:not(.scrolled)'
,
function
(
e
)
{
TweenMax
.
killTweensOf
(
'.nav-content'
);
var
mainHeight
=
$
(
'.main'
).
outerHeight
();
$
(
this
).
addClass
(
'scrolled'
);
if
(
!
(
$
(
'.footer-home-content .nav-content'
).
length
))
{
$
(
'.footer-home-content'
).
append
(
$
(
'.nav-content'
).
clone
());
$
(
'.main'
).
outerHeight
(
mainHeight
+
$
(
'.footer-home-content'
).
outerHeight
());
$
(
'.home-down-wrapper'
).
css
(
'top'
,
-
(
$
(
'.home-down-wrapper'
).
outerHeight
()));
$
(
'.home-down'
).
css
(
'top'
,
-
(
$
(
'.home-down'
).
outerHeight
()));
//$('.home-down-wrapper').css('top','121px');
}
//scroll to bottom
$
(
'body'
).
animate
({
scrollTop
:
div
.
outerHeight
()
},
1000
,
'swing'
,
function
()
{
});
}).
on
(
'click'
,
'.scrolled'
,
function
()
{
$
(
this
).
removeClass
(
'scrolled'
);
$
(
"html, body"
).
animate
({
scrollTop
:
0
},
"slow"
);
setTimeout
(
function
()
{
$
(
'.footer-home-content'
).
find
(
'.nav-content'
).
remove
();
$
(
'.home-down-wrapper'
).
css
(
'top'
,
'initial'
);
$
(
'.footer-home-content'
).
removeClass
(
'fixed'
);
$
(
'.main'
).
height
(
$
(
window
).
innerHeight
());
},
600
)
return
false
;
$
(
'.load-page'
).
css
(
'opacity'
,
1
);
}
else
{
$
(
'.load-page'
).
parent
().
css
({
'left'
:
0
,
});
//Get file name of uploaded file
$
(
'#file-p'
).
on
(
'change'
,
function
(
e
)
{
var
fileName
=
e
.
target
.
files
[
0
].
name
;
$
(
'.upload-btn'
).
after
(
$
(
'<p class="loaded-file">'
+
fileName
+
'</p>'
));
$
(
'.load-page'
).
parent
().
addClass
(
'active'
);
}
$
(
'.load-page'
).
load
(
link
,
{
'ajax'
:
1
},
function
()
{
$
.
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
//END load content page on left Panel
$
(
document
).
on
(
'click'
,
'.int-link'
,
function
(
e
)
{
e
.
preventDefault
();
$
(
'.load-page'
).
parent
().
removeClass
(
'active'
);
$
(
'.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
;
$
(
'#home'
).
addClass
(
'container clearfix'
);
if
(
$
(
'body .catlog-panel'
).
length
)
{
$
(
'#home'
).
attr
(
'id'
,
'catalogue'
);
}
else
{
$
(
'#home'
).
attr
(
'id'
,
''
);
}
//checkWhiteColor = function(item) {
$
.
fn
.
setColorToWhite
=
function
(
item
)
{
//$('.list-wrapper .color-list')
$
(
this
).
each
(
function
()
{
elem
=
item
?
$
(
this
).
find
(
item
)
:
$
(
this
),
isWhite
=
checkWhiteColor
(
elem
.
data
(
'color'
));
if
(
isWhite
!=
elem
.
data
(
'color'
))
{
elem
.
addClass
(
'is-white'
);
}
});
}
$
.
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
();
})
$
(
'.main .container-bg'
).
removeClass
(
'hidden'
);
//$('.main').css('padding-top', $('.nav-header').outerHeight());
}
$
(
'.loading-container-subpage'
).
hide
();
});
history
.
pushState
(
null
,
null
,
link
);
});
//}
var
div
=
$
(
'.nav-content'
);
$
(
'.footer-home-content'
).
on
(
'click'
,
'.home-down:not(.scrolled)'
,
function
(
e
)
{
TweenMax
.
killTweensOf
(
'.nav-content'
);
var
mainHeight
=
$
(
'.main'
).
outerHeight
();
$
(
this
).
addClass
(
'scrolled'
);
if
(
!
(
$
(
'.footer-home-content .nav-content'
).
length
))
{
$
(
'.footer-home-content'
).
append
(
$
(
'.nav-content'
).
clone
());
$
(
'.main'
).
outerHeight
(
mainHeight
+
$
(
'.footer-home-content'
).
outerHeight
());
$
(
'.home-down-wrapper'
).
css
(
'top'
,
-
(
$
(
'.home-down-wrapper'
).
outerHeight
()));
$
(
'.home-down'
).
css
(
'top'
,
-
(
$
(
'.home-down'
).
outerHeight
()));
}
//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
$
(
'#file-p'
).
on
(
'change'
,
function
(
e
)
{
var
fileName
=
e
.
target
.
files
[
0
].
name
;
$
(
'.upload-btn'
).
after
(
$
(
'<p class="loaded-file">'
+
fileName
+
'</p>'
));
})
//END get file name
//END load content page on left Panel
$
(
document
).
on
(
'click'
,
'.int-link'
,
function
(
e
)
{
e
.
preventDefault
();
$
(
'.load-page'
).
parent
().
removeClass
(
'active'
);
$
(
'.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) {
$
.
fn
.
setColorToWhite
=
function
(
item
)
{
//$('.list-wrapper .color-list')
$
(
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);
//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'
);
}
}).
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
);
}).
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'
);
}
$
.
fn
.
animatePageScroll
=
function
(
element
,
duration
)
{
return
$
(
this
).
fromTo
(
element
,
duration
,
{
opacity
:
0
,
visibility
:
"hidden"
,
marginBottom
:
'80px'
},
{
opacity
:
1
,
visibility
:
"visible"
,
marginBottom
:
'0px'
},
0.7
);
//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
)
{
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
timeout
=
1.7
,
duration
=
1.2
;
setTimeout
(
function
()
{
$
(
'.moveDown'
).
removeClass
(
'hidden-elem'
).
addClass
(
'visible-elem animated rollIn'
);
},
2000
);
$
(
"#fullpage .section"
).
first
().
addClass
(
'first'
);
$
(
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
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
);
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'
);
}
}
$
.
fn
.
appendMap
=
function
()
{
var
$this
=
$
(
this
);
if
(
!
(
this
.
find
(
'.map'
).
length
))
{
this
.
append
(
$
(
'.map'
));
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
);
}
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
);
setTimeout
(
function
()
{
if
(
!
(
$this
.
find
(
'li.current'
).
length
))
{
$
(
'.main-nav .nav-content li.current'
).
addClass
(
'to-replace'
);
$
(
'.main-nav .nav-content li.current'
).
clone
(
true
).
find
(
'ul'
).
remove
().
end
().
appendTo
(
$this
);
$this
.
find
(
"li.current"
).
append
(
$
(
'.main-nav.nav-wrapper li.current ul'
));
}
$
(
'.right-container'
).
css
(
'padding-top'
,
$this
.
parent
().
outerHeight
());
},
2000
)
}
$
.
fn
.
appendMap
=
function
()
{
var
$this
=
$
(
this
);
if
(
!
(
this
.
find
(
'.map'
).
length
))
{
this
.
append
(
$
(
'.map'
));
}
//Responsive function
$
.
fn
.
responsive
=
function
()
{
$
(
".product-details"
).
css
(
'height'
,
'auto'
);
var
footerHeight
=
$
(
'footer'
).
height
(),
productHeight
=
$
(
".product-details"
).
outerHeight
(),
productWidth
=
$
(
".product-details"
).
outerWidth
(),
windowHeight
=
$
(
window
).
innerHeight
(),
windowWidth
=
$
(
window
).
width
(),
navMenuWidth
=
$
(
'.nav-wrapper'
).
outerWidth
(),
navHeight
=
$
(
'.nav-header'
).
outerHeight
(),
navHeader
=
$
(
'.nav-header'
).
outerHeight
(),
containerHeight
=
windowHeight
-
footerHeight
,
navPhototequeWidth
=
$
(
'.nav-phototeque'
).
outerWidth
(),
navPhototequeHeight
=
$
(
'.nav-phototeque'
).
height
(),
maxHeight
=
productHeight
>
windowHeight
?
productHeight
:
containerHeight
,
galleryWidth
=
windowWidth
-
navPhototequeWidth
,
filterWidth
=
$
(
'.right-container .left-panel'
).
outerWidth
(),
footerContact
=
$
(
'.contact-form .footer'
).
outerHeight
();
$
(
'.gallery-wrapper'
).
outerWidth
(
galleryWidth
).
css
(
'margin-left'
,
navPhototequeWidth
);
$
(
'.main,.load-page'
).
outerHeight
(
containerHeight
);
$
(
'.full-height'
).
outerHeight
(
maxHeight
);
$
(
'.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
)
setTimeout
(
function
()
{
initMap
();
},
330
)
}
$
.
fn
.
appendMobileMenu
=
function
()
{
var
$this
=
$
(
this
);
setTimeout
(
function
()
{
if
(
!
(
$this
.
find
(
'li.current'
).
length
))
{
$
(
'.main-nav .nav-content li.current'
).
addClass
(
'to-replace'
);
$
(
'.main-nav .nav-content li.current'
).
clone
(
true
).
find
(
'ul'
).
remove
().
end
().
appendTo
(
$this
);
$this
.
find
(
"li.current"
).
append
(
$
(
'.main-nav.nav-wrapper li.current ul'
));
}
$
(
'.right-container'
).
css
(
'padding-top'
,
$this
.
parent
().
outerHeight
());
},
2000
)
}
//Responsive function
$
.
fn
.
responsive
=
function
()
{
$
(
".product-details"
).
css
(
'height'
,
'auto'
);
var
footerHeight
=
$
(
'footer'
).
height
(),
productHeight
=
$
(
".product-details"
).
outerHeight
(),
productWidth
=
$
(
".product-details"
).
outerWidth
(),
windowHeight
=
$
(
window
).
innerHeight
(),
windowWidth
=
$
(
window
).
width
(),
navMenuWidth
=
$
(
'.nav-wrapper'
).
outerWidth
(),
navHeight
=
$
(
'.nav-header'
).
outerHeight
(),
navHeader
=
$
(
'.nav-header'
).
outerHeight
(),
containerHeight
=
windowHeight
-
footerHeight
,
navPhototequeWidth
=
$
(
'.nav-phototeque'
).
outerWidth
(),
navPhototequeHeight
=
$
(
'.nav-phototeque'
).
height
(),
maxHeight
=
productHeight
>
windowHeight
?
productHeight
:
containerHeight
,
galleryWidth
=
windowWidth
-
navPhototequeWidth
,
filterWidth
=
$
(
'.right-container .left-panel'
).
outerWidth
(),
footerContact
=
$
(
'.contact-form .footer'
).
outerHeight
();
$
(
'.gallery-wrapper'
).
outerWidth
(
galleryWidth
).
css
(
'margin-left'
,
navPhototequeWidth
);
$
(
'.main,.load-page'
).
outerHeight
(
containerHeight
);
$
(
'.full-height'
).
outerHeight
(
maxHeight
);
$
(
'.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
);
if
(
windowWidth
>
860
)
{
$
(
'#fullpage .chevron'
).
css
(
'left'
,
navMenuWidth
);
$
(
'.container-bg'
).
css
({
'height'
:
'100%'
,
'width'
:
navMenuWidth
});
$
(
'.main'
).
css
(
'padding-top'
,
0
);
$
(
'.contact-form h2'
).
removeClass
(
'show-comm'
);
$
(
'.filter, .left-panel .map, .details, .contact-form form'
).
show
();
$
(
'.left-panel'
).
appendMap
();
$
(
'.filter-list,#home'
).
css
(
'margin-top'
,
0
);
$
(
'.filter-list .top-header'
).
css
(
'top'
,
"initial"
);
$
(
'.header .nav-wrapper li.to-replace'
).
append
(
$
(
'.mobile-nav .nav-wrapper li.current ul'
));
$
(
'.mobile-nav .nav-wrapper ul'
).
find
(
'li'
).
remove
();
}
else
{
$
(
'.filter'
).
appendMap
();
$
(
'.main'
).
css
(
'padding-top'
,
navHeight
);
$
(
'.container-bg'
).
css
({
'height'
:
navHeight
});
$
(
'.contact-form h2'
).
addClass
(
'show-comm'
);
$
(
'.filter-list'
).
css
(
'margin-top'
,
navHeight
);
$
(
'.filter-list .top-header, .mobile-nav'
).
css
(
'top'
,
navHeight
);
$
(
'.mobile-nav .nav-wrapper ul'
).
appendMobileMenu
();
$
(
'#slides'
).
height
(
$
(
'.slides-wrapper'
).
width
());
if
(
$
(
'body #home'
).
length
)
{
$
(
'.main'
).
css
(
'padding-top'
,
0
);
}
if
(
$
(
'.filter-wrapper .header-filter-contact'
).
hasClass
(
'on'
))
{
$
(
'.filter, .left-panel .map, .details'
).
show
();
}
else
{
$
(
'.filter, .left-panel .map, .details'
).
hide
();
}
if
(
$
(
'.contact-form .header-filter-contact'
).
hasClass
(
'on'
))
{
$
(
'.contact-form form'
).
show
();
}
else
{
$
(
'.contact-form form'
).
hide
();
}
checkFilterContactWrapper
();
}
checkFooterNavPosition
();
$
(
'.nav-phototeque .nav-content'
).
outerHeight
(
navPhototequeHeight
-
$
(
'.circle-btn'
).
outerHeight
()
-
$
(
'.phototheque-content .header h2'
).
outerHeight
()
-
footerHeight
);
if
(
windowWidth
>
860
)
{
$
(
'#fullpage .chevron'
).
css
(
'left'
,
navMenuWidth
);
$
(
'.container-bg'
).
css
({
'height'
:
'100%'
,
'width'
:
navMenuWidth
});
// $.fn.getMenuBg();
$
(
'.main'
).
css
(
'padding-top'
,
0
);
$
(
'.contact-form h2'
).
removeClass
(
'show-comm'
);
$
(
'.filter, .left-panel .map, .details, .contact-form form'
).
show
();
$
(
'.left-panel'
).
appendMap
();
$
(
'.filter-list,#home'
).
css
(
'margin-top'
,
0
);
$
(
'.filter-list .top-header'
).
css
(
'top'
,
"initial"
);
$
(
'.header .nav-wrapper li.to-replace'
).
append
(
$
(
'.mobile-nav .nav-wrapper li.current ul'
));
$
(
'.mobile-nav .nav-wrapper ul'
).
find
(
'li'
).
remove
();
}
else
{
$
(
'.filter'
).
appendMap
();
$
(
'.main'
).
css
(
'padding-top'
,
navHeight
);
$
(
'.container-bg'
).
css
({
'height'
:
navHeight
});
$
(
'.contact-form h2'
).
addClass
(
'show-comm'
);
$
(
'.filter-list'
).
css
(
'margin-top'
,
navHeight
);
$
(
'.filter-list .top-header, .mobile-nav'
).
css
(
'top'
,
navHeight
);
$
(
'.mobile-nav .nav-wrapper ul'
).
appendMobileMenu
();
$
(
'#slides'
).
height
(
$
(
'.slides-wrapper'
).
width
());
if
(
$
(
'body #home'
).
length
)
{
$
(
'.main'
).
css
(
'padding-top'
,
0
);
}
if
(
$
(
'.filter-wrapper .header-filter-contact'
).
hasClass
(
'on'
))
{
$
(
'.filter, .left-panel .map, .details'
).
show
();
}
else
{
$
(
'.filter, .left-panel .map, .details'
).
hide
();
}
if
(
$
(
'.contact-form .header-filter-contact'
).
hasClass
(
'on'
))
{
$
(
'.contact-form form'
).
show
();
}
else
{
$
(
'.contact-form form'
).
hide
();
}
checkFilterContactWrapper
();
}
//Wordpress js login
$
(
'#user_login'
).
attr
(
'placeholder'
,
'Identifiant'
);
$
(
'#user_pass'
).
attr
(
'placeholder'
,
'Mot de passe'
);
$
(
"#user_login"
).
addClass
(
"my-login-username"
);
$
(
"#wp-submit"
).
addClass
(
"btn rounded white-btn"
);
checkFooterNavPosition
();
}
//Wordpress js login
$
(
'#user_login'
).
attr
(
'placeholder'
,
'Identifiant'
);
$
(
'#user_pass'
).
attr
(
'placeholder'
,
'Mot de passe'
);
$
(
"#user_login"
).
addClass
(
"my-login-username"
);
$
(
"#wp-submit"
).
addClass
(
"btn rounded white-btn"
);
});
//END Function
function
animateOnScroll
()
{
var
animate
=
new
Animate
({
target
:
'[data-animate]'
,
animatedClass
:
'visible'
,
offset
:
[
0.1
,
0.1
],
delay
:
3
,
remove
:
false
,
reverse
:
true
,
scrolled
:
false
,
debug
:
true
,
onLoad
:
true
,
onScroll
:
true
,
onResize
:
false
,
callbackOnInit
:
function
()
{
},
callbackOnAnimate
:
function
(
element
)
{
}
});
window
.
scrollAnimation
=
animate
;
animate
.
init
();
setTimeout
(
animate
.
render
.
bind
(
animate
),
2000
);
var
animate
=
new
Animate
({
target
:
'[data-animate]'
,
animatedClass
:
'visible'
,
offset
:
[
0.1
,
0.1
],
delay
:
3
,
remove
:
false
,
reverse
:
true
,
scrolled
:
false
,
debug
:
true
,
onLoad
:
true
,
onScroll
:
true
,
onResize
:
false
,
callbackOnInit
:
function
()
{
},
callbackOnAnimate
:
function
(
element
)
{
}
});
window
.
scrollAnimation
=
animate
;
animate
.
init
();
setTimeout
(
animate
.
render
.
bind
(
animate
),
2000
);
}
$
.
fn
.
animation
=
function
()
{
//Catalog page
var
product
=
$
(
'.list-animation article'
);
product
.
find
(
'figure img,ul,h3,.new,.download-btn'
).
attr
({
'data-animate'
:
""
,
'data-animation-classes'
:
"animated fadeIn"
});
var
tlCata
=
new
TimelineMax
();
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
(
'.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 .text-content'
,
0.9
,
{
autoAlpha
:
0
,
marginLeft
:
'-40px'
},
2.2
);
setTimeout
(
function
()
{
$
(
'.form-wrapper'
).
removeClass
(
'hidden-elem'
).
addClass
(
'animated fadeInUp'
)
},
1000
)
animateOnScroll
();
//Catalog page
var
product
=
$
(
'.list-animation article'
);
product
.
find
(
'figure img,ul,h3,.new,.download-btn'
).
attr
({
'data-animate'
:
""
,
'data-animation-classes'
:
"animated fadeIn"
});
var
tlCata
=
new
TimelineMax
();
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
(
'.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 .text-content'
,
0.9
,
{
autoAlpha
:
0
,
marginLeft
:
'-40px'
},
2.2
);
setTimeout
(
function
()
{
$
(
'.form-wrapper'
).
removeClass
(
'hidden-elem'
).
addClass
(
'animated fadeInUp'
)
},
1000
)
animateOnScroll
();
}
function
onScrollCover
()
{
cover
=
$
(
'.subcat.current a.active'
).
attr
(
"href"
);
$
(
'.cover-wrapper'
).
each
(
function
()
{
coverWrapper
=
$
(
this
).
data
(
'cat'
);
if
(
coverWrapper
==
cover
&&
!
(
$
(
this
).
hasClass
(
'current-cover'
)))
{
$
(
'.cover-wrapper'
).
removeClass
(
'last-current-cover'
);
$
(
'.cover-desc-wrapper'
).
removeClass
(
'fadeInDown'
).
addClass
(
'animated fadeOutDown'
)
$
(
'.current-cover'
).
addClass
(
'last-current-cover'
);
$
(
'.cover-wrapper'
).
removeClass
(
'prev next current-cover'
);
$
(
this
).
prevAll
(
'.cover-wrapper'
).
addClass
(
'prev'
);
$
(
this
).
nextAll
(
'.cover-wrapper'
).
addClass
(
'next'
);
$
(
this
).
addClass
(
'current-cover '
);
setTimeout
(
function
()
{
$
(
'.current-cover .cover-desc-wrapper'
).
removeClass
(
'fadeOutDown'
).
addClass
(
'animated fadeInDown'
);
},
600
);
}
});
cover
=
$
(
'.subcat.current a.active'
).
attr
(
"href"
);
$
(
'.cover-wrapper'
).
each
(
function
()
{
coverWrapper
=
$
(
this
).
data
(
'cat'
);
if
(
coverWrapper
==
cover
&&
!
(
$
(
this
).
hasClass
(
'current-cover'
)))
{
$
(
'.cover-wrapper'
).
removeClass
(
'last-current-cover'
);
$
(
'.cover-desc-wrapper'
).
removeClass
(
'fadeInDown'
).
addClass
(
'animated fadeOutDown'
)
$
(
'.current-cover'
).
addClass
(
'last-current-cover'
);
$
(
'.cover-wrapper'
).
removeClass
(
'prev next current-cover'
);
$
(
this
).
prevAll
(
'.cover-wrapper'
).
addClass
(
'prev'
);
$
(
this
).
nextAll
(
'.cover-wrapper'
).
addClass
(
'next'
);
$
(
this
).
addClass
(
'current-cover '
);
setTimeout
(
function
()
{
$
(
'.current-cover .cover-desc-wrapper'
).
removeClass
(
'fadeOutDown'
).
addClass
(
'animated fadeInDown'
);
},
600
);
}
});
}
;
var
lastScrollTop
=
0
;
function
onScroll
(
event
)
{
var
scrollPos
=
$
(
this
).
scrollTop
(),
titleHeight
=
(
$
(
'.panel section > h2'
).
outerHeight
()
/
2
);
//items = event.data.items;
items
=
"li .subcat a"
;
if
(
timer
)
clearTimeout
(
timer
);
timer
=
setTimeout
(
function
()
{
onScrollCover
();
},
330
);
$
(
items
).
each
(
function
()
{
var
currLink
=
$
(
this
);
var
refElement
=
$
(
currLink
.
attr
(
"href"
));
//console.log(currLink);
var
windowWidth
=
$
(
window
).
width
();
var
margin_top
=
0
;
if
(
windowWidth
>
1920
)
margin_top
=
150
;
else
margin_top
=
50
;
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"
);
currLink
.
addClass
(
"active"
);
if
(
$
(
'nav ul ul'
).
find
(
'li.active'
))
{
$
(
'nav ul li'
).
removeClass
(
'current'
).
addClass
(
'off'
);
parent
=
currLink
.
parent
().
parent
().
parent
();
parent
.
addClass
(
'current'
).
removeClass
(
'off'
);
if
(
timer2
)
clearTimeout
(
timer2
);
timer2
=
setTimeout
(
function
()
{
$
(
'.phototheque .off .subcat'
).
stop
().
slideUp
();
parent
.
find
(
'ul'
).
stop
().
slideDown
();
},
330
);
}
var
scrollPos
=
$
(
this
).
scrollTop
(),
titleHeight
=
(
$
(
'.panel section > h2'
).
outerHeight
()
/
2
);
//items = event.data.items;
items
=
"li .subcat a"
;
if
(
timer
)
clearTimeout
(
timer
);
timer
=
setTimeout
(
function
()
{
onScrollCover
();
},
330
);
$
(
items
).
each
(
function
()
{
var
currLink
=
$
(
this
);
var
refElement
=
$
(
currLink
.
attr
(
"href"
));
//console.log(currLink);
var
windowWidth
=
$
(
window
).
width
();
var
margin_top
=
0
;
if
(
windowWidth
>
1920
)
margin_top
=
150
;
else
margin_top
=
50
;
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"
);
currLink
.
addClass
(
"active"
);
if
(
$
(
'nav ul ul'
).
find
(
'li.active'
))
{
$
(
'nav ul li'
).
removeClass
(
'current'
).
addClass
(
'off'
);
parent
=
currLink
.
parent
().
parent
().
parent
();
parent
.
addClass
(
'current'
).
removeClass
(
'off'
);
if
(
timer2
)
clearTimeout
(
timer2
);
timer2
=
setTimeout
(
function
()
{
$
(
'.phototheque .off .subcat'
).
stop
().
slideUp
();
parent
.
find
(
'ul'
).
stop
().
slideDown
();
},
330
);
}
}
else
{
currLink
.
removeClass
(
"active"
);
}
});
}
else
{
currLink
.
removeClass
(
"active"
);
}
});
}
function
scrollAnchor
(
elemId
,
skipZero
)
{
$
(
'.subcat'
).
each
(
function
()
{
$
(
this
).
find
(
'a[href^="#"]'
).
on
(
'click'
,
function
(
e
)
{
e
.
preventDefault
();
e
.
stopPropagation
();
$
(
'a'
).
each
(
function
()
{
$
(
this
).
removeClass
(
'active'
);
})
$
(
this
).
addClass
(
'active'
);
var
target
=
this
.
hash
,
menu
=
target
,
temp
=
0
;
$target
=
$
(
target
);
//$parent = $('#load-page');
$
(
elemId
).
stop
().
animate
({
'scrollTop'
:
$target
.
position
().
top
//- $parent.offset().top
},
1000
,
'swing'
,
function
()
{
window
.
location
.
hash
=
target
;
});
});
})
$
(
'.subcat'
).
each
(
function
()
{
$
(
this
).
find
(
'a[href^="#"]'
).
on
(
'click'
,
function
(
e
)
{
e
.
preventDefault
();
e
.
stopPropagation
();
$
(
'a'
).
each
(
function
()
{
$
(
this
).
removeClass
(
'active'
);
})
$
(
this
).
addClass
(
'active'
);
var
target
=
this
.
hash
,
menu
=
target
,
temp
=
0
;
$target
=
$
(
target
);
//$parent = $('#load-page');
$
(
elemId
).
stop
().
animate
({
'scrollTop'
:
$target
.
position
().
top
//- $parent.offset().top
},
1000
,
'swing'
,
function
()
{
window
.
location
.
hash
=
target
;
});
});
})
}
function
checkFooterNavPosition
()
{
var
mainHeight
=
$
(
'.main-nav .nav-content'
).
height
(),
nav
=
$
(
'.main-nav .nav-content .arrow-white'
).
height
()
+
$
(
'.main-nav .nav-content .arrow-pink'
).
height
(),
footerNav
=
$
(
'.header .nav-content .footer'
).
outerHeight
();
footerSpace
=
mainHeight
-
(
nav
+
40
);
if
(
footerSpace
<=
footerNav
)
{
$
(
'.header .nav-content .footer'
).
addClass
(
'relative'
);
var
mainHeight
=
$
(
'.main-nav .nav-content'
).
height
(),
nav
=
$
(
'.main-nav .nav-content .arrow-white'
).
height
()
+
$
(
'.main-nav .nav-content .arrow-pink'
).
height
(),
footerNav
=
$
(
'.header .nav-content .footer'
).
outerHeight
();
footerSpace
=
mainHeight
-
(
nav
+
40
);
if
(
footerSpace
<=
footerNav
)
{
$
(
'.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
{
$
(
'.header .nav-content .footer'
).
removeClass
(
'relative
'
);
$
(
'.contact-form .footer'
).
removeClass
(
'fixed
'
);
}
},
500
)
}
function
checkFilterContactWrapper
()
{
setTimeout
(
function
()
{
if
(
(
$
(
'.contact-form .form-wrapper'
).
outerHeight
()
+
$
(
'.filter-wrapper'
).
outerHeight
()
+
$
(
'nav .main-nav'
).
outerHeight
()
+
$
(
'.main-nav'
).
outerHeight
())
<
$
(
window
).
outerHeight
()
/*&&
( $('.contact-form .form-wrapper').outerHeight() +
$('.contact-form .footer').outerHeight() +
$('.filter-wrapper').outerHeight()
> $(window).outerHeight() )*/
)
{
$
(
'.contact-form .footer'
).
addClass
(
'fixed'
);
}
else
{
$
(
'.contact-form .footer'
).
removeClass
(
'fixed'
);
}
},
500
)
function
loadCatalogContainer
(){
// Catalog Page : Change product image depending on selected color
$
(
'.product-list article ul li'
).
on
(
'mouseover'
,
function
()
{
$
(
this
).
changeProductImageBg
();
});
$
(
'.product-list article'
).
each
(
function
()
{
$
(
this
).
showProductListColors
();
});
$
(
'.filter-bloc .list-color-filter li'
).
setColorToWhite
();
$
(
'.filter-wrapper'
).
open_filter
();
$
.
fn
.
checkSelectedFilter
();
$
.
fn
.
showSubmenu
();
//Catalog subMenu
setTimeout
(
function
()
{
onScrollCover
();
},
500
);
$
(
'#fullpage'
).
fullpageSlide
();
//Stories
$
.
fn
.
responsive
();
$
(
'.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
()
{
initFunction
();
$
(
'.header .nav-wrapper .nav-content > ul > li'
).
each
(
function
()
{
url
=
$
(
this
).
data
(
'img'
);
$
(
'.img-wrapper'
).
append
(
'<img src='
+
url
+
'>'
);
})
initFunction
();
$
(
'.header .nav-wrapper .nav-content > ul > li'
).
each
(
function
()
{
url
=
$
(
this
).
data
(
'img'
);
$
(
'.img-wrapper'
).
append
(
'<img src='
+
url
+
'>'
);
})
});
//END document load
var
timer
;
var
timer2
;
$
(
window
).
scroll
(
function
(
e
)
{
onScroll
(
e
);
var
elem
=
$
(
'.home-down-wrapper'
);
if
(
elem
.
length
)
{
var
downBTN
=
$
(
'.home-down-wrapper'
).
offset
().
top
;
if
(
$
(
window
).
scrollTop
()
>
downBTN
-
$
(
'.nav-header'
).
outerHeight
())
{
$
(
'.home-footer-nav .nav-wrapper'
).
addClass
(
'fixed'
);
}
else
{
$
(
'.home-footer-nav .nav-wrapper'
).
removeClass
(
'fixed'
);
}
onScroll
(
e
);
var
elem
=
$
(
'.home-down-wrapper'
);
if
(
elem
.
length
)
{
var
downBTN
=
$
(
'.home-down-wrapper'
).
offset
().
top
;
if
(
$
(
window
).
scrollTop
()
>
downBTN
-
$
(
'.nav-header'
).
outerHeight
())
{
$
(
'.home-footer-nav .nav-wrapper'
).
addClass
(
'fixed'
);
}
else
{
$
(
'.home-footer-nav .nav-wrapper'
).
removeClass
(
'fixed'
);
}
}
});
//$(window).bind("scrollStop",onScroll)
//$(window).bind("scrollStop",onScroll)
$
(
document
).
ready
(
function
()
{
$
(
document
).
on
(
'mouseover'
,
'.nav-content li'
,
function
()
{
$
(
this
).
stop
(
false
,
true
).
fadeImage
();
});
// Catalog Page : Change product image depending on selected color
$
(
'.product-list article ul li'
).
on
(
'mouseover'
,
function
()
{
$
(
this
).
changeProductImageBg
();
});
$
(
'.product-list article'
).
each
(
function
()
{
$
(
this
).
showProductListColors
();
});
$
(
'.filter-bloc .list-color-filter li'
).
setColorToWhite
();
setTimeout
(
function
()
{
onScrollCover
();
},
330
);
$
.
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
();
$
(
document
).
on
(
'mouseover'
,
'.nav-content li'
,
function
()
{
$
(
this
).
stop
(
false
,
true
).
fadeImage
();
});
$
.
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
();
loadCatalogContainer
();
// Load functions catalog page
$
.
fn
.
getMenuBg
();
//Animation BG Menu
$
.
fn
.
loadPageContent
();
});
//end document ready
$
(
window
).
resize
(
function
()
{
$
.
fn
.
responsive
();
$
.
fn
.
responsive
();
});
//end document resize
window
.
addEventListener
(
"load"
,
function
()
{
var
load_screen
=
document
.
getElementById
(
"loading-container"
);
document
.
body
.
removeChild
(
load_screen
);
var
load_screen
=
document
.
getElementById
(
"loading-container"
);
document
.
body
.
removeChild
(
load_screen
);
});
}(
jQuery
));
}(
jQuery
));
wp-content/themes/nap/assets/js/nap.js
View file @
2fc92e00
jQuery
(
document
).
ready
(
function
()
{
jQuery
(
'p'
).
each
(
function
()
{
var
$this
=
jQuery
(
this
);
if
(
$this
.
html
().
replace
(
/
\s
| /g
,
''
).
length
==
0
)
{
$this
.
remove
();
}
});
jQuery
(
document
).
on
(
'click'
,
".download_file"
,
function
()
{
var
id
;
var
download_link
=
jQuery
(
'.download_file_link'
).
attr
(
'href'
);
...
...
@@ -17,9 +17,9 @@ jQuery(document).ready(function() {
else
id
=
variation_id
;
var
link
=
download_link
+
'variation_id='
+
id
;
window
.
open
(
link
,
'_blank'
);
return
false
;
});
...
...
@@ -29,7 +29,7 @@ jQuery(document).ready(function() {
jQuery
(
'.list-animation section'
).
show
();
jQuery
(
'article'
).
removeClass
(
'selected'
);
jQuery
(
'article'
).
removeClass
(
'hidden'
);
var
tabcolor
=
[];
i
=
0
;
...
...
@@ -54,7 +54,7 @@ jQuery(document).ready(function() {
jQuery
(
"#pa_univers .selected"
).
each
(
function
()
{
tabunivers
[
i
++
]
=
jQuery
(
this
).
text
();
});
var
sku
=
jQuery
(
"#sku-search"
).
val
();
var
selected_colors
=
tabcolor
.
join
(
','
);
...
...
@@ -74,9 +74,9 @@ jQuery(document).ready(function() {
jQuery
(
this
).
hide
();
}
});
});
jQuery
(
window
).
on
(
'load'
,
function
()
{
jQuery
(
'.filter-bloc'
).
removeClass
(
'active'
);
jQuery
(
'.filter-bloc '
).
each
(
function
()
{
...
...
@@ -99,8 +99,8 @@ jQuery(document).ready(function() {
jQuery
(
this
).
hide
();
}
});
if
(
result_found
==
false
)
{
jQuery
(
'.search_notfound'
).
text
(
' Aucun produit ne correspond à votre recherche'
);
console
.
log
(
result_found
);
...
...
@@ -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;
if
(
state
===
null
)
{
if ( state === null ) {
var back_link = jQuery('.close-panel .circle-btn a').attr('href');
window.location.href = back_link;
}
});
}
});
*/
});
...
...
wp-content/themes/nap/contact.php
View file @
2fc92e00
<?php
/**
* Template Name: Contact
*
*/
get_header
();
* Template Name: Contact
*
*/
$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"
>
<div
class=
"container-bg abs-full"
></div>
<?php
get_sidebar
();
?>
<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'>
while
(
has_sub_field
(
'contact_pays'
,
$post_ID
))
:
?>
<option
value=
"
<?php
the_sub_field
(
'pays_code'
);
?>
"
>
<?php
the_sub_field
(
'pays_nom'
);
?>
</option>
</form>-->
<?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>
<?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>
<?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>
<?php
get_footer
();
?>
\ No newline at end of file
<?php
if
(
!
(
isset
(
$_POST
[
'ajax'
])))
{
get_template_part
(
'footer'
,
'page-content'
);
}
?>
wp-content/themes/nap/footer-page-content.php
0 → 100644
View file @
2fc92e00
</div>
<!-- END right-container -->
<?php
if
(
!
(
isset
(
$_POST
[
'ajax'
])))
{
get_footer
();
}
?>
wp-content/themes/nap/footer.php
View file @
2fc92e00
...
...
@@ -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=
"to-slide"
><a
href=
"
<?php
echo
get_permalink
(
171
)
?>
"
>
mentions légales
</a></li>
</ul>
</div>
</div>
</div>
</footer>
<div
class=
"popup-container"
>
...
...
@@ -33,7 +33,7 @@
<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>
</form>-->
<?php
<?php
$popoup
=
array
(
'echo'
=>
true
,
// Default 'redirect' value takes the user back to the request URI.
...
...
@@ -63,7 +63,7 @@
</div>
</div>
</div>
<div
id=
"loading-container-subpage"
>
<div
id=
"loading-container-subpage"
class =
"loading-container-subpage"
>
<div
class=
"loading-wrapper"
>
<div
class=
"loading"
>
<div
id=
"loading-center-absolute"
>
...
...
wp-content/themes/nap/front-page.php
View file @
2fc92e00
<?php
get_header
();
get_sidebar
();
$url
=
nap_attachment_image
(
$ID
);
?>
<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
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>
<aside
class=
"news-wrapper container "
>
<div
class=
"news-header crete"
>
...
...
@@ -17,34 +30,34 @@ $url = nap_attachment_image($ID);
while
(
has_sub_field
(
'nap_nouveautes'
,
135
)
)
:
?>
<article
class =
"row
<?php
the_sub_field
(
'nv_taille'
);
?>
"
>
<a
href=
"
<?php
echo
the_sub_field
(
'nv_lien'
);
?>
"
>
<figure>
<img
src=
"
<?php
the_sub_field
(
'nv_image'
);
?>
"
alt=
"Nouveautés"
>
<figcaption>
<?php
htmlspecialchars
(
the_sub_field
(
'nv_titre'
));
?>
</figcaption>
</figure>
</a>
</article>
<?php
<article
class =
"row
<?php
the_sub_field
(
'nv_taille'
);
?>
"
>
<a
href=
"
<?php
echo
the_sub_field
(
'nv_lien'
);
?>
"
>
<figure>
<img
src=
"
<?php
the_sub_field
(
'nv_image'
);
?>
"
alt=
"Nouveautés"
>
<figcaption>
<?php
htmlspecialchars
(
the_sub_field
(
'nv_titre'
));
?>
</figcaption>
</figure>
</a>
</article>
<?php
endwhile
;
endif
;
?>
</div>
</aside>
<!--Menu for mobile-->
<div
class=
"home-footer-nav display--only-mobile"
>
<div
class=
"header"
>
<div
class=
"nav-wrapper footer-home-content"
>
<div
class=
"home-down-wrapper blue-bg"
></div>
<span
class =
"home-down chevron bottom hidden-elem pink-btn abs-center"
></span>
</div>
endif
;
?>
</div>
</aside>
<!--Menu for mobile-->
<div
class=
"home-footer-nav display--only-mobile"
>
<div
class=
"header"
>
<div
class=
"nav-wrapper footer-home-content"
>
<div
class=
"home-down-wrapper blue-bg"
></div>
<span
class =
"home-down chevron bottom hidden-elem pink-btn abs-center"
></span>
</div>
</div>
</div>
<!--END home -->
<?php
</div>
</div>
<!--END home -->
</div>
<?php
get_footer
();
get_footer
();
wp-content/themes/nap/functions.php
View file @
2fc92e00
...
...
@@ -310,7 +310,7 @@ function nap_menu() {
}
else
{
$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
(
'taxonomy'
=>
$taxonomy
,
...
...
wp-content/themes/nap/header-page-content.php
0 → 100644
View file @
2fc92e00
<?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
?>
">
wp-content/themes/nap/header.php
View file @
2fc92e00
...
...
@@ -32,4 +32,3 @@
</div>
</div>
<div
class=
"main"
>
wp-content/themes/nap/nav-list.php
View file @
2fc92e00
<div
class=
"nav-content font-big"
>
<?php
$arrow
=
'arrow-white nav-page'
;
if
(
isset
(
$current_page
)
and
$current_page
==
'phototheque'
)
{
$arrow
=
'arrow-blue phototheque'
;
}
?>
<ul
class =
"main-list-nav
<?php
echo
$arrow
?>
"
>
<?php
echo
nap_menu
();
?>
<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>
<?php
$arrow
=
'arrow-white nav-page'
;
if
(
isset
(
$current_page
)
and
$current_page
==
'phototheque'
)
{
$arrow
=
'arrow-blue phototheque'
;
}
?>
<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>
</ul>
<?php
if
(
!
(
isset
(
$current_page
)
and
$current_page
==
'phototheque'
))
{
?>
<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>
<?php
if
(
!
(
isset
(
$current_page
)
and
$current_page
==
'phototheque'
))
{
?>
<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
}
?>
<?php
}
?>
</div>
wp-content/themes/nap/stories.php
View file @
2fc92e00
<?php
/**
* Template Name: Stories
*
*/
get_header
();
* Template Name: Stories
*
*/
$post_ID
=
get_the_ID
();
if
(
!
(
isset
(
$_POST
[
'ajax'
])))
{
get_template_part
(
'header'
,
'page-content'
);
}
?>
<div
class=
"container clearfix"
data-page =
"stories"
>
<div
class=
"container-bg abs-full"
style=
"background-image: url('
<?php
echo
nap_attachment_image
(
154
);
?>
')"
></div>
<?php
get_sidebar
();
?>
<div
class=
"full-slides right-container right"
>
<div
id=
"fullpage"
>
<span
class =
"moveDown chevron bottom hidden-elem"
></span>
<?php
if
(
get_field
(
'stories'
,
154
))
:
while
(
has_sub_field
(
'stories'
,
154
))
:
?>
<div
class=
"section "
style =
"background-image:url('
<?php
the_sub_field
(
'st_image'
);
?>
')"
>
<div
class=
"bloc"
>
<div
class=
"header-bloc"
>
<span>
01
</span>
<h2>
<?php
the_sub_field
(
'st_titre'
);
?>
</h2>
</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
class=
"hidden data-elem"
data-postid =
"cat-
<?php
echo
$post_ID
?>
"
data-page =
"
<?php
echo
$post_ID
?>
"
data-class=
"full-slides right"
></div>
<div
id=
"fullpage"
>
<span
class =
"moveDown chevron bottom hidden-elem"
></span>
<?php
if
(
get_field
(
'stories'
,
154
))
:
while
(
has_sub_field
(
'stories'
,
154
))
:
?>
<div
class=
"section "
style =
"background-image:url('
<?php
the_sub_field
(
'st_image'
);
?>
')"
>
<div
class=
"bloc"
>
<div
class=
"header-bloc"
>
<span>
01
</span>
<h2>
<?php
the_sub_field
(
'st_titre'
);
?>
</h2>
</div>
<div
class=
"desc-content"
>
<h3>
<?php
the_sub_field
(
'st_citation'
);
?>
</h3>
<?php
htmlspecialchars
(
the_sub_field
(
'st_texte'
));
?>
</div>
</div>
</div>
</div>
<?php
endwhile
;
endif
;
?>
</div>
<?php
get_footer
();
if
(
!
(
isset
(
$_POST
[
'ajax'
])))
{
get_template_part
(
'footer'
,
'page-content'
);
}
?>
wp-content/themes/nap/uniqpaper.php
View file @
2fc92e00
<?php
<?php
/**
* Template Name: Personnalisation
*
*/
get_header
();
?>
<div
class=
"container clearfix"
id=
"uniqpaper"
data-page =
"uniqpaper"
>
<div
class=
"container-bg abs-full"
></div>
<?php
get_sidebar
();
?>
<div
class=
"right-container"
>
<div
class=
"left-panel fixed-full position--after-menu "
>
<div
class=
"cover-wrapper abs-full transition"
style =
"background-image: url('
<?php
echo
get_field
(
'pers_image'
,
151
)
?>
')"
></div>
<div
class=
"abs floated-bloc"
>
<h2>
<?php
echo
get_field
(
'pers_titre'
,
151
)
?>
</h2>
<div
class=
"text-content"
>
<?php
echo
get_field
(
'pers_texte'
,
151
)
?>
</div>
</div>
</div>
* Template Name: Personnalisation
*
*/
$post_ID
=
get_the_ID
();
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=
"left-panel fixed-full position--after-menu "
>
<div
class=
"cover-wrapper abs-full transition"
style =
"background-image: url('
<?php
echo
get_field
(
'pers_image'
,
151
)
?>
')"
></div>
<div
class=
"abs floated-bloc"
>
<h2>
<?php
echo
get_field
(
'pers_titre'
,
151
)
?>
</h2>
<div
class=
"text-content"
>
<?php
echo
get_field
(
'pers_texte'
,
151
)
?>
</div>
</div>
<div
class=
"right-panel right"
>
<div
class=
"form-wrapper clearfix"
>
<!--<form action="#" method="POST">
<h2>Information sur le produit</h2>
<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
class=
"right-panel right"
>
<div
class=
"form-wrapper clearfix"
>
<?php
echo
do_shortcode
(
'[contact-form-7 id="663" title="Personnalisation form"]'
);
?>
</div>
</div>
<?php
get_footer
();
\ No newline at end of file
<?php
if
(
!
(
isset
(
$_POST
[
'ajax'
])))
{
get_template_part
(
'footer'
,
'page-content'
);
}
?>
wp-content/themes/nap/woocommerce/archive-product.php
View file @
2fc92e00
<?php
//print_r($_GET);
/**
* 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.
*
* 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
* 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
* the readme will list any important changes.
*
* @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.0.0
*/
if
(
!
defined
(
'ABSPATH'
))
{
exit
;
// Exit if accessed directly
}
$c
urrent_page
=
'catalogue'
;
* 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.
*
* 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
* 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
* the readme will list any important changes.
*
* @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.0.0
*/
?>
<?php
$product
;
$c
ate
=
get_queried_object
()
;
if
(
!
(
isset
(
$_POST
[
'ajax'
])))
{
get_header
();
set_query_var
(
'cateID'
,
$cate
->
term_id
);
get_template_part
(
'header'
,
'page-content'
);
}
$current_page
=
'catalogue'
;
$product
;
$cate
=
get_queried_object
();
$cateID
=
$cate
->
term_id
;
//SubCats
# 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'
=>
'meta_value_num'
,
'meta_key'
=>
'order'
,
'order'
=>
'ASC'
));
# 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
if
(
!
(
isset
(
$_POST
[
'ajax'
])))
{
?>
<div
class=
"container-bg abs-full"
></div>
<?php
get_sidebar
();
}
?>
<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
;
?>
<?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
);
<div
class=
"center filter-btn-list"
>
<div
class=
"btn pink-btn rounded"
id=
"search-btn"
>
Rechercher
</div>
<span
class =
"reinit-all"
>
Effacer les filtres
</span>
</div>
</div>
</div>
</div>
<?php
endif
;
?>
<?php
foreach
(
$child_category
as
$key
=>
$value
)
:
}
if
(
!
empty
(
$terms
)
&&
!
is_wp_error
(
$terms
))
:
?>
<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>
<?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>
<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
;
?>
<?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>
<?php
endforeach
;
?>
<div
class=
"center filter-btn-list"
>
<div
class=
"btn pink-btn rounded"
id=
"search-btn"
>
Rechercher
</div>
<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=
"cover-desc-wrapper"
>
<?php
if
(
$value
->
description
){
?>
<p>
<?php
echo
$value
->
description
;
?>
</p>
<?php
}
?>
</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>
<?php
if
(
!
(
isset
(
$_POST
[
'ajax'
])))
{
get_footer
();
}
?>
get_template_part
(
'footer'
,
'page-content'
);
}
?>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment