-
Notifications
You must be signed in to change notification settings - Fork 0
/
map.html
229 lines (192 loc) · 8.34 KB
/
map.html
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>2G!vez</title>
<!-- Bootstrap core CSS -->
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="css/simple-sidebar.css" rel="stylesheet">
<script defer src="https://use.fontawesome.com/releases/v5.0.6/js/all.js"></script>
<style>
body{
background-color:#000000;
}
#map{
border: 4px solid #39e600;
margin-left: 170px;
width: 80%;
padding: 0px;
background-color: white;
position: fixed;
}
#jamaica{
width: 490px;
height: 200px;
position: absolute;
left: 7%;
top: 120px;
}
#trinidad{
width: 95px;
height: 90px;
position: absolute;
left: 84%;
top: 710px;
}
#haiti{
width: 95px;
height: 110px;
position: absolute;
left: 44%;
top: 280px;
}
#barbados{
width: 50px;
height: 60px;
position: absolute;
left: 92%;
top: 610px;
}
#key{
border: 3px solid black;
width: 250px;
height:100px;
position: absolute;
left: 80%;
top: 50px;
color:lime;
visibility:hidden;
}
#g{
position: relative;
}
</style>
</head>
<body>
<div id="wrapper">
<!-- Sidebar -->
<div id="sidebar-wrapper">
<ul class="sidebar-nav">
<li class="sidebar-brand">
<a href="index.html" style="margin-left: 20px;">
<img src="images/logo-small.png" >
</a>
</li>
<li>
<a href="map.html">Map</a>
</li>
<li>
<a href="donate.html">Donate</a>
</li>
<li>
<a href="viewGardens.html">View Gardens</a>
</li>
<li>
<a href="gardenBuilder.html">Build a Community Garden</a>
</li>
<li>
<a href="about.html">About</a>
</li>
<li>
<a href="services.html">Volunteer</a>
</li>
<li>
<a href="contact.html">Contact</a>
</li>
</ul>
</div>
<!-- /#sidebar-wrapper -->
<!-- Page Content -->
<div id="page-content-wrapper">
<div class="container-fluid">
<!-- Menu Button do not change -->
<a href="#menu-toggle" id="menu-toggle"><i id="mooooo" class="fas fa-leaf" style="font-size:45;color:lime;"></i></a>
<div style="text-align:center;margin-left:auto;margin-right:auto;"> <button type="button" class="btn btn-success" onclick="showFa()">Show food availability</button> </div>
<br><br>
<div id="map">
<img src="images/map.png" height=800px width=100%>
<div id="jamaica"> </div>
<div id="trinidad"></div>
<div id="haiti"> </div>
<div id="barbados"></div>
<div id="key"> <p> <span style="color:rgb(255, 0, 0)"> Red = Low food availability <span> </br> <span style="color:yellow"> Yellow = Moderate food availability </span></br> <span style="color:green">Green = Sufficient food availability </span></p>
</div>
</div>
<script>
var faJamaica = 76;
var faTrinidad = 89;
var faHaiti = 49;
var faBarbados = 88;
function showFa(){
document.getElementById("key").style.visibility = 'visible';
if(faJamaica < 50){
document.getElementById("jamaica").style.backgroundColor = 'rgba(0,255,0,0.3)';
document.getElementById("jamaica").style.border = 'solid 2px red'
}
else if(faJamaica < 80){
document.getElementById("jamaica").style.backgroundColor = 'rgba(255,255,0,0.3)';
document.getElementById("jamaica").style.border = 'solid 2px yellow'
}
else{
document.getElementById("jamaica").style.backgroundColor = 'rgba(0,255,0,0.3)'
document.getElementById("jamaica").style.border = 'solid 2px green'
}
if(faTrinidad < 50){
document.getElementById("trinidad").style.backgroundColor = 'rgba(0,255,0,0.3)';
document.getElementById("trinidad").style.border = 'solid 2px red'
}
else if(faTrinidad < 80){
document.getElementById("trinidad").style.backgroundColor = 'rgba(255,255,0,0.3)';
document.getElementById("trinidad").style.border = 'solid 2px yellow'
}
else{
document.getElementById("trinidad").style.backgroundColor = 'rgba(0,255,0,0.3)'
document.getElementById("trinidad").style.border = 'solid 2px green'
}
if(faHaiti < 50){
document.getElementById("haiti").style.backgroundColor = 'rgba(255, 0, 0, 0.4)';
document.getElementById("haiti").style.border = 'solid 2px red'
}
else if(faHaiti < 80){
document.getElementById("haiti").style.backgroundColor = 'rgba(255,255,0,0.3)';
document.getElementById("haiti").style.border = 'solid 2px yellow'
}
else{
document.getElementById("haiti").style.backgroundColor = 'rgba(0,255,0,0.3)'
document.getElementById("haiti").style.border = 'solid 2px green'
}
if(faBarbados < 50){
document.getElementById("barbados").style.backgroundColor = 'rgba(255, 0, 0, 0.4)';
document.getElementById("barbados").style.border = 'solid 2px red'
}
else if(faBarbados < 80){
document.getElementById("barbados").style.backgroundColor = 'rgba(255,255,0,0.3)';
document.getElementById("barbados").style.border = 'solid 2px yellow'
}
else{
document.getElementById("barbados").style.backgroundColor = 'rgba(0,255,0,0.3)'
document.getElementById("barbados").style.border = 'solid 2px green'
}
}
</script>
</div>
</div>
<!-- /#page-content-wrapper -->
</div>
<!-- /#wrapper -->
<!-- Bootstrap core JavaScript -->
<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- Menu Toggle Script -->
<script>
$("#menu-toggle").click(function(e) {
e.preventDefault();
$("#wrapper").toggleClass("toggled");
});
</script>
</body>
</html>