Ajout de la section des dons #40

Merged
Nono merged 6 commits from 36-boutons-dons into main 2026-02-03 12:28:23 +00:00
Showing only changes of commit c47bd42d46 - Show all commits

21
js/pop.js Normal file
View file

@ -0,0 +1,21 @@
document.querySelectorAll('button').forEach(function(button) {
button.addEventListener('mouseenter', function() {
function random(max) {
return Math.random() * (max - 0) + 0;
}
var c = document.createDocumentFragment();
for (var i = 0; i < 100; i++) {
var styles = 'transform: translate3d(' + (random(500) - 250) + 'px, ' +
(random(200) - 150) + 'px, 0) rotate(' + random(360) + 'deg);' +
'background: hsla(' + random(360) + ', 100%, 50%, 1);' +
'animation: bang 700ms ease-out forwards;' +
'opacity: 0';
var e = document.createElement("i");
e.style.cssText = styles;
c.appendChild(e);
}
button.appendChild(c);
});
});