forked from Jackywine/Bella
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstyle.css
More file actions
444 lines (388 loc) · 9.11 KB
/
style.css
File metadata and controls
444 lines (388 loc) · 9.11 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
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
/* --- 加载屏幕 --- */
#loading-screen {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #000000;
display: flex;
justify-content: center;
align-items: center;
z-index: 100;
transition: opacity 0.5s ease-out;
}
#loading-screen img {
width: 150px; /* 或者您希望的任何尺寸 */
height: auto;
animation: pulse-loader 2s infinite;
}
@keyframes pulse-loader {
0% {
transform: scale(1);
opacity: 0.8;
}
50% {
transform: scale(1.1);
opacity: 1;
}
100% {
transform: scale(1);
opacity: 0.8;
}
}
/* --- 基本重置和全局样式 --- */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html, body {
height: 100%;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
color: white;
overflow: hidden; /* 防止视频导致滚动条 */
}
/* --- 视频背景 --- */
.video-container {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
background-color: #000000;
}
.bg-video {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: contain; /* 保持视频比例,留出黑边 */
opacity: 0;
transition: opacity 0.2s ease-in-out; /* 交叉淡入淡出动画 */
}
.bg-video.active {
opacity: 1;
}
/* --- 内容覆盖层 --- */
.content-overlay {
position: relative;
height: 100vh;
width: 100%;
display: flex;
flex-direction: column;
justify-content: center; /* 垂直居中 */
align-items: center;
padding: 25px;
z-index: 1;
gap: 40px; /* 在识别结果和按钮之间添加一些间距 */
}
/* --- 语音识别结果显示 --- */
.transcript-container {
width: 80%;
max-width: 600px;
padding: 20px;
background: rgba(0, 0, 0, 0.3);
border-radius: 15px;
text-align: center;
opacity: 0;
transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
pointer-events: none; /* 默认不响应鼠标事件 */
transform: translateY(20px);
}
.transcript-container.visible {
opacity: 1;
transform: translateY(0);
}
#transcript {
font-size: 1.5rem; /* 稍大一点的字体 */
color: #fff;
text-shadow: 1px 1px 3px rgba(0,0,0,0.6);
min-height: 50px; /* 给一个最小高度,防止没内容时跳动 */
line-height: 1.4;
}
transform: scale(1.05);
}
#sentiment-result {
color: white;
font-size: 16px;
margin: 10px 0;
min-height: 20px;
text-align: center;
}
/* 本地语音识别测试区域样式 */
.local-asr-container {
position: fixed;
bottom: 150px; /* 调整位置,避免与情感分析区域重叠 */
left: 50%;
transform: translateX(-50%);
background-color: rgba(0, 0, 0, 0.7);
padding: 15px;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
z-index: 1001;
color: white;
text-align: center;
}
#local-mic-button {
background-color: #4CAF50; /* 绿色 */
color: white;
border: none;
padding: 10px 20px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
border-radius: 5px;
transition: background-color 0.3s;
}
#local-mic-button:hover {
background-color: #45a049;
}
#local-mic-button.recording {
animation: pulse 1.5s infinite;
}
@keyframes pulse {
0% {
box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
}
70% {
box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
}
100% {
box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
}
}
#local-asr-result {
font-weight: bold;
color: #2196F3; /* 蓝色 */
}
/* --- 悬浮按钮和菜单 --- */
#floating-button {
position: fixed;
bottom: 120px; /* 调整位置,使其在麦克风按钮上方 */
right: 30px;
width: 60px;
height: 60px;
background: rgba(255, 255, 255, 0.15);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.2);
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
transition: transform 0.2s ease, box-shadow 0.2s ease;
z-index: 10;
}
#floating-button:hover {
transform: scale(1.1);
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
#floating-button i {
font-size: 24px;
color: white;
}
#menu-container {
position: fixed;
bottom: 200px; /* 调整位置,使其在悬浮按钮上方 */
right: 30px;
width: 150px;
background: rgba(0, 0, 0, 0.7);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
border-radius: 10px;
padding: 10px;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
z-index: 9;
transition: opacity 0.3s ease, transform 0.3s ease;
transform-origin: bottom right;
}
#menu-container.hidden {
opacity: 0;
transform: scale(0.95);
pointer-events: none;
}
.menu-item {
display: block;
width: 100%;
padding: 12px;
background: none;
border: none;
color: white;
font-size: 1rem;
text-align: left;
cursor: pointer;
border-radius: 5px;
transition: background-color 0.2s ease;
}
.menu-item:hover {
background-color: rgba(255, 255, 255, 0.1);
}
/* --- 底部内容 --- */
.bottom-bar {
width: 100%;
display: flex;
flex-direction: column; /* 垂直排列 */
justify-content: center; /* 水平居中 */
align-items: center; /* 垂直居中 */
position: relative; /* 为链接定位 */
}
.mic-button {
width: 80px;
height: 80px;
background: rgba(255, 255, 255, 0.15);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.2);
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.mic-button:hover {
transform: scale(1.1);
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
.mic-button:active {
transform: scale(1.05);
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}
.mic-button i {
font-size: 36px;
color: white;
}
/* 麦克风 "监听中" 的动画效果 */
.mic-button.is-listening {
animation: pulse 1.5s infinite;
}
@keyframes pulse {
0% {
box-shadow: 0 0 0 0 rgba(255, 154, 158, 0.7);
}
70% {
box-shadow: 0 0 0 20px rgba(255, 154, 158, 0);
}
100% {
box-shadow: 0 0 0 0 rgba(255, 154, 158, 0);
}
}
.footer-credit {
margin-top: 20px; /* 与麦克风按钮的间距 */
color: rgba(255, 255, 255, 0.8);
text-decoration: none;
font-size: 1rem;
transition: color 0.3s ease;
}
.footer-credit:hover {
color: white;
text-decoration: underline;
}
/* --- 聊天控制面板 --- */
.chat-control-panel {
position: fixed;
top: 30px;
left: 30px;
display: flex;
gap: 15px;
z-index: 1002; /* 确保在所有元素之上 */
opacity: 0;
transform: translateY(-20px);
transition: opacity 0.8s ease 2s, transform 0.8s ease 2s; /* 延迟2秒显示 */
}
.chat-control-panel.visible {
opacity: 1;
transform: translateY(0);
}
.control-btn {
display: flex;
align-items: center;
gap: 8px;
padding: 12px 18px;
border: none;
border-radius: 12px;
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: all 0.3s ease;
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.2);
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
user-select: none;
pointer-events: auto;
}
.control-btn:hover {
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}
.control-btn:active {
transform: translateY(0);
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.control-btn.primary {
background: rgba(255, 107, 157, 0.9);
color: white;
}
.control-btn.primary:hover {
background: rgba(255, 107, 157, 1);
box-shadow: 0 6px 20px rgba(255, 107, 157, 0.3);
}
.control-btn.secondary {
background: rgba(78, 205, 196, 0.9);
color: white;
}
.control-btn.secondary:hover {
background: rgba(78, 205, 196, 1);
box-shadow: 0 6px 20px rgba(78, 205, 196, 0.3);
}
.control-btn i {
font-size: 16px;
}
.control-btn span {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
/* --- 响应式设计 --- */
@media (max-width: 600px) {
.content-overlay {
padding: 20px;
}
.top-bar label {
font-size: 0.9rem;
}
.progress-container {
height: 10px;
}
.mic-button {
width: 70px;
height: 70px;
}
.mic-button i {
font-size: 30px;
}
.footer-credit {
margin-top: 15px;
font-size: 0.9rem;
}
.chat-control-panel {
top: 20px;
left: 20px;
gap: 10px;
}
.control-btn {
padding: 10px 14px;
font-size: 13px;
}
.control-btn i {
font-size: 14px;
}
}