Giter Site home page Giter Site logo

sounder.js's Introduction

 ____                                __
/\  _`\                             /\ \                    __
\ \,\L\_\    ___   __  __    ___    \_\ \     __   _ __    /\_\    ____  
 \/_\__ \   / __`\/\ \/\ \ /' _ `\  /'_` \  /'__`\/\`'__\  \/\ \  /',__\
   /\ \L\ \/\ \L\ \ \ \_\ \/\ \/\ \/\ \L\ \/\  __/\ \ \/ __ \ \ \/\__, `\
   \ `\____\ \____/\ \____/\ \_\ \_\ \___,_\ \____\\ \_\/\_\_\ \ \/\____/
    \/_____/\/___/  \/___/  \/_/\/_/\/__,_ /\/____/ \/_/\/_/\ \_\ \/___/
                                                           \ \____/
                                                            \/___/

Sound effector small JavaScript library.

Demo

https://sugarshin.github.io/sounder.js/

Quickstart

bower i sounder.js

Usage

<script src="sounder.js"></script>

Or use it as an AMD, CommonJS module

// CommonJS

var Sounder = require('sounder');

var sounder = new Sounder(),
    output = document.getElementById('output');

sounder.create(output);

Config

Sounder([ options ]);

options.size

Piece size

Type: Array

Default: [20, 4]

options.color

Coloring

If specify Array, will be chosen at random

Type: String or Array

Default: '#e74c3c'

options.column

Effect column length

Type: Number

Default: 6

options.maxHeight

Effect max height length

Type: Number

Default: 10

options.autoPlay

Effect auto playing

Type: Boolean

Default: false

options.speed

fps

Type: Number

Default: 60

Methods

.create( DOMElement )

Create and redering.

DOMElement

Type: Element

Returns: this

.play( [callback] )

Play.

Returns: this

.pause( [callback] )

Pause.

Returns: this

.toggle( [callback, callback] )

Toggles the state between play and pause.

Function of the first argument is the callback function for play. next is pause.

Returns: this

.stop( [callback] )

Stop.

Returns: this

.reset()

Effect counter reset.

Returns: this

.destory()

Destory.

Contributing

This library was developed with following things

gulp

CoffeeScript

npm i

Support browser

Modern browser and IE8+

License

MIT

© sugarshin

sounder.js's People

Contributors

sugarshin avatar

Watchers

James Cloos avatar  avatar  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.