1.0.16 • Published 6 years ago

floatygons v1.0.16

Weekly downloads
3
License
ISC
Repository
github
Last release
6 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

6 years ago

1.0.15

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago