Socket
Book a DemoInstallSign in
Socket

@masonite/siriwave

Package Overview
Dependencies
Maintainers
6
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@masonite/siriwave

The Siri wave replicated in a JS library.

latest
Source
npmnpm
Version
1.2.8
Version published
Maintainers
6
Created
Source

@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

Keywords

siri

FAQs

Package last updated on 08 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