User:PabloS/blast.js: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 4: Line 4:
      
      
             if (date.getFullYear() === 2024 && date.getMonth() === 10 && date.getDate() === 16) {
             if (date.getFullYear() === 2024 && date.getMonth() === 10 && date.getDate() === 16) {
                 waitFor("confetti", function() {
                 waitFor("confetti", async () => {
                     for (let i = 1; i < 15; i++) {
                     for (let i = 1; i < 15; i++) {
                         confetti({
                         confetti({

Latest revision as of 22:09, 15 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) {
                waitFor("confetti", async () => {
                    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));
                    }
                });
            }
        }
    }