GithubHelp home page GithubHelp logo

tommytwoeyes / siriwavejs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kopiro/siriwave

1.0 2.0 0.0 349 KB

The Siri wave replicated in a JS library.

License: MIT License

HTML 35.07% JavaScript 64.93%

siriwavejs's Introduction

image

Gitter

Have you ever thought on how to get the Siri wave effect on your website or mobile app?

SiriWaveJS is a library that easily allows you to get this effect.

Embed the script... and Surf!

Usage

<div id="siri-container"></div>
<script src="/path/to/your/siriwave.js"></script>
<script>
var siriWave = new SiriWave({
	container: document.getElementById('siri-container'),
	width: 640,
	height: 200,
	/*
	speed: 0.2,
	color: '#000',
	frequency: 2
	*/
});
</script>

Constructor options

style (String, default: 'none')

  • default - Default iOS9- style
  • ios9 - Style of for iOS9+

container (DOM Object)

The DOM container where the canvas to draw the wave is added.

[speed] (Number, from 0 to 1, default: 0.1)

The speed of the wave.

[amplitude] (Number, from 0 to 1, default: 1)

The noise (amplitude) of the wave.

[frequency] (Number, from 0 to N, default: 1)

The frequency of the wave.

Not available in iOS9 Style

[color] (String, Color, default: #fff)

The color of the wave, in hexadecimal form (#336699, #FF0)

Not available in iOS9 Style

[cover] (Boolean, default: false)

The canvas covers the entire width or height of the container.

[speedInterpolationSpeed] (Number)

The speed to interpolate the speed property.

[amplitudeInterpolationSpeed] (Number)

The speed to interpolate the amplitude property.

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)

Projects/examples that uses this script

Some math

image

siriwavejs's People

Contributors

kopiro avatar lastguest avatar yulon avatar charliegerard avatar mikemaccana avatar gitter-badger avatar

Stargazers

Greyforest Media avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.