From 0b9076a2fdeec1689871360ac4b3d3debce400cc Mon Sep 17 00:00:00 2001 From: nercone-dev Date: Sat, 25 Apr 2026 03:42:53 +0900 Subject: [PATCH] -- --- public/assets/css/style-extra.css | 20 ++++++++++++-------- public/assets/js/script-extra.js | 28 ++-------------------------- 2 files changed, 14 insertions(+), 34 deletions(-) diff --git a/public/assets/css/style-extra.css b/public/assets/css/style-extra.css index 5f38269..4b9273d 100644 --- a/public/assets/css/style-extra.css +++ b/public/assets/css/style-extra.css @@ -15,6 +15,7 @@ header { will-change: transform; background-color: transparent; overflow: hidden; + isolation: isolate; } header::after { content: ''; @@ -25,21 +26,24 @@ header::after { pointer-events: none; } .header-blur { - position: fixed; - top: 0; - left: 0; - right: 0; - z-index: 9; + position: absolute; + inset: 0; + z-index: -2; pointer-events: none; } -.blur-layer { +.header-blur > div { position: absolute; inset: 0; backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur)); - -webkit-mask-image: var(--mask); - mask-image: var(--mask); + -webkit-mask-image: linear-gradient(to top, transparent var(--from), black var(--to)); + mask-image: linear-gradient(to top, transparent var(--from), black var(--to)); } +.header-blur > div:nth-child(1) { --blur: 1px; --from: 0%; --to: 20%; } +.header-blur > div:nth-child(2) { --blur: 2px; --from: 20%; --to: 40%; } +.header-blur > div:nth-child(3) { --blur: 4px; --from: 40%; --to: 60%; } +.header-blur > div:nth-child(4) { --blur: 8px; --from: 60%; --to: 80%; } +.header-blur > div:nth-child(5) { --blur: 16px; --from: 80%; --to: 100%; } /* Fonts */ @font-face { diff --git a/public/assets/js/script-extra.js b/public/assets/js/script-extra.js index 72dbbba..512c392 100644 --- a/public/assets/js/script-extra.js +++ b/public/assets/js/script-extra.js @@ -3,35 +3,11 @@ const header = document.querySelector('header'); if (!header) return; - const LAYERS = [ - { blur: 1, from: 0, to: 15 }, - { blur: 3, from: 15, to: 35 }, - { blur: 6, from: 35, to: 55 }, - { blur: 10, from: 55, to: 75 }, - { blur: 16, from: 75, to: 95 }, - ]; - const container = document.createElement('div'); container.className = 'header-blur'; container.setAttribute('aria-hidden', 'true'); - - LAYERS.forEach(cfg => { - const layer = document.createElement('div'); - layer.className = 'blur-layer'; - layer.style.setProperty('--blur', cfg.blur + 'px'); - layer.style.setProperty( - '--mask', - `linear-gradient(to top, transparent ${cfg.from}%, black ${cfg.to}%)` - ); - container.appendChild(layer); - }); - - header.parentNode.insertBefore(container, header); - - const sync = () => { container.style.height = header.offsetHeight + 'px'; }; - sync(); - if ('ResizeObserver' in window) new ResizeObserver(sync).observe(header); - else window.addEventListener('resize', sync); + for (let i = 0; i < 5; i++) container.appendChild(document.createElement('div')); + header.prepend(container); })(); /* View Transition */