grid-cursor

Grid Cursor Project Documentation

Overview

This project is a minimal interactive hero section built with Next.js and React that creates a visually engaging “spotlight” effect on a grid background, following the user’s mouse cursor. Inspired by eternal’s (which powers blinkit and zomato) hero section .

Features

How It Works

Main Entry (page.tsx)

GridCursor Component (GridCursor.tsx)

Mouse Tracking (useMousePosition.ts)

Styling (page.module.scss)

Technologies Used

Spotlight Effect Details

  1. The grid is rendered as a background using CSS gradients.
  2. A CSS mask (radial gradient) is applied to the grid, centered at the animated cursor position.
  3. The mask is animated using Framer Motion’s spring physics, so the spotlight smoothly follows the mouse with a natural, elastic feel.