1.0.3 • Published 11 months ago

particleground.ts v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

npm version npm downloads npm license npm bundle size GitHub stars GitHub forks GitHub Pages

ParticleGround.ts

ParticleGround.ts is a React component library that creates a particle animation effect on a canvas, inspired by jquery.particleground.js.

Visit the project site: Particleground.ts

Installation

Install via npm and yarn:

npm install particleground.ts
yarn add particleground.ts

Usage

import React from 'react';
import ParticleGround from 'particleground.ts';

const App = () => {
  return (
    <div style={{ position: 'relative', width: '100vw', height: '100vh',overflow: 'hidden',
        backgroundColor: '#000000', }}>
      <ParticleGround />
    </div>
  );
};

export default App;

Props

Prop NameTypeDefault ValueDescription
minSpeedXnumber0.1Minimum horizontal speed.
maxSpeedXnumber0.7Maximum horizontal speed.
minSpeedYnumber0.1Minimum vertical speed.
maxSpeedYnumber0.7Maximum vertical speed.
directionX'center' \| 'left' \| 'right''center'Direction of horizontal movement.
directionY'center' \| 'up' \| 'down''center'Direction of vertical movement.
densitynumber10000Particle density.
dotColorstring'#666666'Color of the particles.
lineColorstring'#666666'Color of the lines connecting particles.
particleRadiusnumber7Radius of the particles.
lineWidthnumber1Width of the lines connecting particles.
curvedLinesbooleanfalseEnable or disable curved lines.
proximitynumber100Distance at which particles connect.
parallaxbooleantrueEnable or disable parallax effect.
parallaxMultipliernumber5Strength of the parallax effect.
onInit() => void() => {}Callback for initialization.
onDestroy() => void() => {}Callback for cleanup.

Demo

You can view a live demo of the Particleground.ts library here.

Or clone the repository and run the demo locally:

git clone https://github.com/Sivamani-18/particleground.ts.git
cd particleground.ts
npm install
npm start

This will start a local development server where you can see the Particleground.ts in action.

License

Licensed under the MIT License.

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago