Create Flying Icons With JavaScript – wand.js

Category: Animation , Javascript | September 20, 2021
Author:ravvis
Views Total:39 views
Official Page:Go to website
Last Update:September 20, 2021
License:MIT

Preview:

Create Flying Icons With JavaScript – wand.js

Description:

wand.js is a tiny JavaScript library for creating flying icons (like bubbles, stars, confetti, hearts) that can be triggered by any JS event.

How to use it:

1. Import the wand.js library.

<script src="/wand.js"></script>

2. Create an element (an HTML button in this example) to trigger the flying icons.

<button id="wand">
  Like
</button>

3. Initialize the Wand on the trigger element, determine the trigger event, and specify the path to the icon.

const {start} = window.Wand({
  targetSelector: "#wand",
  event: "click",
  iconSrc: "heart.svg",
});

You Might Be Interested In:


Leave a Reply