mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-01-30 16:31:52 +01:00
- Move variables oid, oid_likes out of line - Move background-blur out of line - Move fetch-repo code out of line
14 lines
523 B
JavaScript
14 lines
523 B
JavaScript
function backgroundBlur() {
|
|
const script = document.currentScript;
|
|
const targetId = script && script.getAttribute("data-target-id") ? script.getAttribute("data-target-id")
|
|
: (console.error("data-target-id is null"), null);
|
|
|
|
window.addEventListener("scroll", () => {
|
|
const scroll = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
|
|
const backgroundBlur = document.getElementById(targetId);
|
|
backgroundBlur.style.opacity = scroll / 300;
|
|
});
|
|
}
|
|
|
|
backgroundBlur();
|