aboutsummaryrefslogtreecommitdiff
path: root/src/content/index.ts
blob: 82f3a4cc6fa4ceefb905fe5a18ee1348508db5a8 (plain) (blame)
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
import "reflect-metadata";

import Application from "./Application";
import Bootstrap from "./Bootstrap";
import consoleFrameStyle from "./site-style";
import { container } from "tsyringe";
import "./di";

const initDom = () => {
  (async () => {
    try {
      const app = container.resolve(Application);
      await app.init();
    } catch (e) {
      console.error(e);
    }
  })();

  const style = window.document.createElement("style");
  style.textContent = consoleFrameStyle;
  window.document.head.appendChild(style);
};

const bootstrap = new Bootstrap();
if (bootstrap.isReady()) {
  initDom();
} else {
  bootstrap.waitForReady(() => initDom());
}