-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfloating.css
More file actions
418 lines (366 loc) · 9.76 KB
/
Copy pathfloating.css
File metadata and controls
418 lines (366 loc) · 9.76 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
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
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
:root {
--dark-gray: #333333;
--text-white: #ffffff;
--border-color: #444444;
--content-padding: 15px;
}
#xpath-analyzer-container {
position: fixed;
top: 100px;
left: 50%;
width: 800px;
background: var(--dark-gray);
box-shadow: 0 2px 10px rgba(0,0,0,0.3);
z-index: 999999;
border-radius: 8px;
border: 1px solid var(--border-color);
display: none;
color: var(--text-white);
}
#xpath-analyzer-container.visible {
display: block;
}
.xpath-header {
display: flex;
justify-content: space-between;
height: 30px;
align-items: center;
padding: 10px var(--content-padding);
background-color: var(--dark-gray);
border-bottom: 1px solid var(--border-color);
cursor: move;
user-select: none;
color: var(--text-white);
}
.close-button {
background: none;
border: none;
color: var(--text-white);
font-size: 20px;
cursor: pointer;
padding: 0 5px;
}
.xpath-content {
display: flex;
padding: var(--content-padding);
background-color: var(--dark-gray);
min-height: 150px;
gap: 15px;
}
.xpath-input-section {
flex: 1;
display: flex;
flex-direction: column;
gap: 10px;
}
#xpath-input {
width: 100%;
height: 80px;
padding: 10px;
border: 1px solid var(--border-color);
border-radius: 4px;
resize: none;
cursor: text;
background-color: #444444;
color: var(--text-white);
box-sizing: border-box;
}
#xpath-input::placeholder {
color: #888888;
}
.button-group {
display: flex;
gap: 10px;
width: 100%;
}
.button-group button {
flex: 1;
padding: 8px;
border: none;
border-radius: 4px;
cursor: pointer;
background-color: var(--dark-gray);
color: var(--text-white);
border: 1px solid var(--border-color);
}
.button-group button:hover {
background-color: #444444;
}
.xpath-result-section {
flex: 1.2;
border: 1px solid var(--border-color);
border-radius: 4px;
padding: 0;
overflow-y: auto;
}
#result-container {
padding: 10px;
max-height: 300px;
overflow-y: auto;
user-select: text;
cursor: text;
contenteditable: false;
}
/* 自定义滚动条样式 */
#xpath-input::-webkit-scrollbar,
#result-container::-webkit-scrollbar {
width: 8px;
}
#xpath-input::-webkit-scrollbar-track,
#result-container::-webkit-scrollbar-track {
background: #444444;
}
#xpath-input::-webkit-scrollbar-thumb,
#result-container::-webkit-scrollbar-thumb {
background: #666666;
border-radius: 4px;
}
/* =========================================
修复 Copy 按钮在极简模式下的样式
========================================= */
#copy-format-btn {
/* 基础尺寸和字体 */
font-size: 14px; /* 字体调小 */
padding: 6px 12px; /* 左右增加空隙,上下适中 */
line-height: 1.4;
/* 颜色与外观 (也就是极简模式风格) */
background-color: var(--dark-gray);
color: var(--text-white);
border: 1px solid var(--border-color);
border-radius: 4px; /* 圆角 */
cursor: pointer;
transition: background-color 0.2s;
}
/* 鼠标悬停 */
#copy-format-btn:hover {
background-color: #8ab4f8; /* 稍微变亮 */
}
/* 鼠标按下 */
#copy-format-btn:active {
background-color: #222222;
}
/* 修正 Copy 按钮容器的位置,让它垂直居中 */
.result-header .copy-buttons {
display: flex;
align-items: center;
}
/* 结果项样式 */
.result-item {
padding: 8px;
border-bottom: 1px solid var(--border-color);
display: flex;
align-items: flex-start;
gap: 8px;
transition: background-color 0.2s;
}
.result-item:hover {
background-color: rgba(255, 255, 255, 0.05);
}
.result-item:last-child {
border-bottom: none;
}
.result-index {
color: #888888;
font-size: 12px;
font-weight: bold;
min-width: 40px;
flex-shrink: 0;
font-family: 'Courier New', monospace;
}
.result-text {
color: var(--text-white);
font-size: 13px;
line-height: 1.5;
word-break: break-word;
flex: 1;
}
.result-xpath {
color: #888888;
font-size: 12px;
word-break: break-all;
}
/* 添加结果区域的标题样式 */
.result-header {
padding: 10px;
border-bottom: 1px solid var(--border-color);
font-size: 14px;
color: var(--text-white);
background-color: #444444;
border-radius: 4px 4px 0 0;
}
/* 复制成功提示样式 */
.copy-success {
margin-left: 8px;
padding: 2px 6px;
background-color: #4CAF50;
color: white;
font-size: 12px;
border-radius: 3px;
animation: fadeInOut 3s forwards;
}
/* 淡入淡出动画 */
@keyframes fadeInOut {
0% { opacity: 0; }
10% { opacity: 1; }
90% { opacity: 1; }
100% { opacity: 0; }
}
/* =========================================
1. 主题切换开关样式 (iOS Style Toggle)
========================================= */
.theme-switch-wrapper {
display: flex;
align-items: center;
margin-left: 12px;
}
.theme-switch {
position: relative;
display: inline-block;
width: 36px;
height: 20px;
}
.theme-switch input { opacity: 0; width: 0; height: 0; }
.slider {
position: absolute;
cursor: pointer;
top: 0; left: 0; right: 0; bottom: 0;
background-color: #555; /* 默认深灰 */
transition: .3s;
border-radius: 34px;
}
.slider:before {
position: absolute;
content: "";
height: 16px; width: 16px;
left: 2px; bottom: 2px;
background-color: white;
transition: .3s;
border-radius: 50%;
box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
/* 激活状态:苹果绿 或者 纯白高亮,这里用苹果风格的浅灰白,显得高级 */
input:checked + .slider {
background-color: #888;
}
input:checked + .slider:before {
transform: translateX(16px);
}
/* =========================================
2. Apple iOS 风格 - 液态玻璃主题
(当容器拥有 .glass-effect 类时生效)
========================================= */
/* --- 容器:深邃磨砂 --- */
#xpath-analyzer-container.glass-effect {
/* 背景:极深的灰色,模拟 iOS 黑暗模式控制中心 */
background: rgba(30, 30, 30, 0.65) !important;
/* 核心:高强度模糊 */
backdrop-filter: blur(25px) saturate(110%);
-webkit-backdrop-filter: blur(25px) saturate(110%);
/* 边框:极其微弱的亮边 */
border: 1px solid rgba(255, 255, 255, 0.12);
box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5); /* 更深的投影 */
border-radius: 20px; /* 更大的圆角,像 iOS 组件 */
color: rgba(255, 255, 255, 0.9);
}
/* --- 头部 --- */
.glass-effect .xpath-header {
background: transparent !important; /* 头部完全透明,融为一体 */
border-bottom: 1px solid rgba(255, 255, 255, 0.08); /* 极淡的分割线 */
padding-top: 10px;
padding-bottom: 10px;
}
/* --- 关闭按钮:圆形深色背景 --- */
.glass-effect .close-button {
width: 24px;
height: 24px;
background: rgba(0, 0, 0, 0.35) !important; /* 深色背景圆圈 */
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
color: rgba(255, 255, 255, 0.8) !important;
font-size: 16px;
line-height: 1;
transition: all 0.2s;
margin-left: 10px;
}
.glass-effect .close-button:hover {
background: rgba(0, 0, 0, 0.6) !important; /* 悬停变深 */
color: #fff !important;
transform: scale(1.1);
}
/* --- 内容区域 --- */
.glass-effect .xpath-content {
background: transparent !important;
}
/* --- 输入框 & 结果框:凹槽感 --- */
.glass-effect #xpath-input,
.glass-effect .xpath-result-section {
/* 背景:比容器稍深,制造层级 */
background: rgba(0, 0, 0, 0.2) !important;
border: none !important; /* 去掉边框,纯靠色块区分 */
box-shadow: inset 0 1px 3px rgba(0,0,0,0.2); /* 轻微内阴影 */
color: rgba(255, 255, 255, 0.9) !important;
border-radius: 12px;
}
/* 结果框头部 */
.glass-effect .result-header {
background: transparent !important;
border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}
/* --- 按钮通用样式 (Parse, Clear, Copy) --- */
/* 让所有按钮都变成类似 iOS 的“块状”按钮 */
.glass-effect button {
border-radius: 10px;
font-weight: 500;
border: none !important;
transition: all 0.2s;
backdrop-filter: none;
font-size: 13px;
letter-spacing: 0.3px;
}
/* 1. 次要按钮 (Clear) - 浅灰色半透明 */
.glass-effect #clear-btn {
background: rgba(255, 255, 255, 0.12) !important;
color: rgba(255, 255, 255, 0.8);
}
.glass-effect #clear-btn:hover {
background: rgba(255, 255, 255, 0.2) !important;
color: #fff;
}
/* 2. 主要按钮 (Parse 和 Copy Result) - 统一风格 */
/* 这里我们用稍微亮一点的灰白色,类似 iOS 控制中心的激活块 */
.glass-effect #parse-btn,
.glass-effect #copy-format-btn {
background: rgba(255, 255, 255, 0.25) !important; /* 更亮的背景 */
color: #fff;
box-shadow: 0 2px 10px rgba(0,0,0,0.2); /* 悬浮感 */
}
/* 悬停效果 */
.glass-effect #parse-btn:hover,
.glass-effect #copy-format-btn:hover {
background: rgba(255, 255, 255, 0.35) !important;
transform: translateY(-1px);
}
/* 点击效果 */
.glass-effect #parse-btn:active,
.glass-effect #copy-format-btn:active,
.glass-effect #clear-btn:active {
transform: scale(0.96);
}
/* 特别修正 Copy 按钮的大小,让它看起来像个正经按钮 */
.glass-effect #copy-format-btn {
padding: 4px 12px !important;
font-size: 12px;
margin-right: 5px;
}
/* 结果文字颜色 */
.glass-effect .result-item {
border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}
.glass-effect .result-text {
color: rgba(255, 255, 255, 0.85);
}
.glass-effect .result-count {
color: rgba(255, 255, 255, 0.5) !important;
}