@moefy-canvas/theme-ribbon
v0.5.2
Published
<p align="center"> <img alt="type" src="https://img.shields.io/static/v1?label=type&message=background&color=green&style=for-the-badge" /> <a href="https://www.npmjs.com/package/@moefy-canvas/theme-ribbon" target="_blank"><img alt="npm" src="https:/
Downloads
86
Maintainers
Readme
@moefy-canvas/theme-ribbon
:reminder_ribbon: 背景的彩带效果~
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
}