-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpopup.html
More file actions
159 lines (146 loc) · 8.7 KB
/
Copy pathpopup.html
File metadata and controls
159 lines (146 loc) · 8.7 KB
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
<link rel="stylesheet" href="popup.css">
</head>
<body>
<!-- TOAST -->
<div id="toast" class="toast"></div>
<!-- HISTORY SCREEN -->
<div id="history-screen" class="screen hidden">
<div class="screen-header">
<button id="back-history-btn" class="btn-icon" title="Back">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M19 12H5"/><polyline points="12 19 5 12 12 5"/></svg>
</button>
<h2>History</h2>
<button id="clear-history" class="btn-icon" title="Clear History" style="border:none;">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/></svg>
</button>
</div>
<div class="history-body" id="history-list">
<!-- Populated dynamically -->
</div>
</div>
<!-- SETTINGS SCREEN -->
<div id="settings-screen" class="screen hidden">
<div class="screen-header">
<button id="back-btn" class="btn-icon" title="Back">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M19 12H5"/><polyline points="12 19 5 12 12 5"/></svg>
</button>
<h2>Settings</h2>
<div style="width:32px"></div>
</div>
<div class="settings-body">
<div class="field">
<label>Capture Mode</label>
<div class="select-wrapper">
<select id="capture-mode">
<option value="full">Full Page</option>
<option value="view">Current View</option>
</select>
<svg class="select-chevron" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>
</div>
</div>
<div class="field">
<label>Provider</label>
<div class="select-wrapper">
<select id="provider">
<option value="Gemini">Google Gemini</option>
<option value="OpenAI">OpenAI</option>
<option value="Claude">Anthropic Claude</option>
<option value="Ollama">Ollama (Local)</option>
</select>
<svg class="select-chevron" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>
</div>
</div>
<div class="field">
<div class="field-header">
<label>Model</label>
<button id="fetch-models" class="btn-fetch" type="button">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="23 4 23 10 17 10"/><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"/></svg>
<span id="fetch-models-text">Fetch Models</span>
</button>
</div>
<div class="select-wrapper">
<select id="model">
<!-- Populated dynamically -->
</select>
<svg class="select-chevron" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>
</div>
<input type="text" id="model-custom" placeholder="Or type a custom model name...">
</div>
<div class="field" id="api-key-container">
<label>API Key</label>
<div class="input-icon-wrapper">
<input type="password" id="api-key" placeholder="Paste your API key">
<button id="toggle-key-vis" class="btn-icon-inline" type="button" title="Show/Hide">
<svg id="eye-icon" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>
</button>
</div>
</div>
<div class="field hidden" id="base-url-container">
<label>Base URL</label>
<input type="text" id="base-url" placeholder="http://localhost:11434">
</div>
<button id="save-settings" class="btn-primary btn-save">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>
Save Settings
</button>
</div>
</div>
<!-- MAIN SCREEN -->
<div id="main-screen" class="screen">
<div class="main-header">
<div class="brand">
<div class="brand-icon">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/></svg>
</div>
<div class="brand-text">
<span class="brand-name">designpull</span>
<span class="brand-sub" id="current-info">
<span id="current-provider">Gemini</span> · <span id="current-model">gemini-2.0-flash</span>
</span>
</div>
</div>
<div style="display: flex; gap: 8px;">
<button id="open-history" class="btn-icon" title="History">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>
</button>
<button id="open-settings" class="btn-icon" title="Settings">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>
</button>
</div>
</div>
<button id="generate-btn" class="btn-generate">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/></svg>
<span id="generate-btn-text">Extract & Generate</span>
</button>
<div id="loading-container" class="hidden">
<div class="loading-bar-track">
<div class="loading-bar-fill"></div>
</div>
<span id="loading-text">Extracting styles…</span>
</div>
<div id="output-container" class="hidden">
<div class="output-header">
<span class="output-label">Generated design.md</span>
<div class="output-actions">
<button id="copy-btn" class="btn-sm" title="Copy to clipboard">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>
<span id="copy-btn-text">Copy</span>
</button>
<button id="download-btn" class="btn-sm" title="Download as design.md">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>
Download
</button>
</div>
</div>
<textarea id="output" readonly></textarea>
</div>
</div>
<script src="popup.js"></script>
</body>
</html>