Merge pull request #7 from dansch43/master

blur content when the menu is open
This commit is contained in:
Mahendrata Harpi
2020-05-22 21:54:39 +07:00
committed by GitHub
6 changed files with 36 additions and 8 deletions

View File

@@ -4,12 +4,12 @@ layout: compress
<!DOCTYPE html>
<html lang="{{ page.lang | default: site.lang | default: " en " }}">
{% include header.html %}
<body>
<main aria-label="Content">
{% include navbar.html %}
<div class="wrapper not-found">
<div class="wrapper not-found" id="wrapper">
<div class="container">
<div class="title">404</div>
<p class="phrase">😕 Hmm... Seems you lost from my journey.</p>
@@ -20,4 +20,4 @@ layout: compress
</main>
</body>
</html>
</html>

View File

@@ -7,7 +7,7 @@ layout: compress
<body data-theme="{{ site.mode }}">
{% include navbar.html %}
<div class="wrapper">
<div class="wrapper" id="wrapper">
{% include author.html %}
<main aria-label="Content">
{{ content }}
@@ -15,4 +15,4 @@ layout: compress
{% include footer.html %}
</div>
</body>
</html>
</html>

View File

@@ -9,7 +9,7 @@ layout: compress
<body>
{% include navbar.html %}
<div class="wrapper">
<div class="wrapper" id="wrapper">
<header class="header">
<h1 class="header-title center" itemprop="headline">{{ page.title | escape }}.</h1>
</header>
@@ -20,4 +20,4 @@ layout: compress
</div>
</body>
</html>
</html>

View File

@@ -271,6 +271,11 @@ blockquote {
max-width: calc(#{$narrow-size} - (#{$spacing-full}));
padding-right: $spacing-full - 10;
padding-left: $spacing-full - 10;
&.trigger-wrapper {
animation: 0.2s ease-in forwards blur;
-webkit-animation: 0.2s ease-in forwards blur;
}
}
}

View File

@@ -5,7 +5,18 @@
}
100% {
opacity: 0.99;
opacity: 0.8;
}
}
// Animation blur
@keyframes blur {
0% {
filter: blur(0px);
}
100% {
filter: blur(4px);
}
}

View File

@@ -32,4 +32,16 @@
}
}
}
// Blur content when the menu is open
const checkbox = document.getElementById("menu-trigger");
const wrapper = document.getElementById("wrapper");
checkbox.addEventListener("change", function() {
if (this.checked) {
wrapper.classList.add("trigger-wrapper");
} else {
wrapper.classList.remove("trigger-wrapper");
}
});
})();