~ knotless Search/
↑↓ move↵ open⇧↵ all results

johnandersen777.bsky.social/vuln-notif

0
0
main
209 lines · 7.3 KB Raw History
<!DOCTYPE html>
<html lang="en" data-theme="light">
<head>
  <meta charset="utf-8">
  <meta name="referrer" content="origin-when-cross-origin">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>vuln-notif record graph</title>
  <link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='6' fill='%234dc9f6'/%3E%3C/svg%3E">
  <link rel="stylesheet" href="./vendor/pico.min.css">
  <link rel="stylesheet" href="./vendor/highlight-github.min.css">
  <style>
    :root {
      --graph-bg: #ffffff;
      --node-stroke: #ffffff;
    }
    body { margin: 0; padding: 0; overflow: hidden; }

    #topbar {
      display: flex;
      align-items: center;
      gap: 1rem;
      flex-wrap: wrap;
      min-height: 3.25rem;
      padding: 0.35rem 1rem;
      border-bottom: 1px solid var(--pico-muted-border-color);
      box-sizing: border-box;
    }
    #topbar h1 { font-size: 1.15rem; margin: 0; white-space: nowrap; }
    #status { font-size: 0.8rem; color: var(--pico-muted-color); min-width: 10rem; }
    #status.error { color: var(--pico-color-red-500); }
    #counts, #indexed-count { font-size: 0.8rem; color: var(--pico-muted-color); }

    #main-area {
      position: relative;
      height: calc(100vh - 3.25rem);
      background: var(--graph-bg);
    }
    #graph-pane { position: absolute; inset: 0; }
    #graph-pane svg { width: 100%; height: 100%; display: block; }

    #empty-state {
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 2rem;
      text-align: center;
      color: var(--pico-muted-color);
      font-size: 0.95rem;
      white-space: pre-wrap;
    }

    /* legend + collection filters */
    #legend {
      position: absolute;
      top: 10px;
      left: 10px;
      max-height: 55vh;
      overflow-y: auto;
      background: rgba(255, 255, 255, 0.94);
      border: 1px solid var(--pico-muted-border-color);
      border-radius: 8px;
      padding: 0.5rem 0.65rem;
      font-size: 0.7rem;
      color: #222;
      z-index: 10;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    }
    #legend table { margin: 0; border-collapse: collapse; }
    #legend td { padding: 1px 3px; border: 0; vertical-align: middle; }
    #legend label { display: flex; align-items: center; gap: 0.35rem; cursor: pointer; white-space: nowrap; user-select: none; }
    #legend input[type="checkbox"] { margin: 0; width: 0.85rem; height: 0.85rem; }
    #legend .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
    #legend .legend-label.off { opacity: 0.4; }
    #legend .legend-count { color: var(--pico-muted-color); margin-left: 0.2rem; }

    #tooltip {
      position: fixed;
      z-index: 30;
      pointer-events: none;
      background: rgba(20, 20, 20, 0.92);
      color: #fff;
      border-radius: 5px;
      padding: 0.25rem 0.45rem;
      font-size: 0.7rem;
      max-width: 28rem;
      word-break: break-all;
      transform: translate(10px, 10px);
    }

    /* graph marks */
    .node { cursor: pointer; stroke: var(--node-stroke); stroke-width: 1.2px; }
    .node:hover { stroke: #111; stroke-width: 2.4px; }
    .node.selected { stroke: #f59e0b; stroke-width: 4px; }
    .node.dimmed { opacity: 0.12; }
    .node.focus-hidden, .node-label.focus-hidden,
    .edge.focus-hidden, .edge-label.focus-hidden { display: none; }
    .edge { stroke-opacity: 0.45; }
    .edge.dimmed { stroke-opacity: 0.04; }
    .node-label {
      font-size: 8px;
      fill: #222;
      text-anchor: middle;
      pointer-events: none;
      paint-order: stroke;
      stroke: #fff;
      stroke-width: 2px;
      stroke-linejoin: round;
    }
    .edge-label {
      font-size: 7px;
      fill: #555;
      text-anchor: middle;
      pointer-events: none;
      paint-order: stroke;
      stroke: #fff;
      stroke-width: 2px;
      stroke-linejoin: round;
    }
    .node-label.dimmed, .edge-label.dimmed { opacity: 0.08; }

    /* node detail dialog */
    #node-modal {
      max-width: min(760px, 94vw);
      margin: 1rem 1rem 1rem auto;
      background: transparent;
    }
    #node-modal::backdrop { background: rgba(0, 0, 0, 0.05); }
    #node-modal article { margin: 0; }
    #node-modal header {
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      align-items: flex-start;
      gap: 0.75rem;
    }
    #node-modal header > div { min-width: 0; }
    #detail-title { font-size: 1rem; margin: 0 0 0.35rem 0; word-break: break-all; }
    #detail-uri { display: block; font-size: 0.72rem; word-break: break-all; margin-bottom: 0.25rem; }
    #detail-did { font-size: 0.72rem; color: var(--pico-muted-color); word-break: break-all; }
    #modal-close { flex: 0 0 auto; font-size: 1.1rem; line-height: 1; padding: 0.2rem 0.55rem; }
    #detail-yaml-wrap {
      max-height: 52vh;
      overflow: auto;
      margin: 0.75rem 0;
      padding: 0.75rem;
      border-radius: 6px;
      border: 1px solid var(--pico-muted-border-color);
      background: var(--pico-code-background-color);
      font-size: 0.72rem;
      line-height: 1.45;
      white-space: pre-wrap;
      word-break: break-word;
    }
    #detail-yaml { display: block; padding: 0; background: none; font-size: inherit; }
    #detail-yaml[data-highlighted] { background: none; }
    #detail-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
    #detail-actions a, #detail-actions button { margin: 0; font-size: 0.8rem; padding: 0.4rem 0.7rem; }
    #detail-focus[aria-pressed="true"] { background: var(--pico-primary); color: var(--pico-primary-inverse); border-color: var(--pico-primary); }

    @media (max-width: 720px) {
      #legend { max-height: 38vh; }
      #node-modal { max-width: 100vw; }
      #detail-yaml-wrap { max-height: 42vh; }
    }
  </style>
  <script src="./vendor/d3.min.js"></script>
  <script src="./vendor/highlight.min.js"></script>
