@douyinfe/semi-foundation 2.79.0 → 2.80.0-beta.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/lib/cjs/videoPlayer/animation.scss +7 -0
- package/lib/cjs/videoPlayer/constants.d.ts +30 -0
- package/lib/cjs/videoPlayer/constants.js +48 -0
- package/lib/cjs/videoPlayer/foundation.d.ts +75 -0
- package/lib/cjs/videoPlayer/foundation.js +291 -0
- package/lib/cjs/videoPlayer/progressFoundation.d.ts +38 -0
- package/lib/cjs/videoPlayer/progressFoundation.js +131 -0
- package/lib/cjs/videoPlayer/variables.scss +75 -0
- package/lib/cjs/videoPlayer/videoPlayer.css +279 -0
- package/lib/cjs/videoPlayer/videoPlayer.scss +323 -0
- package/lib/es/videoPlayer/animation.scss +7 -0
- package/lib/es/videoPlayer/constants.d.ts +30 -0
- package/lib/es/videoPlayer/constants.js +43 -0
- package/lib/es/videoPlayer/foundation.d.ts +75 -0
- package/lib/es/videoPlayer/foundation.js +283 -0
- package/lib/es/videoPlayer/progressFoundation.d.ts +38 -0
- package/lib/es/videoPlayer/progressFoundation.js +123 -0
- package/lib/es/videoPlayer/variables.scss +75 -0
- package/lib/es/videoPlayer/videoPlayer.css +279 -0
- package/lib/es/videoPlayer/videoPlayer.scss +323 -0
- package/package.json +4 -4
- package/videoPlayer/animation.scss +7 -0
- package/videoPlayer/constants.ts +39 -0
- package/videoPlayer/foundation.ts +332 -0
- package/videoPlayer/progressFoundation.ts +136 -0
- package/videoPlayer/variables.scss +75 -0
- package/videoPlayer/videoPlayer.scss +323 -0
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
@import './variables.scss';
|
|
2
|
+
@import './animation.scss';
|
|
3
|
+
|
|
4
|
+
$module: #{$prefix}-videoPlayer;
|
|
5
|
+
|
|
6
|
+
.#{$module} {
|
|
7
|
+
position: relative;
|
|
8
|
+
display: inline-block;
|
|
9
|
+
width: 100%;
|
|
10
|
+
height: 100%;
|
|
11
|
+
|
|
12
|
+
// Hide native controls
|
|
13
|
+
::-webkit-media-controls {
|
|
14
|
+
display: none;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&-wrapper {
|
|
18
|
+
width: 100%;
|
|
19
|
+
height: 100%;
|
|
20
|
+
position: relative;
|
|
21
|
+
line-height: 0;
|
|
22
|
+
|
|
23
|
+
video {
|
|
24
|
+
width: 100%;
|
|
25
|
+
height: 100%;
|
|
26
|
+
object-fit: contain;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&-dark {
|
|
30
|
+
background-color: $color-videoPlayer_theme_dark-bg;
|
|
31
|
+
color: $color-videoPlayer_theme_dark-text;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&-light {
|
|
35
|
+
background-color: $color-videoPlayer_theme_light-bg;
|
|
36
|
+
color: $color-videoPlayer_theme_light-text;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&-pause {
|
|
42
|
+
top: 0;
|
|
43
|
+
left: 0;
|
|
44
|
+
width: 100%;
|
|
45
|
+
height: 100%;
|
|
46
|
+
position: absolute;
|
|
47
|
+
@include all-center;
|
|
48
|
+
pointer-events: none;
|
|
49
|
+
|
|
50
|
+
svg {
|
|
51
|
+
font-size: 88px;
|
|
52
|
+
color: $color-videoPlayer_pause-bg;
|
|
53
|
+
pointer-events: none;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&-error {
|
|
58
|
+
top: 0;
|
|
59
|
+
left: 0;
|
|
60
|
+
width: 100%;
|
|
61
|
+
height: 100%;
|
|
62
|
+
position: absolute;
|
|
63
|
+
@include all-center;
|
|
64
|
+
flex-direction: column;
|
|
65
|
+
font-weight: $font-videoPlayer_error-fontWeight;
|
|
66
|
+
font-size: $font-videoPlayer_error-fontSize;
|
|
67
|
+
|
|
68
|
+
&-svg {
|
|
69
|
+
margin-bottom: $spacing-videoPlayer_error_svg-marginBottom;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&-dark {
|
|
73
|
+
background-color: $color-videoPlayer_theme_dark-bg;
|
|
74
|
+
color: $color-videoPlayer_theme_dark-text;
|
|
75
|
+
|
|
76
|
+
path {
|
|
77
|
+
fill: $color-videoPlayer_theme_dark-text;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&-light {
|
|
83
|
+
background-color: $color-videoPlayer_theme_light-bg;
|
|
84
|
+
color: $color-videoPlayer_theme_light-text;
|
|
85
|
+
|
|
86
|
+
path {
|
|
87
|
+
fill: $color-videoPlayer_theme_light-text;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&-poster {
|
|
93
|
+
position: absolute;
|
|
94
|
+
top: 0;
|
|
95
|
+
left: 0;
|
|
96
|
+
width: 100%;
|
|
97
|
+
height: 100%;
|
|
98
|
+
pointer-events: none;
|
|
99
|
+
|
|
100
|
+
&-hide {
|
|
101
|
+
opacity: 0;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&-notification {
|
|
106
|
+
position: absolute;
|
|
107
|
+
bottom: $height-videoPlayer_controls_menu-default + $spacing-videoPlayer_notification-bottom;
|
|
108
|
+
left: $spacing-videoPlayer_notification-left;
|
|
109
|
+
text-align: center;
|
|
110
|
+
background-color: $color-videoPlayer_notification-bg;
|
|
111
|
+
color: $color-videoPlayer_notification-text;
|
|
112
|
+
padding: $spacing-videoPlayer_notification_text-paddingY $spacing-videoPlayer_notification_text-paddingX;
|
|
113
|
+
line-height: $font-videoPlayer_notification-lineHeight;
|
|
114
|
+
border-radius: $radius-videoPlayer_notification;
|
|
115
|
+
font-size: $font-videoPlayer_notification-fontSize;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&-mirror {
|
|
119
|
+
video {
|
|
120
|
+
transform: rotateX(0deg) rotateY(180deg);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&-controls {
|
|
125
|
+
position: absolute;
|
|
126
|
+
bottom: 0;
|
|
127
|
+
left: 0;
|
|
128
|
+
right: 0;
|
|
129
|
+
height: fit-content;
|
|
130
|
+
opacity: 1;
|
|
131
|
+
transition: opacity $animation_duration-videoPlayer_controls-show ease-in-out;
|
|
132
|
+
z-index: 1;
|
|
133
|
+
|
|
134
|
+
&-hide {
|
|
135
|
+
opacity: 0;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&-menu {
|
|
139
|
+
display: flex;
|
|
140
|
+
justify-content: space-between;
|
|
141
|
+
align-items: center;
|
|
142
|
+
box-sizing: border-box;
|
|
143
|
+
height: $height-videoPlayer_controls_menu-default;
|
|
144
|
+
background-color: $color-videoPlayer_controls-bg;
|
|
145
|
+
padding: $spacing-videoPlayer-controls-padding;
|
|
146
|
+
|
|
147
|
+
&-left,
|
|
148
|
+
&-right {
|
|
149
|
+
display: flex;
|
|
150
|
+
align-items: center;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
&-item {
|
|
154
|
+
margin-right: $spacing-videoPlayer-controls_item-gap;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&-button {
|
|
158
|
+
svg {
|
|
159
|
+
color: $color-videoPlayer_controls-text;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
&-time {
|
|
165
|
+
color: $color-videoPlayer_controls-text;
|
|
166
|
+
font-size: $font-videoPlayer_controls_time_text-fontSize;
|
|
167
|
+
margin-right: $spacing-videoPlayer-controls_item-gap;
|
|
168
|
+
padding: 0 $spacing-videoPlayer-controls_time-paddingX;
|
|
169
|
+
font-variant-numeric: tabular-nums;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
&-popover {
|
|
173
|
+
background-color: transparent;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
&-volume {
|
|
177
|
+
box-sizing: border-box;
|
|
178
|
+
width: $width-videoPlayer_controls_volume-default;
|
|
179
|
+
height: $height-videoPlayer_controls_volume-default;
|
|
180
|
+
background-color: $color-videoPlayer_controls_item-bg;
|
|
181
|
+
color: $color-videoPlayer_controls_popup_item-text-default;
|
|
182
|
+
border-radius: $radius-videoPlayer_controls_popup;
|
|
183
|
+
padding: $spacing-videoPlayer-controls_volume_popup-paddingY $spacing-videoPlayer-controls_volume_popup-paddingX;
|
|
184
|
+
line-height: $font-videoPlayer_controls_popup_item-lineHeight;
|
|
185
|
+
font-size: $font-videoPlayer_controls_item-fontSize;
|
|
186
|
+
user-select: none;
|
|
187
|
+
|
|
188
|
+
&-title {
|
|
189
|
+
padding: $spacing-videoPlayer-controls_volume_title-paddingX $spacing-videoPlayer-controls_volume_title-paddingY;
|
|
190
|
+
text-align: center;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
&-popup {
|
|
195
|
+
@include all-center;
|
|
196
|
+
width: $width-videoPlayer_controls_popup_item-default;
|
|
197
|
+
height: $height-videoPlayer_controls_popup-default;
|
|
198
|
+
background-color: $color-videoPlayer_controls_item_popup-bg-default;
|
|
199
|
+
color: $color-videoPlayer_controls-text;
|
|
200
|
+
font-weight: $font-videoPlayer_controls_popup_item-fontWeight;
|
|
201
|
+
font-size: $font-videoPlayer_controls_item-fontSize;
|
|
202
|
+
line-height: $font-videoPlayer_controls_popup_item-lineHeight;
|
|
203
|
+
border-radius: $radius-videoPlayer_controls_item;
|
|
204
|
+
cursor: pointer;
|
|
205
|
+
|
|
206
|
+
&-menu {
|
|
207
|
+
width: $width-videoPlayer_controls_popup-default;
|
|
208
|
+
background-color: $color-videoPlayer_controls_item_popup-bg-default;
|
|
209
|
+
border-radius: $radius-videoPlayer_controls_popup;
|
|
210
|
+
|
|
211
|
+
&-item {
|
|
212
|
+
@include all-center;
|
|
213
|
+
padding: $spacing-videoPlayer-controls_popup-paddingY $spacing-videoPlayer-controls_popup-paddingX;
|
|
214
|
+
height: $height-videoPlayer_controls_popup_item-default;
|
|
215
|
+
color: $color-videoPlayer_controls-text;
|
|
216
|
+
font-size: $font-videoPlayer_controls_item-fontSize;
|
|
217
|
+
|
|
218
|
+
&:hover {
|
|
219
|
+
background-color: $color-videoPlayer_controls_item_popup-bg-hover !important;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.#{$prefix}-dropdown-item-active {
|
|
224
|
+
color: $color-videoPlayer_controls_popup_item-text-active;
|
|
225
|
+
font-weight: $font-videoPlayer_controls_popup_item-fontWeight;
|
|
226
|
+
cursor: pointer;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
&-progress {
|
|
234
|
+
position: relative;
|
|
235
|
+
height: $height-videoPlayer_progress_bar_hotSpot-default;
|
|
236
|
+
display: flex;
|
|
237
|
+
align-items: center;
|
|
238
|
+
justify-content: center;
|
|
239
|
+
cursor: pointer;
|
|
240
|
+
margin: $spacing-videoPlayer-progress_bar_wrapper-marginY $spacing-videoPlayer-progress_bar_wrapper-marginX;
|
|
241
|
+
|
|
242
|
+
&-markers {
|
|
243
|
+
position: absolute;
|
|
244
|
+
width: 100%;
|
|
245
|
+
height: 100%;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
&-tooltip {
|
|
249
|
+
top: $spacing-videoPlayer-progress_bar_tooltip-top;
|
|
250
|
+
|
|
251
|
+
&-content {
|
|
252
|
+
@include all-center;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
&-slider {
|
|
257
|
+
position: absolute;
|
|
258
|
+
width: 100%;
|
|
259
|
+
height: 100%;
|
|
260
|
+
left: 0;
|
|
261
|
+
bottom: 0;
|
|
262
|
+
border-radius: $radius-videoPlayer_progress_bar;
|
|
263
|
+
|
|
264
|
+
&-active, &:hover {
|
|
265
|
+
.#{$module}-progress-slider-list,
|
|
266
|
+
.#{$module}-progress-slider-played,
|
|
267
|
+
.#{$module}-progress-slider-buffered {
|
|
268
|
+
height: $height-videoPlayer_progress_bar-hover;
|
|
269
|
+
transition: transform $animation_duration-videoPlayer_slider-in;
|
|
270
|
+
transition-timing-function: $animation_function-videoPlayer_slider-in;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
&-list {
|
|
275
|
+
position: absolute;
|
|
276
|
+
bottom: 0;
|
|
277
|
+
left: 0;
|
|
278
|
+
background-color: $color-videoPlayer_progress_bar-bg-unplayed;
|
|
279
|
+
height: $height-videoPlayer_progress_bar-default;
|
|
280
|
+
width: calc(100% - $spacing-videoPlayer-progress_bar_chapter-marginRight);
|
|
281
|
+
margin-right: $spacing-videoPlayer-progress_bar_chapter-marginRight;
|
|
282
|
+
border-radius: $radius-videoPlayer_progress_bar;
|
|
283
|
+
transition: transform $animation_duration-videoPlayer_slider-in;
|
|
284
|
+
transition-timing-function: $animation_function-videoPlayer_slider-out;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
&-played {
|
|
288
|
+
position: absolute;
|
|
289
|
+
bottom: 0;
|
|
290
|
+
left: 0;
|
|
291
|
+
background-color: $color-videoPlayer_progress_bar-bg-played;
|
|
292
|
+
height: $height-videoPlayer_progress_bar-default;
|
|
293
|
+
border-radius: $radius-videoPlayer_progress_bar;
|
|
294
|
+
transition: transform $animation_duration-videoPlayer_slider-in;
|
|
295
|
+
transition-timing-function: $animation_function-videoPlayer_slider-out;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
&-buffered {
|
|
299
|
+
position: absolute;
|
|
300
|
+
bottom: 0;
|
|
301
|
+
left: 0;
|
|
302
|
+
background-color: $color-videoPlayer_progress_bar-bg-loaded;
|
|
303
|
+
height: $height-videoPlayer_progress_bar-default;
|
|
304
|
+
border-radius: $radius-videoPlayer_progress_bar;
|
|
305
|
+
transition: transform $animation_duration-videoPlayer_slider-in;
|
|
306
|
+
transition-timing-function: $animation_function-videoPlayer_slider-out;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
&-handle {
|
|
311
|
+
box-sizing: border-box;
|
|
312
|
+
position: absolute;
|
|
313
|
+
width: $height-videoPlayer_progress_bar_handle;
|
|
314
|
+
height: $height-videoPlayer_progress_bar_handle;
|
|
315
|
+
background-color: $color-videoPlayer_progress_bar_handle-bg;
|
|
316
|
+
border: 1px solid $color-videoPlayer_progress_bar_handle-border;
|
|
317
|
+
box-shadow: 0px 0px 4px 0px $color-videoPlayer_progress_bar_handle-shadow;
|
|
318
|
+
border-radius: $radius-videoPlayer_progress_bar_handle;
|
|
319
|
+
top: $spacing-videoPlayer_progress_bar_handle-top;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
}
|
|
323
|
+
}
|