JohnCoene / waiter

🕰️ Loading screens for Shiny
https://waiter.john-coene.com/
Other
495 stars 25 forks source link

How to add backround image to waiter? #107

Closed Camil88 closed 2 years ago

Camil88 commented 2 years ago

Hi, I'm following example from offcicial documentation concerning adding image to waiter. The code you added there is as follows:

library(shiny)
library(waiter)

url <- "https://www.freecodecamp.org/news/content/images/size/w2000/2020/04/w-qjCHPZbeXCQ-unsplash.jpg"

ui <- fluidPage(
   use_waiter(), 
   h1("Can you see me?")
)

server <- function(input, output, session){
   w <- Waiter$new(
      html = h1("Wait!"),
      image = url
   )$show()

   Sys.sleep(10)
   w$hide()
}

shinyApp(ui, server)

Can I do the same as above using waiter_preloader? I mean add image as backround and text on it?

Camil88 commented 2 years ago

I used the following code:

waiter_preloader(html = h1("Wait!"), image = url)

and it works.