New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

drop-animation

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

drop-animation

浏览器中的掉落动画

latest
Source
npmnpm
Version
0.0.5
Version published
Weekly downloads
11
57.14%
Maintainers
1
Weekly downloads
 
Created
Source

drop-animation

npm npm

浏览器中的掉落动画 🎾

Install

npm install drop-animation --save

Start

import Dropper from 'drop-animation';

// 新建实例
function onClick() {
  new Dropper({
    element: '<div class="dropper"></div>',
    startPosition: {
      x: x + width / 2,
      y: y + height / 2,
    },
    endPosition,
    width,
    height,
  });
}

Document

new Dropper(Object opts)

参数 Object opts:

属性类型是否必填默认值说明
elementElement | String-掉落元素
containerElementdocument.body父级容器
startPosition.xNumber0起点位置横坐标,单位:px
startPosition.yNumber0起点位置纵坐标,单位:px
endPosition.xNumber0终点位置横坐标,单位:px
endPosition.yNumber0终点位置纵坐标,单位:px
widthNumber0掉落元素宽度,单位:px
heightNumber0掉落元素高度,单位:px
durationNumber600掉落时间,单位:ms
jumpHeightNumber60弹跳的高度,单位:px
scaleNumber1缩放值
rotateNumber360旋转度数
onEndFunction() => {}动画结束回调
endAnimationBooleantrue是否需要收尾动画
endRotateNumber360收尾旋转角度
endJumpHeightNumber40收尾弹跳的高度,单位:px
endAnimationDurationNumber400收尾动画时间,单位:ms

Demo

cd demo
npm install
npm start

访问 http://localhost:3000 查看

Keywords

drop

FAQs

Package last updated on 02 Jan 2019

Did you know?

Socket

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