Skip to content

woosweb/react-big-bang-star-field

 
 

Repository files navigation

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

Property Type Default Description
numStars number 333 Number of stars to use.
maxStarSpeed number 1 Maximum star speed.
scale number 4.0 Scaling factor for canvas
size number width: x, height: y Size (determined by sizeMe)
starColor string 217, 160, 244 RGB color of stars produced
style style Style attributes applied to root canvas element
... ... undefined Any 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.

About

React Big Bang Star Field Animation Canvas

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 73.5%
  • JavaScript 20.9%
  • HTML 3.9%
  • CSS 1.7%