You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1.4 KiB

title description categories script css date git
Spawn Sticker simple & flexible & adhesive
JS
Web
SI16
spawnSticker.js sticker.css 09/12/2021 https://git.xpub.nl/kamo/spawn-sticker

A script that let you add stickers on top of HTML elements. To make it works just add a data-sticker attribute to your element. The content of the sticker will be the value of the attribute.

<div data-sticker='Hello'>World</div>

This script was used for the SI16 - Learning how to walk while cat-walking website. This is a simplified version. In the original one we had to deal with fixed elements (such as the header / nav of the pages) as well as relative ones. So the code there is a bit messier, but this one here it's simple and clean.

How does it work

The code it's composed of 3 main functions: one to create the sticker, one to spawn and attach it to an element, and a last one to limit the amount of stickers spawned at once.

propper documentation coming sooon