Skip to content

Latest commit

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

A beautiful, calm and subtle particle effect using canvas. Click the image for a live preview.

splash.png

Setup

Simple setup

  1. Download the subtle.js file by right-clicking this and clicking save as
  2. Add the following snippet to your website:
    <!-- Start of Subtle.js --><scriptsrc="subtle.js"></script><script>document.addEventListener('DOMContentLoaded',Subtle.mount);</script><!-- End of Subtle.js -->

Advanced setup

The Subtle.mount function accepts a configuration object.
The following keys are currently supported:

KeyDefaultDescription
modeSubtle.mode.squareThe particle shape
target'body'Target element selector
excludenullExclusion element selector
size32The particle diameter or size
speed0.25The average particle velocity
count25The number of particles on screen
lightness0.75The lightness of a particle
saturation0.25The color intensity of a particle
randomizeRotationfalseWhether to randomize particle rotation
containfalseWhether to fully restrict particles to target bounds

Example of an intense circle configuration with randomized rotation:

Subtle.mount({mode: Subtle.mode.circle,speed: 0.3,count: 50,lightness: 0.6,saturation: 0.5,randomizeRotation: true,});

About

Beautiful subtle particle effects using canvas.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages