Skip to content

Remove window resize event #195

Closed
Closed
@Maxigong

Description

Hello!
I was wondering if there is a way of removing the windows event it create, because the confetti resize events remain there even after user navigate to another route.

Screenshot 2023-02-24 at 5 52 27 PM

I tried the CDN link and the npm package and the situation is the same.

I am using this code:

const count = 100
    const defaults = {
        origin: { y: 0.35 },
    }
    function fire(particleRatio, opts) {
        confetti(
            Object.assign({}, defaults, opts, {
                particleCount: Math.floor(count * particleRatio),
            })
        )
    }

    fire(0.25, {
        spread: 26,
        startVelocity: 55,
    })
    fire(0.2, {
        spread: 60,
    })
    fire(0.35, {
        spread: 100,
        decay: 0.91,
        scalar: 0.8,
    })
    fire(0.1, {
        spread: 120,
        startVelocity: 25,
        decay: 0.92,
        scalar: 1.2,
    })
    fire(0.1, {
        spread: 120,
        startVelocity: 45,
    })

    setTimeout(() => {
        confetti.reset()
    }, 2000)

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions