Giter VIP home page Giter VIP logo

jquery.wakeup.js's Introduction

これはローディングアニメーションを生成する jQuery プラグインです。
wakeUp() でアニメーション生成、 goToBed() で破棄します。
Canvas で描かれるので、Canvas 対応ブラウザ(非対応の場合は対応処理を施した上)でお使いください。

アニメーションの形とそれぞれのプロパティ

circle

  • type: アニメーションの形 / 'circle'
  • color: アニメーションの色 / CSS での値
  • size: アニメーションの大きさ / 数値
  • speed: アニメーションの速さ / ミリ秒
  • clockwise: 時計回りかどうか / true もしくは false
  • fade: フェイドインやフェイドアウトの時間 / ミリ秒
  • fadeIn: フェイドインするかどうか / true もしくは false
  • fadeOut: フェイドアウトするかどうか / true もしくは false

dot/line

  • type: アニメーションの形 / 'dot' もしくは 'line'
  • color: アニメーションの色 / CSS での値
  • size: アニメーションの大きさ / 数値
  • speed: アニメーションの速さ / ミリ秒
  • clockwise: 時計回りかどうか / true もしくは false
  • item: アニメーションする物体の数 / 数値
  • itemSize: アニメーションする物体の大きさ / 数値
  • fade: フェイドインやフェイドアウトの時間 / ミリ秒
  • fadeIn: フェイドインするかどうか / true もしくは false
  • fadeOut: フェイドアウトするかどうか / true もしくは false

beat/star/heart

  • type: アニメーションの形 / 'beat' もしくは 'star' もしくは 'heart'
  • color: アニメーションの色 / CSS での値
  • size: アニメーションの大きさ / 数値
  • speed: アニメーションの速さ / ミリ秒
  • phase: アニメーションする段階 / 数値
  • fade: フェイドインやフェイドアウトの時間 / millisecond
  • fadeIn: フェイドインするかどうか / true or false
  • fadeOut: フェイドアウトするかどうか / true or false

使用例

html

<button>Play/Stop</button>
<div id='loading'></div>

jQuery

$('button').click(function() {  
	if ($('#loading').find('canvas')[0]) {  
		$('#loading').goToBed();
	} else {
		var option = {
			type: 'line',
			color: 'rgb(0, 255, 0)',
			size: 50,
			speed: 30,
			clockwise: false,
			item: 24,
			itemSize: 12
		};
		$('#loading').wakeUp(option);
	}
});

このプラグインがお役に立てば幸いです。

Special Thanks

@astronaughts https://twitter.com//astronaughts

jquery.wakeup.js's People

Stargazers

 avatar

Watchers

James Cloos avatar Yutaka Imagawa avatar

Forkers

frient

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.