1.2.8 • Published 5 years ago

@masonite/siriwave v1.2.8

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

@masonite/siriwave

The "Apple Siri" wave replicated in pure Javascript using the Canvas API. Based on kopiro/siriwave.

Usage

npm install @masonite/siriwave
import SiriWave from "@masonite/siriwave";

const siriWave = new SiriWave({
  container: document.getElementById('siri-container'),
  height: 200,
  autostart: true
});

The default options for the siriwave used for Masonite are as follows:

{ 
  cover: true,
  autostart: false,
  style: "ios9",
  colors (changed in src/ios9curve.js): rgb(146,200,62), rgb(67,71,75), rgb(67,71,75),
  amplitude: 2
}

See below for additional options and customizations to the siriwave package.

Options

KeyTypeDescriptionDefaultRequired
containerDOMElementThe DOM container where the DOM canvas element will be added.nullyes
style"ios", "ios9"The style of the wave."ios9"no
ratioNumberRatio of the display to use. Calculated by default.calculatedno
speedNumberThe speed of the animation.0.2no
amplitudeNumberThe amplitude of the complete wave-form.2no
frequencyNumberThe frequency of the complete wave-form. Only available in style "ios"6no
colorStringColor of the wave. Only available in style "ios""#fff"no
coverBoolThe canvas covers the entire width or height of the containertrueno
autostartBoolDecide wether start the animation on boot.falseno
pixelDepthNumberNumber of step (in pixels) used when drawed on canvas.0.02no
lerpSpeedNumberLerp speed to interpolate properties.0.01no

API

start()

Start the animation

stop()

Stop the animation.

setSpeed(newValue)

Set the new value of speed (animated)

setAmplitude(value)

Set the new value of amplitude (animated)

Grapher plots

1.2.8

5 years ago

1.2.7

5 years ago

1.2.5

5 years ago