JSPM

canvas-starfield

1.1.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 13
  • Score
    100M100P100Q55950F
  • License MIT

A canvas rendered starfield that twinkles and moves.

Package Exports

  • canvas-starfield

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (canvas-starfield) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

canvas-starfield

A canvas rendered starfield.

Install

npm install canvas-starfield

Getting Started

var Starfield = require('canvas-starfield')
var sf = new Starfield({
  canvas: '#starfield-canvas', // string selector or HTML element
  numStars: 800,               // default 500
  dx: 0.05,                    // x speed of stars in px/frame, default 0.05
  dy: 0.025,                   // y speed of stars in px/frame, default 0.05
  maxRadius: 2,                // maximum star radius in px
  shootingStarInterval: 5     // time in seconds between shooting stars (omit field to disable shooting stars)
})

sf.start()