-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathexample.html
39 lines (39 loc) · 1.09 KB
/
example.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
<html>
<head>
<title>Improv BLE Example</title>
<style>
@media (prefers-color-scheme: dark) {
body {
background-color: #333;
color: #fff;
}
a {
color: #58a6ff;
}
}
</style>
</head>
<body>
<p>Default button:</p>
<improv-wifi-launch-button></improv-wifi-launch-button>
<p>Custom launch button:</p>
<improv-wifi-launch-button>
<a href="#" slot="activate">Launch improv</a>
</improv-wifi-launch-button>
<p>Custom message if unsupported:</p>
<improv-wifi-launch-button>
<span slot="unsupported">⚠️ Browser set-up not supported</span>
</improv-wifi-launch-button>
<p>Events:</p>
<pre id="events"></pre>
<script src="./dist/web/launch-button.js" type="module"></script>
<script>
document.querySelectorAll("improv-wifi-launch-button").forEach((button) =>
button.addEventListener("state-changed", (ev) => {
document.querySelector("pre").innerText +=
JSON.stringify(ev.detail) + "\n";
})
);
</script>
</body>
</html>