Giter Club home page Giter Club logo

meteor-spin's Introduction

Spin

A meteor package for Spin.js.

Installation

meteor add hckrs:spin

Usage

You can easily add the spin to your html template by calling:

{{> spin}}

Use different sizes:

{{> spin size='xs'}}
{{> spin size='sm'}}
{{> spin size='lg'}}

Advanced

Spin.js listed properties to tweak the spinner style.
There are several ways to change these properties.

1. Custom

Pass additional arguments to the spinner:

{{> spin radius=18 length=15}}

2. Options

Pass an object containing the style properties.
Define such object in a template helper.

{{> spin options=myOptions}}

3. Sizes

Add more sizes in JavaScript:

Spin.size.big = {
  length: 50,
  radius: 50,
  width: 4
}

Call them by name:

{{> spin size='big'}}

4. Presets

You can define your own presets in JavaScript, like:

Spin.preset.myPreset = {
  lines: 13, // The number of lines to draw
  length: 20, // The length of each line
  width: 10, // The line thickness
  radius: 30, // The radius of the inner circle
  corners: 1, // Corner roundness (0..1)
  rotate: 0, // The rotation offset
  direction: 1, // 1: clockwise, -1: counterclockwise
  color: '#000', // #rgb or #rrggbb or array of colors
  speed: 1, // Rounds per second
}

Refer to the preset by name:

{{> spin preset='myPreset'}}

5. Default

You can also overwrite the default properties:

Spin.default = {
  color: '#f00', // #rgb or #rrggbb or array of colors
  speed: 3, // Rounds per second
}

In that case you can just call:

{{> spin}}

6. Combine

You can also combine the above approaches, like:

{{> spin preset="myPreset" size="lg" options=extraOptions speed=5}}

In the case of overlapping properties the precedence is defined as
the order in which this ReadMe file is written.

meteor-spin's People

Contributors

jarnoleconte avatar nathan-muir avatar

Watchers

 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.