Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

react-particles-js

npm install react-particles-js
Comment

react particles react

import Particles from "react-tsparticles";

const App = () => {
  const particlesInit = (main) => {
    console.log(main);

    // you can initialize the tsParticles instance (main) here, adding custom shapes or presets
  };

  const particlesLoaded = (container) => {
    console.log(container);
  };
  return (
    <Particles
      id="tsparticles"
      init={particlesInit}
      loaded={particlesLoaded}
      options={{
        background: {
          color: {
            value: "#0d47a1",
          },
        },
        fpsLimit: 120,
        interactivity: {
          events: {
            onClick: {
              enable: true,
              mode: "push",
            },
            onHover: {
              enable: true,
              mode: "repulse",
            },
            resize: true,
          },
          modes: {
            bubble: {
              distance: 400,
              duration: 2,
              opacity: 0.8,
              size: 40,
            },
            push: {
              quantity: 4,
            },
            repulse: {
              distance: 200,
              duration: 0.4,
            },
          },
        },
        particles: {
          color: {
            value: "#ffffff",
          },
          links: {
            color: "#ffffff",
            distance: 150,
            enable: true,
            opacity: 0.5,
            width: 1,
          },
          collisions: {
            enable: true,
          },
          move: {
            direction: "none",
            enable: true,
            outMode: "bounce",
            random: false,
            speed: 6,
            straight: false,
          },
          number: {
            density: {
              enable: true,
              area: 800,
            },
            value: 80,
          },
          opacity: {
            value: 0.5,
          },
          shape: {
            type: "circle",
          },
          size: {
            random: true,
            value: 5,
          },
        },
        detectRetina: true,
      }}
    />
  );
};
Comment

react particles

<Particles
    params={{
	    "particles": {
	        "number": {
	            "value": 160,
	            "density": {
	                "enable": false
	            }
	        },
	        "size": {
	            "value": 3,
	            "random": true,
	            "anim": {
	                "speed": 4,
	                "size_min": 0.3
	            }
	        },
	        "line_linked": {
	            "enable": false
	        },
	        "move": {
	            "random": true,
	            "speed": 1,
	            "direction": "top",
	            "out_mode": "out"
	        }
	    },
	    "interactivity": {
	        "events": {
	            "onhover": {
	                "enable": true,
	                "mode": "bubble"
	            },
	            "onclick": {
	                "enable": true,
	                "mode": "repulse"
	            }
	        },
	        "modes": {
	            "bubble": {
	                "distance": 250,
	                "duration": 2,
	                "size": 0,
	                "opacity": 0
	            },
	            "repulse": {
	                "distance": 400,
	                "duration": 4
	            }
	        }
	    }
	}} />
Comment

react particles js

yarn add react-particles-js
Comment

particle js with react

<Particles
    params={{
	    "fps_limit": 28,
	    "particles": {
	        "collisions": {
	            "enable": false
	        },
	        "number": {
	            "value": 200,
	            "density": {
	                "enable": false
	            }
	        },
	        "line_linked": {
	            "enable": true,
	            "distance": 30,
	            "opacity": 0.4
	        },
	        "move": {
	            "speed": 1
	        },
	        "opacity": {
	            "anim": {
	                "enable": true,
	                "opacity_min": 0.05,
	                "speed": 1,
	                "sync": false
	            },
	            "value": 0.4
	        }
	    },
	    "polygon": {
	        "enable": true,
	        "scale": 0.5,
	        "type": "inline",
	        "move": {
	            "radius": 10
	        },
	        "url": "/small-deer.2a0425af.svg",
	        "inline": {
	            "arrangement": "equidistant"
	        },
	        "draw": {
	            "enable": true,
	            "stroke": {
	                "color": "rgba(255, 255, 255, .2)"
	            }
	        }
	    },
	    "retina_detect": false,
	    "interactivity": {
	        "events": {
	            "onhover": {
	                "enable": true,
	                "mode": "bubble"
	            }
	        },
	        "modes": {
	            "bubble": {
	                "size": 6,
	                "distance": 40
	            }
	        }
	    }
	}} />
Comment

PREVIOUS NEXT
Code Example
Javascript :: regex serch in capture group 
Javascript :: node js file extension 
Javascript :: sails js 
Javascript :: AJAX - XMLHttpRequest 
Javascript :: console.log is not a function 
Javascript :: javascript classes 
Javascript :: A closure Function 
Javascript :: encrpting data in javascript 
Javascript :: JavaScript Debug usage Example 
Javascript :: arrow function in javascript 
Javascript :: array concat 
Javascript :: js compiler 
Javascript :: bind method in js 
Javascript :: passing ref to child component 
Javascript :: express framework 
Javascript :: code checker javascript 
Javascript :: what does the useReducer do in react 
Javascript :: update url parameters and create history entry 
Javascript :: google chart ajax json 
Javascript :: typeahead bootstrap 4 add multiple values 
Javascript :: javascript program name 
Javascript :: angular key value pipe compareFn example 
Javascript :: telerik grid data automatically scroll to particular record in react 
Javascript :: array of alphabets 
Javascript :: generators javascript in class 
Javascript :: Instar y crear proyecto AdonisJS 
Javascript :: javascript factorial with closure 
Javascript :: eosio name to int js 
Javascript :: how to get only citnames in google maps api js 
Javascript :: page slug vuejs 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =