Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

11.5 KB
Raw Blame
<!--
╔═══════════════════════════════════════════════════════════════════════════╗
║                                                                           ║
║                           @@@@@@@@@@@@                                    ║
║                         @@@@@@@@@@@@@@@@@@@@@@@@@                         ║
║                       @@@@@@@@@@@@@@@@@@@@@@@@@@@@@                       ║
║                       @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                      ║
║                      @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                     ║
║                       @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                     ║
║                    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                     ║
║                  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                   ║
║                 @@@@@@@@@                      @@@@@@@@@                  ║
║                 @@@@@@                            @@@@@@                  ║
║                 @@@@@    @@@@  @@@@  @@@@  @@@@    @@@@@                  ║
║                 @@@@@    @@@@  @@@@  @@@@  @@@@    @@@@@                  ║
║                 @@@@@@                            @@@@@@                  ║
║                  @@@@@@@                        @@@@@@@                   ║
║                   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                    ║
║                      @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                       ║
║                                                                           ║
║                 _    _ _           __      __         _ _                 ║
║                / \  | (_) __ _ ___ \ \    / /_ _ _   _| | |_              ║
║               / _ \ | | |/ _` / __| \ \/\/ / _` | | | | | __|             ║
║              / ___ \| | | (_| \__ \  \  / / (_| | |_| | | |_              ║
║             /_/   \_\_|_|\__,_|___/   \/  \__,__|\__,_|_|\__|             ║
║                                                                           ║
║                AliasVault - Privacy-first password manager                ║
║             https://github.com/aliasvault/aliasvault | AGPLv3             ║
║                                                                           ║
║           Found a security issue? Please report it responsibly:           ║
║    [email protected] | github.com/aliasvault/aliasvault/security    ║
╚═══════════════════════════════════════════════════════════════════════════╝
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<title>AliasVault</title>
<link rel="icon" type="image/png" href="/favicon.png" />
<link rel="apple-touch-icon" sizes="500x500" href="/img/icon-500.png" />
<link rel="apple-touch-icon" sizes="192x192" href="/img/icon-192.png" />
<link rel="stylesheet" href="/src/style.css" />
<script>
  (function () {
    var theme = localStorage.getItem('color-theme');
    if (theme === 'dark' || (!theme && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
      document.documentElement.classList.add('dark');
    }
  })();
  window.addEventListener('error', function (event) {
    if (event.target && event.target.tagName === 'SCRIPT') {
      window.appLoadFailed = true;
      if (window.showAppLoadError) { window.showAppLoadError(); }
    }
  }, true);
</script>
<style>
  body { background-color: #f3f4f6; }
  html.dark body { background-color: #111827; }
  .index-aliasvault-inline-spinner { height: 51px; width: 112px; display: flex; justify-content: center; align-items: center; }
  .index-cloud-shape-inline { border: 6px solid #eabf69; border-radius: 9999px; padding: 13px 26px; display: flex; gap: 10px; align-items: center; background-color: transparent; box-shadow: 0 0 4px 2px rgba(0, 0, 0, 0.1); }
  .index-dot-inline { width: 10px; height: 10px; border-radius: 9999px; background-color: #eabf69; animation: index-pulse-inverted 1.4s infinite ease-in-out; }
  .index-delay-1 { animation-delay: 0s; }
  .index-delay-2 { animation-delay: 0.2s; }
  .index-delay-3 { animation-delay: 0.4s; }
  .index-delay-4 { animation-delay: 0.6s; }
  @keyframes index-pulse-inverted { 0%, 100% { opacity: 0.3; transform: scale(1); } 50% { opacity: 1; transform: scale(1.3); } }
</style>
</head>
<body class="bg-gray-100 dark:bg-gray-900" av-disable="true">
<div id="loading-screen">
  <div class="fixed inset-0 flex items-center justify-center px-6 pt-8 pb-8">
    <div class="w-full max-w-md space-y-4">
      <div class="p-6 sm:p-8 bg-white rounded-lg shadow dark:bg-gray-800">
        <div class="text-center">
          <div class="inner">
            <div class="index-aliasvault-inline-spinner mx-auto">
              <div class="index-cloud-shape-inline">
                <div class="index-dot-inline index-delay-1"></div>
                <div class="index-dot-inline index-delay-2"></div>
                <div class="index-dot-inline index-delay-3"></div>
                <div class="index-dot-inline index-delay-4"></div>
              </div>
            </div>
            <h2 id="loading-title" class="mt-4 text-xl font-semibold text-gray-900 dark:text-white">AliasVault is loading</h2>
            <p id="loading-message" class="mt-2 text-sm text-gray-500 dark:text-gray-400">Initializing secure environment. AliasVault prioritizes your privacy by running entirely in your browser. The first load might take a short while.</p>
            <div id="loading-progress-text" class="text-sm font-medium text-gray-700 dark:text-gray-300 mt-4"></div>
            <div class="mt-4 text-center">
              <p id="security-quote" class="text-sm text-primary-600 italic"></p>
            </div>
            <div id="error-message" class="hidden text-red-600 dark:text-red-400 mt-4"></div>
          </div>
        </div>
      </div>
      <div id="refresh-button" class="text-center w-full mt-4 p-6 sm:p-8 bg-white rounded-lg shadow dark:bg-gray-800 hidden">
        <p id="refresh-text" class="text-sm text-gray-600 dark:text-gray-400 mb-2">If loading seems stuck, you can click the button below to refresh the page.</p>
        <a href="javascript:window.location.reload(true)" class="inline-block px-4 py-2 bg-primary-600 text-white text-sm font-medium rounded-md hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 transition duration-150 ease-in-out"><span id="refresh-button-text">Refresh Page</span></a>
      </div>
    </div>
  </div>
</div>
<div id="app"></div>
<script>
  var translations = (function () {
    var all = {};
    try {
      all = JSON.parse(document.getElementById('loading-screen-translations').textContent);
    } catch (error) {
      console.warn('Failed to read the loading screen translations, using fallback strings:', error);
    }
    var stored = localStorage.getItem('AppLanguage');
    var browserLang = (navigator.language || '').split('-')[0];
    return all[stored] || all[browserLang] || all.en || {};
  })();
  function getTranslation(path) {
    var keys = path.split('.');
    var value = translations;
    for (var i = 0; i < keys.length; i++) {
      value = value ? value[keys[i]] : undefined;
      if (!value) { break; }
    }
    return value || '';
  }
  function localizeContent() {
    var localizations = [
      { id: 'loading-title', key: 'loading.title' },
      { id: 'loading-message', key: 'loading.message' },
      { id: 'refresh-text', key: 'loading.refreshText' },
      { id: 'refresh-button-text', key: 'loading.refreshButtonText' }
    ];
    localizations.forEach(function (entry) {
      var element = document.getElementById(entry.id);
      var text = getTranslation(entry.key);
      if (element && text) { element.textContent = text; }
    });
    var quoteSource = getTranslation('quotes.security') || {};
    var securityQuotes = Array.isArray(quoteSource) ? quoteSource : Object.keys(quoteSource).map(function (key) { return quoteSource[key]; });
    if (securityQuotes.length > 0) {
      var quoteElement = document.getElementById('security-quote');
      var randomIndex = Math.floor(Math.random() * securityQuotes.length);
      if (quoteElement) { quoteElement.textContent = '"' + securityQuotes[randomIndex] + '"'; }
    }
  }
  var minDisplayTime = 400;
  (function () {
    var progressElement = document.getElementById('loading-progress-text');
    var downloadPercent = 0;
    var hasProgress = false;
    function render() {
      var timePercent = Math.min(100, performance.now() / minDisplayTime * 100);
      var shown = Math.floor(Math.min(downloadPercent, timePercent));
      progressElement.textContent = shown + '%';
      if (shown < 100) { requestAnimationFrame(render); }
    }
    function onProgress(loaded, total) {
      if (!progressElement || !total) { return; }
      downloadPercent = Math.min(100, loaded / total * 100);
      if (!hasProgress) {
        hasProgress = true;
        requestAnimationFrame(render);
      }
    }
    window.__onLoadingProgress = onProgress;
    if (window.__loadingProgress) { onProgress(window.__loadingProgress.loaded, window.__loadingProgress.total); }
  })();
  var loadingScreen = document.getElementById('loading-screen');
  var errorMessageElement = document.getElementById('error-message');
  var refreshButton = document.getElementById('refresh-button');
  var webAssemblySupported = 'WebAssembly' in window;
  function showError(message) {
    if (errorMessageElement) {
      errorMessageElement.textContent = message;
      errorMessageElement.classList.remove('hidden');
    }
    refreshButton.classList.remove('hidden');
  }
  window.showAppLoadError = function () {
    showError(getTranslation('errors.unhandledError'));
  };
  if (window.appLoadFailed) {
    window.showAppLoadError();
  }
  if (!webAssemblySupported) {
    showError(getTranslation('errors.webAssemblyError'));
  }
  function manageLoadingScreen() {
    var startTime = new Date().getTime();
    var checkInterval = 200;
    var refreshButtonTimeout = 20000;
    var appElement = document.getElementById('app');
    appElement.style.visibility = 'hidden';
    loadingScreen.style.display = 'flex';
    setTimeout(function () { refreshButton.classList.remove('hidden'); }, refreshButtonTimeout);
    if (!webAssemblySupported) {
      return;
    }
    var intervalId = setInterval(function () {
      var elapsedTime = new Date().getTime() - startTime;
      var hasContent = appElement.innerHTML.trim() !== '';
      if (elapsedTime >= minDisplayTime && hasContent) {
        loadingScreen.style.display = 'none';
        appElement.style.removeProperty('visibility');
        clearInterval(intervalId);
      }
    }, checkInterval);
  }
  function handleWebAssemblyError(errorMessage) {
    if (String(errorMessage).indexOf('WebAssembly') !== -1) {
      showError(getTranslation('errors.webAssemblyError'));
    }
  }
  window.addEventListener('error', function (event) {
    handleWebAssemblyError((event.error && event.error.message) || event.message || '');
  });
  window.addEventListener('unhandledrejection', function (event) {
    handleWebAssemblyError((event.reason && event.reason.message) || event.reason || '');
  });
  localizeContent();
  window.addEventListener('load', manageLoadingScreen);
</script>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>