index.html

4.4 KB · raw

1<!DOCTYPE html>2<html lang="en">3  <head>4    <meta charset="UTF-8" />5    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />6    <link7      rel="preload"8      href="/fonts/CormorantGaramond-LightItalic.woff2"9      as="font"10      type="font/woff2"11      crossorigin12    />13    <link14      rel="preload"15      href="/fonts/IBMPlexMono-Light.woff2"16      as="font"17      type="font/woff2"18      crossorigin19    />20    <link rel="stylesheet" href="./styles/vars.css" />21    <link rel="stylesheet" href="./styles/popup.css" />22    <title>Peach</title>23  </head>24  <body>25<script>26(function() {27  // Capacitor shim: provides chrome.* APIs using Capacitor Plugins28  // so the mobile build works without a background service worker.29  if (!window.chrome) {30    window.chrome = {};31  }32  var _capStorage = null;33  function getCapStorage() {34    if (!_capStorage) {35      _capStorage = {36        _data: {},37        get: function(keys, cb) {38          var result = {};39          var keyArray = Array.isArray(keys) ? keys : [keys];40          var found = false;41          for (var i = 0; i < keyArray.length; i++) {42            var k = keyArray[i];43            if (this._data[k] !== undefined) {44              result[k] = this._data[k];45              found = true;46            }47          }48          cb(found ? result : {});49        },50        set: function(items, cb) {51          for (var k in items) {52            this._data[k] = items[k];53          }54          if (cb) cb();55        },56        remove: function(keys, cb) {57          var keyArray = Array.isArray(keys) ? keys : [keys];58          for (var i = 0; i < keyArray.length;i++) {59            delete this._data[keyArray[i]];60          }61          if (cb) cb();62        },63        clear: function(cb) {64          this._data = {};65          if (cb) cb();66        }67      };68    }69    return _capStorage;70  }71  chrome.storage = {72    local: {73      get: function(k,c){ getCapStorage().get(k, c||function(){}); },74      set: function(i,c){ getCapStorage().set(i, c||function(){}); },75      remove: function(k,c){ getCapStorage().remove(k, c||function(){}); },76      clear: function(c){ getCapStorage().clear(c||function(){}); }77    },78    session: {79      get: function(k,c){ getCapStorage().get(k, c||function(){}); },80      set: function(i,c){ getCapStorage().set(i, c||function(){}); },81      remove: function(k,c){ getCapStorage().remove(k, c||function(){}); }82    },83    onChanged: {84      addListener: function(){},85      removeListener: function(){}86    }87  };88  chrome.runtime = {89    sendMessage: function(msg, cb) {90      // Stub: messages go nowhere on mobile without SW91      if (cb) cb({ ok: false, error: "NO_SERVICE_WORKER" });92    },93    onMessage: { addListener: function(){}, removeListener: function(){} },94    connect: function() { return { disconnect: function(){} }; },95    lastError: null96  };97})();98</script>99    <div id="pre-lock">100      <section class="peach-screen peach-theme peach-screen-prelock">101        <div class="peach-screen-header">102          <span class="peach-wordmark-wrap">103            <svg class="peach-brand-mark" width="14" height="14" viewBox="0 0 64 64" fill="none" aria-hidden="true">104              <path d="M32 54C16 54 8 44 8 31C8 18 17 10 27 10C28 7 30 5.5 32 5.5C34 5.5 36 7 37 10C47 10 56 18 56 31C56 44 48 54 32 54Z" fill="#D96830"></path>105              <path d="M37 8.5C40.5 3.5 48 5 46 10.5C42 11 37 8.5 37 8.5Z" fill="#7B9060"></path>106              <path d="M32 5.5Q35.5 1 39 2.5" stroke="#7B9060" stroke-width="1.5" stroke-linecap="round"></path>107            </svg>108            <span class="peach-status-pip is-hidden"></span>109            <span class="peach-wordmark">peach</span>110          </span>111        </div>112        <h1 class="peach-unlock-headline">113          welcome114          <br />115          back.116        </h1>117        <p class="peach-subline">your vault is waiting</p>118        <div class="prelock-form">119          <input120            type="password"121            class="peach-underline-input peach-unlock-input"122            placeholder="master password"123            autocomplete="current-password"124          />125          <button class="peach-btn peach-btn--accent peach-btn--md peach-lock-submit">126            unlock127          </button>128        </div>129      </section>130    </div>131    <div id="app"></div>132    <script type="module" src="./index.tsx"></script>133  </body>134</html>