Initial commit.
This commit is contained in:
10
themes/blowfish/assets/js/background-blur.js
Normal file
10
themes/blowfish/assets/js/background-blur.js
Normal file
@@ -0,0 +1,10 @@
|
||||
(() => {
|
||||
const script = document.currentScript;
|
||||
const targetId = script?.getAttribute("data-target-id");
|
||||
|
||||
window.addEventListener("scroll", () => {
|
||||
const scroll = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
|
||||
const backgroundBlur = document.getElementById(targetId);
|
||||
backgroundBlur.style.opacity = scroll / 300;
|
||||
});
|
||||
})();
|
||||
Reference in New Issue
Block a user