-
Notifications
You must be signed in to change notification settings - Fork 5
/
ui.R
121 lines (113 loc) · 3.97 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
ui <- fluidPage(title = "Climate emergency slide pack",
# Set the language of the page - important for accessibility
tags$html(lang = "en-GB"),
tags$head(
tags$link(rel = "stylesheet", href = "styles.css"),
tags$style("
@import url('https://fonts.googleapis.com/css?family=Open+Sans%7CRoboto');
.shiny-notification {
top: 50% !important;
left: 50% !important;
margin-top: -100px !important;
color: #212121;
}
/* HTML5 fallback styles for older browsers */
main, section, header, footer, nav, figure, figcaption
{
display: block;
box-sizing: border-box;
}
/* ---------------------------------------- */
h1 {
font-family: 'Roboto', sans-serif;
color: #707070;
display: inline-block;
}
a, a:hover, a:focus, a:visited {
color: #046dc3;
}
a {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
footer {
position:fixed;
text-align:center;
left: 0; bottom:0;
width:100%;
z-index:1000;
height:30px;
padding: 5px 20px;
background-color: #f5f9ff;
}
")
),
tags$header(
class = "headerContainer",
a(
img(
src = "https://www.trafforddatalab.io/images/trafford_council_logo_black_on_white_100px.png",
style = "position: relative; top: -5px;",
height = 60,
alt = "Trafford Council"
),
href = "https://www.trafford.gov.uk",
target = "_blank"
),
h1("Climate emergency slide pack")
),
fluidRow(
tags$main(
class = "col-sm-12 col-md-6 col-lg-6",
box(
width = '100%',
p("Last updated: 22 January 2024"),
tags$figure(style="display:inline-block;",
img(
src="GLOBE---1850-2022-MO.png",
style="width:100%;align:left;padding-top:10px;padding-bottom:10px",
alt=""
),
tags$figcaption(
em("Annual average global temperatures (1850-2022). Source: ", a(href = "https://showyourstripes.info", target = "_blank", "showyourstripes.info"))
)
),
br(),br(),
includeHTML("intro.html"),
br(),
tags$label(id="a11y-selection", style="display: none;", "Choose a local authority district"),
selectInput("selection", tags$strong("Choose a local authority district:"),
choices = sort(unique(lookup$area_name)),
selected = "Trafford"),
downloadButton("slides", "Build slides")
)
)
),
br(),br(),br(),
tags$footer(
"Developed in ",
a(href = "https://cran.r-project.org/", target = "_blank", "R"),
" by the ",
a(href = "https://www.trafforddatalab.io", target = "_blank", "Trafford Data Lab"),
" under the ",
a(href = "https://www.trafforddatalab.io/LICENSE.txt", target = "_blank", "MIT"),
" licence"
),
HTML("
<script>
// Add label to the hidden select element for the LA choice
var cb_selectLabel = setInterval(function() {
try {
var label = document.getElementById('a11y-selection');
label.setAttribute('for', 'selection');
clearInterval(cb_selectLabel); // cancel further calls to this fn
}
catch(e) {
// do nothing, wait until function is called again next interval
}
}, 500);
</script>
")
)