78 lines
2.5 KiB
R
78 lines
2.5 KiB
R
library(shiny)
|
|
library(shiny.router)
|
|
library(magrittr)
|
|
library(ggplot2)
|
|
library(plotly)
|
|
library(DT)
|
|
library(shinyjs)
|
|
|
|
#source(".R/home_module.R",encoding="utf-8")
|
|
#source(".R/about_module.R",encoding="utf-8")
|
|
#source(".R/profil_module.R",encoding="utf-8")
|
|
|
|
source("routing_module.R",encoding="utf-8")
|
|
|
|
|
|
ui <- fluidPage(
|
|
|
|
fluidRow(
|
|
useShinyjs(),
|
|
inlineCSS(list(.clicked = "background-color: #008375 !important")),
|
|
column(12,
|
|
navbarPage("",
|
|
tabPanel(a("TakeCareApp",id='takeCareApp',class = "tab-link", href = route_link("home"))),
|
|
tabPanel(a("Firmy",id="tab1",class = "tab-link", href = route_link("profil"))),
|
|
tabPanel(a("O nas",id="tab2",class = "tab-link", href = route_link("about"))),
|
|
tabPanel(a("Zaloguj",id="tab3",class="tab-link", href = route_link("login"))),
|
|
tabPanel(a("Rejestracja",id="tab4",class="tab-link", href = route_link("register")))),
|
|
|
|
)),
|
|
router$ui)
|
|
|
|
|
|
|
|
server <- shinyServer(function(input, output, session){
|
|
|
|
shinyjs::onclick(id="takeCareApp",expr = {
|
|
shinyjs::removeCssClass(id="tab1",class = "clicked")
|
|
shinyjs::removeCssClass(id="tab2",class = "clicked")
|
|
shinyjs::removeCssClass(id="tab3",class = "clicked")
|
|
shinyjs::removeCssClass(id="tab4",class = "clicked")
|
|
})
|
|
|
|
shinyjs::onclick(id="tab1",expr = {
|
|
shinyjs::addCssClass(id="tab1",class = "clicked")
|
|
shinyjs::removeCssClass(id="tab2",class = "clicked")
|
|
shinyjs::removeCssClass(id="tab3",class = "clicked")
|
|
shinyjs::removeCssClass(id="tab4",class = "clicked")
|
|
})
|
|
|
|
shinyjs::onclick(id="tab2",expr = {
|
|
shinyjs::addCssClass(id="tab2",class = "clicked")
|
|
shinyjs::removeCssClass(id="tab1",class = "clicked")
|
|
shinyjs::removeCssClass(id="tab3",class = "clicked")
|
|
shinyjs::removeCssClass(id="tab4",class = "clicked")
|
|
})
|
|
|
|
shinyjs::onclick(id="tab3",expr = {
|
|
shinyjs::addCssClass(id="tab3",class = "clicked")
|
|
shinyjs::removeCssClass(id="tab2",class = "clicked")
|
|
shinyjs::removeCssClass(id="tab1",class = "clicked")
|
|
shinyjs::removeCssClass(id="tab4",class = "clicked")
|
|
})
|
|
|
|
shinyjs::onclick(id="tab4",expr = {
|
|
shinyjs::addCssClass(id="tab4",class = "clicked")
|
|
shinyjs::removeCssClass(id="tab2",class = "clicked")
|
|
shinyjs::removeCssClass(id="tab1",class = "clicked")
|
|
shinyjs::removeCssClass(id="tab3",class = "clicked")
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
router$server(input, output, session)
|
|
})
|
|
|
|
shinyApp(ui=ui,server=server) |