-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathui.R
160 lines (159 loc) · 5.84 KB
/
ui.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#' ////////////////////////////////////////////////////////////////////////////
#' FILE: ui.R
#' AUTHOR: David Ruvolo
#' CREATED: 2020-02-13
#' MODIFIED: 2020-03-10
#' PURPOSE: client side for application
#' STATUS: working
#' PACKAGES: see global
#' COMMENTS:
#' In this file, define all <head> content and load any javascript assets.
#' This application works by rendering the subpages into the uiOutput
#' element "page". This is loaded dynamically in the server. Application
#' routing is defined in server/routing.R and the corresponding JavaScript
#' can be found in www/js/index.js.
#' Using `tags$body` will render two <body> elements. Avoid using it!
#' ////////////////////////////////////////////////////////////////////////////
ui <- tagList(
tags$head(
tags$meta(charset = "utf-8"),
tags$meta(`http-equiv` = "X-UA-Compatible", content = "IE=edge"),
tags$meta(
name = "viewport",
content = "width=device-width, initial-scale=1"
),
tags$script(
src = "https://api.mapbox.com/mapbox-gl-js/v1.8.1/mapbox-gl.js"
),
tags$link(
href = "https://api.mapbox.com/mapbox-gl-js/v1.8.1/mapbox-gl.css",
rel = "stylesheet"
),
tags$link(rel = "stylesheet", href = "css/styles.css"),
tags$title("shinyTravel")
),
#' Loading page -- will be removed post load
tags$div(id = "loading",
tags$p(class = "visually-hidden", "Loading"),
HTML("
<svg aria-hidden='true' width='90' height='25' viewBox='0 0 90 25'>
<circle class='dot' cx='10' cy='12.5' r='10' />
<circle class='dot' cx='40' cy='12.5' r='10' />
<circle class='dot' cx='70' cy='12.5' r='10' />
</svg>"
)
),
#' App output container and subpages
tags$div(id = "root",
#' Navbar
tags$nav(class = "nav", role = "navigation",
tags$h1(
class = "nav-item nav-title",
"shinyTravel"
),
#' Links
tags$ul(
id = "navlinks",
class = "nav-item menu",
tags$li(class = "menu-item",
tags$a(
id = "home",
class = "shiny-bound-input menu-link",
href = "home",
`data-tab` = "home",
"Home"
)
),
tags$li(class = "menu-item",
tags$a(
id = "search",
class = "shiny-bound-input menu-link",
href = "search",
`data-tab` = "search",
"Search"
)
),
tags$li(class = "menu-item",
tags$a(
id = "map",
class = "shiny-bound-input menu-link",
href = "map",
`data-tab` = "map",
"Map"
)
),
tags$li(class = "menu-item",
tags$a(
id = "data",
class = "shiny-bound-input menu-link",
href = "data",
`data-tab` = "data",
"Data"
)
)
),
#' Menu Toggle
tags$div(
class = "nav-item menu-item menu-btn",
tags$button(
id = "toggle",
class = "btn btn-icon action-button shiny-button-input",
`aria-describedby` = "toggle-label",
`aria-expanded` = "false",
tags$span(
id = "toggle-label",
class = "visually-hidden",
"open and close menu"
),
tags$span(
class = "menu-icon",
`aria-hidden` = "true",
tags$span(class = "menu-bar"),
tags$span(class = "menu-bar"),
tags$span(class = "menu-bar")
)
)
)
),
uiOutput("page"),
tags$div(
id = "footer-banner",
`aria-hidden` = "true",
style = "
background-image: url('images/page-footer-grayscale.svg')
"
),
tags$footer(
class = "footer",
tags$div(
class = "footer-content",
tags$h2("shinyTravel"),
tags$ul(class = "menu", id = "footer-nav",
tags$li(class = "menu-item",
tags$a(class = "menu-link",
href = "https://github.com/davidruvolo51/travel-app",
"Code"
)
),
tags$li(class = "menu-item",
tags$a(class = "menu-link",
href = "https://github.com/davidruvolo51/travel-app-data",
"Data"
)
),
tags$li(class = "menu-item",
tags$a(class = "menu-link",
href = "https://davidruvolo51.github.io/shinytutorials/tutorials/shiny-contest-submission",
"Blog"
)
)
)
)
)
),
#' Load Assets
tags$script(src = "assets/d3.v5.min.js"),
tags$script(src = "assets/topojson.min.js"),
# tags$script(src = "js/index.js")
tags$script(src = "js/index.min.js")
)