@moefy-canvas/theme-popper
v0.5.2
Published
<p align="center"> <img alt="type" src="https://img.shields.io/static/v1?label=type&message=cursor-effects&color=green&style=for-the-badge" /> <a href="https://www.npmjs.com/package/@moefy-canvas/theme-popper" target="_blank"><img alt="npm" src="htt
Downloads
610
Maintainers
Readme
@moefy-canvas/theme-popper
:tada: 点击鼠标试试~
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
}