summaryrefslogtreecommitdiff
path: root/src/index.jsx
blob: 6c58df3f8a6d09f4f8f00fe0a8db3d6b22ca9a2c (plain)
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
import * as React from "react";
import { createRoot } from "react-dom/client";
import { requestAudioContext, randrange } from "./lib/util";

import App from "./ui/App.jsx";

document.body.style.backgroundColor = "#111";
document.body.style.color = "#fff";
document.body.style.margin = 0;
document.body.style.padding = 0;
document.body.style.height = "100%";
document.body.style.width = "100%";
document.body.style.fontFamily = "Helvetica, Arial";
document.body.parentNode.style.margin = 0;
document.body.parentNode.style.padding = 0;
document.body.parentNode.style.height = "100%";
document.body.parentNode.style.width = "100%";

requestAudioContext(() => {
  const container = document.createElement("div");
  container.style.height = "100%";
  container.style.width = "100%";
  document.body.innerHTML = "";
  document.body.appendChild(container);
  const root = createRoot(container);
  root.render(<App />);
});