-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpopup.html
More file actions
208 lines (179 loc) · 5.62 KB
/
popup.html
File metadata and controls
208 lines (179 loc) · 5.62 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
202
203
204
205
206
207
208
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
body {
width: 350px;
padding: 16px;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
font-size: 14px;
}
h1 {
font-size: 18px;
margin: 0 0 16px 0;
color: #1976d2;
}
.section {
margin-bottom: 20px;
}
label {
display: block;
margin-bottom: 8px;
font-weight: 500;
}
input[type="text"] {
width: 100%;
padding: 8px;
border: 1px solid #ddd;
border-radius: 4px;
box-sizing: border-box;
}
.domain-list {
max-height: 120px;
overflow-y: auto;
border: 1px solid #ddd;
border-radius: 4px;
padding: 8px;
margin-top: 8px;
background: #f9f9f9;
}
.domain-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 4px 0;
border-bottom: 1px solid #eee;
}
.domain-item:last-child {
border-bottom: none;
}
button {
background: #1976d2;
color: white;
border: none;
padding: 8px 16px;
border-radius: 4px;
cursor: pointer;
font-size: 13px;
}
button:hover {
background: #1565c0;
}
.remove-btn {
background: #f44336;
padding: 2px 8px;
font-size: 12px;
}
.remove-btn:hover {
background: #d32f2f;
}
.current-domain {
background: #e3f2fd;
padding: 8px;
border-radius: 4px;
margin-bottom: 12px;
font-size: 13px;
}
.add-current {
background: #4caf50;
margin-left: 8px;
padding: 4px 8px;
font-size: 12px;
}
.add-current:hover {
background: #45a049;
}
.info {
font-size: 12px;
color: #666;
margin-top: 8px;
line-height: 1.4;
}
.info code {
background: #f0f0f0;
padding: 1px 4px;
border-radius: 2px;
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
font-size: 11px;
}
.style-section {
border-top: 1px solid #ddd;
padding-top: 20px;
margin-top: 20px;
}
textarea {
width: 100%;
height: 120px;
padding: 8px;
border: 1px solid #ddd;
border-radius: 4px;
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
font-size: 12px;
line-height: 1.4;
resize: vertical;
box-sizing: border-box;
margin-bottom: 12px;
}
.preview-box {
background: #f5f5f5;
padding: 12px;
border-radius: 4px;
margin: 12px 0;
font-size: 14px;
}
.reset-btn {
background: #ff9800;
font-size: 12px;
padding: 6px 12px;
}
.reset-btn:hover {
background: #f57c00;
}
</style>
</head>
<body>
<h1>Base64 解码器设置</h1>
<div class="current-domain">
<strong>当前域名:</strong> <span id="currentDomain"></span>
<button class="add-current" id="addCurrentBtn">添加当前域名</button>
</div>
<div class="section">
<label for="domainInput">添加允许自动转换的域名模式:</label>
<input type="text" id="domainInput" placeholder="例如: example.com 或 *.example.com">
<button id="addBtn">添加</button>
<div class="info" style="margin-top: 8px;">
<strong>支持的模式:</strong><br>
• <code>example.com</code> - 精确匹配<br>
• <code>*.example.com</code> - 匹配所有子域名<br>
• <code>.example.com</code> - 匹配域名及其子域名<br>
• <code>test*.com</code> - 通配符匹配<br>
• <code>*.*.com</code> - 多级通配符匹配
</div>
</div>
<div class="section">
<label>已启用的域名模式:</label>
<div class="domain-list" id="domainList"></div>
<div class="info">
留空则在所有网站上运行。添加模式后仅在匹配的域名上运行。
</div>
</div>
<div class="style-section">
<label><strong>解码文本样式设置:</strong></label>
<div class="info" style="margin-bottom: 12px;">
直接输入CSS样式代码,例如:background-color: #e8f5e8; color: #2e7d32;
</div>
<textarea id="customCSS" placeholder="background-color: #e8f5e8 !important;
color: #2e7d32 !important;
border-left: 3px solid #4caf50 !important;
padding: 2px 4px !important;
border-radius: 3px !important;
font-weight: 500 !important;"></textarea>
<div class="preview-box">
<span id="preview">这是解码文本的预览效果</span>
</div>
<button class="reset-btn" id="resetStyleBtn">恢复默认样式</button>
</div>
<script src="popup.js"></script>
</body>
</html>