Created
October 22, 2020 01:07
-
-
Save gadenbuie/61b27108ceec6c7a55cd9966609128d7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "animate.css attention seekers with xaringanExtra" | |
author: "Garrick Aden-Buie" | |
output: | |
xaringan::moon_reader: | |
lib_dir: libs | |
seal: false | |
nature: | |
highlightStyle: github | |
highlightLines: true | |
countIncrementalSlides: true | |
--- | |
layout: true | |
class: middle | |
--- | |
```{r xe, echo=TRUE} | |
xaringanExtra::use_animate_css() | |
``` | |
This works fine. Notice that the content inside the `[ ... ]` is on a new line. | |
.pull-left[ | |
``` | |
.animated.pulse.infinite[ | |
## Hello there! | |
] | |
``` | |
] | |
.pull-right[ | |
.animated.pulse.infinite[ | |
## Hello there! | |
] | |
] | |
--- | |
But this doesn't work... | |
.pull-left[ | |
``` | |
Make this word | |
.animated.bounce.infinite[jump!] | |
``` | |
] | |
.pull-right[ | |
Make this word | |
.animated.bounce.infinite[jump!] | |
] | |
Notice that the content in the `[...]` is on the **same line**. | |
--- | |
If we create a simple CSS class that makes an object **inline-block**, | |
then the animation will work. Drop this CSS into your slides and then add | |
`.dib` to the `.animated.<attn_seeker>.infinite` classes. | |
````markdown | |
```{css echo=FALSE}`r ''` | |
.dib { display: inline-block; } | |
``` | |
```` | |
```{css echo=FALSE} | |
.dib { display: inline-block; } | |
``` | |
.pull-left[ | |
``` | |
Make this word | |
.animated.bounce.infinite.dib[jump!] | |
``` | |
] | |
.pull-right[ | |
Make this word .animated.bounce.infinite.dib[jump!] | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment