Title: | Animate 'shiny' and 'rmarkdown' Content when it Comes into View |
---|---|
Description: | Animate 'shiny' and 'rmarkdown' content when it comes into view using 'animate-css' effects <https://daneden.github.io/animate.css/> thanks to 'jQuery AniView' <https://jjcosgrove.github.io/jquery-aniview/>. |
Authors: | Félix Luginbuhl [aut, cre] |
Maintainer: | Félix Luginbuhl <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.1 |
Built: | 2025-01-10 05:32:54 UTC |
Source: | https://github.com/lgnbhl/aniview |
Programmatically animate Shiny and R Markdown content when it comes into view.
aniview(element, animation, ...)
aniview(element, animation, ...)
element |
An shiny or rmarkdown element. |
animation |
An animation from animate.css |
... |
Additional class element |
if (interactive()) { library(shiny) shinyApp( ui = fluidPage( use_aniview(), # add use_aniview() in the UI aniview(h1("Shiny with AniView"), animation = "fadeInUp"), aniview(textOutput("text"), animation = "zoomIn") ), server <- function(input, output, session){ output$text <- renderText({ print("An animated text.") }) } ) }
if (interactive()) { library(shiny) shinyApp( ui = fluidPage( use_aniview(), # add use_aniview() in the UI aniview(h1("Shiny with AniView"), animation = "fadeInUp"), aniview(textOutput("text"), animation = "zoomIn") ), server <- function(input, output, session){ output$text <- renderText({ print("An animated text.") }) } ) }
Get aniview html dependencies.
html_dependencies_aniview(use_cdn = TRUE)
html_dependencies_aniview(use_cdn = TRUE)
use_cdn |
boolean. TRUE to use a Content Delivery Network (CDN), true by default, or false to use locally stored files. |
Use AniView
use_aniview(animateThreshold = 0, scrollPollInterval = 20, use_cdn = TRUE)
use_aniview(animateThreshold = 0, scrollPollInterval = 20, use_cdn = TRUE)
animateThreshold |
integrer. +ve numbers delay the animation sequence until the specified number of pixels have come into view. -ve numbers will trigger the animation sequence prior to the element coming into view. |
scrollPollInterval |
integrer. frequency at which user scrolling is 'polled' i.e. tested. This is in milliseconds and is an extension to jQuery's in-built 'scroll' event/handler. |
use_cdn |
boolean. TRUE to use a Content Delivery Network (CDN), true by default, or false to use locally stored files. |
if (interactive()) { library(shiny) shinyApp( ui = fluidPage( use_aniview(), # add use_aniview() in the UI aniview(h1("Shiny with AniView"), animation = "fadeInUp"), aniview(textOutput("text"), animation = "zoomIn") ), server <- function(input, output, session){ output$text <- renderText({ print("An animated text.") }) } ) }
if (interactive()) { library(shiny) shinyApp( ui = fluidPage( use_aniview(), # add use_aniview() in the UI aniview(h1("Shiny with AniView"), animation = "fadeInUp"), aniview(textOutput("text"), animation = "zoomIn") ), server <- function(input, output, session){ output$text <- renderText({ print("An animated text.") }) } ) }