2017 © Pedro Peláez
 

library animate

Simple PHP wrapper around Animate.css

image

jsila/animate

Simple PHP wrapper around Animate.css

  • Wednesday, June 4, 2014
  • by JSila
  • Repository
  • 1 Watchers
  • 0 Stars
  • 17 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Animate

A simple PHP wrapper around Animate.css. It generates string of classes based on which animation you specify as a method to a Animate class instance. For all animations please refer to GitHub page for Animate.css., (*1)

Installation

You can install this package via Composer by including the following in your composer.json:, (*2)

{
    "require": {
        "jsila/animate": "0.1.0"
    }
}

It depends on php>=5.4 and Animate.css., (*3)

Laravel 4

If you are using Laravel 4, you can also register the AnimateServiceProvider for easier integration with the framework., (*4)

To do so, just update the providers array in your app/config/app.php:, (*5)

    'providers' => array(
        //...
        'JSila\Animate\AnimateServiceProvider'
    ),

AnimateServiceProvider will also add alias for Animate facade., (*6)

Usage with Laravel

For example, if you want zoomIn animation (for which the output will be animated zoomIn), you will get it like this:, (*7)

    Animate::zoomIn();

You can also provide options when generating class string for a specific animation. These options are:, (*8)

$options = [
    'infinite', // boolean
    'duration', // string
    'delay', // string
    'direction', // string
    'iteration-count' // int
];

Please note that last four options are CSS3 animations properties so specify values accordingly., (*9)

Each option will add another class to the class string. Some classes are already defined in Animate.css, some are generated dinamically and are accessible from URL which points to CSS., (*10)

For example, if you want zoomIn animation to run infinitely and is delayed for 0.2s, than this code will do the trick:, (*11)

    Animate::zoomIn(['infinite' => true, 'delay' => '.2s']);

If you use Laravel 4, that url to CSS defaults to /css/animate_custom_classes.css (you can change it, just publish package configurationd)., (*12)

Usage as a stand-alone

Classes that are dynamically created are stored in session variable classes. You will first need to make an implementation of JSila\Animate\SessionInterface interface which is a dependency to JSila\Animate\Animate class (eg. MySession)., (*13)

Than you will also have to generate CSS response. JSila\Animate\Animate class provides generateCSS method, which generates CSS string of classes, but this does not act as a response., (*14)

Stand-alone example:, (*15)

$animate = new JSila\Animate\Animate(new Acme\Animate\Session\MySession); // this assumes MySession class is saved in Acme/Animate/Session
$animate->zoomIn(['infinite' => true, 'delay' => '.2s']);

The Versions

04/06 2014

dev-master

9999999-dev

Simple PHP wrapper around Animate.css

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Jernej Sila

animate.css animations

04/06 2014

0.1.0

0.1.0.0

Simple PHP wrapper around Animate.css

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

by Jernej Sila

animate.css animations