Skip to content

wakeworks/elemental-animator

Elemental Animator for Silverstripe

Packagist Version GitHub

Introduction

Introduces easily integratable animations for your elemental blocks

Requirements

  • silverstripe/framework ^4.4 || ^5
  • silverstripe/elemental ^4 || ^5

This module was only tested on >= 4.10.

Installation

composer require wakeworks/elemental-animator

Then dev/build?flush=1.

How does it work? / Setup

To introduce animations into your elements, you'll have to which animation you want to each element.

<div
    data-scroll
    data-animated="fadeIn">

    $HTML
</div>

There are multiple options available

<div
    data-scroll
    data-animated="fadeIn"
    data-animated-delay="100"
    data-animated-duration="100">

    $HTML
</div>
Option Description Default
data-animated Which effect will be used none
data-animated-delay Delay in ms after which the effect will start 0
data-animated-duration Duration in ms that the animation will take 1000

Available effects

  • fadeIn
  • fadeInUp
  • fadeInDown
  • fadeInLeft
  • fadeInRight

Control animations from CMS

You can control your animations in cms by enabling the animations for all elements or specific ones. This will add input fields to your element's settings tab.

# Enable for all
DNADesign\Elemental\Models\BaseElement:
    animated: true

# Enable for specific one
Your\Specific\Element:
    animated: true
<div
    data-scroll
    data-animated="$Animation"
    data-animated-delay="$AnimationDelay"
    data-animated-duration="$AnimationDuration">

    $HTML
</div>

About

Adds animation options to your silverstripe elements

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published