Skip to content

A cross platform Audiobookshelf client for Android and iOS

Dart
4.9 KB
Raw Blame
<!DOCTYPE html>
<html>
<head>
  <!--
    If you are serving your web app in a path other than the root, change the
    href value below to reflect the base path you are serving from.

    The path provided below has to start and end with a slash "/" in order for
    it to work correctly.

    For more details:
    * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base

    This is a placeholder for base href that will be replaced by the value of
    the `--base-href` argument provided to `flutter build`.
  -->
  <base href="$FLUTTER_BASE_HREF">

  <meta charset="UTF-8">
  <meta content="IE=Edge" http-equiv="X-UA-Compatible">
  <meta name="description" content="Listen to your Audiobookshelf library with Absorb.">
  <meta name="theme-color" content="#111318">

  <!-- iOS meta tags & icons -->
  <meta name="mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="apple-mobile-web-app-title" content="Absorb">
  <link rel="apple-touch-icon" href="assets/assets/icon/app_icon.png">

  <!-- Favicon -->
  <link rel="icon" type="image/png" href="assets/assets/icon/app_icon.png"/>

  <title>Absorb</title>
  <link rel="manifest" href="manifest.json">
  <style>
    html,
    body {
      width: 100%;
      height: 100%;
    }

    body {
      margin: 0;
      background: #111318;
    }

    #absorb-loading {
      position: fixed;
      inset: 0;
      z-index: 9999;
      display: grid;
      place-items: center;
      color: #e3e2e9;
      background: #111318;
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }

    .absorb-loading-content {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 22px;
    }

    .absorb-loading-wordmark {
      color: #c4c5ce;
      font-size: 13px;
      font-weight: 300;
      letter-spacing: 8px;
      transform: translateX(4px);
    }

    .absorb-loading-spinner {
      width: 24px;
      height: 24px;
      border: 2px solid rgba(196, 197, 206, 0.2);
      border-top-color: #bdc2ff;
      border-radius: 50%;
      animation: absorb-spin 0.8s linear infinite;
    }

    .absorb-loading-label {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }

    .absorb-loading-help {
      display: none;
      max-width: 320px;
      color: #c4c5ce;
      font-size: 14px;
      line-height: 1.5;
      text-align: center;
    }

    .absorb-loading-retry {
      padding: 9px 18px;
      border: 0;
      border-radius: 999px;
      color: #202044;
      background: #bdc2ff;
      font: inherit;
      font-weight: 650;
      cursor: pointer;
    }

    #absorb-loading.is-stalled .absorb-loading-spinner {
      display: none;
    }

    #absorb-loading.is-stalled .absorb-loading-help {
      display: block;
    }

    @keyframes absorb-spin {
      to { transform: rotate(360deg); }
    }

    @media (prefers-reduced-motion: reduce) {
      .absorb-loading-spinner { animation: none; }
    }
  </style>
</head>
<body>
  <div id="absorb-loading" role="status" aria-live="polite">
    <div class="absorb-loading-content">
      <div class="absorb-loading-wordmark" aria-hidden="true">A B S O R B</div>
      <div class="absorb-loading-spinner" aria-hidden="true"></div>
      <span class="absorb-loading-label">Loading Absorb</span>
      <div class="absorb-loading-help">
        <p>Absorb couldn’t finish loading. The server may still be starting.</p>
        <button class="absorb-loading-retry" type="button">Reload</button>
      </div>
    </div>
  </div>
  <script>
    const loadingShell = document.getElementById('absorb-loading');
    const loadingLabel = loadingShell?.querySelector('.absorb-loading-label');
    const stalledTimer = window.setTimeout(() => {
      loadingShell?.classList.add('is-stalled');
      if (loadingLabel) loadingLabel.textContent = 'Absorb could not finish loading';
    }, 45000);

    loadingShell?.querySelector('.absorb-loading-retry')?.addEventListener('click', () => {
      window.location.reload();
    });

    window.addEventListener('error', (event) => {
      if (event.target instanceof HTMLScriptElement) {
        loadingShell?.classList.add('is-stalled');
        if (loadingLabel) loadingLabel.textContent = 'Absorb could not finish loading';
      }
    }, true);

    window.addEventListener('flutter-first-frame', () => {
      window.clearTimeout(stalledTimer);
      loadingShell?.remove();
    }, {once: true});
  </script>
  <!--
    You can customize the "flutter_bootstrap.js" script.
    This is useful to provide a custom configuration to the Flutter loader
    or to give the user feedback during the initialization process.

    For more details:
    * https://docs.flutter.dev/platform-integration/web/initialization
  -->
  <script src="flutter_bootstrap.js" async></script>
</body>
</html>