Socket
Socket
Sign inDemoInstall

@moefy-canvas/theme-sparkler

Package Overview
Dependencies
4
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @moefy-canvas/theme-sparkler

<img alt="npm" src="h


Version published
Weekly downloads
2
Maintainers
1
Created
Weekly downloads
 

Readme

Source

@moefy-canvas/theme-sparkler

type npm downloads downloads GitHub license

:sparkler: 就是现在鼠标周围的粒子效果啦~

Install

pnpm add @moefy-canvas/theme-sparkler

Usage

<canvas id="moefy-canvas"></canvas>
import {
   Sparkler,
   SparklerMode,
   type SparklerConfig,
   type CanvasOptions,
   MAX_Z_INDEX,
} from '@moefy-canvas/theme-sparkler'

const themeConfig: SparklerConfig = {
   mode: SparklerMode.TRAIL,
}

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

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

ThemeConfig

export enum SparklerMode {
   FOLLOW = 'follow',
   TRAIL = 'trail',
}

export interface SparklerConfig extends ThemeConfig {
   mode?: SparklerMode
   numParticles?: number
   sparkleFactor?: number
   particleDurationRange?: [number, number]
   particleDistanceRange?: [number, number]
   particleSizeRange?: [number, number]
}

Keywords

FAQs

Last updated on 12 Sep 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc