šŸŽ†Angular Confetti Effect 2.0: Fireworks Edition!

I’m a simple chick: sparklers and fireworks just make me plain happy. šŸŽ‡ Want to add a celebratory element to your Angular project? Today we’ll accomplish that by coming back to an old favorite: Canvas Confetti. Keep reading to find out how!

Procedure

As in previous tutorials, let’s first install Node and npm:

Set up the Angular project by installing the Angular CLI tool:

npm install -g @angular/cli

Create a project called my-fireworks-project:

ng new my-fireworks-project

Enter the project directory:

cd my-fireworks-project

Install canvas-confetti:

npm install --save canvas-confetti

Install the Types if using TypeScript:

npm i --save-dev @types/canvas-confetti

Now here is the code to achieve continuous fireworks with a duration of 15 seconds:

app.ts

Check your browser at localhost:4200 for the result! šŸ˜‰

Conclusion

We have successfully created a fireworks effect in our Angular project. Hopefully this will make your day a little more glitzy. 🌟 Happy Coding!

Leave a comment