import React, { useState, useEffect, useRef } from 'react';
import { ArrowRight, Menu, X, ArrowUpRight } from 'lucide-react';
// --- Custom Hook for Intersection Observer (Scroll Animations) ---
const useOnScreen = (options) => {
const ref = useRef(null);
const [isVisible, setIsVisible] = useState(false);
useEffect(() => {
const observer = new IntersectionObserver(([entry]) => {
if (entry.isIntersecting) {
setIsVisible(true);
observer.disconnect(); // Trigger only once
}
}, options);
if (ref.current) {
observer.observe(ref.current);
}
return () => {
if (ref.current) observer.unobserve(ref.current);
};
}, [ref, options]);
return [ref, isVisible];
};
// --- Components ---
const Navbar = () => {
const [isScrolled, setIsScrolled] = useState(false);
const [isOpen, setIsOpen] = useState(false);
useEffect(() => {
const handleScroll = () => {
setIsScrolled(window.scrollY > 50);
};
window.addEventListener('scroll', handleScroll);
return () => window.removeEventListener('scroll', handleScroll);
}, []);
return (
);
};
const Hero = () => {
const [mousePos, setMousePos] = useState({ x: 0, y: 0 });
useEffect(() => {
const handleMouseMove = (e) => {
setMousePos({
x: (e.clientX / window.innerWidth - 0.5) * 20, // -10 to 10
y: (e.clientY / window.innerHeight - 0.5) * 20,
});
};
window.addEventListener('mousemove', handleMouseMove);
return () => window.removeEventListener('mousemove', handleMouseMove);
}, []);
return (
Beyond the Visual
Silent
Impact
True impact does not scream; it resonates. We create digital experiences that linger in the mind like a haunting melody. By stripping away the noise, we reveal the essential core.