r-world-devs / shinyGizmo

https://r-world-devs.github.io/shinyGizmo
Other
19 stars 0 forks source link

Chain animations #24

Closed stla closed 2 years ago

stla commented 2 years ago

I included the following example but I expected that the slideOutRight effect hides the element, and this is not the case. One has to merge this effect with a hide effect.

library(shiny)
library(shinyGizmo)
ui <- fluidPage(
    actionButton("value", "Click me", class = "btn-primary"),
    br(), br(),
    conditionalJS(
        tags$h1("Hello", style = "display: none;"),
        "input.value % 2 === 1",
        jsCalls$custom(
            true = runAnimation(animation("jello"), animation("swing")),
            false = runAnimation(animation("slideOutRight"))
        )
    )
)
server <- function(input, output, session) {}
if(interactive()) {
  shinyApp(ui, server)
}
krystian8207 commented 2 years ago

@stla LGTM, the change will be release in v0.3 of the package. Thank you so much for the contribution :)