Skip to content

Commit

Permalink
app supertinyicons: checkbox transparent background
Browse files Browse the repository at this point in the history
  • Loading branch information
stla committed Aug 25, 2020
1 parent 5a34c71 commit ab3ec74
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions inst/essais/supertinyicons.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,14 @@ nnodes <- lapply(nodes, function(node){
})

ui <- fluidPage(
tags$head(tags$style(HTML("#jstree {background-color: #fff5ee;"))),
tags$head(
tags$style(
HTML(
"#jstree {background-color: #fff5ee;}",
"img {background-color: #333; padding: 50px;}"
)
)
),
titlePanel("Super tiny icons"),
fluidRow(
column(
Expand All @@ -34,6 +41,7 @@ ui <- fluidPage(
),
column(
width = 6,
checkboxInput("transparent", "Transparent background"),
uiOutput("icon")
)
)
Expand All @@ -49,8 +57,10 @@ server <- function(input, output){
})
output[["icon"]] <- renderUI({
req(length(input[["jstree_selected"]]) > 0)
svg <- input[["jstree_selected"]][[1]][["data"]][["svg"]]
tags$img(src = paste0("/SuperTinyIcons/", svg))
svg <- req(input[["jstree_selected"]][[1]][["data"]][["svg"]])
if(input[["transparent"]])
svg <- paste0("transparent-", svg)
tags$img(src = paste0("/SuperTinyIcons/", svg), width = "75%")
})
}

Expand Down

0 comments on commit ab3ec74

Please sign in to comment.