mcanouil / quarto-animate

Animate.css extension for Quarto
https://m.canouil.dev/quarto-animate/
MIT License
40 stars 0 forks source link

Shorter animations not rendering correctly #7

Open kevolve opened 10 months ago

kevolve commented 10 months ago

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:

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

mcanouil commented 10 months ago

Could you share something reproducible? Do you observe the same thing inside a regular document?

You can share a Quarto document using the following syntax, i.e., using more backticks than you have in your document (usually four ````).

````qmd
---
title: "Reproducible Quarto Document"
format: html
---

This is a reproducible Quarto document using `format: html`.
It is written in Markdown and contains embedded R code.
When you run the code, it will produce a plot.

```{r}
plot(cars)

A placeholder image

The end.

kevolve commented 10 months ago

Sorry, below is some code written as a Qmd file. It appears to also not work in a regular quarto HTML document either.

---
title: "test_doc"
---

{{< animate fadeIn 'This should fade in 0.1 seconds' delay=0.1s duration=0.1s >}}
{{< animate fadeIn 'This should fade in 0.5 seconds' delay=0.5s duration=0.5s >}}
{{< animate fadeIn 'This should fade in 700 milliseconds' delay=700ms duration=700ms >}}
{{< animate fadeIn 'This should fade in 1 second' delay=1s duration=1s >}}
{{< animate fadeIn 'This should fade in 1.5 seconds' delay=1.5s duration=1.5s >}}
{{< animate fadeIn 'This should fade in 2 seconds' delay=2s duration=2s >}}

The 1 second and 2 second delays are working fine, but the rest all appear far too quickly and mostly in unison - indicating a reversal back to default settings I believe. Thanks again for your help, Kevin