Skip to content

@moefy-canvas/theme-sakura

typenpmdownloadsdownloadsGitHub license

🌸 稍等片刻~

Install

bash
pnpm add @moefy-canvas/theme-sakura

Usage

html
<canvas id="moefy-canvas"></canvas>
ts
import {
   Sakura,
   type SakuraConfig,
   MAX_Z_INDEX,
   type CanvasOptions,
} from '@moefy-canvas/theme-sakura'

const themeConfig: SakuraConfig = {
   numPatels: 30,
}

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

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

ThemeConfig

ts
export interface SakuraConfig extends ThemeConfig {
   numPatels?: number
}

Released under the MIT License.