-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathexplorer.html
61 lines (58 loc) · 2.05 KB
/
explorer.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="fonts/open-sans-400-700.css" />
<link rel="stylesheet" href="assets/css/toasty.css" />
<script src="assets/js/clipboard.min.js"></script>
<!-- config.js contains deployer-specified configuration -->
<script type="text/javascript" src="config.js"></script>
<link rel="icon" type="image/svg+xml" href="assets/img/logo-alt.svg" />
<title>Design System Explorer</title>
<link
rel="stylesheet"
type="text/css"
href="assets/css/elm-ui-explorer.css"
/>
<link
rel="stylesheet"
type="text/css"
href="assets/css/github-markdown.min.css"
/>
</head>
<body class="overflow-hidden">
<div id="root"></div>
<script src="explorer.js"></script>
<script type="text/javascript">
var app = Elm.DesignSystem.Explorer.init({
node: document.getElementById("root"),
flags: config,
});
// Fired when the browser has lost access to the network.
window.addEventListener("offline", (event) => {
app.ports.updateNetworkConnectivity.send(false);
});
window.addEventListener("online", (event) => {
app.ports.updateNetworkConnectivity.send(true);
});
// Subscribe to color mode changes so that we can update markdown css.
app.ports.onModeChanged.subscribe(function (mode) {
const darkLink = document.getElementById("uie-dark-theme");
if (darkLink) {
darkLink.remove();
}
if (mode === "Dark") {
const link = document.createElement("link");
const head = document.getElementsByTagName("head")[0];
link.rel = "stylesheet";
link.href = "assets/css/markdown-plus-themes.css";
link.id = "uie-dark-theme";
link.type = "text/css";
head.appendChild(link);
}
});
</script>
</body>
</html>