Skip to content

Self-improving AI Employees for everyone

2.7 KB
Raw Blame
<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/svg+xml" href="/opencompany-icon.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <!--
      Pre-paint theme. Applies the stored theme to <html> before the first
      paint so a light-theme user never sees a dark flash while the bundle
      loads. Read-only: ThemeProvider (src/contexts/ThemeContext.tsx) owns
      the key migrations and every later write. The two theme lists must
      match AVAILABLE_THEMES and DARK_FAMILY there; the
      contexts/__tests__/themePrePaint.test.ts test enforces it.
    -->
    <script>
      (function () {
        var THEMES = ['light', 'dark', 'atomic'];
        var DARK_FAMILY = ['dark'];
        var theme = 'dark';
        try {
          var stored = localStorage.getItem('opencompany-theme');
          if (stored === null) stored = localStorage.getItem('machinaos-theme');
          if (stored !== null && THEMES.indexOf(stored) !== -1) {
            theme = stored;
          } else {
            var legacy = localStorage.getItem('darkMode');
            if (legacy !== null) theme = legacy === 'false' ? 'light' : 'dark';
          }
        } catch (e) {
          // Storage blocked by browser policy: keep the default.
        }
        var html = document.documentElement;
        html.setAttribute('data-theme', theme);
        if (DARK_FAMILY.indexOf(theme) !== -1) html.classList.add('dark');
      })();
    </script>
    <!--
      Theme typography. Each theme picks its display + body + mono via
      the --font-display / --font-body / --font-mono tokens. Light and
      dark use Geist (@fontsource-variable/geist, bundled at build time)
      and the system mono. Loading Atomic's fonts as `media="print"
      onload=...` defers the network cost, so light and dark render
      without blocking and Atomic's fonts swap in once their stylesheet
      lands.

      Atomic: Bevan (display), Lato (body), Space Mono (mono).
    -->
    <link rel="preconnect" href="https://fonts.googleapis.com" />
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
    <link
      rel="stylesheet"
      href="https://fonts.googleapis.com/css2?family=Bevan&family=Lato:wght@400;700&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap"
      media="print"
      onload="this.media='all'"
    />
    <noscript>
      <link
        rel="stylesheet"
        href="https://fonts.googleapis.com/css2?family=Bevan&family=Lato:wght@400;700&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap"
      />
    </noscript>
    <title>OpenCompany</title>
  </head>
  <body>
    <div id="root"></div>
    <script type="module" src="/src/main.tsx"></script>
  </body>
</html>