Browse Source

Move css to new file

Petra Lamborn 3 years ago
parent
commit
0f640644ab
2 changed files with 56 additions and 53 deletions
  1. 2
    53
      viz/app.R
  2. 54
    0
      viz/extras.R

+ 2
- 53
viz/app.R View File

@@ -7,6 +7,7 @@ library(leaflet.extras)
7 7
 library(shinyWidgets)
8 8
 
9 9
 source("leafletfunctions.R")
10
+source("extras.R")
10 11
 
11 12
 # work_travel <- read_csv("../travel-work.csv")
12 13
 load(file="datasets.RData")
@@ -35,59 +36,7 @@ hrstr <- "<hr style='border-top: 1px solid #000;'/>"
35 36
 ui <- fluidPage(
36 37
   useShinyjs(),
37 38
   leafletjs,
38
-  tags$style(type = "text/css", 
39
-  "html, body {
40
-    width:100%;
41
-    height:100%
42
-  }
43
-  #map {
44
-    height: 100% !important;
45
-    position: absolute !important;
46
-    top: 0;
47
-    left: 0;
48
-  }
49
-  #loading {
50
-    cursor: progress !important;
51
-  }
52
-  #loading p {
53
-    border-radius: 5px;
54
-    background-color: rgba(255, 255, 255, 0.8);
55
-    padding: 6px 8px;
56
-    box-shadow: 0 0 15px rgba(0,0,0,0.2);
57
-    font-size: 1.5em;
58
-    font-weight: bold;
59
-  }
60
-  #mapcontrol, #infobuttoncontainer, #infopanel {
61
-    background-color: rgba(255, 255, 255, 0.8);
62
-    border-radius: 5px;
63
-    box-shadow: 0 0 15px rgba(0,0,0,0.2);
64
-    padding: 6px 8px;
65
-    font: 14px/16px Arial, Helvetica, sans-serif;
66
-  }
67
-  #infopanel {
68
-    display: none;
69
-    padding: 30px;
70
-    z-index: 1001;
71
-  }
72
-  #lochtml ul {
73
-    padding-left: 15px;
74
-  }
75
-  .radio label span p {
76
-    margin-top: 3px;
77
-    margin-bottom: 0px;
78
-  }
79
-  .leaflet-container {
80
-    background-color: #84e1e1;
81
-  }
82
-  #infobuttoncontainer {
83
-    margin-bottom: 16px;
84
-    z-index: 1002;
85
-  }
86
-  #infobuttoncontainer .shiny-input-container,
87
-  #infobuttoncontainer div div {
88
-    margin-right: 0px !important;
89
-    margin-bottom: 0px !important;
90
-  }"),
39
+  tags$style(type = "text/css", extracss),
91 40
   leafletOutput("map"),
92 41
   absolutePanel(top = 10, right = 10, id="mapcontrol",
93 42
                 radioButtons("radioinout", label="Show commuters who",

+ 54
- 0
viz/extras.R View File

@@ -0,0 +1,54 @@
1
+extracss <- "
2
+html, body {
3
+  width:100%;
4
+  height:100%
5
+}
6
+#map {
7
+  height: 100% !important;
8
+  position: absolute !important;
9
+  top: 0;
10
+  left: 0;
11
+}
12
+#loading {
13
+  cursor: progress !important;
14
+}
15
+#loading p {
16
+  border-radius: 5px;
17
+  background-color: rgba(255, 255, 255, 0.8);
18
+  padding: 6px 8px;
19
+  box-shadow: 0 0 15px rgba(0,0,0,0.2);
20
+  font-size: 1.5em;
21
+  font-weight: bold;
22
+}
23
+#mapcontrol, #infobuttoncontainer, #infopanel {
24
+  background-color: rgba(255, 255, 255, 0.8);
25
+  border-radius: 5px;
26
+  box-shadow: 0 0 15px rgba(0,0,0,0.2);
27
+  padding: 6px 8px;
28
+  font: 14px/16px Arial, Helvetica, sans-serif;
29
+}
30
+#infopanel {
31
+  display: none;
32
+  padding: 30px;
33
+  z-index: 1001;
34
+}
35
+#lochtml ul {
36
+  padding-left: 15px;
37
+}
38
+.radio label span p {
39
+  margin-top: 3px;
40
+  margin-bottom: 0px;
41
+}
42
+.leaflet-container {
43
+  background-color: #84e1e1;
44
+}
45
+#infobuttoncontainer {
46
+  margin-bottom: 16px;
47
+  z-index: 1002;
48
+}
49
+#infobuttoncontainer .shiny-input-container,
50
+#infobuttoncontainer div div {
51
+  margin-right: 0px !important;
52
+  margin-bottom: 0px !important;
53
+}
54
+"