menu overlay fade in
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
{{ partial "head.html" . }}
|
{{ partial "head.html" . }}
|
||||||
<body class="single-body">
|
<body class="single-body">
|
||||||
{{ partial "nav-bar.html" . }}
|
{{ partial "nav-bar.html" . }}
|
||||||
<main class="content side-padding">
|
<main class="content side-text-padding">
|
||||||
<article class="post">
|
<article class="post">
|
||||||
<header class="post-header">
|
<header class="post-header">
|
||||||
<h1 class="post-title">{{ .Title }}</h1>
|
<h1 class="post-title">{{ .Title }}</h1>
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
<nav class="nav-bar side-padding">
|
<nav class="nav-bar side-padding">
|
||||||
<h1 class="nav-header"><a href="/" class="nav-text">mdd</a></h1>
|
<h1 class="nav-header"><a href="/" class="nav-text">mdd</a></h1>
|
||||||
<div class="hamburger-menu">
|
<div class="hamburger-menu">
|
||||||
<input type="checkbox" />
|
<input type="checkbox" onclick="hamburgerMenuPressed()"/>
|
||||||
<span></span>
|
<span></span>
|
||||||
<span></span>
|
<span></span>
|
||||||
<ul class="hamburger-menu-view">
|
<ul class="hamburger-menu-view">
|
||||||
|
<li><a href="/">Home</a></li>
|
||||||
{{ range $key, $value := .Site.Taxonomies.categories }}
|
{{ range $key, $value := .Site.Taxonomies.categories }}
|
||||||
<li><a href="{{ $.Site.BaseURL }}categories/{{ $key | urlize }}">{{ $key | humanize }}</a></li>
|
<li><a href="/categories/{{ $key | urlize }}">{{ $key | humanize }}</a></li>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ body {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
p {
|
p {
|
||||||
margin: 1em 0;
|
margin: 1em 0;
|
||||||
@@ -31,11 +33,12 @@ strong {
|
|||||||
}
|
}
|
||||||
.nav-text {
|
.nav-text {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
z-index: 105;
|
||||||
}
|
}
|
||||||
.hamburger-menu {
|
.hamburger-menu {
|
||||||
display: block;
|
display: block;
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 1;
|
z-index: 105;
|
||||||
-webkit-user-select: none;
|
-webkit-user-select: none;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
@@ -47,7 +50,7 @@ strong {
|
|||||||
top: -9px;
|
top: -9px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
opacity: 0; /* hide this */
|
opacity: 0; /* hide this */
|
||||||
z-index: 2; /* and place it over the hamburger */
|
z-index: 500; /* and place it over the hamburger */
|
||||||
-webkit-touch-callout: none;
|
-webkit-touch-callout: none;
|
||||||
}
|
}
|
||||||
.hamburger-menu span {
|
.hamburger-menu span {
|
||||||
@@ -57,7 +60,7 @@ strong {
|
|||||||
position: relative;
|
position: relative;
|
||||||
background: #3A3B3C;
|
background: #3A3B3C;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
z-index: 1;
|
z-index: 105;
|
||||||
transform-origin: center;
|
transform-origin: center;
|
||||||
transition: transform 0.5s cubic-bezier(0.77,0.2,0.05,1.0),
|
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),
|
background 0.5s cubic-bezier(0.77,0.2,0.05,1.0),
|
||||||
@@ -68,34 +71,48 @@ strong {
|
|||||||
}
|
}
|
||||||
.hamburger-menu input:checked ~ span {
|
.hamburger-menu input:checked ~ span {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
background: white;
|
||||||
transform: rotate(45deg) translate(3.2px , 3.2px);
|
transform: rotate(45deg) translate(3.2px , 3.2px);
|
||||||
}
|
}
|
||||||
.hamburger-menu input:checked ~ span:nth-last-child(2) {
|
.hamburger-menu input:checked ~ span:nth-last-child(2) {
|
||||||
transform: rotate(-45deg) translate(3.2px , -3.2px);
|
transform: rotate(-45deg) translate(3.2px , -3.2px);
|
||||||
}
|
}
|
||||||
.hamburger-menu input ~ ul {
|
.hamburger-menu input ~ ul {
|
||||||
display: none;
|
|
||||||
text-align: center;
|
|
||||||
padding: 3em 0 0 0;
|
|
||||||
transition: all 1s cubic-bezier(0.77,0.2,0.05,1.0);
|
|
||||||
}
|
|
||||||
.hamburger-menu > ul > li > a {
|
|
||||||
text-decoration: none;
|
|
||||||
font-size: 2em;
|
|
||||||
line-height: 1.7;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
.hamburger-menu input:checked ~ ul {
|
|
||||||
display: block;
|
display: block;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
box-sizing: border-box;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
box-sizing: border-box;
|
z-index: 100;
|
||||||
|
text-align: center;
|
||||||
|
visibility: hidden;
|
||||||
|
overflow-y: hidden;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
background-color: rgba(0, 0, 0, 0.8);
|
padding: 3em 0 0 0;
|
||||||
|
background-color: rgb(0, 0, 0);
|
||||||
|
opacity: 0;
|
||||||
|
transition: visibility 0.3s ease-out, opacity 0.3s ease-out;
|
||||||
}
|
}
|
||||||
|
.hamburger-menu input:checked ~ ul {
|
||||||
|
visibility: visible;
|
||||||
|
opacity: 0.9;
|
||||||
|
overflow-y: scroll;
|
||||||
|
}
|
||||||
|
.hamburger-menu > ul > li > a {
|
||||||
|
text-decoration: none;
|
||||||
|
text-transform: uppercase;
|
||||||
|
font-size: 2em;
|
||||||
|
line-height: 1.7;
|
||||||
|
color: white;
|
||||||
|
transition: all 0.5s ease-out;
|
||||||
|
/* opacity: 0; */
|
||||||
|
}
|
||||||
|
/* .hamburger-menu input:checked ~ ul li a {
|
||||||
|
font-size: 1.8em;
|
||||||
|
opacity: 1;
|
||||||
|
} */
|
||||||
.post {
|
.post {
|
||||||
margin: 0 0 1em 0;
|
margin: 0 0 1em 0;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
@@ -230,7 +247,7 @@ strong {
|
|||||||
}
|
}
|
||||||
.end-nav {
|
.end-nav {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 47rem;
|
max-width: 49rem;
|
||||||
}
|
}
|
||||||
.pagination-nav {
|
.pagination-nav {
|
||||||
margin: 2em 0;
|
margin: 2em 0;
|
||||||
@@ -256,17 +273,26 @@ strong {
|
|||||||
transform: scale(1);
|
transform: scale(1);
|
||||||
}
|
}
|
||||||
.side-gutter {
|
.side-gutter {
|
||||||
margin-left: 0.7rem !important;
|
margin-left: 1rem !important;
|
||||||
margin-right: 0.7rem !important;
|
margin-right: 1rem !important;
|
||||||
}
|
}
|
||||||
.side-padding {
|
.side-padding {
|
||||||
padding-left: 0.7rem !important;
|
padding-left: 1rem !important;
|
||||||
padding-right: 0.7rem !important;
|
padding-right: 1rem !important;
|
||||||
|
box-sizing: border-box !important;
|
||||||
|
}
|
||||||
|
.side-text-padding {
|
||||||
|
padding-left: 1.2rem !important;
|
||||||
|
padding-right: 1.2rem !important;
|
||||||
box-sizing: border-box !important;
|
box-sizing: border-box !important;
|
||||||
}
|
}
|
||||||
.muted-text {
|
.muted-text {
|
||||||
color: #7A7B7C;
|
color: #7A7B7C;
|
||||||
}
|
}
|
||||||
|
.no-scroll {
|
||||||
|
overflow: hidden;
|
||||||
|
position: fixed;
|
||||||
|
}
|
||||||
h1, h2, h3, h4, h5, h6 {
|
h1, h2, h3, h4, h5, h6 {
|
||||||
margin: 1.5em 0 0.7em 0;
|
margin: 1.5em 0 0.7em 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
|
|
||||||
|
|
||||||
function cardPressed() {
|
function cardPressed() {
|
||||||
this.classList.add('card-hover');
|
this.classList.add('card-hover');
|
||||||
}
|
}
|
||||||
@@ -6,3 +7,14 @@ function cardPressed() {
|
|||||||
function cardReleased() {
|
function cardReleased() {
|
||||||
this.classList.remove('card-hover');
|
this.classList.remove('card-hover');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function hamburgerMenuPressed() {
|
||||||
|
if (document.body.classList.contains('no-scroll')) {
|
||||||
|
document.body.classList.remove('no-scroll');
|
||||||
|
document.body.style.paddingRight = 0 + "px";
|
||||||
|
} else {
|
||||||
|
document.body.style.paddingRight = window.innerWidth - document.documentElement.clientWidth + "px";
|
||||||
|
document.body.classList.add('no-scroll');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user