Free
🤖 AI
Starfall Canvas
Canvas starfield with occasional shooting stars and cursor gravity — lightweight and mesmerizing.
2.8k views 435 copies 256 words
The Prompt
# Starfall Canvas — Animated Background ## Goal Build a canvas-based starfield background: 200 twinkling stars, rare shooting stars, and gentle cursor gravity. It must drop cleanly into an existing Next.js + Tailwind project as a self-contained component. ## Design Spec - Canvas fills the section (device-pixel-ratio aware resize handler); base painted #05070D each frame with 0.25 alpha for subtle motion trails. - Stars: 200 points, radius 0.3-1.4px, brightness mapped to radius; 10% get a faint cross-glint (two 1px lines) — the detail people feel but don't spot. - Shooting star: every 6-14s, a streak with gradient tail (140px) crosses at a shallow angle, 900ms lifespan. - A soft radial vignette (CSS, not canvas) keeps edges darker so content pops. - Component wraps children; canvas is aria-hidden and pointer-events-none. ## Motion Spec - Twinkle: each star's alpha follows its own sine (random period 2-6s, phase offset). - Cursor gravity: stars within 120px of pointer drift 2-6px toward it, spring back on leave — simple velocity easing, no physics lib. - Pause entirely when off-screen (IntersectionObserver); cap work when tab is hidden. - Respect `prefers-reduced-motion` — provide a static fallback that still looks intentional. ## Component API - `<Starfall density?: number shooting?: boolean children />` — density scales star count by viewport area. ## Quality Bar - TypeScript strict, zero `any`. Tailwind only — no external CSS files. - Works on mobile: touch targets ≥ 44px, no hover-only affordances. - 60fps: animate only `transform` and `opacity`; use `will-change` sparingly. - Accessible: correct roles/aria, keyboard operable, focus-visible styles.
You may also like
Free
Featured
Fastshot Landing
🤖 AI
Single-screen AI app-builder landing: full-bleed dawn video, glass composer card and a pixel-specified absolute toolbar.
4.0k 639CursorClaude CodeLovable
Free
Palomar
🤖 AI
Quiet editorial landing hero for an LLM platform: cream-and-forest palette, frosted pill over a full-bleed landscape video, wordmarks set in five display faces.
2.9k 245CursorClaude CodeLovable
Premium
Ink Flow Waves
🎨 Portfolio
Slow liquid ink waves rendered with layered SVG paths and turbulence — organic motion for editorial sites.
4.5k 685CursorClaude CodeWindsurf
Free
Logoipsum
🤖 AI
Hero over a looping film whose loop seam is hand-rolled: a requestAnimationFrame fade system cross-fades the video out 0.55s before the end and back in after a manual restart, under a glass prompt box.
1.8k 152CursorClaude CodeLovable