blur content when the menu is open
This commit is contained in:
@@ -9,7 +9,7 @@ layout: compress
|
|||||||
<body>
|
<body>
|
||||||
<main aria-label="Content">
|
<main aria-label="Content">
|
||||||
{% include navbar.html %}
|
{% include navbar.html %}
|
||||||
<div class="wrapper not-found">
|
<div class="wrapper not-found" id="wrapper">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="title">404</div>
|
<div class="title">404</div>
|
||||||
<p class="phrase">😕 Hmm... Seems you lost from my journey.</p>
|
<p class="phrase">😕 Hmm... Seems you lost from my journey.</p>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ layout: compress
|
|||||||
|
|
||||||
<body data-theme="{{ site.mode }}">
|
<body data-theme="{{ site.mode }}">
|
||||||
{% include navbar.html %}
|
{% include navbar.html %}
|
||||||
<div class="wrapper">
|
<div class="wrapper" id="wrapper">
|
||||||
{% include author.html %}
|
{% include author.html %}
|
||||||
<main aria-label="Content">
|
<main aria-label="Content">
|
||||||
{{ content }}
|
{{ content }}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ layout: compress
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
{% include navbar.html %}
|
{% include navbar.html %}
|
||||||
<div class="wrapper">
|
<div class="wrapper" id="wrapper">
|
||||||
<header class="header">
|
<header class="header">
|
||||||
<h1 class="header-title center" itemprop="headline">{{ page.title | escape }}.</h1>
|
<h1 class="header-title center" itemprop="headline">{{ page.title | escape }}.</h1>
|
||||||
</header>
|
</header>
|
||||||
|
|||||||
@@ -271,6 +271,11 @@ blockquote {
|
|||||||
max-width: calc(#{$narrow-size} - (#{$spacing-full}));
|
max-width: calc(#{$narrow-size} - (#{$spacing-full}));
|
||||||
padding-right: $spacing-full - 10;
|
padding-right: $spacing-full - 10;
|
||||||
padding-left: $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% {
|
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