User:PabloS/blast.js: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Created page with "async function blast() { if (window.location.href.includes("Half-Life_2")) { const date = new Date(); if (date.getFullYear() === 2024 && d...")
 
m (Protected "User:PabloS/blast.js" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
(No difference)

Revision as of 14:24, 14 November 2024

async function blast() {
        if (window.location.href.includes("Half-Life_2")) {
            const date = new Date();
    
            if (date.getFullYear() === 2024 && date.getMonth() === 10 && date.getDate() === 16) {
                for (let i = 1; i < 15; i++) {
                    confetti({
                        particleCount: 100,
                        startVelocity: 30,
                        spread: 360,
                        origin: {
                            x: Math.random(),
                            y: Math.random() - .2
                        },
                        disableForReducedMotion: true
                    });
            
                    await new Promise(r => setTimeout(r, 1000));
                }
            }
        }
    }