An interactive, physics-based photo gallery built with p5.js and Matter.js. This project breaks away from static grids, allowing users to interact with "memories" as if they were physical polaroids scattered on a table.
π Live Demo
- Real Physics Engine: Images have mass, friction, and restitution (bounciness).
- Interactive Drag & Drop: Users can grab, drag, and throw images across the canvas.
- Scroll to Rotate: Hover over an image and scroll to rotate it precisely.
- Dynamic Stacking: The active/hovered image always pops to the front (smart z-index management).
- Responsive Physics: Optimized force calculations for a smooth feel.
- HTML5 & CSS3 (Manrope Typography)
- JavaScript (ES6+)
- p5.js - For canvas rendering and interaction loop.
- Matter.js - For 2D physics simulation (gravity, collision, rigid bodies).
- Clone the repository:
git clone [https://github.com/your-username/interactive-physics-gallery.git](https://github.com/your-username/interactive-physics-gallery.git)
- Navigate to the project folder:
cd interactive-physics-gallery - Open
index.htmlin your browser.- Tip: Use "Live Server" extension in VS Code for the best experience.
- Images: Replace images in the
assets/folder. Recommended count: 12-15 images. - Physics: Tweak
frictionAir,restitution, anddensityinscript.jsto change how "heavy" or "bouncy" the cards feel.
This project is open source and available under the MIT License.
Created by Raunak chaurasiya
