loonywizard / js-confetti

JS Confetti library that supports emojis 🦄 🎉 ⚡️
https://loonywizard.github.io/js-confetti/
MIT License
1.13k stars 48 forks source link

text confetti properties #29

Closed 5alidshammout closed 3 years ago

5alidshammout commented 3 years ago

I was happy I was able to do this: image using:

const jsConfetti = new JSConfetti();

document.addEventListener('click', () => {
   jsConfetti.addConfetti({
     emojis: [...'5alidshammout'.repeat(10), '👨🏻‍💻'],
     confettiNumber: '5alidshammout'.length,
     confettiRadius: 1,
   });
});

but I want to change the font, color and size of the text, can you do that please?

loonywizard commented 3 years ago

Hi! Can you implement this feature and open Pull Request?

you need to pass fontFamily and fontColor args to ConfettiShape constructor and use them in draw method

don't forget about default values and TypeScript typings, and please provide an example of usage

5alidshammout commented 3 years ago

how to use the .draw() method?

loonywizard commented 3 years ago

you don't need to use draw method, it is called by JSConfetti instance

5alidshammout commented 3 years ago

thanks but I really didn't understand, can you show me how to make the text white by changing my code please?

loonywizard commented 3 years ago

you need to fork this repo, do changes described in this comment https://github.com/loonywizard/js-confetti/issues/29#issuecomment-900980170 and then create a pull request

After that, I will review changes, and if it is OK I will merge this, otherwise I will leave comments on PR

5alidshammout commented 3 years ago

sorry, I'd really like to contribute to this repo, but I don't know ts