mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-10-10 22:09:31 +00:00
Floating glass header with ⌘K search, landing homepage layout with hero image and GitHub-stars CTA, background canvas with dissolving heroes, burufugu colour scheme, movie-quote 404, taxonomy pills, keyboard/ARIA accessibility across menus, search and tabs, idle- loaded third-party scripts, and dedicated print styles. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
25 lines
675 B
JavaScript
25 lines
675 B
JavaScript
(function () {
|
|
var script = document.currentScript;
|
|
var target = document.getElementById(script.getAttribute("data-hero-id"));
|
|
if (!target) return;
|
|
var distance = parseInt(script.getAttribute("data-fade-distance"), 10) || 500;
|
|
var ticking = false;
|
|
function update() {
|
|
ticking = false;
|
|
var opacity = Math.max(0, 1 - window.scrollY / distance);
|
|
target.style.opacity = opacity;
|
|
target.style.visibility = opacity === 0 ? "hidden" : "visible";
|
|
}
|
|
window.addEventListener(
|
|
"scroll",
|
|
function () {
|
|
if (!ticking) {
|
|
ticking = true;
|
|
requestAnimationFrame(update);
|
|
}
|
|
},
|
|
{ passive: true }
|
|
);
|
|
update();
|
|
})();
|