forked from publiclab/infragram
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex2.html
539 lines (470 loc) · 33.4 KB
/
index2.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
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
<!DOCTYPE html>
<html lang="en">
<head>
<title>Infragram | by Public Lab - Home</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Public Lab's online, open source service for generating plant health analyses from near-infrared imagery.">
<link rel="stylesheet" href="node_modules/bootstrap5/dist/css/bootstrap.min.css">
<link href="node_modules/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<!-- Favicon -->
<link rel="icon" type="image/x-icon" href="/assets/favicon.ico">
<!-- CSS Link -->
<link href="dist/infragram2.css" rel="stylesheet">
<script src="node_modules/jquery/dist/jquery.min.js"></script>
<script src="node_modules/bootstrap5/dist/js/bootstrap.bundle.min.js"></script>
<script src="node_modules/webrtc-adapter/out/adapter.js"></script>
<script src="node_modules/getusermedia-js/dist/getUserMedia.min.js"></script>
<script src="dist/infragram2.js"></script>
<script type="x-shader/x-vertex" id="shader-vs"></script>
<script type="x-shader/x-fragment" id="shader-fs-template"></script>
<script type="x-shader/x-fragment" id="shader-fs"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-TC8EC01HKK"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-TC8EC01HKK');
</script>
</head>
<body>
<div id="video-container" style="display:none"></div>
<div class="container-fluid d-flex flex-column main-container">
<!-- TODO: change this: -->
<!-- This is the container for the entire page - it currently has 2 rows: HEADER & MAIN-CONTENT. they are preceded by the STEPS -->
<!-- ====================== get started steps- (for welcome tour )========================== -->
<!-- <a tabindex="0" class="btn steps step1 phone-d-none" role="button" data-bs-toggle="popover" data-bs-trigger="focus" data-placement="bottom" data-bs-content="Drop an Image/Video below or upload one from your computer.">Step 1</a>
<a tabindex="0" class="btn steps step2 sidebar-step align-self-end" role="button" data-bs-toggle="popover" data-bs-trigger="focus" data-placement="right" data-bs-content="Choose an Analysis Mode for pixel conversion. ">Step 2</a>
<a tabindex="0" class="btn steps step3 sidebar-step align-self-end" role="button" data-bs-toggle="popover" data-bs-trigger="focus" data-placement="right" data-bs-content="Emphasizes high-photosynthesis areas by mapping grey-scale NDVI outputs to wide and intense color ranges.">Step 3</a> -->
<!-- ====================================== HEADER ================================== -->
<!-- TODO: FIX RESPONSIVE @MAX-WIDTH:450PX -->
<!-- TODO: FIX RESPONSIVE @Min-WIDTH:1400PX(??) -->
<div class="row" style="border-bottom: var(--border)">
<div class="col-12 header">
<div class="header-title">
<img src="assets/infragram-mini-leaf-transparent-bg.png" alt="Infragram logo image." class="logo" />
<h1 style="font-size:1.5rem;line-height:3.1rem;letter-spacing:0.09rem;margin-bottom:0;"><a style="color:var(--white);padding-right:.3rem" href="../">Infragram</a><small style="font-size:.875rem;color:var(--light-grey);">by <a href="http://publiclab.org" target="_blank" style="font-size:1rem;color:var(--blue);">Public Lab</a></small></h1>
</div>
<!-- ========================= camera/image/video-controls ======================== -->
<div class="btn-toolbar mediaSelect media-tools" role="toolbar" aria-label="Toolbar with button groups">
<div class="btn-group" id="imageselect"type="button" role="group" aria-label="First group">
<label for="file-sel" data-bs-toggle="tooltip" data-bs-placement="left" title="Upload an image">
<a onClick="toggleToolbar()" class="btn-lg btn">
<i class="fa fa-upload"></i>
</a>
<input type="file" id="file-sel" class="d-none" accept="image/*,video/*">
</label>
</div>
<div class="btn-group labeled" role="group" aria-label="First group">
<button rel="tooltip" title="Connect to an Infragram webcam" id="webcam-activate" type="button" class="btn btn-lg btn-primary"><i class="fa fa-camera-retro"></i></button>
</div>
</div>
<!-- -----------VIDEO CONTROLS------------------------ -->
<!-- ============ tools to be moved to canvas upon video upload ?????? ====== -->
<div class="videoControls btn-toolbar" role="toolbar" style="display: none;" aria-label="Toolbar with button groups">
<div id="localVideoControls" class="d-flex justify-content-center align-items-center">
<button id="localVideoPlayPause" type="button" class="btn btn-dark"><i class="fa fa-pause"></i></button>
<div id="custom-seekbar">
<span></span>
</div>
</div>
<div class="btn-group dropdown" role="group" aria-label="Third group">
<div class="btn-group" role="group">
<a id="btnGroupDrop2" role="button" type="button" class="btn dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
<i class="fa fa-video-camera"></i>
</a>
<ul class="dropdown-menu" aria-labelledby="btnGroupDrop1">
<li><a id="qvga" class="dropdown-item" href="javascript:void(0);">QVGA</a></li>
<li><a id="vga" class="dropdown-item" href="javascript:void(0);">VGA</a></li>
<li><a id="hd" class="dropdown-item" href="javascript:void(0);">HD</a></li>
<li><a id="full-hd" class="dropdown-item" href="javascript:void(0);">FULL HD</a></li>
</ul>
</div>
</div>
<div class="btn-group" role="group" aria-label="Third group" id="startRecord" style="display:block">
<a role="button" type="button" class="btn btn-dark" ><i class="fa fa-circle" data-bs-toggle="tooltip" data-placement="bottom"></i></a>
</div>
<div class="btn-group" role="group" aria-label="Third group" id="stopRecord" id="startRecord" style="display:none">
<a role="button" type="button" class="btn btn-dark"><i class="fa fa-pause" data-bs-toggle="tooltip" data-placement="bottom"></i></a>
</div>
<div class="btn-group" role="group">
<a onClick="toggleToolbar()" role="button" type="button" class="btn btn-dark"><i class="fa fa-window-close" data-bs-toggle="tooltip" data-placement="bottom"></i></a>
</div>
</div>
<!-- ============================ nav links/help menus ======================== -->
<nav class="btn-toolbar" role="toolbar" aria-label="Toolbar with button groups">
<div class="btn-group" role="group" aria-label="First group">
<a role="button" type="button" class="nav-item btn btn-lg" href="https://infragram.org/">
<i class="fa fa-home" data-bs-toggle="tooltip" ddata-bs-placement="left" title="Create FTO issue to add in link to homepage here"></i>
</a>
</div>
<div class="btn-group" role="group" aria-label="Second group">
<div class="btn-group" role="group">
<a id="btnGroupDrop3" role="button" type="button" class="nav-item btn btn-lg dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
<i class="fa fa-question-circle-o" data-bs-toggle="tooltip" data-bs-placement="left" title="Links to be added in..."></i>
</a>
<ul class="dropdown-menu" aria-labelledby="btnGroupDrop1">
<li><a class="nav-item dropdown-item" href="#">Tutorials</a></li>
<li><a class="nav-item dropdown-item" href="#">Help</a></li>
<li><a class="nav-item dropdown-item" href="#">Tips</a></li>
<li><a class="nav-item dropdown-item" href="#">Obtain a kit</a></li>
</ul>
</div>
</div>
<div class="btn-group" role="group" aria-label="Third group">
<div class="btn-group" role="group">
<a id="save-zone" role="button" type="button" class="btn btn-lg dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
<i class="fa fa-save" data-bs-toggle="tooltip"="tooltip" data-bs-placement="left" title="Functional, but 'Export' is sketchy"></i>
</a>
<ul class="dropdown-menu" aria-labelledby="save-zone">
<li><a onClick="openInPl()" type="button" class="dropdown-item" href="#">Save</a></li>
<li><a onClick="infragram.download()" type="button" class="dropdown-item" href="#">Download</a></li>
<li><a onClick="openInSequencer()" type="button" class="dropdown-item" href="#">Export</a></li>
</ul>
</div>
</div>
</nav>
</div>
</div>
<!-- ============================== MAIN CONTENT "ROW" ==============================
========SIDEBAR, IMAGE CONTAINER, LOWER TOOL PANEL ====== -->
<div class="row">
<!-- ================ SIDEBAR (Tool Panel)- not displayed on mobile================ -->
<div class="col-12 d-none col-md-2 d-md-flex flex-md-column justify-content-md-between align-items-md-start sidebar pl-4">
<div class="analysis-tools" style="height:100%;">
<!--------------------------- Quick-Start --------------------------------------->
<div class="pt-5">
<a class="btn btn-outline-secondary" data-bs-toggle="offcanvas" href="#preset-modal" role="button" aria-controls="preset-modal">QUICK START</a>
<p>Get up and running in seconds with our default settings. These will auto-load your raw or converted media.</p>
<!-- ------------------ quick-start offcanvas panel ------------------------ -->
<div class="offcanvas offcanvas-start" tabindex="-1" id="preset-modal" aria-labelledby="preset-modal">
<div class="offcanvas-header">
<h5 class="offcanvas-title">Quick start</h5>
<button type="button" class="btn-close-white text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<div class="mb-4">
<h6>Raw</h6>
<p>Just what your camera sees, no filters.</p>
<div style="padding-left:1em;"><a id="preset_raw" type="button" href="#" class="btn btn-sm btn-outline-dark" style="font-size:.7rem;margin-left:-5px;">Begin</a></div>
</div>
<!-- -------------------- red filters --------------------- -->
<div class="mb-4">
<h6>Red filters <i class="fa fa-filter" aria-hidden="true" style="color:rgb(163, 24, 24);"></i></h6>
<p>Basic plant analysis for <a href="" style="color:var(--link-color);">Infragram Point & Shoot cameras</a>.</p>
<div style="padding-left:1em;">
<a id="preset_ndvi_red" type="button" href="#" class="btn btn-sm btn-outline-secondary" data-bs-toggle="tooltip" data-placement="bottom" title="Normalized Difference Vegetation Index." style="font-size:.7rem;">NDVI</a>
<a id="preset_ndvi_red_color" type="button" href="#" class="btn btn-sm btn-outline-secondary" data-bs-toggle="tooltip" data-placement="bottom" title="Emphasizes high-photosynthesis areas by mapping grey-scale NDVI outputs to wide and intense color ranges." style="font-size:.7rem;border-left: var(--border)">Colorize</a>
</div>
</div>
<!-- -------------------- blue filters --------------------- -->
<div>
<h6>BLUE filters <i class="fa fa-filter" aria-hidden="true" style="color:#347ab7;"></i></h6>
<p>Basic plant analysis for <a href="" style="color:var(--link-color);">filter packs and webcams</a>.</p>
<div style="padding-left:1em;">
<a id="preset_ndvi_blue" type="button" href="#" class="btn btn-sm btn-outline-secondary" data-bs-toggle="tooltip" data-placement="bottom" title="Normalized Difference Vegetation Index." style="font-size:.7rem;">NDVI</a>
<a id="preset_ndvi_blue_color"type="button" href="#" class="btn btn-sm btn-outline-secondary" data-bs-toggle="tooltip" data-placement="bottom" title="Emphasizes high-photosynthesis areas by mapping grey-scale NDVI outputs to wide and intense color ranges." style="font-size:.7rem;border-left: var(--border)">Colorize</a>
</div>
</div>
</div>
</div>
</div>
<!-- -------------------- CONVERT/ANALYZE --------------------------- -->
<div class="tool-divider">
<button onClick="$('.analysis-msg').toggle();" class="btn btn-secondary" type="button" data-bs-toggle="collapse" data-bs-target="#analysis-inputs" aria-expanded="false" aria-controls="analysis-inputs">
ANALYZE
</button>
<div id="analysis-inputs" class="collapse">
<select class="form-control" style="display:inline;width:80px;" id="modeSwitcher" onChange="if(this.value == 'infragrammar_mono'){$('.colorize').show()}else{$('.colorize').hide()}">
<option value='infragrammar_mono'>Grey</option>
<option value='infragrammar'>RGB</option>
<!-- <option value='infragrammar_hsv'>HSV</option> -->
</select>
<form id="infragrammar_mono" class="form-inline" style="display:inline;" action="javascript:void(0);">
<input placeholder="monochrome" type="text" id="m_exp" class="form-control" value="(R-B)/(R+B)">
<button type="submit" class="btn btn-primary">Run</button>
</form>
<form id="infragrammar" class="form-inline" style="display:none;" action="javascript:void(0);">
<input placeholder="R" type="text" id="r_exp" class="form-control" value="R">
<input placeholder="G" type="text" id="g_exp" class="form-control" value="G">
<input placeholder="B" type="text" id="b_exp" class="form-control" value="B">
<button type="submit" class="btn btn-primary">Run</button>
</form>
<form id="infragrammar_hsv" class="form-inline" style="display:none;" action="javascript:void(0);">
<input placeholder="H" type="text" id="h_exp" class="form-control" value="-(R-B)/(R+B)">
<input placeholder="S" type="text" id="s_exp" class="form-control" value="1">
<input placeholder="V" type="text" id="v_exp" class="form-control" value="1">
<button type="submit" class="btn btn-primary">Run</button>
</form>
</div>
<div class="analysis-msg">
<p>Formulate simple epressions or modify the individual color channels to generate your own pixel conversions!</p>
<a class="col-1 offset-8 info-icon d-block" style="margin-top:-1.5rem;" role="button" target="_blank" href="http://publiclab.org/infragrammar" data-bs-toggle="tooltip" data-placement="bottom" title="To include links to all things analysis"><i class="fa fa-info-circle pl-2 my-3"></i></a>
</div>
</div>
<!-- -------------------- COLORIZE --------------------------- -->
<div class="tool-divider colorize">
<div class="btn-group" role="group">
<a id="btnGroupDrop6" type="submit" class="btn dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
COLORIZE
</a>
<ul class="dropdown-menu" aria-labelledby="btnGroupDrop1">
<li><a id="default_colormap" class="dropdown-item" href="#">Default colormap</a></li>
<li><a id="stretched_colormap" class="dropdown-item" href="#">Stretched colormap</a></li>
</ul>
</div>
<p>(optional)</p>
<div>
<p>Emphasizes high-photosynthesis areas by mapping grey-scale NDVI outputs to wide and intense color ranges.</p>
<a class="col-1 offset-8 d-block info-icon" style="margin-top:-1.5rem;" role="button" target="_blank" href="#" data-bs-toggle="tooltip" data-placement="bottom" title="To include links to all things colormap"><i class="fa fa-info-circle pl-2"></i></a>
</div>
</div>
</div>
</div>
<!--============================ IMAGE-SCREEN-CANVAS ============================== -->
<div id="image-container" class="col-12 col-md-10 image-container">
<div style="display:none;" id="webcam"></div>
<a id="fullscreen" class="btn btn-default"><i class="fa fa-expand"></i></a>
<!-- ========================= intro/welcome msg =============================== -->
<!-- onClick="$('.choose-prompt').hide();" -->
<div class="choose-prompt welcome-msg">
<div class="welcome-msg-text">
<h2 style="font-size:1.25rem;">Analyze plant health. <br> Visualize photosynthesis.</h2>
<p>Every pixel of your infragram media is converted to display the amount of infrared light reflected when used <a href="" style="color:var(--link-color);">with an Infragram camera or filter kit</a>. The default setting generates grey-scale NDVI, the Normalized Difference Vegetation Index, and has a built in colorize function to intensify individual pixel channels.</p>
</div>
<!-- ======================= get started upload/select ======================= -->
<div class="card text-center sample-images">
<div class="card-body">
<p class="card-text" style="font-size:.625rem;"><small>Drop your media here, connect through your computer above <br class="sample-text-effect"> or <br> explore with our ready-to-use images</small></p>
<div class="d-flex justify-content-around">
<div class="d-flex flex-column justify-content-center align-items-baseline">
<img src="assets/red-filtered-trees-thumbnail.jpeg" alt="Red filtered image - select to explore the tool." style="width:5rem;height:auto;border:.5rem solild var(--image-container-bg);">
<p class="card-text" style="font-size:.625rem;padding-top:.5rem;"><small>Red filtered trees</small></p>
</div>
<div class="d-flex flex-column justify-content-center align-items-center">
<img src="assets/blue-filtered-plant-thumbnail.jpeg" alt="Blue filtered image - select to explore the tool." style="width:5rem;height:auto;">
<p class="card-text" style="font-size:.625rem;padding-top:.5rem;"><small>Blue filtered plant</small></p>
</div>
</div>
</div>
</div>
</div>
<div style="background:#111;display:none;position:absolute;top:0;left:0;z-index:1;width:100%;height:100%;" id="backdrop"></div>
<div id="overlay-container" style="display:none;">
<img id="overlay-img" src="assets/grid.svg" alt="grid overlay image">
</div>
<a class="btn-inverse btn-small" style="display:none;position:absolute;right:2vw;top:12vh;z-index:3;" id="exit-fullscreen"><i class="fa fa-remove"></i> Exit full screen</a>
<canvas class="fullscreen" id="image">
</canvas>
<div id="colorbar-container" style="display:none;">
<span id="colorbar-min">-1.00</span>
<canvas id="colorbar"></canvas>
<span id="colorbar-max">1.00</span>
</div>
</div>
<!-------- MOBILE TOOL PANEL (3rd row on mobile - not displayed on desktop------------>
<div class="btn-group col-12 d-md-none d-flex justify-content-around align-items-center mobile-analysis-tools">
<!-- ==================== mobile - QUICK START ================================== -->
<div>
<div class="d-flex flex-column justif-content-center align-items-center">
<a id="qsMobile" class="btn btn-lg d-block" data-bs-toggle="offcanvas" href="#preset-modalMobile" role="button" aria-controls="preset-modal"><i class="fa fa-fighter-jet"></i></a>
<label for="qsMobile">QUICK START</label>
</div>
<!-- ------------------ quick-start offcanvas panel -------------------------- -->
<div class="offcanvas offcanvas-bottom" tabindex="-1" id="preset-modalMobile" aria-labelledby="preset-modalMobile">
<div class="offcanvas-header">
<h5 class="offcanvas-title">Quick start</h5>
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body d-flex justify-content-center">
<!-- -------------------- red filters --------------------- -->
<div class="" style="width:35%;margin:0 1.5rem;">
<h6 style="text-decoration:underline;">Red filters <i class="fa fa-filter" aria-hidden="true" style="color:rgb(163, 24, 24);"></i></h6>
<p>Basic plant analysis for <a href="" style="color:var(--link-color);">Infragram Point & Shoot cameras</a>.</p>
<div style="padding-left:1em;">
<a type="button" href="#" class="btn btn-sm btn-outline-secondary" data-bs-toggle="tooltip" data-placement="bottom" title="Normalized Difference Vegetation Index." style="font-size:.7rem;">NDVI</a>
<a type="button" href="#" class="btn btn-sm btn-outline-secondary" data-bs-toggle="tooltip" data-placement="bottom" title="Emphasizes high-photosynthesis areas by mapping grey-scale NDVI outputs to wide and intense color ranges." style="font-size:.7rem;border-left: var(--border)">Colorize</a>
</div>
</div>
<!-- -------------------- raw, no filters --------------------- -->
<div style="width:30%;margin:0 1.5rem;">
<h6 style="text-decoration:underline;">Raw</h6>
<p>Just what your camera sees, no filters.</p>
<div style="padding-left:1em;"><a type="button" href="#" class="btn btn-sm btn-outline-dark" style="font-size:.7rem;margin-left:-5px;">Begin</a></div>
</div>
<!-- -------------------- blue filters --------------------- -->
<div style="width:35%">
<h6 style="text-decoration:underline;">BLUE filters <i class="fa fa-filter" aria-hidden="true" style="color:#347ab7;"></i></h6>
<p>Basic plant analysis for <a href="" style="color:var(--link-color);">filter packs and webcams</a>.</p>
<div style="padding-left:1em;margin:0 1.5rem;">
<a type="button" href="#" class="btn btn-sm btn-outline-secondary" data-bs-toggle="tooltip" data-placement="bottom" title="Normalized Difference Vegetation Index." style="font-size:.7rem;">NDVI</a>
<a type="button" href="#" class="btn btn-sm btn-outline-secondary" data-bs-toggle="tooltip" data-placement="bottom" title="Emphasizes high-photosynthesis areas by mapping grey-scale NDVI outputs to wide and intense color ranges." style="font-size:.7rem;border-left: var(--border)">Colorize</a>
</div>
</div>
</div>
</div>
</div>
<!-- ===================== mobile - ANALYSIS INPUTS ============================= -->
<div class="analyze">
<div class="btn-group labeled dropup d-flex flex-column justify-content-center align-items-center" role="group">
<a id="btnGroupDrop8" class="btn btn-lg dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false"><i class="fa fa-pencil-square-o"></i></a>
<label for="btnGroupDrop8">ANALYZE</label>
<div class="dropdown-menu" aria-labelledby="analysis-mobile">
<select style="display:inline;width:80px;" id="modeSwitcher" onChange="if(this.value == 'infragrammar_mono'){$('.colorize').show()}else{$('.colorize').hide()}">
<option value='infragrammar_mono'>Grey</option>
<option value='infragrammar'>RGB</option>
<!-- <option value='infragrammar_hsv'>HSV</option> -->
</select>
<form id="infragrammar_mono" class="form-inline" style="display:inline;" action="javascript:void(0);">
<input placeholder="monochrome" type="text" id="m_exp" class="form-control" value="(R-B)/(R+B)">
<button type="submit" class="btn btn-primary">Run</button>
</form>
<form id="infragrammar" class="form-inline" style="display:none;" action="javascript:void(0);">
<input placeholder="R" type="text" id="r_exp" class="form-control" value="R">
<input placeholder="G" type="text" id="g_exp" class="form-control" value="G">
<input placeholder="B" type="text" id="b_exp" class="form-control" value="B">
<button type="submit" class="btn btn-primary">Run</button>
</form>
<form id="infragrammar_hsv" class="form-inline" style="display:none;" action="javascript:void(0);">
<input placeholder="H" type="text" id="h_exp" class="form-control" value="-(R-B)/(R+B)">
<input placeholder="S" type="text" id="s_exp" class="form-control" value="1">
<input placeholder="V" type="text" id="v_exp" class="form-control" value="1">
<button type="submit" class="btn btn-primary">Run</button>
</form>
</div>
</div>
<!-- <p class="text-center">Modify the equations
<a class="col-1 offset-8 info-icon d-block" style="margin-top:-1.5rem;" role="button" target="_blank" href="http://publiclab.org/infragrammar" data-bs-toggle="tooltip" data-placement="bottom" title="To include links to all things analysis"><i class="fa fa-info-circle pl-2 analyze-info"></i></a>
</p> -->
</div>
<!-- ====================== mobile - COLORIZE =================================== -->
<div class="colorize">
<div class="btn-group labeled dropup d-flex flex-column justify-content-center align-items-center" role="group">
<a id="btnGroupDrop6" type="submit" role="button"class="btn btn-lg btn-colorize dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"><i class="fa fa-diamond"></i></a>
<label for="btnGroupDrop6">COLORIZE</label>
<ul class="dropdown-menu" aria-labelledby="btnGroupDrop1">
<li><a id="default_colormapMobile" class="dropdown-item" href="#">Default colormap</a></li>
<li><a id="stretched_colormapMobile" class="dropdown-item" href="#">Stretched colormap</a></li>
</ul>
</div>
<!-- <p class="text-center"> (optional)</p>
<p class="text-center">Emphasize outputs.<a class="info-icon" role="button" target="_blank" href="http://publiclab.org/infragrammar" data-bs-toggle="tooltip" data-placement="bottom" title="To include links to all things colormap"><i class="fa fa-info-circle pl-2"></i></a></p> -->
</div>
</div>
<!-- -------BOTTOM ROW TOOL PANEL (displayed on mobile & desktop) ----------------- -->
<!-- TODO: FIX RESPONSIVE @MAX-WIDTH:450PX -->
<div class="tool-panel col-12 col-md-10 offset-md-2 d-flex justify-content-around align-items-center" style='border-top: var(--border);border-left: var(--border);'>
<!-- -----------ADJUSTMENT TS: REVERT, FLIP, OVERLAY ---------------------------- -->
<div class="btn-toolbar" role="toolbar" aria-label="Toolbar with button groups">
<div class="btn-group labeled" role="group" aria-label="First group">
<label for="revert">REVERT</label>
<a id="revert" role="button" type="button" class="btn btn-dark">
<i class="fa fa-refresh" data-bs-toggle="tooltip"="tooltip" data-placement="bottom" title="Revert to Basic Analysis"></i>
</a>
</div>
<div class="btn-group labeled" role="group" aria-label="Second group">
<label for="flip">FLIP</label>
<div id="flip" class="btn-group" role="group" aria-label="Second group">
<a role="button" type="button" class="btn btn-dark">
<i class="fa fa-chevron-left pr-2" data-bs-toggle="tooltip" data-placement="bottom" title="Flip Left"></i> |
<i class="fa fa-chevron-right pl-2" data-bs-toggle="tooltip" data-placement="bottom" title="Flip Right"></i>
</a>
</div>
</div>
<div class="btn-group" role="group" aria-label="Third group">
<div class="btn-group labeled dropup" role="group">
<label for="overlay-btn">OVERLAY</label>
<a id="overlay-btn" role="button" type="button" class="btn btn-dark">
<i class="fa fa-th" aria-hidden="true"></i>
</a>
</div>
</div>
<div id="overlay-controls-container" class="btn-group" style="display:none;"role="group" aria-label="Third group">
<div class="d-flex align-items-center">
<div class="d-flex flex-column justify-content-between align-items-center px-2 h-100">
<label id="overlay-size" for="overlay-slider" style="color:#d5d5d5;"></label>
<input id="overlay-slider" type="range" class="mb-2" min="10" max="50" value="100"/>
</div>
<button id="overlay-save-btn" class="btn btn-dark" style="border:1px solid #353948;">Save</button>
<span id="overlay-save-info" style="color:green; display: none; padding-left:.5rem;">Size saved!</span>
</div>
</div>
</div>
<!-- ------------------------ ZOOM ---------------------------------------------- -->
<div class="btn-toolbar btn-group labeled" role="toolbar" aria-label="Toolbar with button groups">
<label for="zoom">ZOOM</label>
<div id="zoom" class="btn-group">
<div class="btn-group" role="group" aria-label="First group">
<a id="revert" role="button" type="button" class="btn btn-dark">
<i class="fa fa-minus-circle pr-2" data-bs-toggle="tooltip" data-placement="bottom" title="Zoom Out"></i>
</a>
</div>
<div class="zoom btn-group labeled" role="group" aria-label="Second group">
<input type="range" class="form-control-range" id="formControlRange">
</div>
<div class="btn-group" role="group" aria-label="Third group">
<a id="revert" role="button" type="button" class="btn btn-dark">
<i class="fa fa-plus-circle pl-2" data-bs-toggle="tooltip" data-placement="bottom" title="Zoom In"></i>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
return new bootstrap.Tooltip(tooltipTriggerEl)
});
// var popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]'));
// var popoverList = popoverTriggerList.map(function (popoverTriggerEl) {
// return new bootstrap.Popover(popoverTriggerEl)
// });
// var popover = new bootstrap.Popover(document.querySelector('.popover-dismiss'), {
// trigger: 'focus'
// });
document.addEventListener("DOMContentLoaded", function (event) {
(function () {
$('[data-bs-toggle="tooltip"]').tooltip()
})();
});
// document.addEventListener("DOMContentLoaded", function (event) {
// $(function () {
// $('[data-bs-toggle="popover"]').popover()
// })();
// });
function toggleToolbar() {
$('.mediaSelect').toggle();
$('.videoControls').toggle();
}
var infragram, openInPl, openInSequencer;
(function() {
infragram = Infragram({
uploader: false,
processor: 'webgl'
});
openInPl = function openInPl() {
var dataurl = infragram.options.processor.getCurrentImage();
function postToPL(imgSrc) {
var uniq = Date.now();
var color = $('#m_exp').val().substr(1,3) == "R-B" ? "blue" : "red";
var bodyText = "The lead image is a processed Infragram image from https://infragram.org. It is good practice to upload the original image as well. The sequence used to generate the above image was: https://sequencer.publiclab.org/examples/#steps=ndvi{filter:" + color + "},colormap{colormap:default}";
$('body').append('<form method="post" id="postToPL' + uniq + '" action="https://publiclab.org/post?tags=infragram,infragram-upload&body=' + bodyText + '" target="postToPLWindow"><input type="hidden" name="datauri_main_image" /></form>');
f = $('#postToPL' + uniq)[0];
f.datauri_main_image.value = imgSrc;
window.open('', 'postToPLWindow');
f.submit();
}
postToPL(dataurl);
}
openInSequencer = function openInSequencer() {
var color = $('#m_exp').val().substr(1,3) == "R-B" ? "blue" : "red";
var dataurl = infragram.options.processor.getInputImage();
window.location = "https://sequencer.publiclab.org/examples/#steps=ndvi{filter:" + color + "},colormap{colormap:default}&src=" + dataurl;
}
})()
</script>
</body>
</html>