1.0.10 • Published 4 years ago

react-big-bang-star-field v1.0.10

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

react-big-bang-star-field

✨ Canvas-based Big Bang Star Field animation for React.

NPM TypeScript

Demo

Install

npm install --save react-big-bang-star-field

Usage

Check out the demo.

Demo includes background image div

import React, { Component } from 'react'

import BigBangStarField from 'react-big-bang-star-field'

class Example extends Component {
  render () {
    return (
      <BigBangStarField
        numStars={666}
        maxStarSpeed={1}
        scale={4}
        style={{
            position: 'absolute',
            width: '100%',
            height: '100%'
          }}
        starColor={"217, 160, 244"}
      />
    )
  }
}

Props

PropertyTypeDefaultDescription
numStarsnumber333Number of stars to use.
maxStarSpeednumber1Maximum star speed.
scalenumber4.0Scaling factor for canvas
sizenumberwidth: x, height: ySize (determined by sizeMe)
starColorstring217, 160, 244RGB color of stars produced
stylestyleStyle attributes applied to root canvas element
......undefinedAny other props are applied to the root canvas element.

Related

License

MIT © chrisjosephs

Background stars image in example from piqsels released under public domain license

This module was bootstrapped with create-react-library.

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.4

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