yiliansource / party-js

A JavaScript library to brighten up your user's site experience with visual effects!
https://party.js.org
MIT License
994 stars 45 forks source link

How to further control the lifetime and speed? #82

Open meirroth opened 2 years ago

meirroth commented 2 years ago

Hi, great lib!

I'd like to have the sparkles appear fast and then stay on screen, or at least for a minute or two.

I've tried tweaking speed, lifetime, messing with modules and creating a custom template, but I could not get the effect I'm after. See CodePen

Is it possible to expose the lifetime and speed within the modules? Or set an easing curve to those values so that they are not constant?

See here what I am trying to achieve:

Thank you

yiliansource commented 2 years ago

Hi there,

unfortunately, as of yet I haven't come up with a good solution for customizing velocity yet. I'll have to look into this, once uni allows it.

To increase the lifetime, you can increase the initialLifetime property when creating a custom emitter:

party.scene.current.createEmitter({
    // ...
    emissionOptions: {
        initialLifetime: 100
    }
    // ...
});

I'll get back to this, sorry for not being able to fully support what you need currently.