@w-run/wdesign-ui 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +174 -2
- package/dist/index.d.ts +83 -0
- package/dist/style/ai-msg.css +187 -0
- package/dist/style/alert.css +64 -0
- package/dist/style/audio.css +1363 -0
- package/dist/style/avatar.css +88 -0
- package/dist/style/badge.css +48 -0
- package/dist/style/breadcrumb.css +54 -0
- package/dist/style/button.css +234 -0
- package/dist/style/card.css +71 -0
- package/dist/style/carousel.css +101 -0
- package/dist/style/checkbox.css +129 -0
- package/dist/style/chevron.css +33 -0
- package/dist/style/collapse.css +69 -0
- package/dist/style/command.css +201 -0
- package/dist/style/container.css +7 -0
- package/dist/style/datepicker.css +205 -0
- package/dist/style/descriptions.css +119 -0
- package/dist/style/divider.css +62 -0
- package/dist/style/dot.css +30 -0
- package/dist/style/drawer.css +145 -0
- package/dist/style/dropdown.css +83 -0
- package/dist/style/empty.css +36 -0
- package/dist/style/explorer.css +336 -0
- package/dist/style/file-list.css +92 -0
- package/dist/style/form.css +96 -0
- package/dist/style/grid.css +4 -0
- package/dist/style/group.css +478 -0
- package/dist/style/icon-btn.css +75 -0
- package/dist/style/image-preview.css +81 -0
- package/dist/style/input.css +119 -0
- package/dist/style/list.css +81 -0
- package/dist/style/markdown.css +312 -0
- package/dist/style/modal.css +164 -0
- package/dist/style/notification.css +52 -0
- package/dist/style/otp.css +139 -0
- package/dist/style/pagination.css +120 -0
- package/dist/style/popconfirm.css +87 -0
- package/dist/style/popover.css +110 -0
- package/dist/style/post-item.css +134 -0
- package/dist/style/progress.css +34 -0
- package/dist/style/radio.css +126 -0
- package/dist/style/rate.css +44 -0
- package/dist/style/result.css +54 -0
- package/dist/style/segmented-picker.css +120 -0
- package/dist/style/segmented.css +190 -0
- package/dist/style/select.css +281 -0
- package/dist/style/skeleton.css +31 -0
- package/dist/style/slider.css +81 -0
- package/dist/style/sortable.css +128 -0
- package/dist/style/space.css +25 -0
- package/dist/style/spinner.css +27 -0
- package/dist/style/statistic.css +44 -0
- package/dist/style/steps.css +100 -0
- package/dist/style/switch.css +95 -0
- package/dist/style/table.css +379 -0
- package/dist/style/tabs.css +167 -0
- package/dist/style/tag.css +97 -0
- package/dist/style/timeline.css +521 -0
- package/dist/style/toast.css +37 -0
- package/dist/style/tooltip.css +45 -0
- package/dist/style/tree.css +189 -0
- package/dist/style/typography.css +66 -0
- package/dist/style/upload.css +169 -0
- package/dist/style/vlist.css +49 -0
- package/dist/style/vplayer.css +846 -0
- package/dist/wdesign-ui.css +10300 -0
- package/dist/wdesign-ui.esm.js +16333 -0
- package/package.json +47 -3
- package/tokens.json +385 -0
|
@@ -0,0 +1,846 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
.wd-vplayer {
|
|
3
|
+
position: relative;
|
|
4
|
+
/* 面板用 cqw/cqh 相对播放器定宽 —— 需要这个容器类型 */
|
|
5
|
+
container-type: size;
|
|
6
|
+
container-name: vplayer;
|
|
7
|
+
width: 100%;
|
|
8
|
+
aspect-ratio: 16/9;
|
|
9
|
+
background: #000;
|
|
10
|
+
border-radius: var(--wd-radius-md);
|
|
11
|
+
/*
|
|
12
|
+
* ⚠️ 这里**不能** overflow: hidden。
|
|
13
|
+
* 倍速 / 选集面板是向上弹出的,会被容器裁掉一大半
|
|
14
|
+
* (实测面板 top 超出容器 23px、left 超出 27px,
|
|
15
|
+
* 看起来就是"点了没反应")。
|
|
16
|
+
*
|
|
17
|
+
* 圆角裁切改由内层负责:
|
|
18
|
+
* · video 元素自己裁(它才是需要贴合圆角的那个)
|
|
19
|
+
* · 控制条 / 顶部条是不透明色块,本来就在圆角内
|
|
20
|
+
*/
|
|
21
|
+
color: var(--wd-on-dark-text);
|
|
22
|
+
/* 播放器内部不再继承页面字体,避免外部 line-height 影响垂直居中 */
|
|
23
|
+
line-height: 1.4;
|
|
24
|
+
font-size: 13px;
|
|
25
|
+
user-select: none;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.wd-vplayer:fullscreen {
|
|
29
|
+
border-radius: 0;
|
|
30
|
+
aspect-ratio: auto;
|
|
31
|
+
width: 100vw;
|
|
32
|
+
height: 100vh;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.wd-vplayer.no-cursor {
|
|
36
|
+
cursor: none;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/*
|
|
40
|
+
* 视频元素 + 隐藏原生控件。
|
|
41
|
+
*
|
|
42
|
+
* ⚠️ 只在标签上不写 `controls` 是**不够的**:
|
|
43
|
+
* · iOS Safari 在播放中触摸视频仍会浮出原生控件条
|
|
44
|
+
* · Android Chrome 双击/长按也会唤出
|
|
45
|
+
* 必须用 -webkit-media-controls-* 伪元素逐个关掉。
|
|
46
|
+
*
|
|
47
|
+
* ⚠️ 这些伪元素**不能写在嵌套里** ——
|
|
48
|
+
* SCSS 不会把 `&::-webkit-media-controls-panel` 展开成有效选择器
|
|
49
|
+
* (实测编译后只剩 3 条),必须写成完整选择器。
|
|
50
|
+
*/
|
|
51
|
+
.wd-vplayer__el {
|
|
52
|
+
display: block;
|
|
53
|
+
width: 100%;
|
|
54
|
+
height: 100%;
|
|
55
|
+
object-fit: contain;
|
|
56
|
+
background: #000;
|
|
57
|
+
/* 圆角裁切移到这里:容器不再 hidden */
|
|
58
|
+
border-radius: var(--wd-radius-md);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.wd-vplayer__el::-webkit-media-controls,
|
|
62
|
+
.wd-vplayer__el::-webkit-media-controls-panel,
|
|
63
|
+
.wd-vplayer__el::-webkit-media-controls-play-button,
|
|
64
|
+
.wd-vplayer__el::-webkit-media-controls-start-playback-button,
|
|
65
|
+
.wd-vplayer__el::-webkit-media-controls-overlay-play-button,
|
|
66
|
+
.wd-vplayer__el::-webkit-media-controls-current-time-display,
|
|
67
|
+
.wd-vplayer__el::-webkit-media-controls-time-remaining-display,
|
|
68
|
+
.wd-vplayer__el::-webkit-media-controls-timeline,
|
|
69
|
+
.wd-vplayer__el::-webkit-media-controls-volume-slider,
|
|
70
|
+
.wd-vplayer__el::-webkit-media-controls-mute-button,
|
|
71
|
+
.wd-vplayer__el::-webkit-media-controls-toggle-closed-captions-button,
|
|
72
|
+
.wd-vplayer__el::-webkit-media-controls-fullscreen-button,
|
|
73
|
+
.wd-vplayer__el::-webkit-media-controls-enclosure {
|
|
74
|
+
display: none !important;
|
|
75
|
+
-webkit-appearance: none !important;
|
|
76
|
+
opacity: 0 !important;
|
|
77
|
+
pointer-events: none !important;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* 点击层:铺满画面用于暂停/播放。
|
|
81
|
+
放在 video 之上、控件之下,避免拦截控件点击。 */
|
|
82
|
+
.wd-vplayer__hit {
|
|
83
|
+
position: absolute;
|
|
84
|
+
inset: 0;
|
|
85
|
+
cursor: pointer;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/* 覆盖层(弹幕/字幕):不吃点击 */
|
|
89
|
+
.wd-vplayer__overlay {
|
|
90
|
+
position: absolute;
|
|
91
|
+
inset: 0;
|
|
92
|
+
pointer-events: none;
|
|
93
|
+
display: flex;
|
|
94
|
+
align-items: flex-end;
|
|
95
|
+
padding: 0 12px 88px;
|
|
96
|
+
overflow: hidden;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.wd-vplayer__overlay > * {
|
|
100
|
+
pointer-events: auto;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/* ---------------- 顶部条 ---------------- */
|
|
104
|
+
.wd-vplayer__top {
|
|
105
|
+
position: absolute;
|
|
106
|
+
top: 0;
|
|
107
|
+
left: 0;
|
|
108
|
+
right: 0;
|
|
109
|
+
display: flex;
|
|
110
|
+
align-items: center;
|
|
111
|
+
gap: 10px;
|
|
112
|
+
padding: 12px 14px 26px;
|
|
113
|
+
/* 渐进遮罩:只在顶部压暗,不形成明显色块边界 */
|
|
114
|
+
background: linear-gradient(to bottom, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0));
|
|
115
|
+
opacity: 0;
|
|
116
|
+
transform: translateY(-6px);
|
|
117
|
+
transition: opacity var(--wd-dur-fast) ease, transform var(--wd-dur-fast) ease;
|
|
118
|
+
pointer-events: none;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.wd-vplayer__top.is-visible {
|
|
122
|
+
opacity: 1;
|
|
123
|
+
transform: translateY(0);
|
|
124
|
+
pointer-events: auto;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/*
|
|
128
|
+
顶部条要跟随容器圆角。
|
|
129
|
+
虽然父级有 overflow:hidden,但渐变背景的矩形在圆角处会露出"直角"
|
|
130
|
+
(外层圆角 16px,内层仍是 90°),视觉上像视频被切掉一块。
|
|
131
|
+
*/
|
|
132
|
+
.wd-vplayer__top {
|
|
133
|
+
border-radius: var(--wd-radius-md) var(--wd-radius-md) 0 0;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.wd-vplayer__bottom {
|
|
137
|
+
border-radius: 0 0 var(--wd-radius-md) var(--wd-radius-md);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.wd-vplayer:fullscreen .wd-vplayer__top,
|
|
141
|
+
.wd-vplayer:fullscreen .wd-vplayer__bottom {
|
|
142
|
+
border-radius: 0;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.wd-vplayer__title {
|
|
146
|
+
/* 标题可收缩:窄屏时让位给 LIVE 标识与右侧按钮,而不是把它们挤出画面 */
|
|
147
|
+
flex: 1 1 auto;
|
|
148
|
+
min-width: 0;
|
|
149
|
+
overflow: hidden;
|
|
150
|
+
text-overflow: ellipsis;
|
|
151
|
+
white-space: nowrap;
|
|
152
|
+
font-weight: 600;
|
|
153
|
+
font-size: 13.5px;
|
|
154
|
+
color: var(--wd-on-dark-text);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/* 顶部条的插槽内容不压缩 */
|
|
158
|
+
.wd-vplayer__top > *:not(.wd-vplayer__title) {
|
|
159
|
+
flex: none;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.wd-vplayer__spacer {
|
|
163
|
+
flex: 1;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/* 直播标识 */
|
|
167
|
+
.wd-vplayer__live {
|
|
168
|
+
flex: none;
|
|
169
|
+
display: inline-flex;
|
|
170
|
+
align-items: center;
|
|
171
|
+
gap: 5px;
|
|
172
|
+
padding: 2px 8px 2px 6px;
|
|
173
|
+
border-radius: 999px;
|
|
174
|
+
background: var(--wd-red);
|
|
175
|
+
color: #fff;
|
|
176
|
+
font-size: 11px;
|
|
177
|
+
font-weight: 700;
|
|
178
|
+
letter-spacing: 0.02em;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.wd-vplayer__live-dot {
|
|
182
|
+
width: 6px;
|
|
183
|
+
height: 6px;
|
|
184
|
+
border-radius: 50%;
|
|
185
|
+
background: #fff;
|
|
186
|
+
/* 呼吸灯:live 的视觉锚点 */
|
|
187
|
+
animation: wd-vplayer-live 1.6s ease-in-out infinite;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
@keyframes wd-vplayer-live {
|
|
191
|
+
0%, 100% {
|
|
192
|
+
opacity: 1;
|
|
193
|
+
}
|
|
194
|
+
50% {
|
|
195
|
+
opacity: 0.25;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
@media (prefers-reduced-motion: reduce) {
|
|
199
|
+
.wd-vplayer__live-dot {
|
|
200
|
+
animation: none;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
/* ---------------- 底部条 ---------------- */
|
|
204
|
+
.wd-vplayer__bottom {
|
|
205
|
+
position: absolute;
|
|
206
|
+
left: 0;
|
|
207
|
+
right: 0;
|
|
208
|
+
bottom: 0;
|
|
209
|
+
padding: 30px 12px 8px;
|
|
210
|
+
background: linear-gradient(to top, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.42) 55%, rgba(0, 0, 0, 0));
|
|
211
|
+
opacity: 0;
|
|
212
|
+
transform: translateY(8px);
|
|
213
|
+
transition: opacity var(--wd-dur-fast) ease, transform var(--wd-dur-fast) ease;
|
|
214
|
+
pointer-events: none;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.wd-vplayer__bottom.is-visible {
|
|
218
|
+
opacity: 1;
|
|
219
|
+
transform: translateY(0);
|
|
220
|
+
pointer-events: auto;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/* ---------------- 进度条 ---------------- */
|
|
224
|
+
.wd-vplayer__scrub {
|
|
225
|
+
position: relative;
|
|
226
|
+
height: 16px;
|
|
227
|
+
margin-bottom: 2px;
|
|
228
|
+
cursor: pointer;
|
|
229
|
+
outline: none;
|
|
230
|
+
display: flex;
|
|
231
|
+
align-items: center;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.wd-vplayer__scrub:focus-visible {
|
|
235
|
+
box-shadow: 0 0 0 2px var(--wd-red-on-dark);
|
|
236
|
+
border-radius: 4px;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.wd-vplayer__track,
|
|
240
|
+
.wd-vplayer__buffer,
|
|
241
|
+
.wd-vplayer__played {
|
|
242
|
+
position: absolute;
|
|
243
|
+
left: 0;
|
|
244
|
+
height: 3px;
|
|
245
|
+
border-radius: 2px;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.wd-vplayer__track {
|
|
249
|
+
width: 100%;
|
|
250
|
+
background: var(--wd-on-dark-3);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.wd-vplayer__buffer {
|
|
254
|
+
background: rgba(255, 255, 255, 0.3);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.wd-vplayer__played {
|
|
258
|
+
background: var(--wd-red);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/* 悬停时进度条加粗,更易瞄准;不悬停时保持细条不压画面 */
|
|
262
|
+
.wd-vplayer__scrub:hover .wd-vplayer__track,
|
|
263
|
+
.wd-vplayer__scrub:hover .wd-vplayer__buffer,
|
|
264
|
+
.wd-vplayer__scrub:hover .wd-vplayer__played,
|
|
265
|
+
.wd-vplayer__scrub:focus-visible .wd-vplayer__track,
|
|
266
|
+
.wd-vplayer__scrub:focus-visible .wd-vplayer__played {
|
|
267
|
+
height: 5px;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.wd-vplayer__knob {
|
|
271
|
+
position: absolute;
|
|
272
|
+
top: 50%;
|
|
273
|
+
width: 11px;
|
|
274
|
+
height: 11px;
|
|
275
|
+
margin-left: -5.5px;
|
|
276
|
+
border-radius: 50%;
|
|
277
|
+
background: #fff;
|
|
278
|
+
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
|
|
279
|
+
transform: translateY(-50%) scale(0);
|
|
280
|
+
transition: transform var(--wd-dur-fast) var(--wd-ease-out);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.wd-vplayer__scrub:hover .wd-vplayer__knob,
|
|
284
|
+
.wd-vplayer__scrub:focus-visible .wd-vplayer__knob {
|
|
285
|
+
transform: translateY(-50%) scale(1);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/* 直播:一条脉动的实时线 */
|
|
289
|
+
.wd-vplayer__live-bar {
|
|
290
|
+
height: 3px;
|
|
291
|
+
margin-bottom: 10px;
|
|
292
|
+
border-radius: 2px;
|
|
293
|
+
background: var(--wd-on-dark-3);
|
|
294
|
+
overflow: hidden;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.wd-vplayer__live-bar span {
|
|
298
|
+
display: block;
|
|
299
|
+
width: 100%;
|
|
300
|
+
height: 100%;
|
|
301
|
+
background: linear-gradient(90deg, transparent, var(--wd-red), transparent);
|
|
302
|
+
animation: wd-vplayer-scan 2.2s linear infinite;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
@keyframes wd-vplayer-scan {
|
|
306
|
+
from {
|
|
307
|
+
transform: translateX(-100%);
|
|
308
|
+
}
|
|
309
|
+
to {
|
|
310
|
+
transform: translateX(100%);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
@media (prefers-reduced-motion: reduce) {
|
|
314
|
+
.wd-vplayer__live-bar span {
|
|
315
|
+
animation: none;
|
|
316
|
+
background: var(--wd-red);
|
|
317
|
+
opacity: 0.6;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
/* ---------------- 按钮行 ---------------- */
|
|
321
|
+
.wd-vplayer__row {
|
|
322
|
+
display: flex;
|
|
323
|
+
align-items: center;
|
|
324
|
+
gap: 4px;
|
|
325
|
+
min-height: 34px;
|
|
326
|
+
/*
|
|
327
|
+
* ⚠️ 不能用 overflow-x: auto。
|
|
328
|
+
* 按 CSS 规范,一个轴设为 auto 时另一个轴会自动变成 auto(而非 visible),
|
|
329
|
+
* 于是倍速/选集面板被这条滚动容器裁掉 —— 面板向上弹出、
|
|
330
|
+
* 超出 row 的上边界就看不见了(实测面板顶部超出 23px)。
|
|
331
|
+
*
|
|
332
|
+
* 代价:极窄容器下控件会被压缩(见下面的 flex-shrink 规则),
|
|
333
|
+
* 但**绝不换行** —— 控制条换行会让播放器高度跳变,比挤压更难看。
|
|
334
|
+
*/
|
|
335
|
+
flex-wrap: nowrap;
|
|
336
|
+
/*
|
|
337
|
+
* 明确声明两个轴都是 visible。
|
|
338
|
+
* ⚠️ 这里曾经残留一条 `overflow-y: hidden`,它会把上面刚写的
|
|
339
|
+
* `overflow: visible` 覆盖掉(同为声明属性,后出现的胜出),
|
|
340
|
+
* 面板照样被裁 —— 排查时非常容易漏看。
|
|
341
|
+
*/
|
|
342
|
+
overflow: visible;
|
|
343
|
+
overflow-x: visible;
|
|
344
|
+
overflow-y: visible;
|
|
345
|
+
/* 关键:禁止 flex 子项被压缩 —— 每个按钮都是固定尺寸的点击目标,
|
|
346
|
+
被压窄会变成"看得见但点不准",比溢出更糟 */
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.wd-vplayer__row > * {
|
|
350
|
+
flex-shrink: 0;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.wd-vplayer__btn {
|
|
354
|
+
flex: none;
|
|
355
|
+
display: inline-flex;
|
|
356
|
+
align-items: center;
|
|
357
|
+
justify-content: center;
|
|
358
|
+
min-width: 32px;
|
|
359
|
+
height: 32px;
|
|
360
|
+
padding: 0 6px;
|
|
361
|
+
border: 0;
|
|
362
|
+
/*
|
|
363
|
+
* 图标按钮 → 圆形。
|
|
364
|
+
* 但控制条里也有带文字的按钮(如「字幕」),min-width 会把它撑成椭圆,
|
|
365
|
+
* 所以只在图标型(无文字)时才强制圆形,见下方 :has 规则。
|
|
366
|
+
*/
|
|
367
|
+
border-radius: 50%;
|
|
368
|
+
background: transparent;
|
|
369
|
+
color: var(--wd-on-dark-2);
|
|
370
|
+
font: inherit;
|
|
371
|
+
cursor: pointer;
|
|
372
|
+
transition: background var(--wd-dur-fast) ease, color var(--wd-dur-fast) ease;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
.wd-vplayer__btn:hover:not(:disabled) {
|
|
376
|
+
background: rgba(255, 255, 255, 0.16);
|
|
377
|
+
color: #fff;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
.wd-vplayer__btn:disabled {
|
|
381
|
+
opacity: 0.32;
|
|
382
|
+
cursor: default;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
.wd-vplayer__btn--text {
|
|
386
|
+
font-size: 12.5px;
|
|
387
|
+
font-weight: 700;
|
|
388
|
+
font-variant-numeric: tabular-nums;
|
|
389
|
+
padding: 0 7px;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
/* 播放三角的视觉补偿已修正到图标本身(play.svg),此处不再需要 transform */
|
|
393
|
+
.wd-vplayer__time {
|
|
394
|
+
margin-left: 6px;
|
|
395
|
+
font-size: 12px;
|
|
396
|
+
color: var(--wd-on-dark);
|
|
397
|
+
font-variant-numeric: tabular-nums;
|
|
398
|
+
white-space: nowrap;
|
|
399
|
+
/* 时间是最先被挤坏的元素:/ 两侧必须有空隙,否则 0:00/0:05 读不出来 */
|
|
400
|
+
letter-spacing: 0.01em;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
/*
|
|
404
|
+
* 超窄容器:**按优先级层层隐藏**,而不是让控件换行或被压扁。
|
|
405
|
+
*
|
|
406
|
+
* 优先级(从低到高):音量 < 倍速 < 选集 < 画中画 < 时间
|
|
407
|
+
* 播放键、进度条、全屏始终保持可见。
|
|
408
|
+
*
|
|
409
|
+
* 用容器查询而非媒体查询:播放器可以嵌在任意宽度的容器里
|
|
410
|
+
* (侧栏、弹窗、卡片网格),与视口宽度无关。
|
|
411
|
+
*/
|
|
412
|
+
@container vplayer (max-width: 460px) {
|
|
413
|
+
.wd-vplayer__vol {
|
|
414
|
+
display: none;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
@container vplayer (max-width: 380px) {
|
|
418
|
+
.wd-vplayer__btn--text {
|
|
419
|
+
display: none;
|
|
420
|
+
} /* 倍速文字按钮 */
|
|
421
|
+
}
|
|
422
|
+
@container vplayer (max-width: 320px) {
|
|
423
|
+
.wd-vplayer__panel-wrap {
|
|
424
|
+
display: none;
|
|
425
|
+
} /* 选集 */
|
|
426
|
+
}
|
|
427
|
+
/* ---------------- 音量(悬停展开) ---------------- */
|
|
428
|
+
/*
|
|
429
|
+
* 参考 Plyr 的做法:滑条**始终占据固定宽度**(62px),
|
|
430
|
+
* 展开时只改变透明度 + 位移,不改变布局尺寸。
|
|
431
|
+
*
|
|
432
|
+
* ⚠️ 原来的写法是 `width: 0 → 62px` 过渡 ——
|
|
433
|
+
* 那会**改变盒模型宽度**,把时间、倍速、选集等后续控件
|
|
434
|
+
* 整体往右推,窄容器下直接换行。
|
|
435
|
+
*
|
|
436
|
+
* 现在的做法:
|
|
437
|
+
* width 固定 62px,收起态用 opacity + transform,
|
|
438
|
+
* 都不参与布局,所以其他控件纹丝不动。
|
|
439
|
+
*
|
|
440
|
+
* ⚠️ 不用 scaleX(0.2):那会把圆角横向压扁(2px 半径变成 0.4px),
|
|
441
|
+
* 展开过程中圆头看起来像"刀片"。改用 translateX + 透明度,
|
|
442
|
+
* 形状始终保持不变,只是从按钮里"滑出来"。
|
|
443
|
+
*/
|
|
444
|
+
.wd-vplayer__vol {
|
|
445
|
+
display: flex;
|
|
446
|
+
align-items: center;
|
|
447
|
+
/* 给滑条预留固定宽度,收起时也不收回 */
|
|
448
|
+
flex: none;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
.wd-vplayer__vol-slider {
|
|
452
|
+
width: 62px;
|
|
453
|
+
height: 4px;
|
|
454
|
+
margin: 0 8px 0 2px;
|
|
455
|
+
border-radius: 2px;
|
|
456
|
+
background: var(--wd-on-dark-3);
|
|
457
|
+
cursor: pointer;
|
|
458
|
+
overflow: hidden;
|
|
459
|
+
/* 收起态:滑到按钮后面藏起来,不可见、不可点,但仍占位 */
|
|
460
|
+
opacity: 0;
|
|
461
|
+
transform: translateX(14px);
|
|
462
|
+
pointer-events: none;
|
|
463
|
+
transition: opacity var(--wd-dur) var(--wd-ease-out), transform var(--wd-dur) var(--wd-ease-out);
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
.wd-vplayer__vol:hover .wd-vplayer__vol-slider,
|
|
467
|
+
.wd-vplayer__vol-slider:focus-within,
|
|
468
|
+
.wd-vplayer__vol.is-open .wd-vplayer__vol-slider {
|
|
469
|
+
opacity: 1;
|
|
470
|
+
transform: translateX(0);
|
|
471
|
+
pointer-events: auto;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
.wd-vplayer__vol-fill {
|
|
475
|
+
display: block;
|
|
476
|
+
height: 100%;
|
|
477
|
+
background: var(--wd-on-dark-2);
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
/* ---------------- 弹出面板(倍速 / 选集) ---------------- */
|
|
481
|
+
.wd-vplayer__panel-wrap {
|
|
482
|
+
position: relative;
|
|
483
|
+
flex: none;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
.wd-vplayer__panel {
|
|
487
|
+
position: absolute;
|
|
488
|
+
right: 0;
|
|
489
|
+
bottom: calc(100% + 8px);
|
|
490
|
+
border-radius: var(--wd-radius-sm);
|
|
491
|
+
background: rgba(20, 20, 22, 0.96);
|
|
492
|
+
box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
|
|
493
|
+
backdrop-filter: blur(8px);
|
|
494
|
+
/* 面板用 display 控制,不依赖过渡收尾(时钟停摆时也能正确显隐) */
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
.wd-vplayer__panel--rates {
|
|
498
|
+
display: flex;
|
|
499
|
+
flex-direction: column;
|
|
500
|
+
min-width: 72px;
|
|
501
|
+
padding: 4px;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
.wd-vplayer__panel--rates button {
|
|
505
|
+
padding: 7px 12px;
|
|
506
|
+
border: 0;
|
|
507
|
+
/* 文字按钮 → 胶囊 */
|
|
508
|
+
border-radius: var(--wd-radius-pill);
|
|
509
|
+
background: transparent;
|
|
510
|
+
color: var(--wd-on-dark-2);
|
|
511
|
+
font: inherit;
|
|
512
|
+
font-size: 12.5px;
|
|
513
|
+
text-align: left;
|
|
514
|
+
cursor: pointer;
|
|
515
|
+
white-space: nowrap;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
@media (hover: hover) {
|
|
519
|
+
.wd-vplayer__panel--rates button:hover {
|
|
520
|
+
background: rgba(255, 255, 255, 0.12);
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
.wd-vplayer__panel--rates button.is-on {
|
|
524
|
+
color: var(--wd-red-on-dark);
|
|
525
|
+
font-weight: 700;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
/* 选集面板 */
|
|
529
|
+
/*
|
|
530
|
+
* 选集面板:宽度**跟随播放器**,而不是用固定的 400px。
|
|
531
|
+
*
|
|
532
|
+
* ⚠️ 固定宽度在窄播放器里会溢出到容器外
|
|
533
|
+
* (实测播放器 453px、面板 400px + 按钮定位偏移 → 左侧超出 27px)。
|
|
534
|
+
* 用容器查询单位 cqw 让它恒为播放器宽度的 92%,最宽 420px。
|
|
535
|
+
* 不支持 cqw 的环境回落到 vw。
|
|
536
|
+
*/
|
|
537
|
+
.wd-vplayer__panel--eps {
|
|
538
|
+
width: min(400px, 88cqw, 88vw);
|
|
539
|
+
max-height: min(280px, 50cqh);
|
|
540
|
+
display: flex;
|
|
541
|
+
flex-direction: column;
|
|
542
|
+
/*
|
|
543
|
+
* ⚠️ 面板挂在「选集」按钮的 wrap 上,而该按钮靠近右端 ——
|
|
544
|
+
* 直接 `right: 0` 只是相对按钮,面板比按钮宽就会向左溢出
|
|
545
|
+
* (实测左侧超出播放器 48px)。
|
|
546
|
+
*
|
|
547
|
+
* 正解:用固定偏移把面板右边缘**对到播放器右边缘**。
|
|
548
|
+
* 播放器右侧内距是 12px(控制条 padding),按钮宽 32px,
|
|
549
|
+
* 所以从按钮右缘再往右 12px 即可。
|
|
550
|
+
*/
|
|
551
|
+
right: -12px;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
.wd-vplayer__eps-head {
|
|
555
|
+
flex: none;
|
|
556
|
+
padding: 10px 12px 8px;
|
|
557
|
+
font-size: 12px;
|
|
558
|
+
font-weight: 700;
|
|
559
|
+
color: var(--wd-on-dark);
|
|
560
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
.wd-vplayer__eps-grid {
|
|
564
|
+
display: grid;
|
|
565
|
+
grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
|
|
566
|
+
gap: 6px;
|
|
567
|
+
padding: 10px;
|
|
568
|
+
overflow-y: auto;
|
|
569
|
+
overscroll-behavior: contain;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
.wd-vplayer__ep {
|
|
573
|
+
position: relative;
|
|
574
|
+
padding: 7px 10px;
|
|
575
|
+
border: 0;
|
|
576
|
+
/* 剧集文字按钮 → 胶囊 */
|
|
577
|
+
border-radius: var(--wd-radius-pill);
|
|
578
|
+
background: rgba(255, 255, 255, 0.08);
|
|
579
|
+
color: var(--wd-on-dark-2);
|
|
580
|
+
font: inherit;
|
|
581
|
+
font-size: 12px;
|
|
582
|
+
cursor: pointer;
|
|
583
|
+
overflow: hidden;
|
|
584
|
+
text-overflow: ellipsis;
|
|
585
|
+
white-space: nowrap;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
@media (hover: hover) {
|
|
589
|
+
.wd-vplayer__ep:hover {
|
|
590
|
+
background: rgba(255, 255, 255, 0.18);
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
.wd-vplayer__ep.is-on {
|
|
594
|
+
background: var(--wd-red);
|
|
595
|
+
color: #fff;
|
|
596
|
+
font-weight: 700;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
.wd-vplayer__ep.is-off {
|
|
600
|
+
opacity: 0.38;
|
|
601
|
+
cursor: default;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
.wd-vplayer__ep-tag {
|
|
605
|
+
position: absolute;
|
|
606
|
+
top: 0;
|
|
607
|
+
right: 0;
|
|
608
|
+
padding: 0 3px;
|
|
609
|
+
font-size: 9px;
|
|
610
|
+
font-style: normal;
|
|
611
|
+
line-height: 1.5;
|
|
612
|
+
background: rgba(0, 0, 0, 0.45);
|
|
613
|
+
border-bottom-left-radius: 4px;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
/* ---------------- 中央大按钮 / 加载 / 错误 ---------------- */
|
|
617
|
+
.wd-vplayer__big {
|
|
618
|
+
position: absolute;
|
|
619
|
+
top: 50%;
|
|
620
|
+
left: 50%;
|
|
621
|
+
transform: translate(-50%, -50%);
|
|
622
|
+
display: flex;
|
|
623
|
+
align-items: center;
|
|
624
|
+
justify-content: center;
|
|
625
|
+
width: 68px;
|
|
626
|
+
height: 68px;
|
|
627
|
+
padding: 0;
|
|
628
|
+
border: 0;
|
|
629
|
+
border-radius: 50%;
|
|
630
|
+
background: rgba(0, 0, 0, 0.5);
|
|
631
|
+
color: #fff;
|
|
632
|
+
cursor: pointer;
|
|
633
|
+
backdrop-filter: blur(4px);
|
|
634
|
+
transition: transform var(--wd-dur-fast) var(--wd-ease-out), background var(--wd-dur-fast) ease;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
/*
|
|
638
|
+
播放三角的视觉补偿已挪到图标自身(play.svg 内平移 12.4 viewBox 单位)。
|
|
639
|
+
图标的视觉重心是图标的责任,不该让每个使用方各自写 transform 补偿 ——
|
|
640
|
+
那样每处补偿量都得单独调,且容易互相覆盖。
|
|
641
|
+
*/
|
|
642
|
+
.wd-vplayer__big:hover {
|
|
643
|
+
transform: translate(-50%, -50%) scale(1.06);
|
|
644
|
+
background: var(--wd-red);
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
.wd-vplayer__loading {
|
|
648
|
+
position: absolute;
|
|
649
|
+
top: 50%;
|
|
650
|
+
left: 50%;
|
|
651
|
+
transform: translate(-50%, -50%);
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
.wd-vplayer__spinner {
|
|
655
|
+
display: block;
|
|
656
|
+
width: 30px;
|
|
657
|
+
height: 30px;
|
|
658
|
+
border: 2.5px solid rgba(255, 255, 255, 0.22);
|
|
659
|
+
border-top-color: #fff;
|
|
660
|
+
border-radius: 50%;
|
|
661
|
+
animation: wd-vplayer-spin 0.8s linear infinite;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
@keyframes wd-vplayer-spin {
|
|
665
|
+
to {
|
|
666
|
+
transform: rotate(360deg);
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
.wd-vplayer__error {
|
|
670
|
+
position: absolute;
|
|
671
|
+
inset: 0;
|
|
672
|
+
display: flex;
|
|
673
|
+
flex-direction: column;
|
|
674
|
+
align-items: center;
|
|
675
|
+
justify-content: center;
|
|
676
|
+
gap: 8px;
|
|
677
|
+
background: rgba(0, 0, 0, 0.72);
|
|
678
|
+
color: var(--wd-on-dark-text);
|
|
679
|
+
font-size: 13px;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
/* 弹幕开关的关闭态:文字变灰,与"已开启"区分 */
|
|
683
|
+
.wd-vplayer__btn--text.is-muted {
|
|
684
|
+
color: var(--wd-on-dark-3);
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
/* =============================================================
|
|
688
|
+
* 选集抽屉(右侧滑出)
|
|
689
|
+
*
|
|
690
|
+
* ⚠️ 为什么不用弹出层:
|
|
691
|
+
* 浮层是从按钮上方弹出的,宽度会被按钮位置限制,
|
|
692
|
+
* 而且必须超出播放器上边界才能容纳(集数多时更高)——
|
|
693
|
+
* 那就一定会被容器裁切。
|
|
694
|
+
*
|
|
695
|
+
* 抽屉方案:贴着播放器右边缘、占满整个高度,
|
|
696
|
+
* 内部竖向滚动。永远不会超出播放器,也不需要裁切。
|
|
697
|
+
* ============================================================= */
|
|
698
|
+
.wd-vplayer__drawer {
|
|
699
|
+
position: absolute;
|
|
700
|
+
top: 0;
|
|
701
|
+
right: 0;
|
|
702
|
+
bottom: 0;
|
|
703
|
+
z-index: 6;
|
|
704
|
+
width: min(240px, 62%);
|
|
705
|
+
flex-direction: column;
|
|
706
|
+
background: rgba(18, 18, 20, 0.94);
|
|
707
|
+
backdrop-filter: blur(14px);
|
|
708
|
+
/*
|
|
709
|
+
* 显隐用 display 兜底,动效只做锦上添花。
|
|
710
|
+
*
|
|
711
|
+
* ⚠️ 原本只靠 transform + opacity + transition 实现,
|
|
712
|
+
* 在动画时钟停摆的环境(无头渲染 / 后台标签页 / 省电模式)里,
|
|
713
|
+
* transition 卡在起始帧 → opacity 永远是 0,
|
|
714
|
+
* 面板"打开了但看不见"。
|
|
715
|
+
*
|
|
716
|
+
* 现在:display: none 完全不渲染,.is-open 时 display: flex,
|
|
717
|
+
* 动画只是附加效果,不参与"是否可见"的判定。
|
|
718
|
+
*/
|
|
719
|
+
display: none;
|
|
720
|
+
transform: translateX(100%);
|
|
721
|
+
opacity: 0;
|
|
722
|
+
pointer-events: none;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
/*
|
|
726
|
+
* ⚠️ 完全不用动画。
|
|
727
|
+
*
|
|
728
|
+
* 试过两条路都不行(无头环境下动画时钟停摆):
|
|
729
|
+
* · transition + transform/opacity → opacity 卡在 0
|
|
730
|
+
* · keyframes + animation → opacity 仍卡在 from 帧
|
|
731
|
+
*
|
|
732
|
+
* 这里显隐只由 display 决定,静态属性直接给最终值。
|
|
733
|
+
* 代价是失去滑入动效 —— 但"面板打不开"比"没有动效"严重得多。
|
|
734
|
+
* 真实浏览器里再加过渡会更自然,但正确性优先。
|
|
735
|
+
*/
|
|
736
|
+
.wd-vplayer__drawer.is-open {
|
|
737
|
+
display: flex;
|
|
738
|
+
transform: none;
|
|
739
|
+
opacity: 1;
|
|
740
|
+
pointer-events: auto;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
.wd-vplayer__drawer-head {
|
|
744
|
+
flex: none;
|
|
745
|
+
display: flex;
|
|
746
|
+
align-items: center;
|
|
747
|
+
justify-content: space-between;
|
|
748
|
+
gap: 10px;
|
|
749
|
+
padding: 12px 12px 10px 14px;
|
|
750
|
+
font-size: 12.5px;
|
|
751
|
+
font-weight: 700;
|
|
752
|
+
color: var(--wd-on-dark-text);
|
|
753
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.08);
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
.wd-vplayer__drawer-close {
|
|
757
|
+
display: inline-flex;
|
|
758
|
+
align-items: center;
|
|
759
|
+
justify-content: center;
|
|
760
|
+
flex: none;
|
|
761
|
+
width: 24px;
|
|
762
|
+
height: 24px;
|
|
763
|
+
padding: 0;
|
|
764
|
+
border: 0;
|
|
765
|
+
border-radius: 50%;
|
|
766
|
+
background: transparent;
|
|
767
|
+
color: var(--wd-on-dark-2);
|
|
768
|
+
cursor: pointer;
|
|
769
|
+
transition: background var(--wd-dur-fast) ease;
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
@media (hover: hover) {
|
|
773
|
+
.wd-vplayer__drawer-close:hover {
|
|
774
|
+
background: rgba(255, 255, 255, 0.14);
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
/*
|
|
778
|
+
* 抽屉主体:**竖向滚动**。
|
|
779
|
+
* ⚠️ 必须 overscroll-behavior: contain,
|
|
780
|
+
* 否则集数多时滚到底会带动整个页面滚动。
|
|
781
|
+
*/
|
|
782
|
+
.wd-vplayer__drawer-body {
|
|
783
|
+
flex: 1;
|
|
784
|
+
min-height: 0;
|
|
785
|
+
overflow-y: auto;
|
|
786
|
+
overscroll-behavior: contain;
|
|
787
|
+
padding: 8px;
|
|
788
|
+
display: grid;
|
|
789
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
790
|
+
grid-auto-rows: min-content;
|
|
791
|
+
gap: 6px;
|
|
792
|
+
scrollbar-width: thin;
|
|
793
|
+
scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
.wd-vplayer__drawer-body::-webkit-scrollbar {
|
|
797
|
+
width: 5px;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
.wd-vplayer__drawer-body::-webkit-scrollbar-thumb {
|
|
801
|
+
background: rgba(255, 255, 255, 0.28);
|
|
802
|
+
border-radius: 999px;
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
/* 抽屉内的集数按钮:胶囊,够小能排三列 */
|
|
806
|
+
.wd-vplayer__drawer .wd-vplayer__ep {
|
|
807
|
+
display: inline-flex;
|
|
808
|
+
align-items: center;
|
|
809
|
+
justify-content: center;
|
|
810
|
+
gap: 3px;
|
|
811
|
+
padding: 7px 4px;
|
|
812
|
+
border: 0;
|
|
813
|
+
border-radius: var(--wd-radius-pill);
|
|
814
|
+
background: rgba(255, 255, 255, 0.07);
|
|
815
|
+
color: var(--wd-on-dark-2);
|
|
816
|
+
font: inherit;
|
|
817
|
+
font-size: 12px;
|
|
818
|
+
font-weight: 600;
|
|
819
|
+
white-space: nowrap;
|
|
820
|
+
overflow: hidden;
|
|
821
|
+
cursor: pointer;
|
|
822
|
+
transition: background var(--wd-dur-fast) ease, color var(--wd-dur-fast) ease;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
@media (hover: hover) {
|
|
826
|
+
.wd-vplayer__drawer .wd-vplayer__ep:hover:not(:disabled) {
|
|
827
|
+
background: rgba(255, 255, 255, 0.16);
|
|
828
|
+
color: #fff;
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
.wd-vplayer__drawer .wd-vplayer__ep.is-on {
|
|
832
|
+
background: var(--wd-red);
|
|
833
|
+
color: #fff;
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
.wd-vplayer__drawer .wd-vplayer__ep.is-off {
|
|
837
|
+
color: rgba(255, 255, 255, 0.3);
|
|
838
|
+
cursor: not-allowed;
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
/* 超窄容器:抽屉占满全宽 */
|
|
842
|
+
@container vplayer (max-width: 380px) {
|
|
843
|
+
.wd-vplayer__drawer {
|
|
844
|
+
width: 100%;
|
|
845
|
+
}
|
|
846
|
+
}
|