DaveM2430 commited on
Commit
c798e13
Β·
verified Β·
1 Parent(s): f686b77

Update app.R

Browse files
Files changed (1) hide show
  1. app.R +38 -53
app.R CHANGED
@@ -1,80 +1,65 @@
1
  library(shiny)
2
- library(bslib)
3
 
4
- ui <- page_fluid(
5
- theme = bs_theme(
6
- bg = "#ffffff",
7
- fg = "#002147",
8
- primary = "#002147",
9
- base_font = font_google("Inter")
10
- ),
 
 
 
 
 
 
 
 
11
 
12
- div(
13
- style = "background-color:#002147; padding:14px 24px;
14
- display:flex; align-items:center; justify-content:space-between;
15
- margin-bottom:20px;",
16
- div(
17
- tags$h1("Butler Baseball Analytics", style="color:white; margin:0; font-size:26px; font-weight:700;"),
18
- tags$p("Trackman Dashboard",
19
- style="color:#aabbcc; margin:0; font-size:13px;")
20
  ),
21
- tags$img(
22
- src = "Butler-Bulldogs-Logo-1990.png",
23
- height = "52px"
24
- )
25
  ),
26
 
27
- # ── Filters ─────────────────────────────────────────────────────────────────
28
- div(
29
- style = "display:flex; gap:24px; align-items:flex-end;
30
- padding:0 8px 20px 8px; flex-wrap:wrap;",
31
-
32
- div(
33
- style = "min-width:160px;",
34
- tags$label("Level", style="font-weight:600; font-size:12px;
35
- text-transform:uppercase; letter-spacing:0.4px;
36
- color:#555; display:block; margin-bottom:4px;"),
37
  selectInput("level", label=NULL,
38
  choices = c("All","D1","D2","D3","JUCO","Other"),
39
  selected = "All",
40
- width = "100%")
41
  ),
42
-
43
- div(
44
- style = "min-width:160px;",
45
- tags$label("Position", style="font-weight:600; font-size:12px;
46
- text-transform:uppercase; letter-spacing:0.4px;
47
- color:#555; display:block; margin-bottom:4px;"),
48
  selectInput("position", label=NULL,
49
  choices = c("Pitcher","Hitter"),
50
  selected = "Pitcher",
51
- width = "100%")
52
  ),
53
-
54
- div(
55
- style = "min-width:160px;",
56
- tags$label("Min Pitches", style="font-weight:600; font-size:12px;
57
- text-transform:uppercase; letter-spacing:0.4px;
58
- color:#555; display:block; margin-bottom:4px;"),
59
  numericInput("min_pitches", label=NULL,
60
- value=100, min=1, max=1000, step=25,
61
- width="100%")
62
  )
63
  ),
64
 
65
- # ── Main content placeholder ─────────────────────────────────────────────────
66
- div(
67
- id = "main_content",
68
- style = "padding:0 8px;",
69
  uiOutput("main_ui")
70
  )
71
  )
72
 
73
  server <- function(input, output, session) {
74
  output$main_ui <- renderUI({
75
- div(style="color:#888; font-size:14px; padding:20px;",
76
- "Content will load here.")
77
  })
78
  }
79
 
80
- shinyApp(ui, server)
 
1
  library(shiny)
2
+ library(dplyr)
3
 
4
+ ui <- fluidPage(
5
+ tags$head(tags$style(HTML("
6
+ body { margin:0; font-family:'Segoe UI',Arial,sans-serif; background:#f5f5f5; }
7
+ .header { background:#002147; padding:14px 24px;
8
+ display:flex; align-items:center; justify-content:space-between; }
9
+ .header h1 { color:white; margin:0; font-size:26px; font-weight:700; }
10
+ .header p { color:#aabbcc; margin:0; font-size:13px; }
11
+ .filters { display:flex; gap:24px; align-items:flex-end;
12
+ padding:16px 24px; background:white;
13
+ border-bottom:1px solid #e0e0e0; flex-wrap:wrap; }
14
+ .filter-label { font-weight:600; font-size:11px; text-transform:uppercase;
15
+ letter-spacing:0.4px; color:#555; margin-bottom:4px; }
16
+ .main { padding:20px 24px; }
17
+ .form-control { border:1px solid #d0d0d0; border-radius:4px; }
18
+ "))),
19
 
20
+ # ── Header ───────────────────────────────────────────────────────────────────
21
+ tags$div(class="header",
22
+ tags$div(
23
+ tags$h1("Butler Baseball Analytics"),
24
+ tags$p("Trackman Dashboard")
 
 
 
25
  ),
26
+ tags$img(src="Butler-Bulldogs-Logo-1990.png", height="52px")
 
 
 
27
  ),
28
 
29
+ # ── Filters ──────────────────────────────────────────────────────────────────
30
+ tags$div(class="filters",
31
+ tags$div(
32
+ tags$div("Level", class="filter-label"),
 
 
 
 
 
 
33
  selectInput("level", label=NULL,
34
  choices = c("All","D1","D2","D3","JUCO","Other"),
35
  selected = "All",
36
+ width = "160px")
37
  ),
38
+ tags$div(
39
+ tags$div("Position", class="filter-label"),
 
 
 
 
40
  selectInput("position", label=NULL,
41
  choices = c("Pitcher","Hitter"),
42
  selected = "Pitcher",
43
+ width = "160px")
44
  ),
45
+ tags$div(
46
+ tags$div("Min Pitches", class="filter-label"),
 
 
 
 
47
  numericInput("min_pitches", label=NULL,
48
+ value = 100, min = 1, max = 1000, step = 25,
49
+ width = "160px")
50
  )
51
  ),
52
 
53
+ # ── Main content ─────────────────────────────────────────────────────────────
54
+ tags$div(class="main",
 
 
55
  uiOutput("main_ui")
56
  )
57
  )
58
 
59
  server <- function(input, output, session) {
60
  output$main_ui <- renderUI({
61
+ tags$p("Content will load here.", style="color:#888;")
 
62
  })
63
  }
64
 
65
+ shinyApp(ui, server)