• Stars
    star
    146
  • Rank 252,769 (Top 5 %)
  • Language
    TypeScript
  • Created almost 6 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A flexible, configurable animation of wave - 一个灵活的可配置的波浪动画

中文

English

波浪动画

一个灵活的可配置的波浪动画

简单的展示

附代码的展示

教程

使用

在实例化时接收两个参数

第一个参数:动画容器的选择器

第二个参数(可选):options

引用 /dist/wave.es.js

import Wave from './dist/wave.es.js'
  
const wave = new Wave('body')

引用 /dist/wave.js

<script src="./dist/wave.js"></script>
<script >
  const wave = new Wave('body')
</script>

配置参数

container

类型:string

默认值:--

说明:动画容器的选择器

options

options.number

类型: number

默认值:3

说明:波浪个数(层数)

options.smooth

类型: number

默认值:50

说明:平滑程度

options.velocity

类型: number

默认值:1

说明:速度

options.height

类型: number

默认值:.3

说明:波浪高度,可以是百分比,也可以是具体的高度

options.colors

类型: Array<{ hex: string, rgba: string }>

默认值:['#ff7657']

说明:每个波浪的颜色

options.opacity

类型: number

默认值:.5

说明:波浪的透明度

options.border.show

类型: boolean

默认值:true

说明:是否显示边框

options.border.width

类型: number

默认值:2

说明:边框宽度

options.border.color

类型: string[]

默认值:['']

说明:边框颜色,默认为波浪颜色相同

options.position

类型: 'top' | 'bottom' | 'left' | 'right'

默认值:"bottom"

说明:波浪的位置

方法

animate

开始动画

pause

暂停动画

setOptions

设置参数,接收值与上述 options 相同

reset

重置动画,当容器大小变化时可用

TODO

增加多个波浪(多个贝塞尔曲线连接)

More Repositories

1

css_tricks

Some CSS tricks - 一些 CSS 常用样式
CSS
4,029
star
2

live2DModel

页面上加载的模型
HTML
304
star
3

vuepress-plugin-cat

Add cat model for vuepress
Vue
180
star
4

animate_resume_ts

动态简历(an animate resume build by typescript )
TypeScript
135
star
5

js_tricks

Some commonly used javascript methods - 一些常用的 JS 方法
JavaScript
97
star
6

animate_resume

动态简历(animate_resume)
JavaScript
25
star
7

blog

JavaScript
21
star
8

resume

my resume
HTML
14
star
9

rhythm-ripple

仿网易云音乐播放时的动画
JavaScript
12
star
10

finxos

An editor based on the slate.js, UI components use antd in the early.
TypeScript
9
star
11

log-tree

Log the tree of object
JavaScript
8
star
12

QTree

JavaScript
5
star
13

Q

some codes always be used
JavaScript
5
star
14

three.js-demo

JavaScript
4
star
15

gutenberg-js-demo

gutenberg-js-demo
JavaScript
4
star
16

dont-touch-white

别踩白块 don`t touch white
JavaScript
4
star
17

particleText

particleText, 粒子文字
JavaScript
4
star
18

vue_tetris

俄罗斯方块(tetris by vue and vuex)
JavaScript
3
star
19

quick-sass

use sass quickly
JavaScript
3
star
20

qishaoxuan.github.io

平常写的拉个列表记录
HTML
3
star
21

learn_shell

3
star
22

PAnimate

animate of a paragraph
JavaScript
2
star
23

exia-react

An react cli
JavaScript
2
star
24

compare-chart

HTML
1
star
25

gutenberg-rebuild

JavaScript
1
star
26

click-tip

popup a tip in page any where when click
HTML
1
star
27

writeWhenBoring

writeBoring,无聊时写的一点东西
1
star
28

color-creater

Create color from color
1
star
29

react-app-template

A react app template to build quickly
1
star
30

log-dir-tree

Log the directory constructor tree like use tree dir in linux
JavaScript
1
star
31

exia-event

An event emitter
JavaScript
1
star
32

parabola

parabola
JavaScript
1
star
33

travel

JavaScript
1
star
34

exia

Some common operations are simplified as commands.
JavaScript
1
star
35

interview-summary

面试总结,interview summary
HTML
1
star
36

giki-helper

Help giki operations from the terminal
JavaScript
1
star