jsila/animate 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jsila/animate

最新稳定版本:0.1.0

Composer 安装命令:

composer require jsila/animate

包简介

Simple PHP wrapper around Animate.css

README 文档

README

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.

Installation

You can install this package via Composer by including the following in your composer.json:

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

It depends on php>=5.4 and Animate.css.

Laravel 4

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

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

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

AnimateServiceProvider will also add alias for Animate facade.

Usage with Laravel

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

    Animate::zoomIn();

You can also provide options when generating class string for a specific animation. These options are:

$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.

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.

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

    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).

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).

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.

Stand-alone example:

$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']);

统计信息

  • 总下载量: 32
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-06-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固