Code Monkey home page Code Monkey logo

quarto-animate's Introduction

Animate.css Extension for Quarto

This extension provides support and shortcode to animate.css.
Animations are only available for HTML-based documents.

Installing

quarto add mcanouil/quarto-animate

This will install the extension under the _extensions subdirectory.
If you're using version control, you will want to check in this directory.

Using

To animate a text, use the {{< animate >}} shortcode. For example:

{{< animate bounce "Some text" >}}
  • 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., 1s or 800ms.
    See https://animate.style/ for more details.

Animation effects

  • Attention seekers:
    bounce, flash, pulse, rubberBand, shakeX, shakeY, headShake, swing, tada, wobble, jello, heartBeat.
  • Back entrances:
    backInDown, backInLeft, backInRight, backInUp.
  • Back exits:
    backOutDown, backOutLeft, backOutRight, backOutUp.
  • Bouncing entrances:
    bounceIn, bounceInDown, bounceInLeft, bounceInRight, bounceInUp.
  • Bouncing exits:
    bounceOut, bounceOutDown, bounceOutLeft, bounceOutRight, bounceOutUp.
  • Fading entrances:
    fadeIn, fadeInDown, fadeInDownBig, fadeInLeft, fadeInLeftBig, fadeInRight, fadeInRightBig, fadeInUp, fadeInUpBig, fadeInTopLeft, fadeInTopRight, fadeInBottomLeft, fadeInBottomRight.
  • Fading exits:
    fadeOut, fadeOutDown, fadeOutDownBig, fadeOutLeft, fadeOutLeftBig, fadeOutRight, fadeOutRightBig, fadeOutUp, fadeOutUpBig, fadeOutTopLeft, fadeOutTopRight, fadeOutBottomRight, fadeOutBottomLeft.
  • Flippers:
    flip, flipInX, flipInY, flipOutX, flipOutY.
  • Lightspeed:
    lightSpeedInRight, lightSpeedInLeft, lightSpeedOutRight, lightSpeedOutLeft.
  • Rotating entrances:
    rotateIn, rotateInDownLeft, rotateInDownRight, rotateInUpLeft, rotateInUpRight.
  • Rotating exits:
    rotateOut, rotateOutDownLeft, rotateOutDownRight, rotateOutUpLeft, rotateOutUpRight.
  • Specials:
    hinge, jackInTheBox, rollIn, rollOut.
  • Zooming entrances:
    zoomIn, zoomInDown, zoomInLeft, zoomInRight, zoomInUp.
  • Zooming exits:
    zoomOut, zoomOutDown, zoomOutLeft, zoomOutRight, zoomOutUp.
  • Sliding entrances:
    slideInDown, slideInLeft, slideInRight, slideInUp.
  • Sliding exits:
    slideOutDown, slideOutLeft, slideOutRight, slideOutUp.

Advanced

The following won't work:

{{< animate bounce "[HTML](https://m.canouil.dev/quarto-animate/)" >}}

But this will:

[[HTML](https://m.canouil.dev/quarto-animate/)]{.animate__animated .animate__bounce style="display:inline-block;"}

Or:

::: {.animate__animated .animate__bounce}
[HTML](https://m.canouil.dev/quarto-animate/)
:::

See https://animate.style/ for more details.

Example

Here is the source code for a minimal example: example.qmd.

This is the output of example.qmd for HTML.


Animate.css by Daniel Eden under Hippocratic License 3.0.

quarto-animate's People

Contributors

mcanouil avatar

Stargazers

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

Watchers

 avatar  avatar

quarto-animate's Issues

Shorter animations not rendering correctly

Hi Mickaël,
I really love your quarto-animation extension overall! I am trying to build my web page with the fadeIn animation for each of the left navbar texts, where each one fades in at a different time in rapid succession. This works well if I use round numbers, but fails when I use decimal places (e.g. delay=0.5s) or attempt to input with milliseconds (e.g., delay=1500ms). The same occurs for animations outside the navbar as well. I was wondering if this is something I've done in error and if not if this could possibly be patched in the future? Thanks again!

Some test code for the Quarto Website YAML.
website:
title: "Test Website"
navbar:
left:
- href: index.qmd
text: "{{< animate fadeIn 'Home' delay=0.5s duration=0.5s >}}"
- href: index.qmd
text: "{{< animate fadeIn 'Research' delay=1s duration=0.5s >}}"
- href: index.qmd
text: "{{< animate fadeIn 'Blog' delay=1500ms duration=0.5s >}}"
- href: index.qmd
text: "{{< animate fadeIn 'Art' delay=2s duration=0.5s >}}"

Runnning R version 4.2.2 (2022-10-31)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Ventura 13.6.3

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.