HTMLify
Sticker Wall
Views: 42 | Author: sticker-archive
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | <script> fetch("./stickers.json") .then(res => res.json()) .then(data => { // shuffle for (let i = data.length - 1; i > 0; i--) { const j = Math.floor(Math.random() * (i + 1)); [data[i], data[j]] = [data[j], data[i]]; } // adding data.forEach(name => { const img = document.createElement("img"); img.src = "stickers/" + name; img.loading = "lazy"; img.decoding = "async"; document.body.appendChild(img); }); }); </script> |