Skip to main content

Fragments

This allows to reveal, remove or highlight some objects on a slide using built-in animation framework of RevealJS.

For example

.slide

# Fragments example

This will be here all the time

<span style="color:red">Appears later</span> <!-- .element: class="fragment" data-fragment-index="1" -->

And this one <!-- .element: class="fragment fade-up" data-fragment-index="2" -->
info

A selector .element is applied to a single Markdown line, or a single HTML or WLX tag

Animation types

Here is the list of available classes

NameEffect
fade-outStart visible, fade out
fade-upSlide up while fading in
fade-downSlide down while fading in
fade-leftSlide left while fading in
fade-rightSlide right while fading in
fade-in-then-outFades in, then out on the next step
current-visibleFades in, then out on the next step
fade-in-then-semi-outFades in, then to 50% on the next step
growScale up
semi-fade-outFade out to 50%
shrinkScale down
strikeStrike through
highlight-redTurn text red
highlight-greenTurn text green
highlight-blueTurn text blue
highlight-current-redTurn text red, then back to original on next step
highlight-current-greenTurn text green, then back to original on next step
highlight-current-blueTurn text blue, then back to original on next step

Custom Fragments

Following the original guide we can craft our own effects. For example for blur effect one can do it in two cells

cell 1
.wlx

<style>
.fragment.blur {
filter: blur(5px);
}
.fragment.blur.visible {
filter: none;
}
</style>
cell 2
.slide

# Example

A sample line <!-- .element: class="fragment blur" data-fragment-index="1" -->