mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-01-23 06:55:43 -06:00
Merge pull request #548 from nunocoracao/547-new-header-that-blurs-to-background-color
✨ new header that blurs to background color
This commit is contained in:
commit
cff12498dc
5 changed files with 17 additions and 6 deletions
|
@ -62,9 +62,6 @@ window.addEventListener("DOMContentLoaded", (event) => {
|
|||
var updateMeta = () => {
|
||||
var elem, style;
|
||||
elem = document.querySelector('body');
|
||||
console.log(elem)
|
||||
style = getComputedStyle(elem);
|
||||
console.log(style.backgroundColor)
|
||||
|
||||
document.querySelector('meta[name="theme-color"]').setAttribute('content', style.backgroundColor);
|
||||
}
|
|
@ -24,7 +24,7 @@ disableImageOptimization = false
|
|||
# smartTOCHideUnfocusedChildren = true
|
||||
|
||||
[header]
|
||||
layout = "basic" # valid options: basic, fixed, fixed-fill
|
||||
layout = "basic" # valid options: basic, fixed, fixed-fill, fixed-fill-blur
|
||||
|
||||
[footer]
|
||||
showMenu = true
|
||||
|
|
|
@ -24,7 +24,7 @@ smartTOC = true
|
|||
smartTOCHideUnfocusedChildren = true
|
||||
|
||||
[header]
|
||||
layout = "fixed" # valid options: basic, fixed, fixed-fill
|
||||
layout = "fixed" # valid options: basic, fixed, fixed-fill, fixed-fill-blur
|
||||
|
||||
[footer]
|
||||
showMenu = true
|
||||
|
|
|
@ -154,7 +154,7 @@ Many of the article defaults here can be overridden on a per article basis by sp
|
|||
|
||||
| Name | Default | Description |
|
||||
| --------------- | --------- | --------------------------------------------------------------------------------- |
|
||||
| `header.layout` | `"basic"` | Defines the header for the entire site, supported values are `basic`, `fixed`, and `fixed-fill`. |
|
||||
| `header.layout` | `"basic"` | Defines the header for the entire site, supported values are `basic`, `fixed`, `fixed-fill`, and `fixed-fill-blur`. |
|
||||
### Footer
|
||||
|
||||
| Name | Default | Description |
|
||||
|
|
14
layouts/partials/header/fixed-fill-blur.html
Normal file
14
layouts/partials/header/fixed-fill-blur.html
Normal file
|
@ -0,0 +1,14 @@
|
|||
<div class="min-h-[148px]"></div>
|
||||
<div class="fixed inset-x-0 pl-[24px] pr-[24px]" style="z-index:100">
|
||||
<div id="menu-blur" class="absolute opacity-0 inset-x-0 top-0 h-full single_hero_background nozoom bg-neutral dark:bg-neutral-800"></div>
|
||||
<div class="relative max-w-[64rem] ml-auto mr-auto">
|
||||
{{ partial "partials/header/basic.html" . }}
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.addEventListener('scroll', function (e) {
|
||||
var scroll = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
|
||||
var background_blur = document.getElementById('menu-blur');
|
||||
background_blur.style.opacity = (scroll / 300);
|
||||
});
|
||||
</script>
|
Loading…
Reference in a new issue