Merge pull request #7 from dansch43/master
blur content when the menu is open
This commit is contained in:
@@ -9,7 +9,7 @@ layout: compress
|
||||
<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>
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,18 @@
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 0.99;
|
||||
opacity: 0.8;
|
||||
}
|
||||
}
|
||||
|
||||
// Animation blur
|
||||
@keyframes blur {
|
||||
0% {
|
||||
filter: blur(0px);
|
||||
}
|
||||
|
||||
100% {
|
||||
filter: blur(4px);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user