Welcome to HackHive, a Hack Club node for teenage builders in Delhi. This is the code for the website.
The site is built with React, Vite, Tailwind CSS, and Framer Motion. Here’s a quick look at the cool frontend mechanics:
When you first scroll, the HackHive logo zooms in and fades out to transition into the main content. We do this by mapping the scroll position directly to the scale and opacity:
const { scrollY } = useScroll();
const textScale = useTransform(scrollY, [0, scrollLimit * 0.8], [1, 25]);
const textOpacity = useTransform(scrollY, [scrollLimit * 0.3, scrollLimit * 0.8], [1, 0]);- Once the scroll reaches
scrollLimit, a direct CSSdisplay: nonestyle mapping is triggered. This completely hides the intro overlays so the browser stops rendering invisible elements and stops wasting CPU/GPU resources.
The solar system orbits in the background scale down and rotate dynamically.
- To prevent rendering glitches and flickering (common when nesting transforms in Chrome/Safari), we use compositor-thread CSS keyframe animations for the rotation instead of Framer Motion JS loops:
@keyframes rotate-clockwise { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
- All glow and shadow effects are rendered using hardware-accelerated radial gradients rather than heavy SVG/CSS blur filters.
Behind everything is a interactive particle grid (components/Constellations.tsx). It uses a 2D spatial-hashing grid to bucket particles into local cells, ensuring distance checks between particles run in
Bring your own tools, clone, and run:
# Install dependencies
npm install
# Start the dev server
npm run dev
# Build for production
npm run build