← back to Govarbitrage

extension/popup.html

199 lines

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>GovArbitrage Capture</title>
    <style>
      :root {
        --bg: #0f141a;
        --panel: #161d26;
        --panel-2: #1d2733;
        --border: #2a3644;
        --text: #e6edf3;
        --muted: #8b98a5;
        --accent: #3fb950;
        --accent-hover: #2ea043;
        --blue: #388bfd;
        --blue-hover: #2f7ce0;
        --danger: #f85149;
      }
      * {
        box-sizing: border-box;
      }
      html,
      body {
        margin: 0;
        padding: 0;
      }
      body {
        width: 400px;
        background: var(--bg);
        color: var(--text);
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
        font-size: 13px;
        line-height: 1.45;
      }
      .wrap {
        padding: 14px;
      }
      h1 {
        font-size: 15px;
        font-weight: 600;
        margin: 0 0 12px;
        display: flex;
        align-items: center;
        gap: 8px;
      }
      h1 .dot {
        width: 9px;
        height: 9px;
        border-radius: 50%;
        background: var(--accent);
        display: inline-block;
      }
      label {
        display: block;
        font-size: 11px;
        color: var(--muted);
        margin: 0 0 4px;
        text-transform: uppercase;
        letter-spacing: 0.04em;
      }
      input[type="text"] {
        width: 100%;
        padding: 7px 9px;
        background: var(--panel-2);
        border: 1px solid var(--border);
        border-radius: 6px;
        color: var(--text);
        font-size: 13px;
        outline: none;
      }
      input[type="text"]:focus {
        border-color: var(--blue);
      }
      .field {
        margin-bottom: 12px;
      }
      .row {
        display: flex;
        gap: 8px;
      }
      button {
        flex: 1;
        padding: 9px 10px;
        border: 1px solid var(--border);
        border-radius: 6px;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
        color: var(--text);
        background: var(--panel-2);
        transition: background 0.12s ease, border-color 0.12s ease;
      }
      button:hover {
        background: #26313d;
      }
      button:disabled {
        opacity: 0.5;
        cursor: not-allowed;
      }
      button.primary {
        background: var(--accent);
        border-color: var(--accent);
        color: #05130a;
      }
      button.primary:hover {
        background: var(--accent-hover);
      }
      button.send {
        background: var(--blue);
        border-color: var(--blue);
        color: #04101f;
      }
      button.send:hover {
        background: var(--blue-hover);
      }
      .preview-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin: 14px 0 6px;
      }
      .preview-head label {
        margin: 0;
      }
      .summary {
        font-size: 11px;
        color: var(--muted);
      }
      pre#preview {
        background: var(--panel);
        border: 1px solid var(--border);
        border-radius: 6px;
        padding: 10px;
        margin: 0;
        max-height: 240px;
        overflow: auto;
        font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
        font-size: 11px;
        white-space: pre-wrap;
        word-break: break-word;
        color: #c8d3de;
      }
      pre#preview:empty::before {
        content: "No capture yet — click “Capture this page”.";
        color: var(--muted);
      }
      #status {
        margin-top: 10px;
        min-height: 16px;
        font-size: 12px;
      }
      #status.ok {
        color: var(--accent);
      }
      #status.err {
        color: var(--danger);
      }
      #status.info {
        color: var(--muted);
      }
      .spacer {
        height: 8px;
      }
    </style>
  </head>
  <body>
    <div class="wrap">
      <h1><span class="dot"></span> GovArbitrage Capture</h1>

      <div class="field">
        <label for="apiBase">API base URL</label>
        <input type="text" id="apiBase" placeholder="http://localhost:3000" spellcheck="false" />
      </div>

      <div class="row">
        <button id="captureBtn" class="primary">Capture this page</button>
      </div>

      <div class="preview-head">
        <label>Extracted data</label>
        <span class="summary" id="summary"></span>
      </div>
      <pre id="preview"></pre>

      <div class="spacer"></div>

      <div class="row">
        <button id="sendBtn" class="send" disabled>Send to GovArbitrage</button>
      </div>

      <div id="status" class="info"></div>
    </div>

    <script src="popup.js"></script>
  </body>
</html>