Mode: auto | Forme: confetti + star
======================================== */
(function() {
const COLORS = [
'#FF1493','#FF6EC7','#FFD700',
'#00FF7F','#00BFFF','#9B59B6',
'#FF4500','#fff'
];
const canvas = document.createElement('canvas');
canvas.style.cssText =
'position:fixed;top:0;left:0;' +
'width:100%;height:100%;' +
'pointer-events:none;z-index:9999';
document.body.appendChild(canvas);
const ctx = canvas.getContext('2d');
let W, H, particles = [];
function resize() {
W = canvas.width = innerWidth;
H = canvas.height = innerHeight;
}
window.addEventListener('resize', resize);
resize();
function rnd(a,b){ return a+Math.random()*(b-a); }
function pick(a){ return a[0|Math.random()*a.length]; }
function starPath(cx,cy,r,pts){
const step = Math.PI/pts;
ctx.beginPath();
for(let i=0;iSe connecter