This repository has been archived by the owner on Mar 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.R
111 lines (93 loc) · 3.85 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
# UI file for mynearestleedsmarginal.com/studentmarginals2019
require(leaflet)
card_meta <- list(
t_ilte = 'Find my nearest Scottish marginal 2019',
u_rl = 'https://findmyscottishmarginal.com/',
img = 'https://findmyscottishmarginal.com/src/img/mynearestleedsmarg.png',
descrip_tion = 'Find your nearest marginal Scottish constituency and help campaign!'
)
# anything going into fluidPage goes into app
ui <- fluidPage(
tags$head(
includeHTML("./src/js/gtag1.html"),
# section for twitter card
tags$meta(name = 'twitter:card', content = 'summary'),
tags$meta(name = 'twitter:title', content = card_meta$t_ilte),
tags$meta(name = 'twitter:url', content = card_meta$u_rl),
tags$meta(name = 'twitter:image', content = card_meta$img),
tags$meta(name = 'twitter:description', content = card_meta$descrip_tion),
# section for FB opengraph
tags$meta(property = 'og:title', content = card_meta$t_ilte),
tags$meta(property = 'og:type', content = 'website'),
tags$meta(property = 'og:image', content = card_meta$img),
tags$meta(property = 'og:url', content = card_meta$u_rl),
tags$meta(property = 'og:description', content = card_meta$descrip_tion),
# include style tag
tags$style(HTML('.Linkbutton {
display: block;
width: 250px;
background: rgb(230, 0, 71);
padding: 5px;
text-align: center;
color: white;
margin: auto;
}
.Linkbutton2 {
display: inline-block;
width: 200px;
background: rgb(230, 0, 71);
padding: 2px;
text-align: center;
color: white;
}'
))
),
includeCSS("./src/css/mark6.1.css"),
# UI title panel
tags$div(class='row',
tags$div(class='left',
titlePanel("Scottish Labour", windowTitle = "Scottish Labour marginal Finder 2019")
),
tags$div(class='right',
titlePanel("Marginal Finder")
)
),
# creates a side bar for postcode, button and slider
sidebarLayout(
sidebarPanel(
tags$p("Welcome to find my nearest Scottish marginal 2019!"),
tags$p("Enter your postcode below and press search to
find your nearest marginal or click on the map to get a link
to details of campaigning."),
tags$p(" "),
# text input for postcode
textInput("postcode","Enter postcode", NULL),
# button to control map generation
actionButton("go","Search"),
tags$br(),
tags$br(),
tags$strong("Don't forget polling day is Thursday 12th December!")
,tags$p(" ")
,tags$p('#turnScotlandRed', class = 'Linkbutton2')
,tags$p(' ')
),
mainPanel(
tags$div(tags$p(htmlOutput("value"),
htmlOutput("link1"),
htmlOutput("link2"))
),
tags$br(),
leafletOutput("mymap"),
tags$style('#help1{font-size: 10px;
text-align: center;
font-family: open sans;
}'),
tags$p(' ')
,tags$p(align = 'center',tags$a(class = 'Linkbutton2', href='https://www.gov.uk/register-to-vote', 'Register to vote')),
tags$br(),
tags$p(id = "help1", "Made by Alex Coleman ~ Found an error?",tags$a(id = "help1",href="mailto:alexcoleman@hunsletandriversidelabour.org.uk", "Email Me.")),
tags$p(id = "help1", "If the page becomes unresponsive try refreshing your browser."),
tags$p(id = "help1", "This page was made using Shiny.", tags$a(id = 'help1', href='https://github.com/Sparrow0hawk/studentmarginals2019', 'Code on GitHub'))
)
)
)