Converted some objects to components.
This commit is contained in:
96
public/styles/components/_hamburger-menu.scss
Normal file
96
public/styles/components/_hamburger-menu.scss
Normal file
@ -0,0 +1,96 @@
|
||||
/*
|
||||
* Hamburger Menu
|
||||
* Mobile-Centric openable menu with a hamburger icon to toggle.
|
||||
*
|
||||
* Dependencies:
|
||||
* styles/settings/animation.scss
|
||||
* styles/settings/colors.scss
|
||||
* styles/settings/z.scss
|
||||
*
|
||||
* Version:
|
||||
* 1.0.0 - 2018/06/12
|
||||
*/
|
||||
$c-hamburger-menu--max: 200%;
|
||||
$c-hamburger-menu--pos-x: 100%;
|
||||
$c-hamburger-menu--pos-y: 0%;
|
||||
@include t-keyframes(c-hamburger-menu--open) {
|
||||
from { clip-path: circle(0% at $c-hamburger-menu--pos-x $c-hamburger-menu--pos-y); }
|
||||
to { clip-path: circle($c-hamburger-menu--max at $c-hamburger-menu--pos-x $c-hamburger-menu--pos-y); }
|
||||
}
|
||||
|
||||
@include t-keyframes(c-hamburger-menu--close) {
|
||||
from { clip-path: circle($c-hamburger-menu--max at $c-hamburger-menu--pos-x $c-hamburger-menu--pos-y); }
|
||||
to { clip-path: circle(0% at $c-hamburger-menu--pos-x $c-hamburger-menu--pos-y); }
|
||||
}
|
||||
|
||||
.c-hamburger-menu {
|
||||
|
||||
&__menu {
|
||||
display: none;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: $s-color--menu__background;
|
||||
transition: all 1s $s-animation--ease-out;
|
||||
|
||||
z-index: $s-z--menu;
|
||||
|
||||
@include t-animation-fill-mode(forwards);
|
||||
@include t-animation-timing-function($s-animation--ease-out);
|
||||
@include t-animation-duration(0.4s);
|
||||
}
|
||||
|
||||
&__links {
|
||||
@extend %t-list-blank;
|
||||
padding: 1em;
|
||||
}
|
||||
|
||||
&__link {
|
||||
@extend %t-list-litem-blank;
|
||||
display: block;
|
||||
font-size: 1.25em;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
border: 1px solid red;
|
||||
|
||||
&-link {
|
||||
position: relative;
|
||||
display: block;
|
||||
padding: 1.5em 0;
|
||||
}
|
||||
|
||||
&:hover:before {
|
||||
//@include t-translate-x(5%); Disabled due to not being needed on mobile
|
||||
}
|
||||
}
|
||||
|
||||
&__button {
|
||||
position: relative;//Helps us win the Z-Fight
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 0.5em;
|
||||
cursor: pointer;
|
||||
z-index: $s-z--menu-button;
|
||||
}
|
||||
|
||||
&__icon {
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
&.is-open {
|
||||
.c-hamburger-menu__menu {
|
||||
display: block;
|
||||
@include t-animation-name(c-hamburger-menu--open);
|
||||
}
|
||||
}
|
||||
|
||||
&.is-closing {
|
||||
.c-hamburger-menu__menu {
|
||||
display: block;
|
||||
@include t-animation-name(c-hamburger-menu--close);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user