Coder Social home page Coder Social logo

rogeralmeida / revealjs-animated Goto Github PK

View Code? Open in Web Editor NEW
14.0 2.0 4.0 1.94 MB

A simple to use plugin to add custom animations, based on the Web Animation API, to your presentations.

Home Page: https://rogeralmeida.github.io/revealjs-animated-examples/

License: MIT License

JavaScript 96.41% HTML 3.59%
revealjs web-animations-api web-animation javascript

revealjs-animated's Introduction

RevealJs-Animated

A revealjs plugin to facilitate the usage of animations inside your slides.

Build Status

Check out the examples

How to install

  1. Install the plugin on your revealjs presentation folder
    npm install revealjs-animated
  1. Import the plugin in your RevealJs initialisation
    //index.html
    Reveal.initialize({
        dependencies: [
            // Other plugins
            {src: 'node_modules/revealjs-animated/dist/revealjs-animated.js', async: true}
        ]
    });

How does it work?

This plugin will look for specific CSS classes to define how to animated elements inside your RevealJs slides. For now, it is meant to be used with revealjs fragments. The CSS class animated is required to keep the element visible.

Usage

Move to MIDDLE TOP

    <h1 id="titulo" class="fragment animated move-to-middle-top">Middle Top</h1>

attributes

This animation doesn't allow any attribute.

Move to specific position

    <p class="fragment animated move-to">Default Parameters</p>

Attributes

Name Default Value Description
data-animated-move-to-left 50px Distance that the animated object should move in the X axis
data-animated-move-to-top 25px Distance that the animated object should move in the Y axis

Scale Up

    <p class="fragment animated scale-up">Let me Grow!</p>

Attributes

Name Default Value Description
data-animated-scale-up-from 1 Transformation starting point
data-animated-scale-up-to 2 Transformation ending position

Scale Down

    <p class="fragment animated scale-down">Let me Shrink!</p>

Attributes

Name Default Value Description
data-animated-scale-down-from 1 Transformation starting point
data-animated-scale-down-to 0.5 Transformation ending position

Rotate

    <p class="fragment animated rotate">Rotate!</p>

Attributes

Name Default Value Description
data-animated-rotate-from 0deg Transformation starting point
data-animated-rotate-to 180deg Transformation ending position

General Time Attributes

The duration, iteration and fill animation's properties can be controlled via the following attributes:

attributes

Name Required Default Value Description
data-animated-duration No 1000 Animation duration time in miliseconds
data-animated-iterations No 1 How many iterations should the animation have
data-animated-fill No forwards Final state of the animation. Possible values are forwards, none, backwards, both, auto. More details on MDN: EffectTiming.fill

Combining animations

Starting from version 1.2.0 you can combine multiple animations to create sofisticated animations. To combine animations you just have to add multiple CSS classes to the same fragment

<p class="fragment animated move-to-middle-top rotate">Move to top and rotate</p>

Note that the General Time Attributes will applied to the animatino combo, not to each animation individually.

revealjs-animated's People

Contributors

ralmeidatyro avatar rogeralmeida avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

revealjs-animated's Issues

Smooth animation

Hey,
I really like this project as it could give the same functionalities as PowerPoint or Keynote.

Is there a way to smooth animations?
Or are you planning to add this feature later?

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.