import { useEffect, useRef, useState } from "react"; import { ChevronDown } from "lucide-react"; export default function Intro() { const [visible, setVisible] = useState(false); const ref = useRef(null); useEffect(() => { const el = ref.current; if (!el) return; const rect = el.getBoundingClientRect(); const inView = rect.top < window.innerHeight && rect.bottom > 0; const isReload = performance.getEntriesByType?.("navigation")?.[0]?.type === "reload"; if (inView && isReload) { setVisible(true); return; } if (inView) { // Fresh navigation — animate in requestAnimationFrame(() => setVisible(true)); return; } const observer = new IntersectionObserver( ([entry]) => { if (entry.isIntersecting) { setVisible(true); observer.disconnect(); } }, { threshold: 0.2 } ); observer.observe(el); return () => observer.disconnect(); }, []); const scrollToNext = () => { const nextSection = document.querySelector("section")?.nextElementSibling; if (nextSection) { const offset = (nextSection as HTMLElement).offsetTop - (window.innerHeight - (nextSection as HTMLElement).offsetHeight) / 2; window.scrollTo({ top: offset, behavior: "smooth" }); } }; const anim = (delay: number) => ({ opacity: visible ? 1 : 0, transform: visible ? "translateY(0)" : "translateY(20px)", transition: `all 0.7s ease-out ${delay}ms`, }) as React.CSSProperties; return (
Timothy Pidashev

Timothy Pidashev

Software Systems Engineer

Open Source Enthusiast

Coffee Connoisseur

"Turning coffee into code" isn't just a clever phrase – it's how I approach each project: methodically, with attention to detail, and a refined process.

); }