@moefy-canvas/theme-popper
TypeScript icon, indicating that this package has built-in type declarations

0.5.2 • Public • Published

@moefy-canvas/theme-popper

type npm downloads downloads GitHub license

🎉 点击鼠标试试~

Install

pnpm add @moefy-canvas/theme-popper

Usage

<canvas id="moefy-canvas"></canvas>
import {
   Popper,
   PopperShape,
   type PopperConfig,
   MAX_Z_INDEX,
   type CanvasOptions,
} from '@moefy-canvas/theme-popper'

const themeConfig: PopperConfig = {
   shape: PopperShape.Star,
   size: 1.75,
   numParticles: 10,
}

const canvasOptions: CanvasOptions = {
   opacity: 1,
   zIndex: MAX_Z_INDEX,
}

const el = document.getElementById('moefy-canvas')
const popper = new Popper(themeConfig, canvasOptions)
popper.mount(el as HTMLCanvasElement)

ThemeConfig

export enum PopperShape {
   Star = 'star',
   Circle = 'circle',
}

export interface PopperConfig extends ThemeConfig {
   shape?: PopperShape
   size?: number
   numParticles?: number
}

Package Sidebar

Install

npm i @moefy-canvas/theme-popper

Weekly Downloads

141

Version

0.5.2

License

MIT

Unpacked Size

14 kB

Total Files

12

Last publish

Collaborators

  • sigure_mo