Loading repository data…
Loading repository data…
OlaProeis / repository
Interactive particle rain animation with geometric shape formations. Features 12 unique shapes, customizable physics, rain effects with trails, and explosive interactions. Built with vanilla JavaScript and HTML5 Canvas. 150+ config options. Click, hover, and keyboard controls. Zero dependencies.
Where Particles Dance and Shapes Come Alive
A mesmerizing, highly customizable interactive canvas animation featuring particle rain effects that dynamically form geometric shapes. Built with pure vanilla JavaScript and HTML5 Canvas.
Interactive particle animation with shape formations
git clone https://github.com/OlaProeis/GeometryRain.git
cd GeometryRain
index.html in your web browser or serve with a local server:# Using Python
python -m http.server 8000
# Using Node.js (http-server)
npx http-server
# Using PHP
php -S localhost:8000
http://localhost:8000Simply include the necessary files in your HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GeometryRain Demo</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header class="hero">
<canvas id="animationCanvas"></canvas>
<div class="hero-content">
<h1 class="hero-title">Your Title</h1>
<p class="hero-subtitle">Your Subtitle</p>
</div>
</header>
<script src="canvas-config.js"></script>
<script src="canvas-animation.js"></script>
</body>
</html>
| Action | Effect |
|---|---|
| Click | Create a small implosion effect |
| Double-Click | Create a larger explosion with ripples |
| Ctrl+Click | Enhanced implosion (more particles, larger radius) |
| Spacebar | Trigger 5 random firework bursts |
| Hover (3s) | Form a geometric shape from nearby particles |
| C Key | Clear all particles |
| D Key | Dissolve all formed shapes |
| R Key | Toggle rain effect on/off |
Note: The mouse cursor naturally repels particles as you move. Hold Shift while moving for stronger repulsion.
Edit canvas-config.js to customize the animation. Here are some key configuration sections:
particles: {
maxCount: 800, // Maximum particles on screen
baseSize: { min: 2, max: 8 }, // Particle size range
avoidMouse: true, // Particles avoid cursor
mouseAvoidanceRadius: 120, // Avoidance distance
}
rain: {
enabled: true, // Enable rain effect
maxDrops: 120, // Maximum rain drops
spawnRate: 0.4, // Spawn rate (0-1)
dropSize: { min: 0.5, max: 5.5 }, // Drop size range
fallSpeed: { min: 2, max: 5 }, // Fall speed range
formShapeChance: 0.008, // Shape formation probability
}
shapes: {
hoverThreshold: 3000, // MS to hover before shape forms
formationRadius: 1000, // Particle collection radius
minParticles: 10, // Minimum particles for shape
maxParticles: 40, // Maximum particles in shape
shapeRadius: 120, // Size of formed shapes
lifetime: 45000, // Shape duration (45 seconds)
types: [ // Available shape types
'circle', 'star', 'spiral', 'grid', 'hexagon', 'heart',
'square', 'pentagon', 'triangle', 'diamond', 'wave', 'infinity'
]
}
colors: {
particles: [
'rgba(255, 255, 255, ', // White
'rgba(59, 130, 246, ', // Blue
'rgba(34, 211, 238, ', // Cyan
'rgba(148, 163, 184, ', // Slate
'rgba(249, 115, 22, ' // Orange
],
rain: [
'rgba(100, 200, 255, ', // Light blue
'rgba(120, 180, 255, ', // Sky blue
'rgba(80, 190, 255, ', // Bright light blue
'rgba(90, 210, 255, ' // Cyan-ish blue
]
}
performance: {
optimizeConnections: true, // Auto-optimize connections
connectionOptimizeThreshold: 200, // When to start optimizing
connectionSkipStep: 2, // Check every Nth particle
hideConnectionsThreshold: 300, // Hide above this count
}
particles: {
maxCount: 150,
baseSize: { min: 1, max: 3 },
},
rain: {
enabled: true,
maxDrops: 30,
spawnRate: 0.2,
}
implosion: {
defaultCount: 30,
ctrlClickCount: 50,
defaultRadius: 400,
defaultStrength: 8,
}
rain: {
enabled: false, // Turn off rain
},
connections: {
enabled: false, // Turn off connection lines
},
uiElements: {
spinningLogo: {
enabled: false, // Disable spinning logo
}
}
GeometryRain/
├── index.html # Main HTML file
├── styles.css # Styling for hero section and UI elements
├── canvas-config.js # Configuration file (150+ options)
├── canvas-animation.js # Main animation engine
├── README.md # This file
└── LICENSE # MIT License
This project works perfectly with GitHub Pages for free hosting!
Option 1: Automatic Deployment (Recommended)
main (or master)/ (root)https://OlaProeis.github.io/GeometryRain/Option 2: Using gh-pages branch
# Create and switch to gh-pages branch
git checkout -b gh-pages
# Push to GitHub
git push origin gh-pages
# Go to Settings → Pages and select gh-pages branch
Option 3: Automated Deployment with GitHub Actions
A workflow file is included in .github/workflows/deploy.yml for automatic deployment on every push.
Contributions are welcome! Here are some ways you can help:
git clone https://github.com/OlaProeis/GeometryRain.git
cd GeometryRain
# Open index.html in your browser or use a local server
This project is licensed under the MIT License - see the LICENSE file for details.