@xiping/react-components 1.0.55 → 1.0.58
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/dist/cjs/components/blur-text/BlurText.d.ts +16 -0
- package/dist/cjs/components/blur-text/BlurText.js +1 -0
- package/dist/cjs/components/blur-text/index.d.ts +2 -0
- package/dist/cjs/components/button/Button.css +1 -0
- package/dist/cjs/components/button/Button.js +1 -1
- package/dist/cjs/components/comic-text/ComicText.css +1 -0
- package/dist/cjs/components/comic-text/ComicText.js +2 -2
- package/dist/cjs/components/dock/Duck.css +1 -0
- package/dist/cjs/components/dock/Duck.d.ts +2 -4
- package/dist/cjs/components/dock/Duck.js +1 -1
- package/dist/cjs/components/flip-text/FlipText.css +1 -0
- package/dist/cjs/components/flip-text/FlipText.js +1 -1
- package/dist/cjs/components/gradient-text/index.css +1 -0
- package/dist/cjs/components/gradient-text/index.js +1 -1
- package/dist/cjs/components/hyper-text/HyperText.css +1 -0
- package/dist/cjs/components/hyper-text/index.js +1 -1
- package/dist/cjs/components/image-compare/ImageCompare.css +1 -0
- package/dist/cjs/components/image-compare/ImageCompare.d.ts +4 -2
- package/dist/cjs/components/image-compare/ImageCompare.js +1 -1
- package/dist/cjs/components/image-viewer/ImageThumbnails.css +1 -0
- package/dist/cjs/components/image-viewer/ImageThumbnails.js +1 -1
- package/dist/cjs/components/image-viewer/ImageViewer.css +1 -0
- package/dist/cjs/components/image-viewer/ImageViewer.js +1 -1
- package/dist/cjs/components/message/Message.css +1 -0
- package/dist/cjs/components/message/Message.js +1 -1
- package/dist/cjs/components/pointer/Pointer.css +1 -0
- package/dist/cjs/components/pointer/Pointer.js +1 -1
- package/dist/cjs/components/scratch-to-reveal/ScratchToReveal.css +1 -0
- package/dist/cjs/components/scratch-to-reveal/ScratchToReveal.js +1 -1
- package/dist/cjs/components/shimmer-button/ShimmerButton.css +1 -0
- package/dist/cjs/components/shimmer-button/ShimmerButton.js +1 -1
- package/dist/cjs/components/shiny-button/ShinyButton.css +1 -0
- package/dist/cjs/components/shiny-button/ShinyButton.js +1 -1
- package/dist/cjs/components/shiny-text/ShinyText.css +1 -0
- package/dist/cjs/components/shiny-text/ShinyText.d.ts +16 -0
- package/dist/cjs/components/shiny-text/ShinyText.js +1 -0
- package/dist/cjs/components/shiny-text/index.d.ts +2 -0
- package/dist/cjs/components/sparkles-text/SparklesText.css +1 -0
- package/dist/cjs/components/sparkles-text/SparklesText.js +1 -1
- package/dist/cjs/components/split-text/SplitText.css +1 -0
- package/dist/cjs/components/split-text/SplitText.js +1 -1
- package/dist/cjs/components/subtitle-player/CurrentMode.css +1 -0
- package/dist/cjs/components/subtitle-player/CurrentMode.d.ts +2 -0
- package/dist/cjs/components/subtitle-player/CurrentMode.js +2 -2
- package/dist/cjs/components/subtitle-player/LyricsMode.css +1 -0
- package/dist/cjs/components/subtitle-player/LyricsMode.d.ts +2 -0
- package/dist/cjs/components/subtitle-player/LyricsMode.js +2 -2
- package/dist/cjs/components/subtitle-player/SubtitlePlayer.css +1 -0
- package/dist/cjs/components/subtitle-player/SubtitlePlayer.d.ts +2 -0
- package/dist/cjs/components/subtitle-player/SubtitlePlayer.js +1 -1
- package/dist/cjs/components/text-animate/TextAnimate.css +1 -0
- package/dist/cjs/components/text-animate/TextAnimate.js +2 -2
- package/dist/cjs/components/text-type/TextType.css +1 -0
- package/dist/cjs/components/text-type/TextType.js +1 -1
- package/dist/cjs/components/txt-reader/index.module.css +1 -0
- package/dist/cjs/components/txt-reader/index.module.css.js +1 -1
- package/dist/cjs/components/typing-animation/index.css +1 -0
- package/dist/cjs/components/typing-animation/index.js +1 -1
- package/dist/cjs/components/variable-proximity/index.css +1 -0
- package/dist/cjs/components/variable-proximity/index.js +1 -1
- package/dist/cjs/components/video-dialog/VideoDialog.css +1 -0
- package/dist/cjs/components/video-dialog/VideoDialog.js +1 -1
- package/dist/cjs/components/video-subtitle-player/VideoSubtitlePlayer.css +1 -0
- package/dist/cjs/components/video-subtitle-player/VideoSubtitlePlayer.d.ts +3 -3
- package/dist/cjs/components/video-subtitle-player/VideoSubtitlePlayer.js +1 -1
- package/dist/cjs/components/video-subtitle-player/VideoSubtitlePlayer.mobile.css +1 -0
- package/dist/cjs/components/video-subtitle-player/VideoSubtitlePlayer.pc.css +1 -0
- package/dist/cjs/components/video-subtitle-player/VideoSubtitlePlayerMobile.d.ts +20 -0
- package/dist/cjs/components/video-subtitle-player/VideoSubtitlePlayerMobile.js +1 -0
- package/dist/cjs/components/video-subtitle-player/VideoSubtitlePlayerPC.d.ts +23 -0
- package/dist/cjs/components/video-subtitle-player/VideoSubtitlePlayerPC.js +1 -0
- package/dist/cjs/components/video-subtitle-player/layouts/VideoSubtitlePlayerLayoutMobile.d.ts +8 -0
- package/dist/cjs/components/video-subtitle-player/layouts/VideoSubtitlePlayerLayoutMobile.js +1 -0
- package/dist/cjs/components/video-subtitle-player/layouts/VideoSubtitlePlayerLayoutPC.d.ts +6 -0
- package/dist/cjs/components/video-subtitle-player/layouts/VideoSubtitlePlayerLayoutPC.js +1 -0
- package/dist/cjs/components/video-subtitle-player/layouts/index.d.ts +3 -0
- package/dist/cjs/components/video-subtitle-player/layouts/types.d.ts +17 -0
- package/dist/cjs/components/video-subtitle-player/useXGPlayer.d.ts +10 -0
- package/dist/cjs/components/video-subtitle-player/useXGPlayer.js +1 -0
- package/dist/cjs/index.d.ts +2 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/llms.txt +2 -13
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/dist/index.min.css +1 -0
- package/dist/cjs/react-components.css +114 -1
- package/dist/es/components/blur-text/BlurText.d.ts +16 -0
- package/dist/es/components/blur-text/BlurText.js +77 -0
- package/dist/es/components/blur-text/index.d.ts +2 -0
- package/dist/es/components/button/Button.css +1 -0
- package/dist/es/components/button/Button.js +35 -46
- package/dist/es/components/comic-text/ComicText.css +1 -0
- package/dist/es/components/comic-text/ComicText.js +13 -12
- package/dist/es/components/dock/Duck.css +1 -0
- package/dist/es/components/dock/Duck.d.ts +2 -4
- package/dist/es/components/dock/Duck.js +60 -64
- package/dist/es/components/flip-text/FlipText.css +1 -0
- package/dist/es/components/flip-text/FlipText.js +8 -8
- package/dist/es/components/gradient-text/index.css +1 -0
- package/dist/es/components/gradient-text/index.js +9 -8
- package/dist/es/components/hyper-text/HyperText.css +1 -0
- package/dist/es/components/hyper-text/index.js +16 -13
- package/dist/es/components/image-compare/ImageCompare.css +1 -0
- package/dist/es/components/image-compare/ImageCompare.d.ts +4 -2
- package/dist/es/components/image-compare/ImageCompare.js +55 -48
- package/dist/es/components/image-viewer/ImageThumbnails.css +1 -0
- package/dist/es/components/image-viewer/ImageThumbnails.js +41 -42
- package/dist/es/components/image-viewer/ImageViewer.css +1 -0
- package/dist/es/components/image-viewer/ImageViewer.js +34 -35
- package/dist/es/components/message/Message.css +1 -0
- package/dist/es/components/message/Message.js +65 -54
- package/dist/es/components/pointer/Pointer.css +1 -0
- package/dist/es/components/pointer/Pointer.js +23 -25
- package/dist/es/components/scratch-to-reveal/ScratchToReveal.css +1 -0
- package/dist/es/components/scratch-to-reveal/ScratchToReveal.js +17 -16
- package/dist/es/components/shimmer-button/ShimmerButton.css +1 -0
- package/dist/es/components/shimmer-button/ShimmerButton.js +8 -8
- package/dist/es/components/shiny-button/ShinyButton.css +1 -0
- package/dist/es/components/shiny-button/ShinyButton.js +13 -13
- package/dist/es/components/shiny-text/ShinyText.css +1 -0
- package/dist/es/components/shiny-text/ShinyText.d.ts +16 -0
- package/dist/es/components/shiny-text/ShinyText.js +76 -0
- package/dist/es/components/shiny-text/index.d.ts +2 -0
- package/dist/es/components/sparkles-text/SparklesText.css +1 -0
- package/dist/es/components/sparkles-text/SparklesText.js +14 -14
- package/dist/es/components/split-text/SplitText.css +1 -0
- package/dist/es/components/split-text/SplitText.js +1 -1
- package/dist/es/components/subtitle-player/CurrentMode.css +1 -0
- package/dist/es/components/subtitle-player/CurrentMode.d.ts +2 -0
- package/dist/es/components/subtitle-player/CurrentMode.js +75 -40
- package/dist/es/components/subtitle-player/LyricsMode.css +1 -0
- package/dist/es/components/subtitle-player/LyricsMode.d.ts +2 -0
- package/dist/es/components/subtitle-player/LyricsMode.js +139 -68
- package/dist/es/components/subtitle-player/SubtitlePlayer.css +1 -0
- package/dist/es/components/subtitle-player/SubtitlePlayer.d.ts +2 -0
- package/dist/es/components/subtitle-player/SubtitlePlayer.js +63 -60
- package/dist/es/components/text-animate/TextAnimate.css +1 -0
- package/dist/es/components/text-animate/TextAnimate.js +57 -55
- package/dist/es/components/text-type/TextType.css +1 -0
- package/dist/es/components/text-type/TextType.js +24 -19
- package/dist/es/components/txt-reader/index.module.css +1 -0
- package/dist/es/components/txt-reader/index.module.css.js +1 -1
- package/dist/es/components/typing-animation/index.css +1 -0
- package/dist/es/components/typing-animation/index.js +12 -12
- package/dist/es/components/variable-proximity/index.css +1 -0
- package/dist/es/components/variable-proximity/index.js +19 -18
- package/dist/es/components/video-dialog/VideoDialog.css +1 -0
- package/dist/es/components/video-dialog/VideoDialog.js +1 -1
- package/dist/es/components/video-subtitle-player/VideoSubtitlePlayer.css +1 -0
- package/dist/es/components/video-subtitle-player/VideoSubtitlePlayer.d.ts +3 -3
- package/dist/es/components/video-subtitle-player/VideoSubtitlePlayer.js +69 -122
- package/dist/es/components/video-subtitle-player/VideoSubtitlePlayer.mobile.css +1 -0
- package/dist/es/components/video-subtitle-player/VideoSubtitlePlayer.pc.css +1 -0
- package/dist/es/components/video-subtitle-player/VideoSubtitlePlayerMobile.d.ts +20 -0
- package/dist/es/components/video-subtitle-player/VideoSubtitlePlayerMobile.js +47 -0
- package/dist/es/components/video-subtitle-player/VideoSubtitlePlayerPC.d.ts +23 -0
- package/dist/es/components/video-subtitle-player/VideoSubtitlePlayerPC.js +75 -0
- package/dist/es/components/video-subtitle-player/layouts/VideoSubtitlePlayerLayoutMobile.d.ts +8 -0
- package/dist/es/components/video-subtitle-player/layouts/VideoSubtitlePlayerLayoutMobile.js +21 -0
- package/dist/es/components/video-subtitle-player/layouts/VideoSubtitlePlayerLayoutPC.d.ts +6 -0
- package/dist/es/components/video-subtitle-player/layouts/VideoSubtitlePlayerLayoutPC.js +50 -0
- package/dist/es/components/video-subtitle-player/layouts/index.d.ts +3 -0
- package/dist/es/components/video-subtitle-player/layouts/types.d.ts +17 -0
- package/dist/es/components/video-subtitle-player/useXGPlayer.d.ts +10 -0
- package/dist/es/components/video-subtitle-player/useXGPlayer.js +36 -0
- package/dist/es/index.d.ts +2 -1
- package/dist/es/index.js +59 -60
- package/dist/es/llms.txt +2 -13
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/dist/index.min.css +1 -0
- package/dist/es/react-components.css +114 -1
- package/package.json +20 -15
- package/dist/cjs/components/animated-list/AnimatedList.d.ts +0 -9
- package/dist/cjs/components/animated-list/AnimatedList.js +0 -1
- package/dist/cjs/components/animated-list/index.d.ts +0 -1
- package/dist/cjs/utils/utils.js +0 -1
- package/dist/es/components/animated-list/AnimatedList.d.ts +0 -9
- package/dist/es/components/animated-list/AnimatedList.js +0 -44
- package/dist/es/components/animated-list/index.d.ts +0 -1
- package/dist/es/utils/utils.js +0 -8
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as r } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
3
|
+
import { motion as y, AnimatePresence as w } from "motion/react";
|
|
4
|
+
import u from "clsx";
|
|
5
|
+
import './TextAnimate.css';/* empty css */
|
|
5
6
|
const s = {
|
|
6
7
|
text: 0.06,
|
|
7
8
|
word: 0.05,
|
|
8
9
|
character: 0.03,
|
|
9
10
|
line: 0.06
|
|
10
|
-
},
|
|
11
|
+
}, i = {
|
|
11
12
|
hidden: { opacity: 1 },
|
|
12
13
|
show: {
|
|
13
14
|
opacity: 1,
|
|
@@ -32,14 +33,14 @@ const s = {
|
|
|
32
33
|
}
|
|
33
34
|
}, o = {
|
|
34
35
|
fadeIn: {
|
|
35
|
-
container:
|
|
36
|
+
container: i,
|
|
36
37
|
item: {
|
|
37
38
|
hidden: { opacity: 0, y: 20 },
|
|
38
|
-
show: (
|
|
39
|
+
show: (t) => ({
|
|
39
40
|
opacity: 1,
|
|
40
41
|
y: 0,
|
|
41
42
|
transition: {
|
|
42
|
-
delay:
|
|
43
|
+
delay: t,
|
|
43
44
|
duration: 0.3
|
|
44
45
|
}
|
|
45
46
|
}),
|
|
@@ -51,14 +52,14 @@ const s = {
|
|
|
51
52
|
}
|
|
52
53
|
},
|
|
53
54
|
blurIn: {
|
|
54
|
-
container:
|
|
55
|
+
container: i,
|
|
55
56
|
item: {
|
|
56
57
|
hidden: { opacity: 0, filter: "blur(10px)" },
|
|
57
|
-
show: (
|
|
58
|
+
show: (t) => ({
|
|
58
59
|
opacity: 1,
|
|
59
60
|
filter: "blur(0px)",
|
|
60
61
|
transition: {
|
|
61
|
-
delay:
|
|
62
|
+
delay: t * 0.1,
|
|
62
63
|
duration: 0.3
|
|
63
64
|
}
|
|
64
65
|
}),
|
|
@@ -70,10 +71,10 @@ const s = {
|
|
|
70
71
|
}
|
|
71
72
|
},
|
|
72
73
|
blurInUp: {
|
|
73
|
-
container:
|
|
74
|
+
container: i,
|
|
74
75
|
item: {
|
|
75
76
|
hidden: { opacity: 0, filter: "blur(10px)", y: 20 },
|
|
76
|
-
show: (
|
|
77
|
+
show: (t) => ({
|
|
77
78
|
opacity: 1,
|
|
78
79
|
filter: "blur(0px)",
|
|
79
80
|
y: 0,
|
|
@@ -96,10 +97,10 @@ const s = {
|
|
|
96
97
|
}
|
|
97
98
|
},
|
|
98
99
|
blurInDown: {
|
|
99
|
-
container:
|
|
100
|
+
container: i,
|
|
100
101
|
item: {
|
|
101
102
|
hidden: { opacity: 0, filter: "blur(10px)", y: -20 },
|
|
102
|
-
show: (
|
|
103
|
+
show: (t) => ({
|
|
103
104
|
opacity: 1,
|
|
104
105
|
filter: "blur(0px)",
|
|
105
106
|
y: 0,
|
|
@@ -112,14 +113,14 @@ const s = {
|
|
|
112
113
|
}
|
|
113
114
|
},
|
|
114
115
|
slideUp: {
|
|
115
|
-
container:
|
|
116
|
+
container: i,
|
|
116
117
|
item: {
|
|
117
118
|
hidden: { y: 20, opacity: 0 },
|
|
118
|
-
show: (
|
|
119
|
+
show: (t) => ({
|
|
119
120
|
y: 0,
|
|
120
121
|
opacity: 1,
|
|
121
122
|
transition: {
|
|
122
|
-
delay:
|
|
123
|
+
delay: t,
|
|
123
124
|
duration: 0.3
|
|
124
125
|
}
|
|
125
126
|
}),
|
|
@@ -133,7 +134,7 @@ const s = {
|
|
|
133
134
|
}
|
|
134
135
|
},
|
|
135
136
|
slideDown: {
|
|
136
|
-
container:
|
|
137
|
+
container: i,
|
|
137
138
|
item: {
|
|
138
139
|
hidden: { y: -20, opacity: 0 },
|
|
139
140
|
show: {
|
|
@@ -149,7 +150,7 @@ const s = {
|
|
|
149
150
|
}
|
|
150
151
|
},
|
|
151
152
|
slideLeft: {
|
|
152
|
-
container:
|
|
153
|
+
container: i,
|
|
153
154
|
item: {
|
|
154
155
|
hidden: { x: 20, opacity: 0 },
|
|
155
156
|
show: {
|
|
@@ -165,7 +166,7 @@ const s = {
|
|
|
165
166
|
}
|
|
166
167
|
},
|
|
167
168
|
slideRight: {
|
|
168
|
-
container:
|
|
169
|
+
container: i,
|
|
169
170
|
item: {
|
|
170
171
|
hidden: { x: -20, opacity: 0 },
|
|
171
172
|
show: {
|
|
@@ -181,7 +182,7 @@ const s = {
|
|
|
181
182
|
}
|
|
182
183
|
},
|
|
183
184
|
scaleUp: {
|
|
184
|
-
container:
|
|
185
|
+
container: i,
|
|
185
186
|
item: {
|
|
186
187
|
hidden: { scale: 0.5, opacity: 0 },
|
|
187
188
|
show: {
|
|
@@ -204,14 +205,14 @@ const s = {
|
|
|
204
205
|
}
|
|
205
206
|
},
|
|
206
207
|
scaleDown: {
|
|
207
|
-
container:
|
|
208
|
+
container: i,
|
|
208
209
|
item: {
|
|
209
210
|
hidden: { scale: 1.5, opacity: 0 },
|
|
210
|
-
show: (
|
|
211
|
+
show: (t) => ({
|
|
211
212
|
scale: 1,
|
|
212
213
|
opacity: 1,
|
|
213
214
|
transition: {
|
|
214
|
-
delay:
|
|
215
|
+
delay: t,
|
|
215
216
|
duration: 0.3,
|
|
216
217
|
scale: {
|
|
217
218
|
type: "spring",
|
|
@@ -228,81 +229,82 @@ const s = {
|
|
|
228
229
|
}
|
|
229
230
|
}
|
|
230
231
|
};
|
|
231
|
-
function
|
|
232
|
-
children:
|
|
232
|
+
function $({
|
|
233
|
+
children: t,
|
|
233
234
|
delay: I = 0,
|
|
234
|
-
duration:
|
|
235
|
-
variants:
|
|
236
|
-
className:
|
|
237
|
-
segmentClassName:
|
|
235
|
+
duration: C = 0.3,
|
|
236
|
+
variants: v,
|
|
237
|
+
className: x,
|
|
238
|
+
segmentClassName: h,
|
|
238
239
|
as: m = "p",
|
|
239
240
|
startOnView: c = !0,
|
|
240
|
-
once:
|
|
241
|
-
by:
|
|
242
|
-
animation:
|
|
241
|
+
once: D = !1,
|
|
242
|
+
by: n = "word",
|
|
243
|
+
animation: a = "fadeIn",
|
|
243
244
|
...f
|
|
244
245
|
}) {
|
|
245
|
-
const
|
|
246
|
+
const g = y.create(m), d = a ? {
|
|
246
247
|
container: {
|
|
247
|
-
...o[
|
|
248
|
+
...o[a].container,
|
|
248
249
|
show: {
|
|
249
|
-
...o[
|
|
250
|
+
...o[a].container.show,
|
|
250
251
|
transition: {
|
|
251
|
-
staggerChildren: s[
|
|
252
|
+
staggerChildren: s[n]
|
|
252
253
|
}
|
|
253
254
|
},
|
|
254
255
|
exit: {
|
|
255
|
-
...o[
|
|
256
|
+
...o[a].container.exit,
|
|
256
257
|
transition: {
|
|
257
|
-
staggerChildren: s[
|
|
258
|
+
staggerChildren: s[n],
|
|
258
259
|
staggerDirection: -1
|
|
259
260
|
}
|
|
260
261
|
}
|
|
261
262
|
},
|
|
262
|
-
item: o[
|
|
263
|
-
} : { container:
|
|
263
|
+
item: o[a].item
|
|
264
|
+
} : { container: i, item: b };
|
|
264
265
|
let e = [];
|
|
265
|
-
switch (
|
|
266
|
+
switch (n) {
|
|
266
267
|
case "word":
|
|
267
|
-
e =
|
|
268
|
+
e = t.split(/(\s+)/);
|
|
268
269
|
break;
|
|
269
270
|
case "character":
|
|
270
|
-
e =
|
|
271
|
+
e = t.split("");
|
|
271
272
|
break;
|
|
272
273
|
case "line":
|
|
273
|
-
e =
|
|
274
|
+
e = t.split(`
|
|
274
275
|
`);
|
|
275
276
|
break;
|
|
276
277
|
default:
|
|
277
|
-
e = [
|
|
278
|
+
e = [t];
|
|
278
279
|
break;
|
|
279
280
|
}
|
|
280
|
-
return /* @__PURE__ */ r(
|
|
281
|
-
|
|
281
|
+
return /* @__PURE__ */ r(w, { mode: "popLayout", children: /* @__PURE__ */ r(
|
|
282
|
+
g,
|
|
282
283
|
{
|
|
283
284
|
variants: d.container,
|
|
284
285
|
initial: "hidden",
|
|
285
286
|
whileInView: c ? "show" : void 0,
|
|
286
287
|
animate: c ? void 0 : "show",
|
|
287
288
|
exit: "exit",
|
|
288
|
-
className:
|
|
289
|
+
className: u("xiping-text-animate", x),
|
|
289
290
|
...f,
|
|
290
291
|
children: e.map((p, l) => /* @__PURE__ */ r(
|
|
291
|
-
|
|
292
|
+
y.span,
|
|
292
293
|
{
|
|
293
294
|
variants: d.item,
|
|
294
|
-
custom: l * s[
|
|
295
|
-
className:
|
|
296
|
-
|
|
297
|
-
|
|
295
|
+
custom: l * s[n],
|
|
296
|
+
className: u(
|
|
297
|
+
"xiping-text-animate-segment",
|
|
298
|
+
n === "line" && "xiping-text-animate-segment--line",
|
|
299
|
+
h
|
|
298
300
|
),
|
|
299
301
|
children: p
|
|
300
302
|
},
|
|
301
|
-
`${
|
|
303
|
+
`${n}-${p}-${l}`
|
|
302
304
|
))
|
|
303
305
|
}
|
|
304
306
|
) });
|
|
305
307
|
}
|
|
306
308
|
export {
|
|
307
|
-
|
|
309
|
+
$ as TextAnimate
|
|
308
310
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.xiping-text-type{display:inline-block;white-space:pre-wrap}.xiping-text-type__content{display:inline-block}.xiping-text-type__cursor{margin-left:.25rem;display:inline-block;opacity:1}.xiping-text-type__cursor--hidden{display:none}
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
import { jsx as b } from "react/jsx-runtime";
|
|
3
3
|
import { useState as o, useRef as k, useMemo as U, useCallback as V, useEffect as I, createElement as W } from "react";
|
|
4
4
|
import { gsap as q } from "gsap";
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import X from "clsx";
|
|
6
|
+
import './TextType.css';/* empty css */
|
|
7
|
+
const ee = ({
|
|
7
8
|
text: u,
|
|
8
9
|
as: v = "div",
|
|
9
10
|
typingSpeed: f = 50,
|
|
@@ -20,11 +21,11 @@ const D = ({
|
|
|
20
21
|
textColors: g = [],
|
|
21
22
|
variableSpeed: c,
|
|
22
23
|
onSentenceComplete: d,
|
|
23
|
-
startOnVisible:
|
|
24
|
+
startOnVisible: p = !1,
|
|
24
25
|
reverseMode: N = !1,
|
|
25
26
|
...J
|
|
26
27
|
}) => {
|
|
27
|
-
const [l,
|
|
28
|
+
const [l, j] = o(""), [i, C] = o(0), [a, H] = o(!1), [t, K] = o(0), [M, L] = o(!p), m = k(null), y = k(null), r = U(() => Array.isArray(u) ? u : [u], [u]), O = V(() => {
|
|
28
29
|
if (!c) return f;
|
|
29
30
|
const { min: e, max: n } = c;
|
|
30
31
|
return Math.random() * (n - e) + e;
|
|
@@ -33,7 +34,7 @@ const D = ({
|
|
|
33
34
|
return g[t % g.length];
|
|
34
35
|
};
|
|
35
36
|
I(() => {
|
|
36
|
-
if (!
|
|
37
|
+
if (!p || !y.current) return;
|
|
37
38
|
const e = new IntersectionObserver(
|
|
38
39
|
(n) => {
|
|
39
40
|
n.forEach((x) => {
|
|
@@ -42,8 +43,8 @@ const D = ({
|
|
|
42
43
|
},
|
|
43
44
|
{ threshold: 0.1 }
|
|
44
45
|
);
|
|
45
|
-
return e.observe(
|
|
46
|
-
}, [
|
|
46
|
+
return e.observe(y.current), () => e.disconnect();
|
|
47
|
+
}, [p]), I(() => {
|
|
47
48
|
T && m.current && (q.set(m.current, { opacity: 1 }), q.to(m.current, {
|
|
48
49
|
opacity: 0,
|
|
49
50
|
duration: E,
|
|
@@ -52,30 +53,30 @@ const D = ({
|
|
|
52
53
|
ease: "power2.inOut"
|
|
53
54
|
}));
|
|
54
55
|
}, [T, E]), I(() => {
|
|
55
|
-
if (!
|
|
56
|
+
if (!M) return;
|
|
56
57
|
let e;
|
|
57
|
-
const n = r[t], x = N ? n.split("").reverse().join("") : n,
|
|
58
|
+
const n = r[t], x = N ? n.split("").reverse().join("") : n, $ = () => {
|
|
58
59
|
if (a)
|
|
59
60
|
if (l === "") {
|
|
60
|
-
if (
|
|
61
|
+
if (H(!1), t === r.length - 1 && !R)
|
|
61
62
|
return;
|
|
62
|
-
d && d(r[t], t), K((s) => (s + 1) % r.length),
|
|
63
|
+
d && d(r[t], t), K((s) => (s + 1) % r.length), C(0), e = setTimeout(() => {
|
|
63
64
|
}, h);
|
|
64
65
|
} else
|
|
65
66
|
e = setTimeout(() => {
|
|
66
|
-
|
|
67
|
+
j((s) => s.slice(0, -1));
|
|
67
68
|
}, A);
|
|
68
69
|
else
|
|
69
70
|
i < x.length ? e = setTimeout(
|
|
70
71
|
() => {
|
|
71
|
-
|
|
72
|
+
j((s) => s + x[i]), C((s) => s + 1);
|
|
72
73
|
},
|
|
73
74
|
c ? O() : f
|
|
74
75
|
) : r.length > 1 && (e = setTimeout(() => {
|
|
75
|
-
|
|
76
|
+
H(!0);
|
|
76
77
|
}, h));
|
|
77
78
|
};
|
|
78
|
-
return i === 0 && !a && l === "" ? e = setTimeout(
|
|
79
|
+
return i === 0 && !a && l === "" ? e = setTimeout($, _) : $(), () => clearTimeout(e);
|
|
79
80
|
}, [
|
|
80
81
|
i,
|
|
81
82
|
l,
|
|
@@ -87,7 +88,7 @@ const D = ({
|
|
|
87
88
|
t,
|
|
88
89
|
R,
|
|
89
90
|
_,
|
|
90
|
-
|
|
91
|
+
M,
|
|
91
92
|
N,
|
|
92
93
|
c,
|
|
93
94
|
d
|
|
@@ -96,7 +97,7 @@ const D = ({
|
|
|
96
97
|
return W(
|
|
97
98
|
v,
|
|
98
99
|
{
|
|
99
|
-
ref:
|
|
100
|
+
ref: y,
|
|
100
101
|
className: `xiping-text-type ${w}`,
|
|
101
102
|
...J
|
|
102
103
|
},
|
|
@@ -105,12 +106,16 @@ const D = ({
|
|
|
105
106
|
"span",
|
|
106
107
|
{
|
|
107
108
|
ref: m,
|
|
108
|
-
className:
|
|
109
|
+
className: X(
|
|
110
|
+
"xiping-text-type__cursor",
|
|
111
|
+
G,
|
|
112
|
+
Q && "xiping-text-type__cursor--hidden"
|
|
113
|
+
),
|
|
109
114
|
children: F
|
|
110
115
|
}
|
|
111
116
|
)
|
|
112
117
|
);
|
|
113
118
|
};
|
|
114
119
|
export {
|
|
115
|
-
|
|
120
|
+
ee as default
|
|
116
121
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._xiping-top-progress_rkm9f_23{position:fixed;left:0;top:0;right:0;background-color:#f08;height:10px}._xiping-container_rkm9f_33{position:relative;width:100%;height:100%;overflow-y:auto}._xiping-content_rkm9f_41{width:100%;white-space:pre-wrap;word-break:break-word}._xiping-bottom-progress_rkm9f_48{position:fixed;color:#fff;border-radius:4px;font-size:.875rem;background-color:#000000b3;padding:.25rem .5rem;right:1.25rem;bottom:1.25rem}._xiping-text-content_rkm9f_63::-webkit-scrollbar{width:8px}._xiping-text-content_rkm9f_63::-webkit-scrollbar-thumb{box-shadow:inset 0 0 5px #0003;background:#0003}._xiping-text-content_rkm9f_63::-webkit-scrollbar-track{box-shadow:inset 0 0 5px #0003;border-radius:0;background:#00000014}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.xiping-typing-animation{font-size:2.25rem;font-weight:700;line-height:5rem;letter-spacing:-.02em}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as T } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
3
|
+
import { motion as x } from "motion/react";
|
|
4
|
+
import { useState as u, useRef as I, useEffect as a } from "react";
|
|
5
|
+
import b from "clsx";
|
|
6
|
+
import './index.css';/* empty css */
|
|
7
7
|
function S({
|
|
8
8
|
children: r,
|
|
9
9
|
className: m,
|
|
10
|
-
duration:
|
|
10
|
+
duration: o = 100,
|
|
11
11
|
delay: n = 0,
|
|
12
12
|
as: l = "div",
|
|
13
13
|
startOnView: i = !1,
|
|
14
14
|
...p
|
|
15
15
|
}) {
|
|
16
|
-
const d =
|
|
16
|
+
const d = x.create(l, {
|
|
17
17
|
forwardMotionProps: !0
|
|
18
|
-
}), [g, v] = u(""), [c, f] = u(!1),
|
|
18
|
+
}), [g, v] = u(""), [c, f] = u(!1), s = I(null);
|
|
19
19
|
return a(() => {
|
|
20
20
|
if (!i) {
|
|
21
21
|
const t = setTimeout(() => {
|
|
@@ -31,21 +31,21 @@ function S({
|
|
|
31
31
|
},
|
|
32
32
|
{ threshold: 0.1 }
|
|
33
33
|
);
|
|
34
|
-
return
|
|
34
|
+
return s.current && e.observe(s.current), () => e.disconnect();
|
|
35
35
|
}, [n, i]), a(() => {
|
|
36
36
|
if (!c) return;
|
|
37
37
|
let e = 0;
|
|
38
38
|
const t = setInterval(() => {
|
|
39
39
|
e < r.length ? (v(r.substring(0, e + 1)), e++) : clearInterval(t);
|
|
40
|
-
},
|
|
40
|
+
}, o);
|
|
41
41
|
return () => {
|
|
42
42
|
clearInterval(t);
|
|
43
43
|
};
|
|
44
|
-
}, [r,
|
|
44
|
+
}, [r, o, c]), /* @__PURE__ */ T(
|
|
45
45
|
d,
|
|
46
46
|
{
|
|
47
|
-
ref:
|
|
48
|
-
className:
|
|
47
|
+
ref: s,
|
|
48
|
+
className: b("xiping-typing-animation", m),
|
|
49
49
|
...p,
|
|
50
50
|
children: g
|
|
51
51
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.xiping-variable-proximity{font-family:Roboto Flex,Noto Sans SC,PingFang SC,Microsoft YaHei,SimHei,sans-serif}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsxs as G, jsx as k } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as H, useRef as y, useMemo as N, useEffect as w } from "react";
|
|
3
3
|
import { motion as J } from "motion/react";
|
|
4
|
-
|
|
4
|
+
import K from "clsx";
|
|
5
|
+
import './index.css';/* empty css */
|
|
5
6
|
const l = {
|
|
6
7
|
robotoFlex: !1,
|
|
7
8
|
notoSansSC: !1,
|
|
@@ -15,7 +16,7 @@ function V(n) {
|
|
|
15
16
|
return !0;
|
|
16
17
|
}
|
|
17
18
|
}
|
|
18
|
-
function
|
|
19
|
+
function O() {
|
|
19
20
|
if (l.loading || l.robotoFlex && l.notoSansSC) return;
|
|
20
21
|
l.loading = !0;
|
|
21
22
|
const n = V("Roboto Flex"), r = V("Noto Sans SC");
|
|
@@ -61,12 +62,12 @@ function K() {
|
|
|
61
62
|
};
|
|
62
63
|
d(0);
|
|
63
64
|
}
|
|
64
|
-
function
|
|
65
|
+
function Q(n = !0) {
|
|
65
66
|
w(() => {
|
|
66
|
-
n && typeof document < "u" &&
|
|
67
|
+
n && typeof document < "u" && O();
|
|
67
68
|
}, [n]);
|
|
68
69
|
}
|
|
69
|
-
function
|
|
70
|
+
function W(n) {
|
|
70
71
|
w(() => {
|
|
71
72
|
let r;
|
|
72
73
|
const i = () => {
|
|
@@ -75,7 +76,7 @@ function Q(n) {
|
|
|
75
76
|
return r = requestAnimationFrame(i), () => cancelAnimationFrame(r);
|
|
76
77
|
}, [n]);
|
|
77
78
|
}
|
|
78
|
-
function
|
|
79
|
+
function Z(n) {
|
|
79
80
|
const r = y({ x: 0, y: 0 });
|
|
80
81
|
return w(() => {
|
|
81
82
|
const i = (t, s) => {
|
|
@@ -93,7 +94,7 @@ function W(n) {
|
|
|
93
94
|
};
|
|
94
95
|
}, [n]), r;
|
|
95
96
|
}
|
|
96
|
-
const
|
|
97
|
+
const _ = H(
|
|
97
98
|
(n, r) => {
|
|
98
99
|
const {
|
|
99
100
|
label: i,
|
|
@@ -109,11 +110,11 @@ const Z = H(
|
|
|
109
110
|
autoLoadFonts: P = !0,
|
|
110
111
|
...A
|
|
111
112
|
} = n;
|
|
112
|
-
|
|
113
|
-
const b = y([]), v = y([]), S =
|
|
113
|
+
Q(P && !g);
|
|
114
|
+
const b = y([]), v = y([]), S = Z(t), x = y({
|
|
114
115
|
x: null,
|
|
115
116
|
y: null
|
|
116
|
-
}),
|
|
117
|
+
}), q = N(() => {
|
|
117
118
|
const e = (o) => new Map(
|
|
118
119
|
o.split(",").map((p) => p.trim()).map((p) => {
|
|
119
120
|
const [h, F] = p.split(" ");
|
|
@@ -125,7 +126,7 @@ const Z = H(
|
|
|
125
126
|
fromValue: p,
|
|
126
127
|
toValue: u.get(o) ?? p
|
|
127
128
|
}));
|
|
128
|
-
}, [f, d]),
|
|
129
|
+
}, [f, d]), I = (e, a, u, o) => Math.sqrt((u - e) ** 2 + (o - a) ** 2), $ = (e) => {
|
|
129
130
|
const a = Math.min(Math.max(1 - e / s, 0), 1);
|
|
130
131
|
switch (m) {
|
|
131
132
|
case "exponential":
|
|
@@ -136,7 +137,7 @@ const Z = H(
|
|
|
136
137
|
return a;
|
|
137
138
|
}
|
|
138
139
|
};
|
|
139
|
-
|
|
140
|
+
W(() => {
|
|
140
141
|
if (!t?.current) return;
|
|
141
142
|
const { x: e, y: a } = S.current;
|
|
142
143
|
if (x.current.x === e && x.current.y === a)
|
|
@@ -145,7 +146,7 @@ const Z = H(
|
|
|
145
146
|
const u = t.current.getBoundingClientRect();
|
|
146
147
|
b.current.forEach((o, p) => {
|
|
147
148
|
if (!o) return;
|
|
148
|
-
const h = o.getBoundingClientRect(), F = h.left + h.width / 2 - u.left, Y = h.top + h.height / 2 - u.top, L =
|
|
149
|
+
const h = o.getBoundingClientRect(), F = h.left + h.width / 2 - u.left, Y = h.top + h.height / 2 - u.top, L = I(
|
|
149
150
|
S.current.x,
|
|
150
151
|
S.current.y,
|
|
151
152
|
F,
|
|
@@ -155,7 +156,7 @@ const Z = H(
|
|
|
155
156
|
o.style.fontVariationSettings = f;
|
|
156
157
|
return;
|
|
157
158
|
}
|
|
158
|
-
const z =
|
|
159
|
+
const z = $(L), M = q.map(({ axis: T, fromValue: R, toValue: D }) => {
|
|
159
160
|
const U = R + (D - R) * z;
|
|
160
161
|
return `'${T}' ${U}`;
|
|
161
162
|
}).join(", ");
|
|
@@ -175,7 +176,7 @@ const Z = H(
|
|
|
175
176
|
"span",
|
|
176
177
|
{
|
|
177
178
|
ref: r,
|
|
178
|
-
className:
|
|
179
|
+
className: K("xiping-variable-proximity", c),
|
|
179
180
|
onClick: E,
|
|
180
181
|
style: X,
|
|
181
182
|
...A,
|
|
@@ -204,8 +205,8 @@ const Z = H(
|
|
|
204
205
|
);
|
|
205
206
|
}
|
|
206
207
|
);
|
|
207
|
-
|
|
208
|
+
_.displayName = "VariableProximity";
|
|
208
209
|
export {
|
|
209
|
-
|
|
210
|
-
|
|
210
|
+
_ as VariableProximity,
|
|
211
|
+
_ as default
|
|
211
212
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.xiping-video-dialog{position:relative}.xiping-video-dialog-container{position:relative;cursor:pointer}.xiping-video-dialog-thumbnail{width:100%;border-radius:.375rem;border:1px solid;box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -2px #0000000d;transition:all .2s ease-out}.xiping-video-dialog-container:hover .xiping-video-dialog-thumbnail{filter:brightness(.8)}.xiping-video-dialog-overlay{position:absolute;inset:0;display:flex;transform:scale(.9);align-items:center;justify-content:center;border-radius:1rem;transition:all .2s ease-out}.xiping-video-dialog-container:hover .xiping-video-dialog-overlay{transform:scale(1)}.xiping-video-dialog-play-outer{display:flex;width:7rem;height:7rem;align-items:center;justify-content:center;border-radius:9999px;background-color:hsla(var(--primary-h),var(--primary-s),var(--primary-l),.1);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}.xiping-video-dialog-play-inner{position:relative;display:flex;width:5rem;height:5rem;transform:scale(1);align-items:center;justify-content:center;border-radius:9999px;background:linear-gradient(to bottom,hsla(var(--primary-h),var(--primary-s),var(--primary-l),.3),hsl(var(--primary-h),var(--primary-s),var(--primary-l)));box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f;transition:all .2s ease-out}.xiping-video-dialog-container:hover .xiping-video-dialog-play-inner{transform:scale(1.2)}.xiping-video-dialog-play-icon{width:2rem;height:2rem;transform:scale(1);fill:#fff;color:#fff;transition:transform .2s ease-out;filter:drop-shadow(0 4px 3px rgb(0 0 0 / .07)) drop-shadow(0 2px 2px rgb(0 0 0 / .06))}.xiping-video-dialog-container:hover .xiping-video-dialog-play-icon{transform:scale(1.05)}.xiping-video-dialog-modal{position:fixed;inset:0;z-index:50;display:flex;align-items:center;justify-content:center;background-color:#00000080;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}.xiping-video-dialog-modal-content{position:relative;margin:0 1rem;aspect-ratio:16 / 9;width:100%;max-width:56rem}@media(min-width:768px){.xiping-video-dialog-modal-content{margin:0}}.xiping-video-dialog-close-button{position:absolute;top:-4rem;right:0;border-radius:9999px;background-color:#17171780;padding:.5rem;font-size:1.25rem;color:#fff;box-shadow:0 0 0 1px #0000001a;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}@media(prefers-color-scheme:dark){.xiping-video-dialog-close-button{background-color:#f5f5f580;color:#000}}.xiping-video-dialog-close-icon{width:1.25rem;height:1.25rem}.xiping-video-dialog-video-wrapper{position:relative;isolation:isolate;z-index:1;width:100%;height:100%;overflow:hidden;border-radius:1rem;border:2px solid white}.xiping-video-dialog-iframe{width:100%;height:100%;border-radius:1rem}:root{--primary-h: 221.2;--primary-s: 83.2%;--primary-l: 53.3%}
|
|
@@ -4,7 +4,7 @@ import { useState as s } from "react";
|
|
|
4
4
|
import { AnimatePresence as m, motion as e } from "motion/react";
|
|
5
5
|
import { Play as y, XIcon as x } from "lucide-react";
|
|
6
6
|
import g from "clsx";
|
|
7
|
-
|
|
7
|
+
import './VideoDialog.css';/* empty css */
|
|
8
8
|
const v = {
|
|
9
9
|
"from-bottom": {
|
|
10
10
|
initial: { y: "100%", opacity: 0 },
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.xiping-video-subtitle-player{width:100%;height:100%;background:#1a1a1a;border-radius:8px;overflow:hidden;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif}.xiping-video-subtitle-player__video-wrapper{width:100%;height:100%;background:#000;overflow:hidden}.xiping-video-subtitle-player__video-container{position:relative;width:100%;height:100%;background:#000;overflow:hidden}.xiping-video-subtitle-player__video{position:absolute;top:0;left:0;width:100%;height:100%;padding:0}.xiping-video-subtitle-player__video-container .xgplayer{width:100%!important;height:100%!important}.xiping-video-subtitle-player__video-container .xgplayer video{-o-object-fit:fill!important;object-fit:fill!important}.xiping-video-subtitle-player__subtitle-container{width:100%;height:100%;padding:20px;overflow-y:auto;background:#0000004d}.xiping-video-subtitle-player__right{width:100%;height:100%;background:#00000080;display:flex;flex-direction:column}.xiping-video-subtitle-player__detail{flex:1;padding:24px;overflow-y:auto;color:#fff}.xiping-video-subtitle-player__detail-loading{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;gap:16px;color:#ffffffb3}.xiping-video-subtitle-player__detail-loading-spinner{width:40px;height:40px;border:3px solid rgba(255,255,255,.1);border-top-color:#fbbf24;border-radius:50%;animation:xiping-vsp-spin 1s linear infinite}@keyframes xiping-vsp-spin{to{transform:rotate(360deg)}}.xiping-video-subtitle-player__detail-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;gap:16px;color:#ffffff80;text-align:center}.xiping-video-subtitle-player__detail-empty-icon{font-size:48px;opacity:.5}.xiping-video-subtitle-player__detail-empty-text{font-size:14px;line-height:1.6}.xiping-video-subtitle-player__detail-content{display:flex;flex-direction:column;gap:20px}.xiping-video-subtitle-player__detail-word{font-size:32px;font-weight:700;color:#fbbf24;line-height:1.2;margin-bottom:8px}.xiping-video-subtitle-player__detail-pronunciation{font-size:18px;color:#ffffffb3;font-style:italic;margin-bottom:4px}.xiping-video-subtitle-player__detail-pos{display:inline-block;padding:4px 12px;background:#fbbf2433;color:#fbbf24;border-radius:4px;font-size:12px;font-weight:600;text-transform:uppercase;width:-moz-fit-content;width:fit-content;margin-bottom:8px}.xiping-video-subtitle-player__detail-label{font-size:12px;font-weight:600;color:#ffffff80;text-transform:uppercase;letter-spacing:.05em;margin-bottom:8px}.xiping-video-subtitle-player__detail-text{font-size:16px;line-height:1.6;color:#ffffffe6}.xiping-video-subtitle-player__detail-translation,.xiping-video-subtitle-player__detail-definition{padding-bottom:16px;border-bottom:1px solid rgba(255,255,255,.1)}.xiping-video-subtitle-player__detail-definition{border-bottom:none}.xiping-video-subtitle-player__detail-examples{display:flex;flex-direction:column;gap:16px}.xiping-video-subtitle-player__detail-example{padding:16px;background:#ffffff0d;border-radius:8px;border-left:3px solid #fbbf24}.xiping-video-subtitle-player__detail-example-en{font-size:15px;line-height:1.6;color:#fffffff2;margin-bottom:8px}.xiping-video-subtitle-player__detail-example-zh{font-size:14px;line-height:1.6;color:#ffffffb3;padding-left:12px;border-left:2px solid rgba(255,255,255,.2)}.xiping-video-subtitle-player__subtitle-container::-webkit-scrollbar,.xiping-video-subtitle-player__detail::-webkit-scrollbar{width:8px}.xiping-video-subtitle-player__subtitle-container::-webkit-scrollbar-track,.xiping-video-subtitle-player__detail::-webkit-scrollbar-track{background:#ffffff0d;border-radius:4px}.xiping-video-subtitle-player__subtitle-container::-webkit-scrollbar-thumb,.xiping-video-subtitle-player__detail::-webkit-scrollbar-thumb{background:#fff3;border-radius:4px}.xiping-video-subtitle-player__subtitle-container::-webkit-scrollbar-thumb:hover,.xiping-video-subtitle-player__detail::-webkit-scrollbar-thumb:hover{background:#ffffff4d}
|
|
@@ -13,11 +13,11 @@ export interface VideoSubtitlePlayerProps {
|
|
|
13
13
|
style?: React.CSSProperties;
|
|
14
14
|
/** 自定义详情获取函数,用于调用大模型API */
|
|
15
15
|
onFetchDetail?: (target: HoverTarget | null) => Promise<void>;
|
|
16
|
+
/** 强制使用布局:传入则不再做设备检测,直接使用对应布局 */
|
|
17
|
+
forceLayout?: "mobile" | "pc";
|
|
16
18
|
}
|
|
17
19
|
/**
|
|
18
|
-
*
|
|
19
|
-
* 左侧:上部分视频播放器(填充模式),下部分字幕显示
|
|
20
|
-
* 右侧:字幕详情(单词/短语的发音、解释等)
|
|
20
|
+
* 视频字幕播放器:根据设备或 forceLayout 选择 PC 或移动端视图,二者完全分离
|
|
21
21
|
*/
|
|
22
22
|
export declare const VideoSubtitlePlayer: React.FC<VideoSubtitlePlayerProps>;
|
|
23
23
|
export default VideoSubtitlePlayer;
|