• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

ajainvivek/ember-cli-spinner: AJAX Spinners for your Ember.js app

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

ajainvivek/ember-cli-spinner

开源软件地址:

https://github.com/ajainvivek/ember-cli-spinner

开源编程语言:

JavaScript 62.5%

开源软件介绍:

ember-cli-spinner

NPM Downloads

Visit project page and demo

ember-cli-spinner displays css3 driven ajax spinner for your ambitious Ember.js app.

Usage

  1. Add {{ember-cli-spinner id="uniq-123"}} to one of your templates, usually in application.hbs or View or Components
  2. Specify id attribute to uniquely identify spinner wrapper.
  3. Inject the spinner service
  4. Show, Hide & Set Animation Type for the spinner
  5. For components or child view spinner loading ensure parent position is set to relative

Examples

import {
  Component,
  inject
} from 'ember';
export default Component.extend({
  spinner: inject.service('spinner'),
  actions: {
    showSpinnerWithTimeout() {
      this.get('spinner').show('id', { //Provide the unique id
        timeout: 3000
      });
    },
    showSpinner() {
      this.get('spinner').show('id');
    },
    hideSpinner() {
      this.get('spinner').hide('id');
    }
  }
});
{{ember-cli-spinner id="123" type="wave" height="40px" width="40px" bgColor="transparent" color="dark-red"}}

...and you can change animation programmatically:

spinner.setAnimation('123', 'pulse');

Animation types available:

  • Pulse -> (pulse)
  • Circles -> (circles)
  • Fading Circles -> (fading-circle)
  • Wave -> (wave)
  • Double Bounce -> (double-bounce)
  • Rotating Plane -> (rotating-plane)
  • Folding Cube -> (folding-cube)
  • Wandering Cubes - (wandering-cubes)
  • Chasing Dots - (chasing-dots)
  • Three Bounce - (three-bounce)
  • Three Bounce Horizontal - (three-bounce-horizontal)
  • Cube Grid - (cube-grid)

API's

  1. show(id, options) //provide unique id for spinner wrapper
  2. hide(id) //provide unique id for spinner wrapper
  3. setAnimation(id, type) //type from available types
  4. setHeight(id, height) //height in px or em
  5. setWidth(id, width) //width in px or em
  6. setColor(id, color) //colors from available colors
  7. setBgColor(id, color) //color can be hex or rgba value

Spinner color class available are:

  • White -> (white) //default
  • Black -> (black)
  • Light Green -> (light-green)
  • Green -> (green)
  • Dark Green -> (dark-green)
  • Magenta -> (magenta)
  • Purple -> (purple)
  • Dark Purple - (dark-purple)
  • Darken - (darken)
  • Light Blue - (light-blue)
  • Blue - (blue)
  • Dark Blue - (dark-blue)
  • Yellow - (yellow)
  • Orange - (orange)
  • Dark Orange - (dark-orange)
  • Red - (red)
  • Dark Red - (dark-red)

Installation

This module is an ember-cli addon, so installation is easy as cake.

npm install ember-cli-spinner --save-dev

Browser Compatibility

IE9 +, Chrome 21+, Mozilla, Safari




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap