0.1.1 • Published 6 years ago

ngx-float-ball v0.1.1

Weekly downloads
8
License
MIT
Repository
github
Last release
6 years ago

ngx-float-ball

这是一个Angular的悬浮球控件。

  • 支持触摸滑动
  • 支持鼠标拖动
  • 支持图标

效果展示

npm.io

参数说明

ParameterTypeDefault ValueDescription
clickedsignalN/A鼠标点击事件
outerCircleDiameternumber60外圆的直径
innerCircleDiameternumber30内圆的直径
delayTime400number鼠标移动延迟响应时间
isBlinkedbooleantrue是否闪烁悬浮球
hasRipplebooleantrue是否有点击波纹效果
foregroundstring#ffffff前景色,默认为白色
backgroundstring#F44336前景色,默认为红色
iconstringnull图标路径
iconDiameternumber30图标的直径
initPosnumber[]200, 200悬浮球的初始化位置
touchOffsetnumber15触摸移动误差15px
openInertiabooleantrue开启弹性双边吸附功能

安装

npm install ngx-float-ball --save

使用

  1. 在app.module.ts内导入:
import { NgxFloatBallModule } from 'ngx-float-ball'
  1. 在html内使用
<ngx-float-ball [isBlinked]="true"
    [hasRipple]="false"
    [icon]="'../assets/face.svg'">
</ngx-float-ball>

npm.io

  1. 弹力吸附功能
<ngx-float-ball [openInertia]="true">
</ngx-float-ball>

npm.io

TODO

  • 增加背景色和前景色属性
  • 增加图标支持
  • 优化渲染
  • 增加tap,点击,双击,长按
  • 触摸到窗口外边界, 造成悬浮球不见防呆
  • 鼠标点击后动画消失,背景色更改至设定背景色
  • 增加自定义嵌入元素
  • 增加弹力吸附
  • 修复鼠标单击后快速移动到某一位置,达到延迟时间后,松开鼠标,悬浮球快速移动过去
  • 修复悬浮球未移动浏览器F12后,位置更换到0,0的错误
  • 增加悬浮球scss样式重载

License

  • MIT
0.1.1

6 years ago

0.1.0

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago