Coder Social home page Coder Social logo

michaeldhopkins / animate-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sw-development-services/animate-plugin

0.0 0.0 0.0 792 KB

This is a small plugin for CraftCMS that helps with animation on scroll. This is based on the AOS library.

Home Page: https://swdevteam.com

License: MIT License

PHP 80.18% Twig 19.82%

animate-plugin's Introduction

Animate plugin for Craft CMS 3.x

This will animate elements using AOS from https://github.com/michalsnik/aos

Screenshot

Requirements

This plugin requires Craft CMS 3.0.0-beta.23 or later.

Installation

To install the plugin, follow these instructions.

  1. Open your terminal and go to your Craft project:

     cd /path/to/project
    
  2. Then tell Composer to load the plugin:

     composer require swdevelopment/animate
    
  3. In the Control Panel, go to Settings → Plugins and click the “Install” button for animate.

or

    ./craft install/plugin animate

Animate Overview

Animate save you time by loading the files needed to run the Animate On Scroll library and allows you add animation elements in your templates.

Configuring Animate

To start using Animate, just navigate to the Control Panel and click on the Animate plugin.

  1. To activate be sure to make sure you turn the Activate Animate lightswitch on.
  2. To use a CDN wiht the library, be sure to turn the Use CDN lightswitch on. It is good practice to use a CDN in production environments. If you are developing locally, there is no need to turn it on.

Screenshot

Using Animate

To use Animate inside of a template, simply add the data-aos tags to any element. Full usage of the library is completely up to you.

  • animations are used with the attribute data-aos

  • settings can be overridden with the attribute data-aos-*

    • delay
    • duration
    • offset
    • easing
    • anchor
    • anchor-placement

Animation Options ( Fade )

Animation Effect Usage
fade data-aos="fade"
fade-up data-aos="fade-up"
fade-down data-aos="fade-down"
fade-left data-aos="fade-left"
fade-right data-aos="fade-down"
fade-up-right data-aos="fade-up-right"
fade-up-left data-aos="fade-up-left"
fade-down-right data-aos="fade-down-right"
fade-down-left data-aos="fade-down-left"

Example code of a "flip-up":

<div class="content" data-aos="flip-up">
    <h1 data-aos="slide-right" data-aos-delay="200" data-aos-duration="400">Welcome</h1>
</div>

For all animations, animation types and settings options, please refer to Animate's settings page.

Animate Roadmap

Future features:

  • Add the ability to edit animation inside the CP on any field without adding any code to the template.

Brought to you by Tim Strawbridge

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.