/
sampleSMWeb.html
611 lines (507 loc) · 16.5 KB
/
sampleSMWeb.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
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>SemanticMarker™</title>
<link rel="SHORTCUT ICON" href="SemanticMarkerSmall.png" type="image/x-icon" />
<style>
/* https://www.w3schools.com/css/css_tooltip.asp */
.tooltip .tooltiptext {
top: -5px;
left: 105%;
}
/* Tooltip container */
.tooltip {
position: relative;
display: inline-block;
}
/* Tooltip text */
.tooltip .tooltiptext {
visibility: hidden;
width: 160px;
background-color: black;
color: #fff;
text-align: center;
padding: 5px 0;
border-radius: 6px;
/* Position the tooltip text - see examples below! */
position: absolute;
z-index: 1;
}
/* Show the tooltip text when you mouse over the tooltip container */
.tooltip:hover .tooltiptext {
visibility: visible;
}
</style>
<style>
a.demo_img {
display: block;
width:400px;
position:relative;
line-height:25px;
}
a.demo_img>div {
position:absolute;
padding:0;
margin:0;
zoom:0.25;
left: 140px; /* change this value to one that works best for you */
top: 100px; /* change this value to one that works best for you */
background: transparent url(files/arrow-down-grey.png) left 23px no-repeat;
margin-left: 24px;
opacity:0;
height: 0;
overflow: hidden;
/* Enable transitions */
/*-webkit-transition: all .3s ease .15s;
-moz-transition: all .3s ease .15s;
-o-transition: all .3s ease .15s;
-ms-transition: all .3s ease .15s;
transition: all .3s ease .15s;*/
}
a.demo_img>div img {
padding:8px;
margin-left:4px;
border:1px solid #BCBDC0;
background-color:#BCBDC0;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
box-sizing:border-box;
}
a.demo_img:hover>div {
opacity:1;
height: 800px;
padding: 8px;
z-index:1;
}
</style>
<style>
/* gradient source: https://uigradients.com/#Wiretap */
/* decreased transparency to 80% */
.highlight {
//background-image: linear-gradient(to right, #F27121cc, #E94057cc, #8A2387cc);
border-radius: 6px;
border: 2px solid black;
padding: 3px 6px;
font-size: 68px;
}
.button {
background-color: #33FFFF;
color: black;
font-size: 18px;
border: 2px solid #4CAF50;
border-radius:12px;
}
.button:hover {
background-color: lightblue;
font-size: 18px;
color: white;
}
.HELPButton {
background-color: lightgreen;
color: black;
font-size: 18px;
border: 2px solid #4CAF50;
border-radius:12px;
}
.HELPButton:hover {
background-color: green;
font-size: 18px;
color: white;
}
.TextWrap {
float: left;
margin: 10px;
}
/* https://www.w3schools.com/cssref/tryit.asp?filename=trycss_sel_link_more2 */
a.ex2:hover, a.ex2:active {font-size: 110%;}
a.ex3:hover, a.ex3:active {font-size: 120%;}
.sansserif {
/*font-family: Arial, Helvetica, sans-serif; */
font-family: "Trebuchet MS", Helvetica, sans-serif;
}
.collapsible {
background-color: black; /*#777;*/
color: white;
cursor: pointer;
padding: 18px;
width: 65%;
border: black;
text-align: left;
outline: none;
font-size: 15px;
font-family: "Trebuchet MS", Helvetica, sans-serif;
}
/* when done, and is not collapsed, keep black */
.active:hover {
background-color: black;
}
/* hover as a grey */
.collapsible:hover {
background-color: #555;
}
/* Plus/Minus label */
.collapsible:after {
content: '\002B';
color: white;
font-weight: bold;
float: right;
margin-left: 5px;
}
/* Plus/Minus label */
.active:after {
content: "\2212";
}
/* the content off white */
.content {
padding: 0 10px; /*was 18*/
max-height: 0;
width: 60%;
overflow: hidden;
transition: max-height 0.2s ease-out;
background-color:#f1f1f1;
}
/* https://www.w3schools.com/css/css_link.asp */
/* unvisited link */
a:link {
color: blue;
}
/* visited link */
a:visited {
color: blue;
}
/* mouse over link */
a:hover {
color: blue;
}
/* selected link */
a:active {
color: blue;
}
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
a:active {
text-decoration: underline;
}
.psmall {
font-size:12px;
}
</style>
<script>
// a few to pick from
var _QRAvatarArray = [ "https://idogwatch.com/pettutor/iDogWatch.png",
"https://KnowledgeShark.me/images/snowLabyrinth.png",
"https://KnowledgeShark.me/images/labyrinthICON.jpeg",
"https://KnowledgeShark.me/images/labyrinthMT.png",
"https://KnowledgeShark.me/images/LacieICON.jpg",
"https://KnowledgeShark.me/images/MaggieICON.png",
"https://KnowledgeShark.me/images/balloonLabyrinth.jpg",
"https://KnowledgeShark.me/images/HowieICON.png",
"https://KnowledgeShark.me/images/DukeICON.png",
"https://KnowledgeShark.me/images/ScoobyICON.png" ];
//! returns TRUE if valid (or a default), false otherwise
function checkQRAvatar(avatarURLId)
{
var whichQRindex = Math.floor(Math.random() * _QRAvatarArray.length);
//var defaultURL = "https://idogwatch.com/pettutor/iDogWatch.png";
var defaultURL = _QRAvatarArray[whichQRindex];
var avatarURL = document.getElementById(avatarURLId).value;
//no avatarURL so use iDogWatch
if (!avatarURL || avatarURL.length==0)
{
if (window.confirm("A custom AvatarURL is needed to physically \ndistinguish among your new Semantic Marker\u2122 collection \n\nWould you like a random Avatar? \n\n(Reset) to try another random Avatar \n\nChange the Avatar Image Kind between Circular and Square as well"))
{
document.getElementById(avatarURLId).value = defaultURL;
return true;
}
else
{
return false;
}
}
return true;
}
//! returns TRUE if valid (or a default), false otherwise
function checkSMAddress(semanticMarkerURLId)
{
var defaultURL = "https://SemanticMarker.org/bot/smart?uuid=xg-Sd7pit29L&flow=1680481930365&flowname=MountainsON";
var semanticMarkerURL = document.getElementById(semanticMarkerURLId).value;
//no avatarURL so use iDogWatch
if (!semanticMarkerURL || semanticMarkerURL.length==0)
{
if (window.confirm("A Semantic Marker address is needed\nWould you like a default Semantic Marker to get an idea on how it works?"))
{
document.getElementById(semanticMarkerURLId).value = defaultURL;
return true;
}
else
{
return false;
}
}
return true;
}
//! just web invokes the SemanticMarker
function invokeSemanticMarker(smId)
{
if (!checkSMAddress(smId))
return;
var webAddress = document.getElementById(smId).value;
if (window.confirm("Invoke: " + webAddress + "?"))
{
// invoke this manually..
//window.open(webAddress, 'SemanticMarkerWindow');
window.open(webAddress);
}
}
</script>
<script src="https://SemanticMarker.org/SemanticMarker.js?v=1"></script>
<script>
//!create a semantic marker, and place at the idSM location
function createSemanticMarkerPath(commandPath, avatarURL, idSM, idLabel)
{
var circular = document.getElementById('boolArgValueCircular').value=="on";
//avatar URL
//var url = document.getElementById(idSemanticMarkerImageURL).value;
//no avatarURL so use iDogWatch
if (!avatarURL || avatarURL.length==0)
{
window.alert("A custom QRAvatarURL is needed to physically distinguish among your new Semantic Marker\u2122 collection");
return;
//hard wire for now..
//avatarURL = "https://idogwatch.com/pettutor/iDogWatch.png";
}
//empty the id first..
var previousSM = document.getElementById(idSM);
//Seems that the call is adding a new SM instead of cleaning it up..
document.getElementById(idSM).value = "";
//document.getElementById(idSM).html = "<p>x</p>";
document.getElementById(idSM).html = "<p >x</p>";
document.getElementById(idSM).innerHTML = "";
console.log(idSM);
console.log(document.getElementById(idSM));
//! fix bug: https://itecnote.com/tecnote/javascript-qrcode-js-error-code-length-overflow-17161056/
if (commandPath.length >= 192 && commandPath.length <= 220)
{
commandPath = commandPath + "&filler=";
// pad to greater thatn 220
var len = commandPath.length;
while (commandPath.length <= 220)
{
commandPath= commandPath + "x";
}
}
try
{
getImage(avatarURL).then
(
function (successurl)
{
var sm = new SemanticMarker(document.getElementById(idSM),
commandPath,
avatarURL,
circular);
}).catch (function (errorurl)
{
alert("Issue creating Avatar in Semantic Marker™ creation: \n" + errorurl + "\nPlease file bug report");
})
}
catch (error)
{
alert("Issue with Semantic Marker™ creation: \n" + error.message + "\nPlease file bug report");
}
//innerHTMl needed .. since a <p>
document.getElementById(idLabel).innerHTML = commandPath;
}
//!create a semantic marker, and place at the idSM location
function createSemanticMarkerPathId(commandPathId, urlId ,idSM, idLabel)
{
if (!checkSMAddress(commandPathId))
return;
var commandPath = document.getElementById(commandPathId).value;
// check the QRAvatar for null, or provide a default.
if (!checkQRAvatar(urlId))
return;
var url = document.getElementById(urlId).value;
if (!url || url.length==0)
{
//url = "https://SemanticMarker.org/images/SM-Circle-R.png";
window.alert("A custom AvatarURL is needed to physically distinguish your new Semantic Marker™ collection");
return;
}
createSemanticMarkerPath(commandPath, url ,idSM, idLabel);
}
//! grab the QRAvatar first..
//! http://www.javascriptkit.com/javatutors/javascriptpromises.shtml
function getImage(url)
{
console.log("getImage(" + url + ")");
return new Promise(function(resolve, reject)
{
var img = new Image()
img.onload = function()
{
console.log("image.onload");
resolve(url)
}
img.onerror = function()
{
reject(url)
}
img.src = url
})
}
</script>
<script>
function contactInfo()
{
if (true)
{
alert("Please email scott@konacurrents.com\nOr visit KonaCurrents.com for more information.");
}
else
{
var info1 = prompt("Please enter your email address and we will get back with you.");
var info2 = prompt("Enter your Name or other information\nAnd any interests you can specify.");
alert("Will get back with you at email: " + info1);
}
}
</script>
</head>
<body>
<h1>Kona Currents, LLC presents </h1>
<h1><span class="highlight">Semantic Marker™</span> </h1>
<h2>Innovative Optical Vision Marker Processing</h2>
<h3>Click on headings below for more information</h3>
<img src="https://SemanticMarker.org/SemanticMarker.png" width="500">
<img class="fit" width="300" src="https://SemanticMarker.org/vision/AR_SM.mov"
<br>
<!-- --------------------------------------------------------- -->
<!--BUTTON Semantic Marker Creation -->
<button class="collapsible">Create your own Semantic Marker™</button>
<div class="content">
<p class="sansserif">
<b>Semantic Marker™</b> offers 3 tiers of service, with Tier II and III requiring an account (advantages listed below.)
<ol class="sansserif">
<li type="I" class="sanserif">Simple Store and Forward
<li type="I" class="sanserif">Semantic Marker™ Indirection
<li type="I" class="sanserif">Semantic Marker™ SMART Button Management <br>(<b>SMART</b> = <b>S</b>emantic <b>M</b>arker™ <b>A</b>ugmented <b>R</b>eality of <b>T</b>hings)
</ol>
<li class="sansserif"><a class="demo_img" href="https://SemanticMarker.org/vision/Avatars.png">Photo Avatar
<div><img src="https://SemanticMarker.org/vision/Avatars.png"></div>Included with Tier I, II, III</a>
<li class="sansserif"><a class="demo_img" href="https://SemanticMarker.org/vision/WatchSM.jpg">Tier III includes Interactive Live Photo Avatar <div><img src="https://SemanticMarker.org/vision/WatchSM.jpg"></div></a>
<p class="sansserif">Create your own <b>Tier I. Semantic Marker™</b>
by providing a URL of a Photo Avatar Image and a <b>SMART Semantic Marker™</b> Address (or just click Create and defaults will be provided. Reset will let you try another.)
<br>
<div class="tooltip">
<input type="button" class="HELPButton" id="HELPButton" value="info" onClick="alert('Avatar URL customizes your Semantic Marker™ \nhelping you distinguish between your future collection')" />
<span class="tooltiptext">Avatar URL customizes your Semantic Marker</span>
</div>
<label class="label">Photo Avatar Image URL:</label>
<input name="semanticMarkerAvatarURL" id="semanticMarkerAvatarURL" size="64" type="text">
<p style="margin-left:100px; margin-right:50px;" id="finalSemanticMarkerImage"></p>
<div class="tooltip">
<input type="button" class="HELPButton" id="HELPButton" value="info"
onClick="alert('Choose a Circular or Square embedded Avatar image')" />
<span class="tooltiptext">
Choose a Circular or Square embedded Avatar image, and click 'Create' again
</span>
</div>
<label class="label" for="boolArgValueCircular">Photo Avatar Image Kind:</label>
<select class="select label" name="boolArgValueCircular" id="boolArgValueCircular">
<option value="on">Circular</option>
<option value="off">Square</option>
</select>
<br>
<div class="tooltip">
<input type="button" class="HELPButton" id="HELPButton" value="info"
onClick="checkQRAvatar('semanticMarkerAvatarURL');checkSMAddress('semanticMarkerURL')" />
<span class="tooltiptext">
Checks if your avatar address is valid
</span>
</div>
<input type="button" class="button" id="createSMAny" value="Create Semantic Marker™" onClick="createSemanticMarkerPathId('semanticMarkerURL','semanticMarkerAvatarURL','finalSemanticMarkerImage','semanticMarkerURLId')" />
<input type="button" class="button" id="resetButton" value="Reset" onClick="document.getElementById('semanticMarkerAvatarURL').value = ''; document.getElementById('semanticMarkerURL').value = '';">
<br><br>
<div class="tooltip">
<input type="button" class="HELPButton" id="HELPButton" value="info"
onClick="alert('SMART - Semantic Marker™ Augmented Reality of Things to run your IoT Devices')" />
<span class="tooltiptext">
SMART - Semantic Marker™ Augmented Reality of Things to run your IoT Devices
</span>
</div>
<label class="label">SMART Semantic Marker™ Address
</label>
<input name="semanticMarkerURL" id="semanticMarkerURL" size="84" type="text">
<br>
<p class="sansserif" id="semanticMarkerURLId">Example: https://SemanticMarker.org</p>
<div class="tooltip">
<input type="button" class="HELPButton" id="HELPButton" value="info"
onClick="alert('Display the special SMART Semantic Marker ™ in a new window')" />
<span class="tooltiptext">
Display the special SMART Semantic Marker ™ in a new window
</span>
</div>
<input type="button" class="button" id="buttonRunFlow" value="Run Semantic Marker™ in New Window" onClick="invokeSemanticMarker('semanticMarkerURL')" />
<br>
<br>
<br>
<input type="button" class="button" value="Contact Kona Currents, LLC to request Tier II and III accounts" onClick="contactInfo()" />
<br>
<br>
</div>
<!----------------------------------------------->
<!-- END of user content -->
<script>
function toggleCol(whichElement, num)
{
// try to have the first one open..
whichElement.classList.toggle("active");
var contentX = whichElement.nextElementSibling;
if (contentX.style.maxHeight)
{
contentX.style.maxHeight = null;
}
else
{
contentX.style.maxHeight = contentX.scrollHeight + "px";
}
if (num == -1)
{
console.log("sc = " + contentX.scrollHeight);
var x = contentX.scrollHeight + 50;
contentX.style.maxHeight = x + "px";
}
console.log("Max = " + contentX.style.maxHeight);
}
//! @see https://stackoverflow.com/questions/68425366/toggle-active-class-to-buttons-when-clicked
var coll = document.getElementsByClassName("collapsible");
var i;
for (i = 0; i < coll.length; i++)
{
coll[i].addEventListener("click", function()
{
toggleCol(this, i);
});
}
// try to have the first one open..
//toggleCol(coll[0], -1);
</script>
<br>
<br>
<a href="https://KnowledgeShark.me/images/KCNewLabel600-small.png"><img src="https://KnowledgeShark.me/images/KCNewLabel600-small.png" width="800"></a>
<p class="sansserif">© 2023 <a class="ex3" href="https://KonaCurrents.com">KonaCurrents.com</a>
<i class="sansserif">and powered by <a class="ex3" href="https://KnowledgeShark.me" target=_blank>KnowledgeShark.me</a></i>
<br>
<!-- heading to GeekWire in Seattle -->
v10.20-2.23