-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathpopup.html
More file actions
201 lines (190 loc) · 7.8 KB
/
popup.html
File metadata and controls
201 lines (190 loc) · 7.8 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>XTranslator Settings</title>
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
direction: ltr;
text-align: left;
margin: 0;
padding: 0;
background-color: #f5f8fa;
min-width: 300px;
}
h3 {
background-color: #01afbe;
color: #fff;
margin: 0;
padding: 15px 20px;
text-align: center;
font-size: 16px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.container {
background-color: #fff;
border: none;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
margin: 15px;
padding: 20px;
}
p {
margin: 10px 0 20px 0;
font-size: 14px;
color: #444;
}
.language-options {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
margin-bottom: 20px;
}
label {
display: flex;
align-items: center;
margin: 8px 0;
font-size: 14px;
color: #333;
cursor: pointer;
transition: all 0.2s ease;
padding: 5px;
border-radius: 4px;
}
label:hover {
background-color: #e0fafd;
}
input[type="checkbox"] {
margin-left: 8px;
width: 16px;
height: 16px;
accent-color: #01afbe;
}
.api-section label {
display: block;
margin-bottom: 8px;
color: #444;
}
input[type="text"] {
width: 100%;
padding: 8px 12px;
border: 2px solid #e1e8ed;
border-radius: 6px;
font-size: 14px;
direction: ltr;
transition: border-color 0.2s ease;
box-sizing: border-box;
}
input[type="text"]:focus {
outline: none;
border-color: #01afbe;
}
button {
display: block;
width: 100%;
margin: 20px auto 10px auto;
padding: 12px;
font-size: 14px;
background-color: #01afbe;
color: white;
border: none;
border-radius: 6px;
cursor: pointer;
transition: background-color 0.2s ease;
font-family: Tahoma, Geneva, Verdana, sans-serif;
}
button:hover {
background-color: #5c7b00;
}
#status {
text-align: center;
color: #01afbe;
font-size: 13px;
margin-top: 10px;
padding: 8px;
background-color: #e0fafd;
border-radius: 4px;
}
.feature-section {
margin-top: 20px;
padding-top: 15px;
border-top: 1px solid #eee;
}
.feature-title {
font-weight: bold;
color: #333;
margin-bottom: 8px;
font-size: 15px;
}
.feature-description {
font-size: 13px;
color: #555;
line-height: 1.5;
}
.new-badge {
display: inline-block;
background-color: #ff6b6b;
color: white;
font-size: 11px;
padding: 2px 6px;
border-radius: 10px;
margin-right: 5px;
font-weight: bold;
}
</style>
</head>
<body>
<h3>EV Translator AI Settings</h3>
<div class="container">
<!-- Screenshot buttons side by side -->
<div style="display: flex; gap: 10px; margin-bottom: 8px; margin-top: 0; padding: 6px 0;">
<button id="screenshot-full" style="flex:1; background-color: #1976d2; color: white; border: none; padding: 12px; margin: 0px auto 10px auto; border-radius: 4px; cursor: pointer; font-weight: bold;">Screenshot Full Page & Translate</button>
<button id="screenshot-area" style="flex:1; background-color: #388e3c; color: white; border: none; padding: 12px; margin: 0px auto 10px auto; border-radius: 4px; cursor: pointer; font-weight: bold;">Screenshot Area & Translate</button>
</div>
<p>Please enter your Gemini API Key and select your preferred translation language. You can also customize the translation prompt.</p>
<label for="api-key">Gemini API Key:</label>
<input type="text" id="api-key" style="width: 100%; padding: 8px; margin-bottom: 5px; border: 1px solid #ddd; border-radius: 4px; box-sizing: border-box;">
<p style="font-size: 12px; color: #555; margin-bottom: 15px;"><a href="https://console.cloud.google.com/apis/credentials?createKeyType=API_KEY" target="_blank" rel="noopener">Create your Gemini API Key</a></p>
<label for="target-language">Translation Language:</label>
<select id="target-language" style="width: 100%; padding: 8px; margin-bottom: 15px; border: 1px solid #ddd; border-radius: 4px; box-sizing: border-box;">
<option value="Persian">Persian</option>
<option value="English">English</option>
<option value="Spanish">Spanish</option>
<option value="French">French</option>
<option value="German">German</option>
<option value="Chinese">Chinese</option>
<option value="Japanese">Japanese</option>
<option value="Russian">Russian</option>
<option value="Arabic">Arabic</option>
<option value="Italian">Italian</option>
<option value="Portuguese">Portuguese</option>
<option value="Korean">Korean</option>
</select>
<label for="exclude-lang" style="margin-bottom:10px;display:block;font-size:14px;">Don't show translate button for tweets in:</label>
<select id="exclude-lang" style="width:100%;padding:8px;margin-bottom:15px;border:1px solid #ddd;border-radius:4px;box-sizing:border-box;">
<option value="">-- None --</option>
<option value="fa">Persian</option>
<option value="en">English</option>
<option value="es">Spanish</option>
<option value="fr">French</option>
<option value="de">German</option>
<option value="zh">Chinese</option>
<option value="ja">Japanese</option>
<option value="ru">Russian</option>
<option value="ar">Arabic</option>
<option value="it">Italian</option>
<option value="pt">Portuguese</option>
<option value="ko">Korean</option>
</select>
<label for="translation-prompt">Translation Prompt:</label>
<textarea id="translation-prompt" style="width: 100%; height: 150px; padding: 8px; margin-bottom: 15px; border: 1px solid #ddd; border-radius: 4px; box-sizing: border-box; font-family: inherit; font-size: 13px; resize: vertical;"></textarea>
<p style="font-size: 12px; color: #666;">Use <code><TEXT></code> as a placeholder for the text to translate and <code><LANGUAGE></code> for the target language.</p>
<div id="status" style="display: none; text-align: center; margin-top: 10px; padding: 8px; background-color: #e8f5e9; color: #2e7d32; border-radius: 4px;">Settings saved successfully!</div>
<button id="save-settings" style="background-color: #01afbe; color: white; border: none; padding: 10px 15px; border-radius: 4px; cursor: pointer; width: 100%; font-weight: bold; margin-bottom: 18px;">Save Settings</button>
</div>
<script src="defaults.js"></script>
<script src="popup.js"></script>
</body>
</html>