if (FALSE) {
if (interactive()) {
library(shiny)
library(r2resize)
library(htmltools)
ui <- fluidPage(
tags$h2("Hover Elastic Cards - Text Only"),
elastiCard(
item1 = c(
icon = "brain",
title = "Cognitive Science",
subtitle = "Exploring the mind",
desc = "Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
text.color = "lightblue"
),
item2 = c(
title = "Neurobiology",
subtitle = "The science of the nervous system",
desc = "Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat.",
text.color = "lightgreen"
),
height.px = 300,
width.px = 900,
border.color = "gray",
border.width.px = 1
),
tags$br(),
tags$h2("Hover Elastic Cards - With Background Images"),
elastiCard(
itemA = c(
bg = "https://r2resize.obi.obianom.com/m/image1.jpg",
icon = "chart-pie",
title = "Data Visualization",
subtitle = "Making data accessible",
desc = "Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur."
),
itemB = c(
bg = "https://r2resize.obi.obianom.com/m/image2.jpg",
title = "Machine Learning",
subtitle = "AI-powered insights",
desc = "Excepteur sint occaecat cupidatat non proident, sunt in culpa qui
officia deserunt mollit anim id est laborum.",
text.color = "white"
),
itemC = c(
bg = "https://r2resize.obi.obianom.com/m/image3.jpg",
title = "Cloud Computing",
subtitle = "Scalable solutions",
desc = "Sed ut perspiciatis unde omnis iste natus error sit voluptatem
accusantium doloremque laudantium.",
text.color = "yellow"
),
height.px = 350
)
)
server <- function(input, output) {}
shinyApp(ui, server)
}
}
Run the code above in your browser using DataLab