</head>
<body>
  <header id="topbar">
    <h1>vuln-notif record graph</h1>
    <span id="status">starting...</span>
    <span id="counts"><span id="node-count">0</span> nodes &middot; <span id="edge-count">0</span> edges</span>
    <span id="indexed-count" title="records mirrored in IndexedDB">0 indexed</span>
  </header>

  <main id="main-area">
    <div id="graph-pane">
      <svg id="graph" role="img" aria-label="Force-directed graph of atproto records"></svg>
      <div id="legend" hidden></div>
      <div id="tooltip" hidden></div>
      <div id="empty-state">Opening local index...</div>
    </div>
  </main>

  <dialog id="node-modal">
    <article>
      <header>
        <div>
          <h2 id="detail-title"></h2>
          <code id="detail-uri"></code>
          <div id="detail-did"></div>
        </div>
        <button id="modal-close" class="secondary outline" aria-label="Close">&times;</button>
      </header>
      <pre id="detail-yaml-wrap"><code id="detail-yaml" class="language-yaml"></code></pre>
      <footer id="detail-actions">
        <a id="detail-pdsls" class="secondary" href="#" target="_blank" rel="noopener noreferrer">Open on pdsls.dev &nearr;</a>
        <button id="detail-focus" class="secondary outline" aria-pressed="false">Show connected only</button>
      </footer>
    </article>
  </dialog>

  <noscript>This viewer needs JavaScript enabled.</noscript>
  <script type="module" src="./main.js"></script>
</body>
</html>