1.0.6 • Published 2 years ago

@devil7softwares/react-drifter-stars v1.0.6

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

React Drifter Stars build npm license min minzip

Drifter Stars by @cr0ybot ported to React with Typescript support

Demo

View Demos @ Storybook

Quick Start

  1. Install package from NPM npm install @devil7softwares/react-drifter-stars
  2. Import drifter stars in your component import DrifterStars from '@devil7softwares/react-drifter-stars'
  3. Add component to your JSX/TSX <DrifterStars />
  4. Import default stylesheet from package for default background. Or use your own css. import '@devil7softwares/react-drifter-stars/dist/styles.css'

Note: The component is transparent by default and takes full width and height of window. And can be used with your existing background.

Options

NOTE: All of the options below are optional.

PropTypeDescription
colorstringColor of particles, flare & lines.
renderMeshbooleanSpecifies whether mesh should be rendered.
blurSizenumberSize of blur for overall canvas.
particleIParticleOptionsParticle related options.
flareIFlareOptionsParticle flare options.
glareIGlareOptionsGlare related options.
linksILinkOptionsLink generation options.
motionIMotionOptionsMotion/movement options.

IParticleOptions

PropTypeDescription
renderbooleanSpecifies whether particles should be rendered.
countnumberCount of the particles to generate.\nNOTE: Particles will be generated even if its not going to be rendered)
sizeBasenumberBase size for particles. Size of particle will be calculated as "Z-Axis x Multiplier + Base".
sizeMultipliernumberMultiplier for particle size calculation. Size of particle will be calculated as "Z-Axis x Multiplier + Base".
flickerSmoothingnumberAmount of smoothing to apply on flickering. Higher Value = Smoother Flicker.

IFlareOptions

PropTypeDescription
renderbooleanSpecifies whether flares should be rendered.
countnumberCount of the flares to render.
sizeBasenumberBase size for flare. Size of flare will be calculated as "Z-Axis x Multiplier + Base".
sizeMultipliernumberMultiplier for flare size calculation. Size of flare will be calculated as "Z-Axis x Multiplier + Base".

IGlareOptions

PropTypeDescription
renderbooleanSpecifies whether particle glare should be rendered.
anglenumberAngle for glare to generate.
opacityMultipliernumberGlare opacity multiplier.

ILinkOptions

PropTypeDescription
renderbooleanSpecifies whether links should be rendered.
lineWidthnumberWidth of link line to generate.
opacitynumberOpactity for link line. A number between 0 & 1.
chancenumberProbability for a new line to appear per frame. Higher Value = Smaller Chance.
fadenumberNumber of frames for link to fade-out.
speednumberDistance a link travels in 1 frame.
minLengthnumberMinimum number of particles to link when a new line is generated.
maxLengthnumberMaximum number of particles to link when a new line is generated.

IMotionOptions

PropTypeDescription
enabledbooleanEnables/disables moving animation of particles.
rationumberAmount of motion to be generated. Default is 0.05.Used to generate motion based on mouse movement/device orientation changes.
randomMotionbooleanEnables random motions even without user interation.
noiseLengthnumberLength of noice for random motion.
noiseStrengthnumberStrength of noice for random motion.

Credits

  • Cory Hughart (@cr0ybot) - For original Drifter Stars animation.
  • Steve Courtney - For Celsius GS's Drifter poster art
1.0.6

2 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago