Appearance

For Reveal.js and Quarto

Why?

In Powerpoint you can make slides with items that appear automatically and sequentially with effects. Appearance is a plugin for Reveal.js that does the same.

Appearance is easy to set up. It uses Animate.css by Daniel Eden for the animations, with some changes to allow for a non-animated state.

Examples

Let’s check out what Appearance does:

Let text appear

  • Add it to any text element.
  • Like list items, or headers.
  • It adds some impact.

Let lines appear per word

or… per character

Let images appear

Use with fragments

Inside fragments like this (click next):

Or as a fragment itself.

Animate.css animations

Appearance supports the standard entrance/in animations that Animate.css offers. Some examples:

  • .animate__backInDown
  • .animate__bounceInDown
  • .animate__fadeInLeft
  • .animate__flipInX
  • .animate__rotateIn
  • .animate__zoomInDown
  • .animate__jackInTheBox

Additional animations

  • .animate__skidLeft
  • .animate__skidLeftBig
  • .animate__skidRight
  • .animate__skidRightBig
  • .animate__shrinkIn
  • .animate__shrinkInBig

Note: The shrinkInBlur animation was removed from Appearance, due to performance issues. For backwards compatibility, any element that used it will now use the shrinkIn animation instead.

Setup

Basics

There are really only three steps:

  1. Install Appearance
  2. Edit the markup to add animation classes
  3. Enjoy the animations

Installation

The following command installs the plugin for use with Quarto:

quarto add martinomagnifico/quarto-appearance


Now refer to the plugin in the YAML:

format:
    revealjs:
      //...
revealjs-plugins:
    - appearance

Markup (auto)

For automatic markup, you can use the autoappear option.

For manual markup, continue to the next slide.

Markup (manual)

Add an animation class to the elements that you would like to have animated when the slide appears:


![](img/1.jpg){.animate__fadeInDown}
![](img/2.jpg){.animate__fadeInDown}

This is the Quarto way of adding attributes. Check the regular demo to see how you do this in HTML.

To simplify it in any markup, you can use the autoappear option.

Markup (manual) for words or letters

To nicely animate the words in a heading, or the letters of a word, add an animation class to it, and add a data-attribute for the kind of split you want:

### [Split into words]{.animate__fadeInDown data-split="words"}
### [Split into letters]{.animate__fadeInDown data-split="letters"}

Quarto and list items

Quarto will wrap the content of a list item in a span if you try to add attibutes to it. The bulletpoint or list number will then not be animated. Appearance can fix this:

  1. This is a list item
  2. This is a list item
  1. This is a list item
  2. This is a list item

Add data-appear-parent="true" to the list item.

1. [This is a list item]{.animate__fadeInLeft data-appear-parent="true"}
2. [This is a list item]{.animate__fadeInLeft data-appear-parent="true"}

or globally like this:

format:
  revealjs:
    ...
    appearance:
      appearparents: true

Now change it

You can change the delay, speed and start of animations easily:

Change the delay

Use data-delay="*" on each element, where the wildcard is the delay in microseconds from the appearance of the previous element.

![](img/1.jpg){.animate__fadeInDown data-delay="0"}
![](img/2.jpg){.animate__fadeInDown data-delay="200"}
![](img/3.jpg){.animate__fadeInDown data-delay="160"}
![](img/4.jpg){.animate__fadeInDown data-delay="120"}
![](img/5.jpg){.animate__fadeInDown data-delay="80"}

data-delay is automatically converted to CSS animation delay.

Change the animation speed

Use the speed classes from Animate.css to change the speed of the animation:

slower

slow

 

fast

faster

![](img/1.jpg){.animate__bounceIn .animate__slower}
![](img/2.jpg){.animate__bounceIn .animate__slow}
![](img/3.jpg){.animate__bounceIn}
![](img/4.jpg){.animate__bounceIn .animate__fast}
![](img/5.jpg){.animate__bounceIn .animate__faster}

Change the settings for words or letters

For words and letters, just set the speed and delay as described above. The smaller parts will inherit these settings. Set a data-container-delay="*" for a different delay for the container, compared to the standard delay = 300 from the options.

Split into words

Split into letters


### [Split into words]{.animate__fadeInDown data-split="words"}
### [Split into letters]{.animate__fadeInDown .animate__faster data-split="letters" data-delay="75" data-container-delay="800"}

Change when appearance starts

Change when appearance starts

You can use any of the following events:

  • slidetransitionend (default, after the transition)
  • slidechanged (with the transition)
  • auto (with transition, on autoanimate slides)

This can also be set per-slide with data-attributes.

Autoappear

You can simplify the addition of animation classes:

Sometimes (for example with Markdown), adding classes to elements is a chore.

Appearance can automatically add animation classes to specific elements (tags or other selectors) in the presentation (with the option autoappear) or per slide (with data-autoappear).

Global auto-appear mode

  • This is list item 1
  • This is list item 2
format:
  revealjs:
    ...
    appearance:
      autoappear: true
      autoelements: '{"ul li": "animate__fadeInLeft"}'
## Global auto-appear mode
* This is list item 1
* This is list item 2

You can use a simple JSON object, or more elaborate like this: '{"ul li": {"animation":"animate__fadeInLeft", "speed":"slow", "delay":"100"}}'.

Local auto-appear

This will use the JSON object from the global autoelements option, even if autoappear is false.

  • This is list item 1
  • This is list item 2
format:
  revealjs:
    ...
    appearance:
      autoappear: false
      autoelements: '{"ul li": "animate__fadeInLeft"}'
## Local auto-appear {data-autoappear=true}
* This is list item 1
* This is list item 2

Local auto-appear, specified

You can also add a JSON object to the slide’s data-autoappear, with specific elements, their animations class(es) as a string or an object with animations class(es), optional speed and optional delay.

  • This is list item 1
  • This is list item 2
## Local auto-appear, specified {data-autoappear="{'ul li':'animate__fadeInRight', 'h2': {'animation':'animate__fadeInDown', 'speed':'slow', 'delay':'100'}}"}

* This is list item 1
* This is list item 2

Local auto-appear, specified and split

And you can do the same for any animations that you would like to have on lines and words.

Appearance

## Local auto-appear, specified and split {data-autoappear="{'h2': {'animation':'animate__fadeInDown', 'speed':'fast', 'delay':'180', 'split':'words', 'container-delay':'500ms'}, 'h3': {'animation':'animate__fadeInDown', 'split':'letters', 'delay':'80'}}"}

### Appearance

More demos

For more demos go to the Appearance plugin for Reveal.js. Not all of the options in the regular plugin are available in the Quarto plugin.

Credits