| Type: | Package | 
| Title: | A Wrapper of the 'JavaScript' Library 'Nightly' | 
| Version: | 0.1.0 | 
| Author: | Mohamed El Fodil Ihaddaden | 
| Maintainer: | Mohamed El Fodil Ihaddaden <ihaddaden.fodeil@gmail.com> | 
| Description: | Allows the user to implement a dark/light toggle mode in 'shiny' using the 'Nightly' 'JavaScript' library. The default mode is dark/light however the user can also specify other colours. | 
| License: | MIT + file LICENSE | 
| Encoding: | UTF-8 | 
| LazyData: | true | 
| Imports: | glue, htmltools | 
| RoxygenNote: | 7.1.0 | 
| URL: | https://github.com/feddelegrand7/Rnightly | 
| BugReports: | https://github.com/feddelegrand7/Rnightly/issues | 
| NeedsCompilation: | no | 
| Packaged: | 2020-06-21 01:18:00 UTC; THINKPAD L390 | 
| Repository: | CRAN | 
| Date/Publication: | 2020-06-25 10:20:06 UTC | 
Implement a dark/light toggle mode by default
Description
Implement a default dark/light toggle mode that will be triggered by any shiny element. The user can also define other colors to work with.
Usage
nightly(
  trigElement,
  bodyColor = "#282828",
  txtColor = "#f5f5f5",
  inpTxtColor = "#f5f5f5",
  inpBgColor = "#313131"
)
Arguments
trigElement | 
 the id of the shiny element that will trigger the toggle mode  | 
bodyColor | 
 the color of the application's body after clicking on the trigElement. Defaults to #282828 (dark)  | 
txtColor | 
 the color of the text within the application after clicking on the trigElement. Defaults to #f5f5f5 (white)  | 
inpTxtColor | 
 the color of the text within the shiny inputs after clicking on the trigElement. Defaults to #f5f5f5 (white)  | 
inpBgColor | 
 the color of the background of the shiny inputs after clicking on the trigElement. Defaults to #313131 (Very Dark Grey)  | 
Value
A default dark/light toggle mode in shiny ui
Examples
if (interactive()) {
ui <- fluidPage(
 use_nightly(),
 h1("Click on the Plot to Toggle a Dark/Light Mode in you Shiny Application"),
 plotOutput(outputId = "plt1"),
 nightly(trigElement = "plt1")
)
server <- function(input, output) {
output$plt1 <- renderPlot({
plot(mtcars)
})
}
shinyApp(ui = ui, server = server)
}
Enables the nightly javascript library
Description
The function activates the capabilities of the nightly javascript library. The user can put it anywhere within the UI.
Usage
use_nightly()
Value
called for the side effect of activating the scrollrevealjs library
Examples
# Put the function within your shiny ui
use_nightly()