aboutsummaryrefslogtreecommitdiff
path: root/src/popup/popup.html
blob: c8838bab664dba8b3f69152654266d39ed8f90d6 (plain)
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<!doctype html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>AI Compose</title>
    <style>
      body {
        font-family: system-ui, sans-serif;
        margin: 0;
        padding: 16px;
        width: 360px;
        background: var(--bg);
        color: var(--fg);
      }
      h2 {
        margin-top: 0;
        font-size: 1.1rem;
      }
      textarea {
        width: calc(100% - 16px);
        min-height: 120px;
        resize: vertical;
        padding: 8px;
        border: 1px solid var(--border);
        border-radius: 6px;
        background: var(--input-bg);
        color: var(--fg);
        font-size: 0.9rem;
        line-height: 1.4;
      }
      .actions {
        margin-top: 14px;
        display: flex;
        align-items: center;
        gap: 8px;
      }
      button {
        padding: 8px 16px;
        border: none;
        border-radius: 6px;
        background: var(--accent);
        color: white;
        font-weight: 500;
        cursor: pointer;
      }
      button:disabled {
        opacity: 0.6;
        cursor: not-allowed;
      }
      #spinner {
        display: none;
        width: 18px;
        height: 18px;
        border: 2px solid rgba(0, 0, 0, 0.2);
        border-top-color: var(--accent);
        border-radius: 50%;
        animation: spin 0.6s linear infinite;
      }
      @keyframes spin {
        to {
          transform: rotate(360deg);
        }
      }
      @media (prefers-color-scheme: light) {
        :root {
          --bg: #ffffff;
          --fg: #111111;
          --border: #cccccc;
          --input-bg: #f9f9f9;
          --accent: #3b82f6;
        }
      }
      @media (prefers-color-scheme: dark) {
        :root {
          --bg: #1e1e1e;
          --fg: #f5f5f5;
          --border: #444444;
          --input-bg: #2a2a2a;
          --accent: #60a5fa;
        }
      }
    </style>
  </head>
  <body>
    <h2>Compose with AI</h2>
    <textarea id="prompt" placeholder="Write your instructions here..."></textarea>
    <div class="actions">
      <button id="send" disabled>Insert</button>
      <div id="spinner"></div>
    </div>

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