Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 1 month 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 (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-12-10T20:52:56.000Z (almost 4 years ago)
- Last Synced: 2024-10-10T18:40:13.794Z (about 1 month 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
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/GomoGomonoMi)](https://cran.r-project.org/package=GomoGomonoMi)
[![CRAN_time_from_release](https://www.r-pkg.org/badges/ago/GomoGomonoMi)](https://cran.r-project.org/package=GomoGomonoMi)
[![metacran downloads](https://cranlogs.r-pkg.org/badges/GomoGomonoMi)](https://cran.r-project.org/package=GomoGomonoMi)
[![metacran downloads](https://cranlogs.r-pkg.org/badges/grand-total/GomoGomonoMi)](https://cran.r-project.org/package=GomoGomonoMi)
[![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://choosealicense.com/licenses/mit/)
[![R build status](https://github.com/feddelegrand7/GomoGomonoMi/workflows/R-CMD-check/badge.svg)](https://github.com/feddelegrand7/GomoGomonoMi/actions)
[![R badge](https://img.shields.io/badge/Build%20with-♥%20and%20R-pink)](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.
![My reaction when I discovered Animate.css](https://media.giphy.com/media/Uk2SWbNXWDnVe/giphy.gif)
## 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")```
![A demo of the gomo_gomo_no() function](man/figures/gomoexample.gif)
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)
```
![Example of reactivity with GomoGomonoMi](man/figures/gomoexample2.gif)
## Code of Conduct
![](https://media.giphy.com/media/4yfGy8lw0xnCU/giphy.gif)
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.