0.0.6 • Published 6 years ago
yuzhua-logo v0.0.6
yuzhua logo
Installation
Install with npm or Yarn
# npm
$ npm install yuzhua-logo --save
# yarn
$ yarn add yuzhua-logo
Usage
import Logo from 'yuzhua-logo'
// with constructor options
new Logo({ x: 50, y: 50 }).render()
// render static logo
new Logo().render()
// render motive logo with options
new Logo().move({ duration: 3000 })
new Logo().move({ duration: 3000, count: 3 })
new Logo().move({ duration: 3000, count: Infinity, reverse: true })
new Logo().move({ duration: 3000, count: 0, reverse: true })
// typings
// constructor options
interface Options {
// target canvas element
el?: string | HTMLCanvasElement
// canvas width
width?: number
// canvas height
height?: number
// logo size
size?: number
// logo line style
lineWidth?: number
color?: string
// render position on the canvas
x?: number
y?: number
}
// move function options
interface MotiveOptions {
// render time
duration?: number
// timing function
ease?: easeFunc
// render count
count?: number
// rendering end reversal position
reverse?: boolean
}
LICENSE
MIT