npm.io
0.1.1 • Published 2 years ago

nuxt-unified-confetti

Licence
—
Version
0.1.1
Deps
2
Size
3 kB
Vulns
0
Weekly
0
Install scriptsThis package runs scripts during installation (preinstall/install/postinstall)

Nuxt Unified Confetti

This library integrates the well made canvas-confetti library into your application as a layer, this enables seamless usage of Nuxt's auto import features as well as ease of further addition of things like mouse tracking and components.

Installation

Install the package and extend your app with the layer.

npm i nuxt-unified-confetti
# or
bun i nuxt-unified-confetti
yarn add nuxt-unified-confetti

Then

// nuxt.config.ts

export default defineNuxtConfig({
  extends: [
    'nuxt-unified-confetti',
  ],
});

And you will be able to use these functions

confettiOnPageSides(duration);
confettiOnCenter(duration);
confettiOnBottom(duration);
confettiOnTop(duration);

confettiCustomParade(duration, config);

Or use this function and directly use the canvas-confetti

confettiCustom(config);