https://github.com/feddelegrand7/GomoGomonoMi
👑 Animate Text in Rmd documents and shiny using the Animate.css Library
https://github.com/feddelegrand7/GomoGomonoMi
css r rmarkdown rmarkdown-document rstats rstats-package shiny
Last synced: 5 months ago
JSON representation
👑 Animate Text in Rmd documents and shiny using the Animate.css Library
- Host: GitHub
- URL: https://github.com/feddelegrand7/GomoGomonoMi
- Owner: feddelegrand7
- License: other
- Created: 2020-06-06T13:25:39.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-12-10T20:52:56.000Z (over 4 years ago)
- Last Synced: 2024-11-22T07:38:05.421Z (5 months ago)
- Topics: css, r, rmarkdown, rmarkdown-document, rstats, rstats-package, shiny
- Language: R
- Homepage:
- Size: 6.04 MB
- Stars: 7
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.Rmd
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- jimsghstars - feddelegrand7/GomoGomonoMi - 👑 Animate Text in Rmd documents and shiny using the Animate.css Library (R)
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
[](https://cran.r-project.org/package=GomoGomonoMi)
[](https://cran.r-project.org/package=GomoGomonoMi)
[](https://cran.r-project.org/package=GomoGomonoMi)
[](https://cran.r-project.org/package=GomoGomonoMi)
[](https://choosealicense.com/licenses/mit/)
[](https://github.com/feddelegrand7/GomoGomonoMi/actions)
[](https://github.com/feddelegrand7/GomoGomonoMi)The GomoGomonoMi packages allows you to animate text in Rmd documents (xaringan slides included) and Shiny apps using the [Animate.css](https://animate.style/) library.

## Installation
You can install the `GomoGomonoMi` package from CRAN with:
```{r, eval = F}
install.packages("GomoGomonoMi")
```
You can install the development version of `GomoGomonoMi` from Github with:
```{r, eval=FALSE}
install.packages("remotes")
remotes::install_github("feddelegrand7/GomoGomonoMi")
```
## How to use it ?
Put the `use_gomo()` function at the beginning of your Rmd document or Shiny application (at the UI). **This function needs to be run only once** :
```{r}
library(GomoGomonoMi)
use_gomo()
```
Then you can animate your text using the `gomo_gomo_no()` function. Don't hesitate to use `help("gomo_gomo_no")` to check out additional arguments.
```{r, eval=FALSE}
library(GomoGomonoMi)use_gomo()
gomo_gomo_no(text = " \"If I give up now, I'm going to regret it\" Monkey D. Luffy",
level = "##",
animation = "zoomIn",
duration = "slower",
delay = 2,
color = "darkred")```

For a listing of all the available animations provided by the __Animate.css__ library, use the following function:
```{r}
available_animations()
```
# Shiny Examples
This is an example of a Shiny app that uses `GomoGomonoMi`
```{r, eval=FALSE}
library(shiny)
library(GomoGomonoMi)ui <- fluidPage(use_gomo(),
gomo_gomo_no(text = "HELLO SHINY !!!!", level = "#", animation = "backInDown", duration = "slower")
)
server <- function(input, output) {
}
shinyApp(ui = ui, server = server)
```
You can also leverage the reactivity in shiny to animate some texts using `GomoGomonoMi`:
```{r eval = F}
library(shiny)
library(GomoGomonoMi)ui <- fluidPage(use_gomo(),
br(),
actionButton(inputId = "btn1", label = "click me ! "),
uiOutput(outputId = "txt1")
)server <- function(input, output) {
observeEvent(input$btn1, {
output$txt1 <- renderUI({
gomo_gomo_no(text = "Thank you for clicking me :) !!!",
level = "#",
repeating = 3,
duration = "faste")
})
})}
shinyApp(ui = ui, server = server)
```

## Code of Conduct

Please note that the GomoGomonoMi project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/0/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.