Description Usage Arguments Value Examples
Animate on scroll a Shiny or R Markdown element.
1 2 3 4 5 6 7 8 9 10 11 12 |
element |
An shiny or rmarkdown element. |
animation |
An animation from AOS |
offset |
string. Change offset to trigger animations sooner or later, px |
duration |
string. Duration of animation in ms |
easing |
string. Choose timing function to ease elements in different ways |
delay |
string. Delay animation in ms |
anchor |
string. Anchor placement |
anchor_placement |
string. Anchor placement - which one position of element on the screen should trigger animation |
once |
boolean. |
... |
Additional class element |
Javascript code animating the element.
1 2 3 4 5 6 7 8 9 10 11 12 13 | if (interactive()) {
library(shiny)
shinyApp(
ui = fluidPage(
use_aos(), # add use_aos() in the UI
aos(h1("Shiny with AOS - Animate On Scroll"), animation = "fade-zoom-in"),
aos(textOutput("text"), animation = "fade-up")
),
server <- function(input, output, session){
output$text <- renderText({ print("An animated text.") })
}
)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.