forked from GoogleChromeLabs/wasm-feature-detect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
website.ejs
111 lines (107 loc) · 2.16 KB
/
website.ejs
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
<!DOCTYPE html>
<title>Wasm Feature Detect</title>
<meta charset="utf-8" />
<link
href="https://fonts.googleapis.com/css?family=Roboto&display=swap"
rel="stylesheet"
/>
<style>
:root {
--tint: 30;
--contrast: 70;
--saturation: 10%;
--padding: 4em;
}
html {
background: hsl(
var(--tint),
var(--saturation),
calc(50% + var(--contrast) / 2)
);
color: hsl(var(--tint), var(--saturation), calc(50% - var(--contrast) / 2));
font-family: "Roboto", sans-serif;
font-size: 18px;
}
body {
max-width: 960px;
margin: 0 auto;
padding: 4em;
box-sizing: border-box;
}
pre, table {
margin: 0 -4em;
padding: 0 4em;
overflow-x: auto;
}
section {
margin: 4em 0;
}
#supporttable {
margin: 0 auto;
}
.marker {
padding: 0 0.5em;
}
tr {
height: 2em;
}
tr:nth-of-type(odd) {
background-color: hsla(0, 0%, 0%, 0.04);
}
.not-supported .marker {
color: hsl(10, 80%, 40%);
}
.supported .marker {
color: hsl(100, 80%, 50%);
}
header {
font-size: 1.5rem;
}
footer {
font-size: 0.8rem;
text-align: right;
}
</style>
<header>
Wasm feature detect —
<a
href="https://npm.im/wasm-feature-detect"
rel="noopener noreferrer"
target="_blank"
>npm.im/wasm-feature-detect</a
>
</header>
<section>
<h1>Your browser supports:</h1>
<table id="supporttable" cellspacing="0"></table>
</section>
<script type="module">
import * as ft from "./wasm-feature-detect.js";
async function generate() {
let acc = "";
for (const [name, detector] of Object.entries(ft)) {
const supported = await detector();
acc += `
<tr class="${supported ? "supported" : "not-supported"}">
<td class="marker">${supported ? "✔️" : "❌"}</td>
<td class="name">${name}</td>
</tr>
`;
}
const table = document.querySelector("#supporttable");
table.innerHTML = `<tbody>${acc}</tbody>`;
}
generate();
</script>
<section>
<%- readme %>
</section>
<footer>
Made with 💻 by
<a
href="https://twitter.com/dassurma"
rel="noopener noreferrer"
target="_blank"
>Surma</a
>
</footer>