marc-leopold/app/layouts/default.vue

112 lines
1.9 KiB
Vue
Raw Normal View History

2019-02-24 16:42:27 +00:00
<template>
<div class="page-container">
<div class="page">
<div class="page-overlay"
:class="{ 'is-active': isMenuOpen }"
@click="closeMenu"
>
</div>
<nuxt />
</div>
<SiteMenu class="menu"
:is-open="isMenuOpen"
@toggleMenu="toggleMenu"
@closeMenu="closeMenu"
/>
</div>
</template>
<script>
import SiteMenu from '~/components/SiteMenu'
export default {
components: {
SiteMenu
},
data() {
return {
isMenuOpen: false,
}
},
2020-05-06 10:07:26 +00:00
watch: {
'$route.path' () {
// a hack method to get open web analytics working correctly
// using plugin and any of the router guards always results in wrong page
// being recorded
if (window && window.owa_cmds) {
window.owa_cmds.push(['trackPageView']);
window.owa_cmds.push(['trackClicks']);
}
},
},
2019-02-24 16:42:27 +00:00
methods: {
toggleMenu () {
this.isMenuOpen = !this.isMenuOpen
},
closeMenu () {
this.isMenuOpen = false
},
2020-05-06 10:07:26 +00:00
updateAnalytics () {
},
2019-02-24 16:42:27 +00:00
}
}
</script>
<style scoped lang="scss">
.page-container {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
overflow: hidden;
background-color: #333;
}
.page {
z-index: $z-index__page;
position: relative;
width: 100%;
height: 100%;
}
.page-overlay {
$color: $color__primary-100;
z-index: $z-index__page-overlay;
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
background-color: rgba($color, .6);
background: linear-gradient(
to right,
rgba($color, 1),
rgba($color, 1) $site-menu__width + 3rem,
rgba($color, .8),
rgba($color, 1)
);
box-shadow: 0 0 70px 40px $color inset;
transition: opacity .5s .2s;
opacity: 0;
pointer-events: none;
@media (min-width: $bp__layout) {
&.is-active {
opacity: 1;
pointer-events: auto;
}
}
}
.menu {
z-index: $z-index__menu;
}
</style>