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 :: what does sanitize do javascript 
Javascript :: xmlhttprequest object 
Javascript :: how to get property names from object using map method react 
Javascript :: angular input 
Javascript :: invariant failed you should not use link outside a router test 
Javascript :: js convert number array to string array 
Javascript :: angular httpclient post body 
Javascript :: pass array from controller to javascript blade 
Javascript :: string repeat in javascript 
Javascript :: debounce function 
Javascript :: node-schedule job on specific datetime 
Javascript :: complete ajax request jquery php call | ajax request 
Javascript :: javascript how to remove first element of array 
Javascript :: initalise typed js library 
Javascript :: set time in javascript 
Javascript :: javascript classlist to array 
Javascript :: superagent set cookie 
Javascript :: material ui icons next js 
Javascript :: how to create an element in js using the map method 
Javascript :: js output to console 
Javascript :: is js object oriented 
Javascript :: react native diasble view 
Javascript :: settimeout with loop js 
Javascript :: datatables and toggle not working 
Javascript :: react native expo flatlist 
Javascript :: change module name react native android studio 
Javascript :: how to cause a whole page reload react redux 
Javascript :: .includes is not a function 
Javascript :: why navlink in react router always active 
Javascript :: js how to get max sub array sum 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =