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

0.5.2 • Public • Published

@moefy-canvas/theme-ribbon

type npm downloads downloads GitHub license

🎗️ 背景的彩带效果~

Install

pnpm add @moefy-canvas/theme-ribbon

Usage

<canvas id="moefy-canvas"></canvas>
import {
   Ribbon,
   type RibbonConfig,
   type CanvasOptions,
   MAX_Z_INDEX,
} from '@moefy-canvas/theme-ribbon'

const themeConfig: RibbonConfig = {
   size: 90,
}

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

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

ThemeConfig

export interface RibbonConfig extends ThemeConfig {
   size?: number
}

Package Sidebar

Install

npm i @moefy-canvas/theme-ribbon

Weekly Downloads

34

Version

0.5.2

License

MIT

Unpacked Size

8 kB

Total Files

8

Last publish

Collaborators

  • sigure_mo