emojisplosion

HomeDemoDocs

emojisplosion

💥 Blasts 😄 emoji 😊 like 🎆 fireworks 🎇 all up in your 💻 HTML 📄 page. 😍

GitHubAstro PluginTypeDoc Plugin

Usage

Easy Mode

Plop this 👇 at the end of your .html <body>:

<script async src="https://unpkg.com/emojisplosion/lib/easy.js"></script>

That ☝ loads Emojisplosion soon after your page loads and starts emojisplosions as soon as it can.

Alternately, to create global emojisplosion and emojisplosions functions:

<script src="https://unpkg.com/emojisplosion/lib/global.js"></script> <script> // Just one explosion, please. emojisplosion(); // Commence explosions! emojisplosions(); </script>

emojisplosion launches a single blast of emojis at random locations on the page.

emojisplosions starts calling emojisplosion on a random interval of every few seconds.


Explanation:

Each emojisplosion causes a fireworks-like explosion of random emojis to be placed around a random location on your page. Each explosion contains around a dozen emojis, each of which are animated in JavaScript to:

  • Start with a random horizontal velocity and random upward vertical velocity
  • Move along the page as if affected by velocity and preserving inertia

After an emoji is completely hidden or out of bounds, it is removed from the page.

Advanced Mode

With Webpack and other modern JavaScript bundlers:

import { emojisplosion, emojisplosions } from "emojisplosion"; // Just one explosion, please. emojisplosion(); // Commence explosions! emojisplosions();

Oh, and Emojisplosion is written in TypeScript and ships with its own typings. 💣


To learn how to further configure emojisplosion read the docs or look at the demos to see the package in action!