Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/raulriera/animator
Animator helper class for Titanium Appcelerator.
https://github.com/raulriera/animator
Last synced: 16 days ago
JSON representation
Animator helper class for Titanium Appcelerator.
- Host: GitHub
- URL: https://github.com/raulriera/animator
- Owner: raulriera
- License: other
- Created: 2013-01-18T15:28:59.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2015-03-30T14:27:29.000Z (over 9 years ago)
- Last Synced: 2024-10-12T10:11:11.362Z (about 1 month ago)
- Language: JavaScript
- Size: 193 KB
- Stars: 58
- Watchers: 11
- Forks: 10
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#Animator:
**Animator** is a helper class to ease your mind when working with animations on Titanium.##Usage:
In your app.js (or elsewhere), call:```javascript
// Load the animator helper
var Animator = require("Animator");
```Now that you have the module initialised you can call one of these animation functions:
* **scale**: increases or decreases the size of the view
* **rotate**: rotates the view
* **fade**: changes the opacity of the view
* **flip**: flips the view (horizontally if nothing is passed)
* **moveTo**: moves the view in the X and Y coordinates
* **sizeTo**: resizing and positioning the view through width, height, bottom, top, left and right
* **backgroundColor**: changes the backgroundColor of the view with fading effect
* **shake**: shake a view like the code dots on the iOS passcode screenLet's for example scale a window to 80% of its size
```javascript
// Load the animator helper
new Animator().scale({ view: window, value: 0.8, duration: 500 });
```##Helpers inside the helper
Queuing animations can be a pain. That is why you can also find two specials methods called:
* **sequence**: uses an array of animations and queues them one after the other
* **parallel**: uses an array of animations and runs them all at onceLet's do a quick example
```javascript
// do a bunch of animations one after the other
new Animator().sequence([
{
type: "scale",
view: pink,
value: 1.5,
duration: 500 },
{
type: "rotate",
view: pink,
value: 57,
duration: 500 } ,
{
type: "fade",
view: blue,
value: 0.8,
duration: 500 } ,
{
type: "moveTo",
view: pink,
value: {x: 0, y: 200 },
duration: 500 },
]);
```Without the **sequence** method, achieving the same result without the previous code will be a nesting nightmare.
##More examples
For more information check out the [examples.js](https://github.com/raulriera/Animator/blob/master/examples.js) file. Or browse around the [Animator.js](https://github.com/raulriera/Animator/blob/master/Animator.js) file.##About:
Created by Raul Riera, [@raulriera](http://twitter.com/raulriera)