0.2.0 • Published 9 months ago

mouse-tailing v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

屏幕鼠标拖尾效果

快速实现页面中鼠标拖尾的效果

mouse-tailing Example

安装

npm install --save mouse-tailing

使用

创建鼠标拖尾

import { createMouseTailing } from 'mouse-tailing'
createMouseTailing(TailConfig)
参数
export interface TailConfig = {
    // 拖尾类型 star|circle|heart|icon
    type:'star',

    // 显示拖尾用的dom容器,可以直接传一个HTMLElement对象或者一个querySelector字符串
    el:document.body,

    // 覆盖默认颜色, Hex颜色格式字符串
    color: '#FFFFFF',

    // 每次移动过程创建拖尾的数量
    count:1,

    // 拖尾存在的时间,毫秒
    duration:1000,

    // 给canvas画布一个识别用class类名
    className:'canvas-tailing'

    // 当type=icon时,需要传入icon的url
    url:'http://xxxxxx'
}

创建画布特效

import { createGroundEffect } from 'mouse-tailing'
createGroundEffect(EffectConfig)
参数
export interface EffectConfig extends Omit<TailConfig, 'type' | 'resource'> {
  // 效果类型 sky
  type?: EffectType;
}
0.2.0

9 months ago

0.1.7

11 months ago

0.1.6

1 year ago

0.1.0

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.0.9

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.5

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago