--- title: Spawn Sticker description: simple & flexible & adhesive categories: - JS - Web - SI16 script: spawnSticker.js css: sticker.css date: 09/12/2021 git: 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. ```html
World
```
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