Stellar Background

A beautiful water drop background effect with physics-based collisions.

A beautiful water drop background effect with physics-based collisions. The water drops splash when they touch the mouse cursor or collide with elements.

Preview

Usage

The Stellar Background component creates a dynamic water drop effect that can interact with other elements on the page. It uses Matter.js for physics-based collisions and animations.

Features

  • Interactive Water Drops: Creates realistic water drop effects that respond to user interaction.
  • Physics-Based Collisions: Uses Matter.js to simulate realistic physics for water drop movements and collisions.
  • Mouse Interaction: Water drops splash when they touch the mouse cursor.
  • Element Collisions: Water drops can collide with specified elements on the page.
  • Highly Customizable: Adjust colors, quantity, size, speed, and other properties to match your design.
  • Visual Effects: Includes wobble effects and splash particles for enhanced realism.
  • Debug Mode: Optional debug mode to visualize collision boundaries.

Component Code

BgStellar.vue
index.ts

Props

PropTypeDefaultDescription
colorstring"FFFF99"Color of the water drops (hex without #)
quantitynumber30Number of water drops
speednumber0.4Speed of the water drops
dropSizenumber5Size of the water drops
cursorRadiusnumber15Radius of cursor interaction
debugbooleanfalseShow debug visuals
splashParticlesnumber8Number of particles in splash
wobbleAmountnumber0.3Amount of wobble for water drops
transparencynumber0.8Base transparency for water drops
collisionElementHTMLElementnullElement to create collision boundaries for

Credits