Header menu routes have animated arrows on hover.

This commit is contained in:
2021-01-02 14:27:45 +01:00
parent 242aa28847
commit 8044759264
3 changed files with 43 additions and 22 deletions

View File

@@ -1,7 +1,7 @@
@import "./media-queries.scss";
@import "./variables.scss";
.top-banner{
.top-banner {
position: sticky;
top: 0;
z-index: 1;
@@ -24,11 +24,11 @@
}
}
.company-logo{
.company-logo {
grid-area: logo;
}
.menu-toggle-container{
.menu-toggle-container {
grid-area: menu;
color: #1e1e1e;
border-radius: 50% 50%;
@@ -40,11 +40,12 @@
flex-direction: column;
justify-content: center;
align-items: center;
&:hover{
&:hover {
cursor: pointer;
}
span{
span {
display: block;
position: relative;
border-radius: 3px;
@@ -53,46 +54,45 @@
background: #111;
z-index: 1;
transform-origin: 4px 0px;
transition:
transition:
transform 0.5s cubic-bezier(0.77,0.2,0.05,1.0),
background 0.5s cubic-bezier(0.77,0.2,0.05,1.0),
opacity 0.55s ease;
}
span:first-child{
span:first-child {
transform-origin: 0% 0%;
margin-bottom: 4px;
}
span:nth-last-child(2){
span:nth-last-child(2) {
transform-origin: 0% 100%;
margin-bottom: 4px;
}
&.open{
&.open {
span{
opacity: 1;
transform: rotate(-45deg) translate(2px, -2px);
background: #232323;
}
span:nth-last-child(2){
span:nth-last-child(2) {
opacity: 0;
transform: rotate(0deg) scale(0.2, 0.2);
}
span:nth-last-child(3){
span:nth-last-child(3) {
transform: rotate(45deg) translate(3.5px, -2px);
}
}
&.open{
&.open {
background: #fff;
}
}
.menu{
.menu {
position: fixed;
top: 0;
background-color: $primary;
@@ -108,15 +108,33 @@
justify-content: center;
row-gap: 3em;
&.collapsed{
&.collapsed {
max-height: 0%;
}
a{
a {
text-decoration: none;
position: relative;
&:hover {
.icon {
opacity: 100%;
right: -2.5rem;
}
}
.icon {
opacity: 0%;
position: absolute;
top: 35%;
right: 0;
color: $link-color;
font-size: 1.4rem;
transition: all 0.25s;
}
}
.single-route{
.single-route {
font-size: 3em;
outline: 0;
text-decoration: none;
@@ -124,16 +142,17 @@
border-bottom: 4px solid transparent;
display: block;
&.open{
&.open {
-webkit-animation: fadeInFromNone 3s ease-out;
-moz-animation: fadeInFromNone 3s ease-out;
-o-animation: fadeInFromNone 3s ease-out;
animation: fadeInFromNone 3s ease-out;
}
&:hover{
&:hover {
cursor: pointer;
border-color: $link-color;
}
}
}

View File

@@ -68,4 +68,5 @@ form {
width: calc(100% - 5rem);
background-color: $light-red;
color: $red;
font-size: 1.5rem;
}

View File

@@ -13,10 +13,11 @@
<nav class="menu" :class="isOpen ? 'open' : 'collapsed'" >
<router-link v-for="(route, index) in routes" :key="index" :to="route.route" class="menu-item-link" >
<a @click="toggleMenu" class="single-route" :class="isOpen ? 'open' : 'collapsed'">{{route.name}}</a>
<a @click="toggleMenu" class="single-route" :class="isOpen ? 'open' : 'collapsed'">{{ route.name }}</a>
<i class="icon icon--arrow-right"></i>
</router-link>
</nav>
<div class="clock">
<h2 v-if="!fiveMinutesLeft || !tenMinutesOver">
<span v-if="days > 0">{{ pad(days) }}:</span>