// On 404 pages, this wasn't happening.
wp_enqueue_style('sage/main.css', asset_path('styles/main.css'), ['elementor-frontend', 'elementor-animations'], null);
wp_enqueue_script('sage/main.js', asset_path('scripts/main.js'), ['jquery'], null, true);
+ wp_enqueue_script('sage/navigation.js', asset_path('scripts/navigation.js'), ['jquery'], null, true);
if (is_single() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
],
"timeline": [
"./scripts/timeline.js"
+ ],
+ "navigation": [
+ "./scripts/navigation.js"
]
},
"publicPath": "/wp-content/themes/c6",
--- /dev/null
+/* eslint-disable */
+jQuery(document).ready(function($){
+ var mainHeader = $('header.site'),
+ headerHeight = mainHeader.height();
+
+ //set scrolling variables
+ var scrolling = false,
+ previousTop = 0,
+ currentTop = 0,
+ scrollDelta = 10,
+ scrollOffset = 500;
+
+ $(window).on('scroll', function(){
+
+ if( !scrolling ) {
+ scrolling = true;
+ mainHeader.addClass('scrolling');
+ (!window.requestAnimationFrame)
+ ? setTimeout(autoHideHeader, 250)
+ : requestAnimationFrame(autoHideHeader);
+ }
+
+ if(currentTop < 15){
+ mainHeader.removeClass('scrolling');
+ }
+ });
+
+ function autoHideHeader() {
+ currentTop = $(window).scrollTop();
+
+ if (previousTop - currentTop > scrollDelta) {
+ //if scrolling up...
+ mainHeader.removeClass('is-hidden');
+ } else if( currentTop - previousTop > scrollDelta && currentTop > scrollOffset) {
+ //if scrolling down...
+ mainHeader.addClass('is-hidden');
+ }
+
+ previousTop = currentTop;
+ scrolling = false;
+ }
+});
\ No newline at end of file
// Menu toggle
$('#full-menu-opener').on('click', function(event) {
+ // Add class earlier than normal so we can hide the logo before menu fully opens
+ $('body').addClass('offcanvas-menu-open');
+
// On larger screens, the menu button just hides the menu
//if ($(window).width() < 1024) {
$.sidr('open', 'offcanvas-menu');
}
// Breakpoints in Rupture (https://github.com/jescalan/rupture)
-rupture.scale = 0 400px 768px 1024px
-rupture.scale-names = 'small' 'medium' 'large'
-rupture.anti-overlap = -1px // Results in +below(1000px) being max-width: 999px and +above(1000px) being min-width: 1000px
-$breakpoint-columns = 900px
-$breakpoint-menu = 850px
+rupture.scale = 0 400px 768px 1024px
+rupture.scale-names = 'small' 'medium' 'large'
+rupture.anti-overlap = -1px // Results in +below(1000px) being max-width: 999px and +above(1000px) being min-width: 1000px
+$breakpoint-columns = 900px
+$breakpoint-menu = 850px
+$offcanvas-menu-width = 260px
// Lost Grid setup (mostly used for Products)
@lost gutter 5%
-$sidebar-width = 260px
-
#offcanvas-menu
background-color: #000
color: #fff
top: 0
height: 100%
z-index: 999999
- width: $sidebar-width
+ width: $offcanvas-menu-width
overflow-x: hidden
overflow-y: auto
&.right
left: auto
- right: - $sidebar-width
+ right: - $offcanvas-menu-width
&.left
- left: - $sidebar-width
+ left: - $offcanvas-menu-width
right: auto
.header-logo
// Hero block header overrides
.hero-header &, .home & // Also applied for home since .hero-header class seems to be added to body too late for Elementor editor
- position: absolute
width: 100%
color: #fff
.inner
background-color: transparent
- .menu-icon
- fill: #fff
-
// Main logo
.header-logo
flex: 0 1 auto
padding-right: 50px // Ensure some breathing space between logo and burger menu icon
+ transition: opacity 0.3s ease-out
&-svg
max-width: 84px
height: auto
+ // When the menu is open, the logo doesn't move because it is fixed position
+ // So we hide it...
+ .offcanvas-menu-open &
+ opacity: 0
+ transition: none
+
+ #offcanvas-menu &
+ opacity: 1
+
.locales
flex: 0 1 auto
height: 0.6em // Needed for IE 11
overflow: hidden // Also needed for IE 11
-
path
stroke: currentColor
display: block
.menu-icon
- width: r(60px)
- height: @width
+ height: 52px
+ width: 52px
+ fill: currentColor
+
+header.site
+ position: fixed
+ top: 0
+ left: 0
+ width: 100%
+ transform: translateZ(0)
+ will-change: transform
+ transition: all .5s ease
+
+header.site.is-hidden
+ transform: translateY(-100%)
+
+header.site.scrolling
+ background: white
+ color: #000
+ transition: all .5s ease
\ No newline at end of file