-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
58 lines (47 loc) · 1.51 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Through Cells</title>
<meta name="description" content="Through Cells">
<link rel="icon" sizes="any" href="./favicon.ico">
<link rel="icon" type="image/svg+xml" href="./favicon.svg">
<link rel="apple-touch-icon" href="./apple-touch-icon.png">
<meta name="theme-color" content="#f4f1ff">
</head>
<body style="
margin: 0;
background-color: #0a000d;
color: white;
touch-action: manipulation;
">
<div id="root"></div>
<script type="module">
import "@rauschma/iterator-helpers-polyfill/install";
import { createRoot } from "react-dom/client";
import { createElement } from "react";
import { RecoilRoot } from "recoil";
import { App } from "./src/app/App";
// import { Xyz } from "./src/blah/Xyz";
const SearchComponent = (() => {
const s = new URLSearchParams(location.search);
// if (s.has("Xyz")) { return Xyz; }
})() ?? App;
const Component =
(import.meta.env.DEV && await (async () => {
const path = document.location.pathname;
if (path === "/") { return; }
const name = path.substring(path.lastIndexOf("/") + 1);
console.log(path, name);
if (!name) { return; }
return (await import(/* @vite-ignore */"./src" + path))[name];
})()) || SearchComponent;
createRoot(document.getElementById("root")).render(
createElement(RecoilRoot, null,
createElement(Component, { standalone: true })
),
);
</script>
</body>
</html>