forked from ModelEarth/localsite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindexDELETE.html
429 lines (338 loc) · 15.5 KB
/
indexDELETE.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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon">
<!--
Localsite Template
localsite.js pulls the #insertedText div from this page as the template for header and map portion of layout.
-->
<title>Community Map</title>
<!-- For Goole Sheets, since CORS blocks CSV loading on some sheets. -->
<script type="text/javascript" src="../map/neighborhood/js/tabletop.js" id="/localsite/map/neighborhood/js/tabletop.js"></script>
<!-- Also in localsite.js. Added here to prevent error "Tabulator JS not available for displaying list." that otherwise pops up after a minute. -->
<!--
<script type="text/javascript" src="https://unpkg.com/[email protected]/dist/js/tabulator.min.js"></script>
<link id="/tabulator-tables/dist/css/tabulator.min.css" rel="stylesheet" type="text/css" href="https://unpkg.com/tabulator-tables/dist/css/tabulator.min.css" media="all">
<link type="text/css" rel="stylesheet" href="/localsite/css/base-tabulator.css" id="/localsite/css/base-tabulator.css" />
-->
<!--
<script>
let hash = getHash();
if (!hash.show) {
hiddenhash.layers = "brigades"; // Only dataset with entire country in one file. Used by loadFromSheet which is called by loadMap1
}
if (!hash.state) {
if (hash.show == "recycling" || hash.show == "ppe" || hash.show == "suppliers" || hash.show == "360" || hash.show == "opendata") {
hiddenhash.state = "GA";
}
}
// To implement
// param.zoom = 8
</script>
-->
<script type="text/javascript" src="../js/jquery.min.js" id="/localsite/js/jquery.min.js"></script>
<link type="text/css" rel="stylesheet" href="../css/base.css" id="/localsite/css/base.css" />
<link rel="stylesheet" href="../css/search-filters.css" id="/localsite/css/search-filters.css" />
<link rel="stylesheet" href="../css/map-display.css" id="/localsite/css/map-display.css" />
<script type="text/javascript" src="../js/localsite.js?show=vehicles&state=GA&showheader=true&showsearch=true&templatepage=true"></script>
<!--
<link rel="stylesheet" href="../css/hexagons.css">
-->
<!-- Local Header Navigation -->
<script>
//applyNavigation();
//alert("test")
if(typeof param == 'undefined') {
var param = {};
}
if (location.host.indexOf('codeforamerica') >= 0) {
param.titleArray = ["code","for","america"]
param.startTitle = "Code for America"
}
$(document).ready(function () {
if (location.host.indexOf('localhost') >= 0) {
$("#filterClickLocation").show(); // Seems to need Tabulator
}
});
</script>
<!-- Activate to include site navigation-->
<link rel="stylesheet" href="../css/leaflet.css" id="/localsite/css/leaflet.css" />
<!-- Resides AFTER Leaflet's CSS -->
<script src="../js/leaflet.js" id="/localsite/js/leaflet.js"></script>
<link href="../css/leaflet.icon-material.css" rel="stylesheet">
<script src="../js/leaflet.icon-material.js"></script>
<!--
<script src="../js/d3/d3-legend.js"></script>
-->
<link rel="stylesheet" href="../css/map.css" id="/localsite/css/map.css" />
<!-- For Facebook -->
<meta property="og:title" content="Community Map Resources" />
<meta property="og:type" content="article" />
<meta property="og:image" content="https://model.earth/data-pipeline/img/elements/bulb.png" />
<!-- To do: populate with the current page and path
<meta property="og:url" content="" />
-->
<meta property="og:description" content="Maps and Data Visualizations" />
<!-- For Twitter -->
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="Community Map Resources" />
<meta name="twitter:description" content="Input-Output Modeling" />
<meta name="twitter:image" content="https://model.earth/data-pipeline/img/elements/bulb.png" />
</head>
<body style="background-color: rgb(250, 250, 250);">
<style>
#headerbar {
/* display: block; */ /* Since navigation.js detects #headerbar prior to move */
}
</style>
<!-- INTRO -->
<div id="introDiv" style="displayX:none" class="local content contentpadding"></div>
<div id="readmeHolder" class="content contentpadding" style="display:none; margin-top:0px; padding-bottom:40px">
<div id="readmeEdit" style='float:right' class='editButton'><a style="text-decoration: none" href='https://github.com/modelearth/community/tree/master/resources/useeio/design'>Edit</a></div>
<div id="readmeDiv"></div>
<a href="javascript:void(0)" onclick="showOverview();" id="showOverview">Show overview</a>
</div>
<script>
param["showhero"] = "false";
if (param["intro"] || param["show"] == "farmfresh") {
//document.getElementById("readmeHolder").style.display = "block";
//document.getElementById("readmeEdit").style.display = "block";
//loadMarkdown("../map/starter/README.md", "introDiv", "_parent");
}
if (param["design"] && param["show"] != "farmfresh") {
document.getElementById("readmeHolder").style.display = "block";
document.getElementById("readmeEdit").style.display = "block";
loadMarkdown("../resources/USEEIO/design/intro.md", "readmeDiv", "_parent");
}
function showOverview() {
document.getElementById("showOverview").style.display = "none";
$("#readmeDiv").html("");
loadMarkdown("../resources/USEEIO/design/README.md", "readmeDiv", "_parent");
}
</script>
<!-- /INTRO -->
<div id="insertedTextSource">
<!-- Move to info/template-main.html -->
</div>
<!--
To add and update listings, download the <a href="map.csv">map.csv</a> file and edit within a spreadsheet.
Copy using a text editor and click the pencil icon <a href="https://github.com/modelearth/community/blob/master/map/map.csv">here</a> to paste into GitHub for review.
<span style="white-space: nowrap;">Or you can fork</span> the <a href="https://github.com/modelearth/community">GitHub Repo</a> and commit using <a href="https://desktop.github.com/">GitHub Desktop</a>.
-->
<script>
// Omit 'use strict' when creating an embed because it could brake third-party code.
'use strict'; // Optional, makes sure we are declaring variables.
$(document).ready(function () {
// Show app menu button
$(".showApps").removeClass("local");
$(".showApps").show();
});
// INIT
let hash = getHash(); // Allows hiddenhash set above to be included.
local_app.init(["somevalue", 1, "controlId"]); // Used by link to feedback form
//local_app.helloWorld();
//local_app.community_root();
document.addEventListener('hashChangeEvent', function (elem) {
//param = loadParam(location.search,location.hash);
//console.log("index.html detects hashChangeEvent");
//hash = getHash();
}, false);
// Try appending railroads here, somehow
//layerControl['map1'].addOverlay(baselayers["Rail"], "Railroads"); // Appends to existing layers
//layerControl['map2'].addOverlay(baselayers["Rail"], "Railroads"); // Appends to existing layers
//localmap.addOverlay(baselayers["Rail"], "Railroads"); // Appends to existing layers
</script>
<!-- Swiper and Plyr -->
<style>
.slideText {
display: none;
position:absolute;
bottom:-30px;
}
</style>
<!-- update
<link rel="stylesheet" href="/localsite/css/swiper/swiper-bundle.min.css" />
-->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper/swiper-bundle.min.css">
<link rel='stylesheet' href='/localsite/css/swiper/plyr.css'>
<link rel='stylesheet' href='/localsite/css/swiper/swiper.css'>
<script src='/localsite/js/polyfill.min.js?features=es6,Array.prototype.includes,CustomEvent,Object.entries,Object.values,URL'></script>
<script src='/localsite/js/plyr.min.js'></script>
<!-- For testing slider -->
<!-- overflow:hidden here might cause slides to be hidden, it did on localhost page. -->
<div class="swiper-container local" style="display:none;clear:both" id="sample1">
<div class="swiper-wrapper">
<!-- Slide 1 -->
<div class="swiper-slide" data-hash="plant">
<!-- BUG why does this need to be swiper-lazyX and src. Scroll to the far right to see -->
<img class="swiper-lazyX" src="/localsite/img/hero/plant.png" style="opacity:0.9;width:100%;max-width:2000px">
<div class="swiper-lazy-preloader swiper-lazy-preloader-white"></div>
<div class="slideText content contentpadding" style="displayX:none;position:absolute; bottom:-30px">
Add Optional Text 1
</div>
</div>
<!-- Slide 2 -->
<div class="swiper-slide" data-hash="2to1-ratio">
<img class="swiper-lazy" data-src="/localsite/img/hero/2to1-ratio.png" style="opacity:0.9;width:100%;max-width:2000px">
<div class="swiper-lazy-preloader swiper-lazy-preloader-white"></div>
<div class="slideText content contentpadding" style="displayX:none;position:absolute; bottom:-30px">
Add Optional Text 2
</div>
</div>
<!-- Slide 3 -->
<div class="swiper-slide" data-hash="sun">
<!-- Example of smaller: solar-rect-sm.png -->
<img class="swiper-lazy swiper-blur" data-src="/localsite/img/hero/solar-rect.png" style="width:100%;max-width:2000px;"><img class="swiper-lazy" data-src="/localsite/img/hero/solar-rect.png" style="opacity:0.9;max-width:2000px;">
<div class="swiper-lazy-preloader swiper-lazy-preloader-white" style="position: relative; border: 10px solid red;"></div>
<div class="slideText content contentpadding" style="displayX:none;position:absolute; bottom:-30px">
Add Optional Text 3
</div>
</div>
<!-- Slide 4: A Walkable Street -->
<div class="swiper-slide" data-hash="communities" style="positionX: relative;">
<img class="swiper-lazy swiper-blur" data-src="/localsite/img/hero/sustainable-communities.jpg" style="width:100%;max-width:2000px;">
<img class="swiper-lazy" data-src="/localsite/img/hero/sustainable-communities.jpg" style="opacity:0.9;width:100%;max-width:3000px">
<div class="swiper-lazy-preloader swiper-lazy-preloader-white"></div>
<div class="box" style="display:none">
<!--div class="title">Title</div-->
<!--
<div class="subtitle" data-swiper-parallax="-200">Graphics project</div>
-->
</div>
</div>
<!-- Slide 5 -->
<div class="swiper-slide" data-hash="explore">
<img class="swiper-lazy" data-src="/localsite/img/hero/future-teepee.png" style="opacity:0.9;width:100%;max-width:2000px;height:740px">
<div class="swiper-lazy-preloader swiper-lazy-preloader-white"></div>
<div class="slideText content contentpadding">
Add Optional Text 5
</div>
</div>
</div>
<!-- Swiper Nav -->
<div class="swiper-button-prev swiper-button-prev-sample1">
<!--<div class="swiper-button-white"></div>-->
</div>
<div class="swiper-button-play swiper-button-play-sample1"></div>
<!-- e034 -->
<div class="swiper-button-pause swiper-button-pause-sample1"></div>
<div class="swiper-button-next swiper-button-next-sample1">
<!--<div class="swiper-button-white"></div>-->
</div>
<!-- /Swiper Nav-->
</div>
<!-- Swiper Pagination -->
<div class="swiper-pagination swiper-pagination-sample1" style="margin-top:15px;"></div>
<!-- /Swiper Pagination -->
<!--
<script src="https://unpkg.com/swiper/swiper-bundle.min.js"></script>
-->
<script src="/localsite/js/swiper/swiper-bundle.min.js"></script>
<!-- Initialize Swiper -->
<script>
// Init multiple slider on a single page
// https://stackoverflow.com/questions/32118999/how-can-i-have-multiple-swiper-slideshows-on-a-single-page
// Function that builds the swiper
const buildSwiperSlider = sliderElm => {
const sliderIdentifier = sliderElm.id;
//alert("test " + sliderIdentifier)
const homeSwiper = new Swiper(`#${sliderElm.id}`, {
slidesPerView: 1,
spaceBetween: 30,
loop: true,
speed: 2500, /* transition */
slidesPerView: 'auto',
lazy: {
loadPrevNext: true,
},
navigation: {
nextEl: '.swiper-button-next-' + sliderIdentifier,
prevEl: '.swiper-button-prev-' + sliderIdentifier
},
pagination: {
el: '.swiper-pagination-' + sliderIdentifier,
clickable: true,
},
effect: 'fade',
/* change hash value (and load based on hash) -- problem: overwrites other hash values */
/*
hashNavigation: {
watchState: true,
},
*/
keyboard: {
enabled: true,
onlyInViewport: false
},
direction: 'horizontal',
/*
history: {
keepQuery: true
},
*/
});
$(".swiper-button-pause-" + sliderIdentifier).click(function(){
$(".swiper-button-pause-" + sliderIdentifier).hide();
$(".swiper-button-play-" + sliderIdentifier).show();
$(".swiper-button-pause-" + sliderIdentifier).addClass("overrideShowPauseQuick");
homeSwiper.autoplay.stop(); // Tiggers icon change below at autoplayStop event
});
$(".swiper-button-play-" + sliderIdentifier).click(function(){
homeSwiper.slideNext(); // Immidiately advance to next on click.
$(".swiper-button-play-" + sliderIdentifier).hide();
$(".swiper-button-pause-" + sliderIdentifier).show();
homeSwiper.autoplay.start();
});
$(".swiper-pagination-" + sliderIdentifier + " .swiper-pagination-bullet").click(function(){
$(".swiper-button-pause-" + sliderIdentifier).hide();
$(".swiper-button-play-" + sliderIdentifier).show();
});
$(".swiper-button-prev-" + sliderIdentifier).click(function(){
$(".swiper-button-pause-" + sliderIdentifier).hide();
$(".swiper-button-play-" + sliderIdentifier).show();
});
$(".swiper-button-next-" + sliderIdentifier).click(function(){
$(".swiper-button-pause-" + sliderIdentifier).hide();
$(".swiper-button-play-" + sliderIdentifier).show();
});
homeSwiper.on('autoplayStart', function () {
//$(".swiper-pagination-bullet-active").css("background","green");
$('head').append('<style id="customCSS">.swiper-pagination-bullet-active { background:green !important }</style>');
});
// Triggered by keyboard arrow keys and pause button:
homeSwiper.on('autoplayStop', function () {
//$(".swiper-pagination-bullet-active").css("background","#888");
$('#customCSS').remove();
// Briefly show the pause button
$(".swiper-button-pause-" + sliderIdentifier).show();
$(".swiper-button-pause-" + sliderIdentifier).addClass("showPauseQuick");
//alert("stop")
setTimeout(() => {
$(".swiper-button-pause-" + sliderIdentifier).hide();
$(".swiper-button-pause-" + sliderIdentifier).removeClass("showPauseQuick"); // to do: figure out why not fading
$(".swiper-button-pause-" + sliderIdentifier).removeClass("overrideShowPauseQuick"); // Allows pause not to be retained briefly when clicking actual pause button.
},1000);
$(".swiper-button-play-" + sliderIdentifier).show();
});
// Play on iniital load
$(".swiper-button-play-" + sliderIdentifier).hide();
$(".swiper-button-pause-" + sliderIdentifier).show();
homeSwiper.autoplay.start();
//return homeSwiper;
}
// Get all of the swipers on the page
const allSliders = document.querySelectorAll('.swiper-container');
// Loop over all of the fetched sliders and apply Swiper on each one.
allSliders.forEach(slider => buildSwiperSlider(slider));
const allListSliders = document.querySelectorAll('#detaillist');
// Loop over all of the fetched sliders and apply Swiper on each one.
allListSliders.forEach(slider => buildSwiperSlider(slider));
$(".swiper-button-play").show();
//$(".swiper-button-play").css('opacity', '0.8');
</script>
<!-- /Initialize Swiper -->
<!-- /Swiper and Plyr -->
</body>
</html>