-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
105 lines (99 loc) · 3.16 KB
/
index.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
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>Mobility Web Component</title>
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<meta
name="viewport"
content="initial-scale=1,maximum-scale=1,user-scalable=no"
/>
<script type="text/javascript">
if (/localhost/.test(window.location.hostname)) {
new EventSource("/esbuild").addEventListener("change", () => {
location.reload();
});
}
</script>
<script type="module" src="./index.js"></script>
<script src="./docutils.js"></script>
<link rel="stylesheet" type="text/css" href="./output.css" />
<style>
::-webkit-scrollbar {
width: 3px;
height: 3px;
}
a {
text-decoration: underline;
}
</style>
</head>
<body class="p-8">
<!-- tailwind hack to add class used in docutils -->
<div class="border px-4 py-2 table-auto w-full flex gap-4 p-2 bg-black text-white hover:bg-gray-700" style="display:none;"></div>
<div id="doc" style="display: none" class="mx-auto max-w-3xl space-y-4">
<h1 class="text-3xl font-bold">Mobility Web Component</h1>
<p>This is a demo of the Mobility Web Component.</p>
<h2 class="text-xl font-bold">Usage example</h2>
<pre id="code" class="bg-slate-800 text-slate-200 p-4 rounded"></pre>
<geops-mobility
class="max-w-3xl h-96 block resize overflow-auto"
></geops-mobility>
<br />
<h2 class="text-xl font-bold">Attributes</h2>
<div id="attributes"></div>
<h2 class="text-xl font-bold">Events</h2>
<div id="events"></div>
<br />
<br />
<h1 class="text-xl font-bold">More mobility web components</h1>
<p>
<a href="search.html" target="_blank"
>>> Usage example Search Component</a
>
</p>
</div>
<br />
<br />
<script type="text/javascript">
const pkgSrc = "https://www.unpkg.com/@geops/mobility-web-component";
const wc = document.querySelector("geops-mobility");
const attrs = [
"apikey",
"baselayer",
"center",
"geolocation",
"mapsurl",
"mots",
"notification",
"notificationat",
"notificationurl",
"notificationbeforelayerid",
"realtime",
"realtimeUrl",
"search",
"tenant",
"zoom",
"permalink",
];
const booleanAttrs = [
"geolocation",
"notification",
"realtime",
"search",
"permalink",
];
const events = [
"mwc:stopssearchselect",
"mwc:attribute",
];
document.querySelector('#attributes').innerHTML = generateAttributesTable(wc, attrs, booleanAttrs);
document.querySelector('#events').innerHTML = generateEventsTable(wc, events);
document.querySelector('#code').innerHTML = generateCodeText(wc, attrs, pkgSrc);
wc.addEventListener('mwc:attribute', (event) => {
document.querySelector('#code').innerHTML = generateCodeText(wc, attrs, pkgSrc);
});
applyPermalinkParameters(wc);
</script>
</body>
</html>