Animate.css Extension for Quarto
Quarto Extension
This extension provides support and shortcode to animate.css.
Animations are only available for HTML-based documents.
Installation
quarto add mcanouil/quarto-animateThis will install the extension under the _extensions subdirectory.
If you’re using version control, you will want to check in this directory.
Usage
To animate a text, use the {{< animate >}} shortcode:
Mandatory
<effect>and<text>:{{< animate <effect> "<text>" >}}Optional
<delay=...>,<duration=...>, and<repeat=...>:{{< animate <effect> "<text>" <delay=...> <duration=...> <repeat=...> >}}<delay=...>and<duration=...>are durations requiring unit, e.g.,1sor800ms. See https://animate.style/ for more details.
For example:
| Shortcode | Text |
|---|---|
{{< animate bounce "Some text" >}} |
Some text |
{{< animate flip "Some text" repeat=2 >}} |
Some text |
{{< animate hinge "Some text" delay=3s duration=4s repeat=infinite >}} |
Some text |
Defining default values for animations can be done in the YAML front matter of your document:
extensions:
animate:
delay: 5s
duration: 10s
repeat: 3Advanced
The following won’t work:
{{< animate bounce "[HTML](https://m.canouil.fr/quarto-animate/)" >}}But this will:
[[HTML](https://m.canouil.fr/quarto-animate/)]{.animate__animated .animate__bounce style="display:inline-block;"}Or:
::: {.animate__animated .animate__bounce}
[HTML](https://m.canouil.fr/quarto-animate/)
:::Available Effects
Attention Seekers
bouncebounceflashflashpulsepulserubberBandrubberBandshakeXshakeXshakeYshakeYheadShakeheadShakeswingswingtadatadawobblewobblejellojelloheartBeatheartBeat
Back Entrances
backInDownbackInDownbackInLeftbackInLeftbackInRightbackInRightbackInUpbackInUp
Back Exits
backOutDownbackOutDownbackOutLeftbackOutLeftbackOutRightbackOutRightbackOutUpbackOutUp
Bouncing Entrances
bounceInbounceInbounceInDownbounceInDownbounceInLeftbounceInLeftbounceInRightbounceInRightbounceInUpbounceInUp
Bouncing Exits
bounceOutbounceOutbounceOutDownbounceOutDownbounceOutLeftbounceOutLeftbounceOutRightbounceOutRightbounceOutUpbounceOutUp
Fading Entrances
fadeInfadeInfadeInDownfadeInDownfadeInDownBigfadeInDownBigfadeInLeftfadeInLeftfadeInLeftBigfadeInLeftBigfadeInRightfadeInRightfadeInRightBigfadeInRightBigfadeInUpfadeInUpfadeInUpBigfadeInUpBigfadeInTopLeftfadeInTopLeftfadeInTopRightfadeInTopRightfadeInBottomLeftfadeInBottomLeftfadeInBottomRightfadeInBottomRight
Fading Exits
fadeOutfadeOutfadeOutDownfadeOutDownfadeOutDownBigfadeOutDownBigfadeOutLeftfadeOutLeftfadeOutLeftBigfadeOutLeftBigfadeOutRightfadeOutRightfadeOutRightBigfadeOutRightBigfadeOutUpfadeOutUpfadeOutUpBigfadeOutUpBigfadeOutTopLeftfadeOutTopLeftfadeOutTopRightfadeOutTopRightfadeOutBottomRightfadeOutBottomRightfadeOutBottomLeftfadeOutBottomLeft
Flippers
flipflipflipInXflipInXflipInYflipInYflipOutXflipOutXflipOutYflipOutY
Lightspeed
lightSpeedInRightlightSpeedInRightlightSpeedInLeftlightSpeedInLeftlightSpeedOutRightlightSpeedOutRightlightSpeedOutLeftlightSpeedOutLeft
Rotating Entrances
rotateInrotateInrotateInDownLeftrotateInDownLeftrotateInDownRightrotateInDownRightrotateInUpLeftrotateInUpLeftrotateInUpRightrotateInUpRight
Rotating Exits
rotateOutrotateOutrotateOutDownLeftrotateOutDownLeftrotateOutDownRightrotateOutDownRightrotateOutUpLeftrotateOutUpLeftrotateOutUpRightrotateOutUpRight
Specials
hingehingejackInTheBoxjackInTheBoxrollInrollInrollOutrollOut
Zooming Entrances
zoomInzoomInzoomInDownzoomInDownzoomInLeftzoomInLeftzoomInRightzoomInRightzoomInUpzoomInUp
Zooming Exits
zoomOutzoomOutzoomOutDownzoomOutDownzoomOutLeftzoomOutLeftzoomOutRightzoomOutRightzoomOutUpzoomOutUp
Sliding Entrances
slideInDownslideInLeftslideInRightslideInUp
Sliding Exits
slideOutDownslideOutLeftslideOutRightslideOutUp