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 :: Using vuejs-datepicker with Nuxt JS 
Javascript :: new Map() collection in react state 
Javascript :: js convert number array to string array 
Javascript :: The slice JavaScript string method 
Javascript :: angular countdown begin stop pause 
Javascript :: js reverse string 
Javascript :: repeat string in javascript 
Javascript :: $.ajax how to read data vale in controller in rails 
Javascript :: cloudwatch logs sdk. 
Javascript :: react onchange multiple functions 
Javascript :: useeffect hook 
Javascript :: carbon to moment js conversion 
Javascript :: react router go back 
Javascript :: how to use json stringify in javascript 
Javascript :: javascript classlist to array 
Javascript :: django ajax redirect to a view on success 
Javascript :: JavaScript querySelector - By Attribute 
Javascript :: add class to element vue 
Javascript :: adding debounce in autocomplete material ui 
Javascript :: variables javascript 
Javascript :: use of map in react 
Javascript :: js get class from instance 
Javascript :: how to get the uppert triangular matrix out of a matrix matlab 
Javascript :: nested json schema mongoose 
Javascript :: javascript keep scroll visible 
Javascript :: how to create a slice of the array with n elements taken from the beginning in javascript 
Javascript :: jQuery DataTables Checkboxes 
Javascript :: how to change size of button in react native 
Javascript :: cek versi node js 
Javascript :: window onload 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =