-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoptions.html
332 lines (311 loc) · 9.91 KB
/
options.html
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Options</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css">
<style>
html, body {
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
}
body {
display: flex;
flex-direction: column;
box-sizing: border-box;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #f8f9fa;
overflow-y: auto;
}
.options-container {
flex: 1;
padding: 20px;
max-width: 600px;
width: 100%;
box-sizing: border-box;
/* overflow-y: auto; */
margin: 0 auto;
padding-right: 25px;
}
.options-container::-webkit-scrollbar {
width: 8px;
}
.options-container::-webkit-scrollbar-track {
background: #f1f1f1;
border-radius: 4px;
}
.options-container::-webkit-scrollbar-thumb {
background: #c1c1c1;
border-radius: 4px;
transition: background 0.3s;
}
.options-container::-webkit-scrollbar-thumb:hover {
background: #a8a8a8;
}
.option-item {
margin-bottom: 20px;
}
.option-item label {
display: block;
font-size: 1.2em;
color: #495057;
margin-bottom: 10px;
}
.option-item input[type="number"],
.option-item input[type="checkbox"],
.option-item input[type="text"],
.option-item input[type="password"] {
width: 100%;
padding: 10px;
font-size: 1em;
border: 1px solid #ced4da;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
transition: box-shadow 0.3s;
}
.option-item input[type="number"]:hover,
.option-item input[type="checkbox"]:hover {
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.option-item input[type="checkbox"] {
width: auto;
margin-right: 10px;
}
.option-item .checkbox-label {
display: flex;
align-items: center;
}
.option-item .checkbox-label input[type="checkbox"] {
margin-right: 10px;
margin-top: 0;
margin-bottom: 0;
}
.option-item .checkbox-label label {
margin-bottom: 0;
}
.sub-label {
display: inline;
font-size: 0.8em;
color: #6c757d;
margin-left: 10px;
}
.save-button {
background-color: #007bff;
color: #ffffff;
border: none;
padding: 10px 20px;
font-size: 1.2em;
border-radius: 8px;
cursor: pointer;
transition: background-color 0.3s, transform 0.3s;
width: 100%;
box-sizing: border-box;
}
.save-button:hover {
background-color: #0056b3;
transform: scale(1.05);
}
.color-picker-wrapper {
display: flex;
align-items: center;
}
.color-display {
width: 30px;
height: 30px;
border-radius: 50%;
margin-left: 10px;
border: 2px solid #b2dfdb;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.styled-input {
width: 100%;
padding: 10px;
font-size: 1em;
border: 1px solid #b2dfdb;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
transition: box-shadow 0.3s;
}
.styled-input:hover {
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.visibility-button {
background: none;
border: none;
cursor: pointer;
font-size: 1.2em;
margin-left: 10px;
transition: transform 0.3s;
}
.visibility-button:hover {
transform: scale(1.1);
}
.message-tip {
margin-top: 20px;
padding: 10px;
border-radius: 8px;
font-size: 1em;
text-align: center;
transition: opacity 0.3s, transform 0.3s;
opacity: 0;
transform: translateY(-10px);
}
.message-tip.show {
opacity: 1;
transform: translateY(0);
}
.message-tip.success {
background-color: #4caf50;
color: #ffffff;
}
.message-tip.error {
background-color: #f44336;
color: #ffffff;
}
.sponsor-button {
position: fixed;
bottom: 5px;
left: 0;
right: 0;
display: flex;
align-items: center;
justify-content: center;
background-color: #28a745;
color: #ffffff;
border: none;
padding: 10px 20px;
font-size: 1.2em;
cursor: pointer;
transition: background-color 0.3s;
z-index: 1000;
}
.sponsor-button:hover {
background-color: #218838;
}
.sponsor-button i {
margin-right: 10px;
}
h1 {
font-size: 2.5em;
color: #007bff;
text-align: center;
margin-bottom: 30px;
padding-bottom: 15px;
border-bottom: 2px solid #e9ecef;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
font-weight: 300;
letter-spacing: 1px;
}
</style>
</head>
<body>
<div class="options-container">
<h1>Glowify Options</h1>
<div class="option-item">
<label for="highlight-color">Highlight Text Color</label>
<div class="color-picker-wrapper">
<input type="color" id="highlight-color" name="highlight-color" value="#000000">
</div>
</div>
<div class="option-item">
<label for="highlight-bg-color">Highlight Background Color</label>
<div class="color-picker-wrapper">
<input type="color" id="highlight-bg-color" name="highlight-bg-color" value="#ffeb3b">
</div>
</div>
<div class="option-item">
<label for="min-text-length">Minimum Text Length</label>
<input type="number" id="min-text-length" name="min-text-length" min="1" value="3">
</div>
<div class="option-item">
<label for="enabled-urls">Enabled URLs (one per line)</label>
<textarea id="enabled-urls" name="enabled-urls" class="styled-input" rows="5"
placeholder="Enter URL patterns, one per line Example: *.google.com/* https://github.com/*"></textarea>
</div>
<div class="option-group">
<div class="option-item">
<label for="vendor">LLM Provider</label>
<select id="vendor" name="vendor" class="styled-input">
<option value="openai">OpenAI</option>
<option value="dashscope">DashScope (阿里灵积)</option>
<option value="moonshot">Moonshot (月之暗面Kimi)</option>
<option value="coze">Coze (扣子) </option>
<option value="deepseek">DeepSeek (深度求索)</option>
</select>
</div>
<div class="option-item">
<label for="llm-api-key">LLM API Key</label>
<div class="color-picker-wrapper">
<input type="password" id="llm-api-key" name="llm-api-key" class="styled-input">
<button type="button" for="llm-api-key" class="visibility-button">👁️</button>
</div>
</div>
<div class="option-item">
<label for="language">Target Language</label>
<select id="language" name="language" class="styled-input">
<option value="Chinese">Chinese</option>
<option value="Japanese">Japanese</option>
<option value="Korean">Korean</option>
<option value="English">English</option>
<option value="Spanish">Spanish</option>
<option value="French">French</option>
<option value="German">German</option>
<option value="Italian">Italian</option>
<option value="Portuguese">Portuguese</option>
<option value="Russian">Russian</option>
</select>
</div>
</div>
<div class="option-group" id="prompt-settings">
<div class="option-item">
<label for="sys-prompt-translate">System Prompt for Translate</label>
<textarea id="sys-prompt-translate" name="sys-prompt-translate" class="styled-input" rows="5"
placeholder="Enter your system prompt for translate here."></textarea>
</div>
<div class="option-item">
<label for="user-prompt-translate">User Prompt for Translate</label>
<textarea id="user-prompt-translate" name="user-prompt-translate" class="styled-input" rows="5"
placeholder="Enter your user prompt for translate here."></textarea>
</div>
<div class="option-item">
<label for="sys-prompt-explain">System Prompt for Explain</label>
<textarea id="sys-prompt-explain" name="sys-prompt-explain" class="styled-input" rows="5"
placeholder="Enter your system prompt for explain here."></textarea>
</div>
<div class="option-item">
<label for="user-prompt-explain">User Prompt for Explain</label>
<textarea id="user-prompt-explain" name="user-prompt-explain" class="styled-input" rows="5"
placeholder="Enter your user prompt for explain here."></textarea>
</div>
</div>
<div class="option-item">
<div class="checkbox-label">
<input type="checkbox" id="save-to-notion" name="save-to-notion">
<label for="save-to-notion">Save to Notion</label>
</div>
</div>
<div id="notion-settings" style="display: none;">
<div class="option-item">
<label for="notion-api-key">Notion API Key</label>
<div class="color-picker-wrapper">
<input type="password" id="notion-api-key" name="notion-api-key" class="styled-input">
<button type="button" for="notion-api-key" class="visibility-button">👁️</button>
</div>
</div>
<div class="option-item">
<label for="notion-database-id">Notion Database ID</label>
<input type="text" id="notion-database-id" name="notion-database-id" class="styled-input">
</div>
</div>
<button class="save-button">Save</button>
<div id="message-tip" class="message-tip" style="display: none;"></div>
</div>
<!-- <button id="sponsor-button" class="sponsor-button">
<i class="fas fa-heart"></i> Sponsor the Author
</button> -->
<script src="scripts/options.js"></script>
</body>
</html>