File size: 2,514 Bytes
5752a28
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Dark Pattern NLP Auditor</title>
    <link rel="stylesheet" href="sidepanel.css" />
  </head>
  <body>
    <header class="hero">
      <div class="eyebrow">NLP browser audit</div>
      <h1>Dark Pattern Auditor</h1>
      <p>Scan visible interface copy and highlight language that needs human review.</p>
    </header>

    <main>
      <section class="actions">
        <button id="scan-button" class="primary">Scan current page</button>
        <button id="clear-button" class="secondary">Clear highlights</button>
      </section>

      <div id="status" class="status" data-tone="neutral">
        Start the local API, then scan an HTTP or HTTPS page.
      </div>

      <section id="summary" class="summary" hidden>
        <div>
          <strong id="scanned-count">0</strong>
          <span>texts scanned</span>
        </div>
        <div>
          <strong id="flagged-count">0</strong>
          <span>flagged</span>
        </div>
        <div>
          <strong id="minimum-score">0%</strong>
          <span>minimum score</span>
        </div>
      </section>

      <section class="results-section">
        <div class="section-heading">
          <h2>Findings</h2>
          <span id="page-label"></span>
        </div>
        <div id="results" class="results">
          <p class="empty">No audit has been run yet.</p>
        </div>
      </section>

      <details class="settings">
        <summary>Connection and thresholds</summary>
        <label>
          Local API URL
          <input id="api-url" type="url" spellcheck="false" />
        </label>
        <label>
          Minimum calibrated score
          <input id="minimum-score-input" type="number" min="20" max="95" step="1" />
        </label>
        <label>
          Maximum page texts
          <input id="max-items" type="number" min="25" max="300" step="25" />
        </label>
        <div class="settings-actions">
          <button id="save-settings" class="secondary">Save settings</button>
          <button id="test-connection" class="ghost">Test connection</button>
        </div>
      </details>

      <p class="disclaimer">
        This tool provides model-assisted screening, not a legal determination.
        Page text is sent only to the configured API endpoint.
      </p>
    </main>

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