made with 🍩 by civet-labs

A tiny badge for the bottom of a page β€” a play on β€œmade with ❀️ by …”, except the heart is a different emoji every time the page loads. One script tag, no dependencies, no tracking.

Click the emoji itself to roll another one.

Drop it in

Put this wherever you want the badge to appear β€” it renders in place of the script tag.

<script src="https://civet-labs.com/badge.js" async></script>

Pill variant, mounted into a container

<div id="site-badge"></div>
<script src="https://civet-labs.com/badge.js"
        data-target="#site-badge"
        data-style="pill"
        data-theme="auto" async></script>

No external script

Self-contained, works with a strict CSP, and degrades to a plain emoji if JavaScript is off.

<span id="made-with">made with 🎲 by <a href="https://civet-labs.com">civet-labs</a></span>
<script>
  (function () {
    var pool = ['🍩','🐊','πŸ¦–','πŸ›Έ','πŸŒ€','πŸ”₯','πŸ§ͺ','πŸͺ„','🧨','🎲','πŸ¦‘','πŸ•','β˜•','πŸ€–','πŸ‘Ύ','πŸ¦†','πŸͺ','⚑','πŸ™','πŸ„'];
    var el = document.getElementById('made-with');
    el.firstChild.nodeValue = 'made with ' + pool[Math.floor(Math.random() * pool.length)] + ' by ';
  })();
</script>

Options

Every option is a data- attribute on the script tag.

AttributeDefaultWhat it does
data-targetβ€”CSS selector to mount into. Without it, the badge replaces the script tag's position.
data-styletexttext for bare text, pill for a bordered pill.
data-themeautoauto, light, or dark. Auto follows the visitor's system setting.
data-size0.875remAny CSS length.
data-emojisbuilt-in poolYour own pool, e.g. data-emojis="🐊,🍩,πŸ›Έ".
data-emojiβ€”Pin one emoji on load. Clicking still rolls from the pool.
data-interval0Milliseconds between automatic rerolls. 0 means only on load and on click.
data-textmade withLeading text.
data-bybyThe joining word.
data-namecivet-labsLink text.
data-hrefhttps://civet-labs.comLink target.
data-autotrueSet to false to skip auto-mounting and call the API yourself.

The badge renders inside a shadow root, so the host page's CSS can't reach in and the badge's CSS can't leak out. Restyle it with custom properties on the wrapper β€” --civet-fg, --civet-bg, --civet-border, --civet-size, --civet-font (set it to inherit to pick up your page's typeface), --civet-link, --civet-link-hover.

Scripting it

With data-auto="false", or from your own bundle:

CivetBadge.render('#footer', { style: 'pill', emojis: 'πŸŠπŸ©πŸ›Έ' });

CivetBadge.roll();            // just the emoji, as a string
CivetBadge.emojis;            // the built-in pool
CivetBadge.create({ ... });   // an element, for you to place

The pool

80 emoji, sampled fresh on every load. A repeat of the previous load is skipped, so a reload always looks like something happened.