knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

GomoGomonoMi

CRAN_Status_Badge CRAN_time_from_release metacran downloads metacran downloads license R build status R badge

The GomoGomonoMi packages allows you to animate text in Rmd documents (xaringan slides included) and Shiny apps using the Animate.css library.

My reaction when I discovered Animate.css

Installation

You can install the GomoGomonoMi package from CRAN with:

install.packages("GomoGomonoMi")

You can install the development version of GomoGomonoMi from Github with:

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 :

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.

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

For a listing of all the available animations provided by the Animate.css library, use the following function:

available_animations()

Shiny Examples

This is an example of a Shiny app that uses GomoGomonoMi

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:

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

Code of Conduct

Please note that the GomoGomonoMi project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.



feddelegrand7/GomoGomonoMi documentation built on Dec. 11, 2020, 9:50 a.m.