1.0.16 • Published 4 years ago

floatygons v1.0.16

Weekly downloads
3
License
ISC
Repository
github
Last release
4 years ago

floatygons.js

npmnpm

Random floating dots that form a polygon, something I made for my portfolio site. Every setting can be tweaked. Example Another Example Default Settings

Usage

//Make a new object, default settings.
let f = require("floatygons");
const m = new f.Floatygons();

//Use the constructor to override any option.
const m = new f.Floatygons({
    canvasId: "#floatygonCanvas",
    clearColor: "#1b1b1b",
    dotColor: "#FFFFFF",
    lineColor: "#FFFFFF",
    maxDotsAlive: 128,
    dotSize: 3,
    maxDotSpeed: 20,
    maxConnections: 3,
    maxDistance: 200,
    fps: 144,
    rescaleToParent: true, //Canvas will rescale to parent, also when screen is rescaled.
    enforceConnectionStrain: false
});

//Use start() only once to begin.
m.start();

//Use stop() to pause.
m.stop();

//Use resume() to start again.
m.resume();

Use the enforceConnectionStrain to hard enable a hard constraint. Normally, dots can be connected to the value from maxConnections but outside connections are still allowed. Setting enforceConnectionStrain to true will prevent outside connections.

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago