mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-17 16:46:31 +03:00
Major changes: - Consolidate 8 design skills into single frontend-design skill with 7 reference files - Add source/patterns.md as single source of truth for patterns/antipatterns - Patterns are merged into skill during build, served via API for website - Website now dynamically renders both "What TO Do" and "What NOT to Do" sections - Update build system to handle directory-based skills with references - Add /api/patterns endpoint to server - Refactor website with new Antidote section layout 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
50 lines
1.1 KiB
JavaScript
50 lines
1.1 KiB
JavaScript
import Lenis from "lenis";
|
|
|
|
export function initSmoothScroll() {
|
|
const lenis = new Lenis({
|
|
duration: 1.2,
|
|
easing: (t) => Math.min(1, 1.001 - 2 ** (-10 * t)),
|
|
orientation: "vertical",
|
|
gestureOrientation: "vertical",
|
|
smoothWheel: true,
|
|
wheelMultiplier: 1,
|
|
touchMultiplier: 2,
|
|
});
|
|
|
|
function raf(time) {
|
|
lenis.raf(time);
|
|
requestAnimationFrame(raf);
|
|
}
|
|
|
|
requestAnimationFrame(raf);
|
|
|
|
// Handle anchor links
|
|
document.querySelectorAll('a[href^="#"]').forEach((anchor) => {
|
|
anchor.addEventListener("click", (e) => {
|
|
e.preventDefault();
|
|
const target = document.querySelector(anchor.getAttribute("href"));
|
|
if (target) {
|
|
lenis.scrollTo(target, { offset: -40 });
|
|
}
|
|
});
|
|
});
|
|
|
|
return lenis;
|
|
}
|
|
|
|
export function initScrollIndicator() {
|
|
const indicator = document.querySelector(".hero-scroll-indicator");
|
|
if (!indicator) return;
|
|
|
|
function update() {
|
|
if (window.scrollY > 20) {
|
|
indicator.classList.add("hidden");
|
|
} else {
|
|
indicator.classList.remove("hidden");
|
|
}
|
|
}
|
|
|
|
window.addEventListener("scroll", update, { passive: true });
|
|
update();
|
|
}
|