A visually stunning, interactive 404 error page with a black hole/space theme featuring particle animations, mouse/touch interaction, and a "space warp" effect to return home.
- Real-time canvas-based black hole animation with particle accretion disk
- Mouse/touch tracking (black hole follows cursor with easing)
- Gravitational redshift color effects on particles
- Interactive "Initiate Space Warp" button with smooth fade-out transition
- Responsive design (works on mobile/desktop)
- Cosmic-themed UI with 3D text perspective and glow effects
- Open Graph meta tags for social sharing
- Smooth resize handling
To see the page in action:
- Clone this repository
- Open
404.htmlin a modern web browser - Hover/move your cursor to interact with the black hole
- Click "Initiate Space Warp" to trigger the warp effect and return to the home page (replace
/in the code with your actual home URL)
- Upload the entire file structure to your web server/GitHub Pages repository
- Configure your web server to use
404.htmlas the custom 404 error page:- For GitHub Pages: Place
404.htmlin the root of your repository (GitHub automatically uses it as the 404 page) - For Apache: Add
ErrorDocument 404 /404.htmlto your.htaccessfile - For Nginx: Add
error_page 404 /404.html;to your server configuration
- For GitHub Pages: Place
- Text/Content: Modify the
error-code,error-msg, and button text in the HTML - Colors: Adjust the hex/rgba values in the inline CSS (black hole glow, button colors, background)
- Animation: Tweak values like
maxParticles,blackHole.radius,gravity, andwarpProgressin the JavaScript - Home URL: Change
window.location.href = '/'(in theanimate()function) to your actual home page URL
- Adjust particle count (maxParticles) for performance (lower = faster on mobile)
- Modify black hole gravity/acceleration values
- Change the warp speed (warpProgress increment value)
- Update the Open Graph meta tags (title, description, image) to match your brand
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
- Mobile Safari/Chrome (responsive support)
- The canvas animation uses requestAnimationFrame for optimal performance
- Particle count is capped at 1400 (reduce for older devices)
- Touch interactions are passive to prevent scrolling issues on mobile
This project is originally created and released by heretool.com. It is open source and available under the MIT License. Feel free to modify and use it for personal/commercial projects.
