Giter VIP home page Giter VIP logo

angular-fx's Introduction

Angular Fx

###Angular.js + animate.css

Conditional animations and effects for your elements: ngfx-shake, ngfx-pulse, ngfx-tada, and more ...

Just use them like you do for ng-if or ng-hide or ng-show.

It uses the awesome animate.css.

The Angular Fx is developed by 720kb.

##Requirements

AngularJS v1.2+

animate.css

###Browser support

Chrome ok

Firefox ok

Safari ok

Opera ok

IE mmm

Load

To use the directive, include the Angular Fx javascript and css files in your web page and the animate.css file:

<!DOCTYPE HTML>
<html>
<head>
  <link href="bower_components/animate.css/animate.min.css" rel="stylesheet" type="text/css" />
  <!-- angular-fx.css goes after animate.css-->
  <link href="path/to/css/angular-fx.css" rel="stylesheet" type="text/css" />
</head>
<body ng-app="app">
  //.....
  <script src="path/to/js/angular-fx.js"></script>
</body>
</html>

##Install

###Bower installation

$ bower install angular-fx --save

then load the js files in your html

###Npm installation

$ npm install angular-fx --save

then load the js files in your html

###Add module dependency

Add the 720kb.fx module dependency

angular.module('app', [
  '720kb.fx'
 ]);

Use them like you do for ng-if or ng-show or ng-hide

<a href="#" ngfx-pulse="3 > 2">Pulse</a>

Example

angular.module('app', [
  '720kb.fx'
 ])
 .controller('myCtrl',['$scope', '$timeout', function ($scope, $timeout) {
    $timeout(function () {

     $scope.x = 3;
    }, 2000);

    $timeout(function () {

     $scope.x = 1;
    }, 6000);
 }]);

Use them like you do for ng-if or ng-show or ng-hide

<div ng-controller="myCtrl">
<a href="#" ngfx-pulse="x > 2">Pulse</a>
<a href="#" ngfx-fade-out="x > 2">Fadeout</a>
</div>

###live example

##Complete list for animations and effects examples, you can refer to the animate.css animations list here

ngfx-flash

ngfx-pulse

ngfx-rubber-band

ngfx-shake

ngfx-swing

ngfx-tada

ngfx-wobble

ngfx-bounce-in

ngfx-bounce-in-down

ngfx-bounce-in-left

ngfx-bounce-in-right

ngfx-bounce-in-up

ngfx-bounce-out

ngfx-bounce-out-down

ngfx-bounce-out-left

ngfx-bounce-out-right

ngfx-bounce-out-up

ngfx-fade-in

ngfx-fade-in-down

ngfx-fade-in-down-big

ngfx-fade-in-left

ngfx-fade-in-left-big

ngfx-fade-in-right

ngfx-fade-in-right-big

ngfx-fade-in-up

ngfx-fade-in-up-big

ngfx-fade-out

ngfx-fade-out-down

ngfx-fade-out-down-big

ngfx-fade-out-left

ngfx-fade-out-left-big

ngfx-fade-out-right

ngfx-fade-out-right-big

ngfx-fade-out-up

ngfx-fade-out-up-big

ngfx-flip

ngfx-flip-in-x

ngfx-flip-in-y

ngfx-flip-out-x

ngfx-flip-out-y

ngfx-light-speed-in

ngfx-light-speed-out

ngfx-rotate-in

ngfx-rotate-in-up-left

ngfx-rotate-in-up-right

ngfx-rotate-in-down-left

ngfx-rotate-in-down-right

ngfx-rotate-out

ngfx-rotate-out-up-left

ngfx-rotate-out-up-right

ngfx-rotate-out-down-left

ngfx-rotate-out-down-right

ngfx-hinge

ngfx-roll-in

ngfx-roll-out

ngfx-zoom-in

ngfx-zoom-in-down

ngfx-zoom-in-left

ngfx-zoom-in-right

ngfx-zoom-in-up

ngfx-zoom-out

ngfx-zoom-out-down

ngfx-zoom-out-left

ngfx-zoom-out-right

ngfx-zoom-out-up

##Options

####Animations speed To set a different animation speed just use the ngfx-speed="medium | fast | slow" attribute (default value, if not specified, is medium):

<a href="#" ngfx-pulse="3 > 2" ngfx-speed="slow">Slow Pulse</a>
<a href="#" ngfx-pulse="3 > 2" ngfx-speed="medium">Medium Pulse</a>
<a href="#" ngfx-pulse="3 > 2" ngfx-speed="fast">Fast Pulse</a>

####Element visibility If, for any reason, you would your element to be shown or hidden by default, you can use the ngfx-default="hide | show" attribute:

<a href="#" ngfx-pulse="3 > 2" ngfx-default="show">Shown by default</a>
<a href="#" ngfx-pulse="3 > 2" ngfx-default="hide">Hidden by default</a>

####Infinite animations If for example you want an element to repeat the animation or effect while your condition/expression is true (sometimes needed), just add the infinite class to your element:

<a href="#" ngfx-pulse="3 > 2">Pulse one time</a>
<a href="#" ngfx-pulse="3 > 2" class="infinite">Pulse continuously</a>

##Contributing

We will be much grate if you help us making this project to grow up. Feel free to contribute by forking, opening issues, pull requests etc.

License

The MIT License (MIT)

Copyright (c) 2014 Filippo Oretti, Dario Andrei

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

angular-fx's People

Contributors

45kb avatar wouldgo avatar

Watchers

 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.