<div id="tsparticles"></div>
<!-- https://github.com/matteobruni/tsparticles -->
<div class="github">
  <a class="btn btn-link" href="https://github.com/matteobruni/tsparticles" title="Find more info on GitHub">
    <img class="img-fluid" id="gh-mark" src="https://cdn.matteobruni.it/images/particles/GitHub-Mark-120px-plus.png" alt="">
    <span id="gh-project">Made with tsParticles</span>
  </a>
  <div>
    <a class="github-button" href="https://github.com/matteobruni/tsparticles" data-icon="octicon-star" data-show-count="true" aria-label="Star matteobruni/tsparticles on GitHub">Star</a>
    <a class="github-button" href="https://github.com/matteobruni/tsparticles/fork" data-icon="octicon-repo-forked" data-show-count="true" aria-label="Fork matteobruni/tsparticles on GitHub">Fork</a>
    <a class="github-button" href="https://github.com/matteobruni/tsparticles/releases/tag/tsparticles%401.17.9" data-icon="octicon-download" aria-label="Download matteobruni/tsparticles on GitHub">Download</a>
  </div>
</div>
<script async="" defer="" src="https://buttons.github.io/buttons.js"></script>
#tsparticles {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  margin: 0;
}

.github {
  bottom: 10px;
  right: 10px;
  position: fixed;
  border-radius: 10px;
  background: #fff;
  padding: 0 12px 6px 12px;
  border: 1px solid #000;
}

.github a:hover,
.github a:link,
.github a:visited,
.github a:active {
  color: #000;
  text-decoration: none;
}

.github img {
  height: 30px;
}

.github #gh-project {
  font-size: 20px;
  padding-left: 5px;
  font-weight: bold;
  vertical-align: bottom;
}

tsParticles
  .load("tsparticles", {
    fpsLimit: 60,
    particles: {
      number: {
        value: 0,
        density: {
          enable: true,
          value_area: 800
        }
      },
      color: {
        value: "#ff0000",
        animation: {
          enable: true,
          speed: 180,
          sync: true
        }
      },
      shape: {
        type: "circle",
        stroke: {
          width: 0,
          color: "#000000"
        },
        polygon: {
          nb_sides: 5
        },
        image: {
          src: "https://cdn.matteobruni.it/images/particles/github.svg",
          width: 100,
          height: 100
        }
      },
      opacity: {
        value: 0.5,
        random: false,
        anim: {
          enable: false,
          speed: 3,
          opacity_min: 0.1,
          sync: false
        }
      },
      size: {
        value: 15,
        random: {
          enable: true,
          minimumValue: 5
        },
        animation: {
          enable: true,
          speed: 5,
          minimumValue: 5,
          sync: true,
          startValue: "min",
          destroy: "max"
        }
      },
      links: {
        enable: false
      },
      move: {
        enable: true,
        speed: 15,
        direction: "none",
        random: false,
        straight: false,
        outMode: "destroy",
        attract: {
          enable: false,
          rotateX: 600,
          rotateY: 1200
        }
      }
    },
    interactivity: {
      detectsOn: "window",
      events: {
        onhover: {
          enable: true,
          mode: "trail"
        },
        onclick: {
          enable: true,
          mode: "push"
        },
        resize: true
      },
      modes: {
        grab: {
          distance: 400,
          line_linked: {
            opacity: 1
          }
        },
        bubble: {
          distance: 400,
          size: 40,
          duration: 2,
          opacity: 0.8,
          speed: 3
        },
        repulse: {
          distance: 200
        },
        push: {
          particles_nb: 4
        },
        remove: {
          particles_nb: 2
        },
        trail: {
          delay: 0.005,
          quantity: 5
        }
      }
    },
    retina_detect: true,
    background: {
      color: "#000000",
      image: "",
      position: "50% 50%",
      repeat: "no-repeat",
      size: "cover"
    }
  })
  .then((c) => {
    var target = c.interactivity.element;

    var rect = {
      left: 0,
      top: 0,
      width: target.innerWidth,
      height: target.innerHeight
    };
    var point = {
      x: rect.width / 2,
      y: rect.height / 2
    };
    var moveType = "mousemove";

    setInterval(() => {
      var moveEvent = new MouseEvent(moveType, {
        view: target,
        bubbles: true,
        cancelable: true,
        clientX: rect.left + point.x,
        clientY: rect.top + point.y
        // you can pass any other needed properties here
      });

      var speed = 50;
      point.x += speed * Math.sin(Math.random() * Math.PI);
      point.y += speed * Math.cos(Math.random() * Math.PI);

      if (point.x > rect.width) {
        point.x = 0;
      }
      
      if (point.y > rect.height) {
        point.y = 0;
      }
      
      if (point.x < 0) {
        point.x = rect.width;
      }

      if (point.y < 0) {
        point.y = rect.height;
      }
      
      target.dispatchEvent(moveEvent);

      setTimeout(() => {
        // this interrupts the movement
        var outType = "mouseout";

        var outEvent = new MouseEvent(outType, {
          view: target,
          bubbles: true,
          cancelable: true,
          // you can pass any other needed properties here
        });

        //target.dispatchEvent(outEvent);
      }, 400);
    });
  });

External CSS

  1. https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.0/css/bootstrap.min.css

External JavaScript

  1. https://cdn.jsdelivr.net/npm/tsparticles@1.18.3/dist/tsparticles.min.js