miracle/components/Header.vue

182 lines
4.0 KiB
Vue
Raw Normal View History

<template>
2020-11-10 19:16:35 +00:00
<div v-click-outside="menuHide">
<div :class="menu_shown ? ['site-header','enabled'] : ['site-header']">
<div :class="menu_shown ? ['site-background','enabled'] : ['site-background']"></div>
2020-06-23 21:37:09 +00:00
<div class="site-header-inner">
<header>
2020-11-10 19:16:35 +00:00
<div class="header-top">
<a @click="menu_shown = !menu_shown" id="menushow">
2020-11-11 11:06:04 +00:00
<span class="h-12 w-12 px-2 py-3 text-white material-icons" alt="menu">menu</span>
2020-11-10 19:16:35 +00:00
</a>
<div class="header-title" @click="menu_shown = !menu_shown" >
<nuxt-link to="/"><h1 class="text-lg text-white">Damillora</h1></nuxt-link>
2020-06-23 21:37:09 +00:00
</div>
2020-11-10 19:16:35 +00:00
</div>
<div class="header-menu">
<div :class="menu_shown ? ['nav-menu','enabled'] : ['nav-menu']">
2020-11-09 10:46:10 +00:00
<NavItem
link="/about"
icon="person"
text="About"
2020-11-10 19:16:35 +00:00
@click="menu_shown = !menu_shown"
2020-11-09 10:46:10 +00:00
/>
<NavItem
link="/projects"
icon="work"
text="Projects"
2020-11-10 19:16:35 +00:00
@click="menu_shown = !menu_shown"
2020-11-09 10:46:10 +00:00
/>
<NavItem
link="/games"
icon="videogame_asset"
text="Game Profile"
2020-11-10 19:16:35 +00:00
@click="menu_shown = !menu_shown"
2020-11-09 10:46:10 +00:00
/>
<NavItem
link="/links"
icon="contacts"
text="Links"
2020-11-10 19:16:35 +00:00
@click="menu_shown = !menu_shown"
2020-11-09 10:46:10 +00:00
/>
<NavItem
link="//blog.nanao.moe"
icon="rss_feed"
text="Blog"
external="true"
2020-11-10 19:16:35 +00:00
@click="menu_shown = !menu_shown"
2020-11-09 10:46:10 +00:00
/>
2020-06-23 21:37:09 +00:00
</div>
</div>
</header>
</div>
</div>
</div>
</template>
<script>
2020-06-23 21:37:09 +00:00
import NavItem from './NavItem';
export default {
2020-06-23 21:37:09 +00:00
components: {
NavItem
},
2020-11-10 19:16:35 +00:00
data() {
return {
menu_shown: false,
};
2020-02-01 20:26:13 +00:00
},
}
</script>
<style>
2020-06-23 21:37:09 +00:00
.site-header {
2020-11-10 19:16:35 +00:00
height: 4rem;
width: 100vw;
overflow: hidden;
@apply fixed transition-all duration-300 ease-in-out;
}
.site-background {
z-index: -1;
width: 100vw;
height: 100vh;
position: absolute;
2020-06-23 21:37:09 +00:00
background-image: url('~assets/images/bg-sm.jpg');
background-size: cover;
2020-11-10 19:16:35 +00:00
background-position: right 25% top 20%;
@apply transition-all duration-300 ease-in-out;
}
.site-background {
top: -23vh;
}
.site-background.enabled {
top: 0;
}
@screen md {
.site-background {
top: 0;
right: -25vw;
}
.site-background.enabled {
top: 0;
right: 0;
}
}
.site-header.enabled {
height: 100vh;
width: 100vw;
2020-06-23 21:37:09 +00:00
}
@screen md {
.site-header {
@apply fixed;
height: 100vh;
2020-11-11 11:06:04 +00:00
width: 4rem;
2020-11-10 19:16:35 +00:00
}
.site-header.enabled {
width: 100vw;
2020-06-23 21:37:09 +00:00
}
}
@screen sm {
2020-11-10 19:16:35 +00:00
.site-background {
2020-06-23 21:37:09 +00:00
background-image: url('~assets/images/bg-md.jpg');
}
}
@screen md {
2020-11-10 19:16:35 +00:00
.site-background {
2020-06-23 21:37:09 +00:00
background-image: url('~assets/images/bg-lg.jpg');
}
}
@screen lg {
2020-11-10 19:16:35 +00:00
.site-background {
2020-06-23 21:37:09 +00:00
background-image: url('~assets/images/bg-xl.jpg');
}
}
@screen xl {
2020-11-10 19:16:35 +00:00
.site-background {
2020-06-23 21:37:09 +00:00
background-image: url('~assets/images/bg-xxl.jpg');
}
}
.site-header-inner {
2020-11-10 19:16:35 +00:00
z-index: 1;
2020-06-23 21:37:09 +00:00
background: rgba(0,0,0,0.5);
@apply w-full h-full;
}
header {
2020-11-10 19:16:35 +00:00
@apply flex flex-col transition duration-300 ease-in-out;
2020-06-23 21:37:09 +00:00
}
2020-11-10 19:16:35 +00:00
.header-top {
@apply flex flex-row;
2020-06-23 21:37:09 +00:00
}
.header-title {
@apply flex-grow transition duration-300 ease-in-out;
}
.header-title a {
2020-11-10 19:16:35 +00:00
@apply flex flex-row items-center py-4 pl-4 w-full h-full;
2020-06-23 21:37:09 +00:00
}
.header-title:hover {
@apply bg-yuika-blue-500;
}
2020-11-10 19:16:35 +00:00
#menushow {
2020-11-11 11:06:04 +00:00
@apply w-16 h-16 cursor-pointer relative p-2 text-center whitespace-no-wrap transition duration-300 ease-in-out;
}
2020-11-10 19:16:35 +00:00
#menushow:hover {
2020-06-23 21:37:09 +00:00
@apply bg-yuika-blue-500;
}
2020-11-10 19:16:35 +00:00
.header-menu .nav-menu {
max-height: 0px;
@apply block transition-all duration-300 ease-in-out overflow-hidden;
}
2020-11-10 19:16:35 +00:00
.header-menu .nav-menu.enabled {
max-height: 100vh;
}
2020-06-23 21:37:09 +00:00
@screen md {
2020-11-10 19:16:35 +00:00
.header-menu .nav-menu {
max-height: 100vh;
2020-11-11 11:06:04 +00:00
margin-left: 4rem;
2020-11-10 19:16:35 +00:00
max-width: 0px;
2020-06-23 21:37:09 +00:00
}
2020-11-10 19:16:35 +00:00
.header-menu .nav-menu.enabled {
max-width: 100vw;
2020-06-23 21:37:09 +00:00
}
}
</style>