Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/eee-n/dots-background


https://github.com/eee-n/dots-background

Last synced: 5 days ago
JSON representation

Awesome Lists containing this project

README

        

# Interactive dots background

A dynamic interactive dot background using HTML canvas and JavaScript.

## Configuration

You can customize the following parameters in the JavaScript file:

- `dotMargin`: Margin for dots before interaction.
- `dotDiameter`: Diameter of the dots.
- `interactionCircleHitboxRadius`: Radius of the interaction circle hitbox.
- `interactionCircleColor`: Color of the interaction circle hitbox.
- `singleDotHitboxColor`: Color of the single dot hitbox.
- `dotColor`: Default color of dots.
- `dotTouchColor`: Color of dots when touched by the interaction circle.
- `pullStrength`: Strength of dot pull to interaction hitbox. (Negative for bulge, positive for pinch)
- `moveDistance`: Distance the dot moves when touched by the single dot hitbox.
- `singleDotHitboxRadius`: Radius for the single dot hitbox.
## Usage

You can toggle the debug setting by setting debug to true or false with the following command: `isDebug = true`


You must add a HTML5 canvas with the dots class and the recommended CSS: ``

## Example

https://jsfiddle.net/yh1etzfg/8/


Credit when used is very appreciated