Disintegrate GitHub

"to reduce to particles, fragments, or parts; break up or destroy the cohesion of"

Hover demo - view source

We can fake a particle on elements with a hover effect by setting creating a class that shares the hover effect properties, add the class to our element by default, use JS to remove the class after our Disintegrte object is ready, then create the particles based on the data that we saved previously.

Relevant code:

<data-dis-type="simultaneous">
  Click me
</button>
disintegrate.init();

if(document.querySelector('[data-dis-type="simultaneous"]')) {
  window.addEventListener("disesLoaded", function() {
    disintegrate.dises.forEach(function(disObj) {
      if(disObj.elem.dataset.disType === "simultaneous") {
        disObj.elem.addEventListener("click", function(e) {
          disintegrate.createSimultaneousParticles(disObj);
        });
      }
    });
  });
}

View more demos