@xiping/react-components 1.0.70 → 1.0.78
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/_virtual/_rolldown/runtime.js +1 -0
- package/dist/cjs/components/blur-fade/BlurFade.js +1 -1
- package/dist/cjs/components/blur-text/BlurText.js +1 -1
- package/dist/cjs/components/button/Button.css +1 -1
- package/dist/cjs/components/button/Button2.js +1 -0
- package/dist/cjs/components/comic-text/ComicText2.js +4 -0
- package/dist/cjs/components/confetti-button/index.js +1 -1
- package/dist/cjs/components/dock/Duck.css +1 -1
- package/dist/cjs/components/dock/Duck2.js +1 -0
- package/dist/cjs/components/flip-text/FlipText.css +1 -1
- package/dist/cjs/components/flip-text/FlipText2.js +1 -0
- package/dist/cjs/components/gradient-text/index.css +1 -1
- package/dist/cjs/components/gradient-text/index2.js +1 -0
- package/dist/cjs/components/hyper-text/HyperText.css +1 -1
- package/dist/cjs/components/hyper-text/index.js +1 -1
- package/dist/cjs/components/image-compare/ImageCompare.css +1 -1
- package/dist/cjs/components/image-compare/ImageCompare2.js +1 -0
- package/dist/cjs/components/image-viewer/ImageThumbnails.css +1 -1
- package/dist/cjs/components/image-viewer/ImageThumbnails2.js +1 -0
- package/dist/cjs/components/image-viewer/ImageViewer.css +1 -1
- package/dist/cjs/components/image-viewer/ImageViewer.d.ts +1 -1
- package/dist/cjs/components/image-viewer/ImageViewer2.js +1 -0
- package/dist/cjs/components/message/Message.css +1 -1
- package/dist/cjs/components/message/Message2.js +1 -0
- package/dist/cjs/components/pinch-content/PinchContent.js +1 -1
- package/dist/cjs/components/pinch-content/index.js +1 -1
- package/dist/cjs/components/pointer/Pointer.css +1 -1
- package/dist/cjs/components/pointer/Pointer2.js +1 -0
- package/dist/cjs/components/scratch-to-reveal/ScratchToReveal.css +1 -1
- package/dist/cjs/components/scratch-to-reveal/ScratchToReveal2.js +1 -0
- package/dist/cjs/components/shimmer-button/ShimmerButton.css +1 -1
- package/dist/cjs/components/shimmer-button/ShimmerButton2.js +1 -0
- package/dist/cjs/components/shiny-button/ShinyButton.css +1 -1
- package/dist/cjs/components/shiny-button/ShinyButton2.js +1 -0
- package/dist/cjs/components/shiny-text/ShinyText2.js +1 -0
- package/dist/cjs/components/sparkles-text/SparklesText.css +1 -1
- package/dist/cjs/components/sparkles-text/SparklesText2.js +1 -0
- package/dist/cjs/components/split-text/SplitText.css +1 -1
- package/dist/cjs/components/split-text/SplitText2.js +1 -0
- package/dist/cjs/components/subtitle-player/CurrentMode.css +1 -1
- package/dist/cjs/components/subtitle-player/CurrentMode2.js +2 -0
- package/dist/cjs/components/subtitle-player/LyricsMode.css +1 -1
- package/dist/cjs/components/subtitle-player/LyricsMode2.js +2 -0
- package/dist/cjs/components/subtitle-player/SubtitlePlayer.css +1 -1
- package/dist/cjs/components/subtitle-player/SubtitlePlayer2.js +1 -0
- package/dist/cjs/components/subtitle-player/utils.js +1 -1
- package/dist/cjs/components/text-animate/TextAnimate.css +1 -1
- package/dist/cjs/components/text-animate/TextAnimate2.js +2 -0
- package/dist/cjs/components/text-type/TextType.css +1 -1
- package/dist/cjs/components/text-type/TextType2.js +1 -0
- package/dist/cjs/components/txt-editor/TxtEditor.js +4 -4
- package/dist/cjs/components/txt-reader/TxtReader.js +1 -1
- package/dist/cjs/components/txt-reader/index.module.css +1 -1
- package/dist/cjs/components/txt-reader/index.module.js +1 -0
- package/dist/cjs/components/typing-animation/index.css +1 -1
- package/dist/cjs/components/typing-animation/index2.js +1 -0
- package/dist/cjs/components/variable-proximity/index.css +1 -1
- package/dist/cjs/components/variable-proximity/index2.js +1 -0
- package/dist/cjs/components/video-dialog/VideoDialog.css +1 -1
- package/dist/cjs/components/video-dialog/VideoDialog2.js +1 -0
- package/dist/cjs/components/video-subtitle-player/VideoSubtitlePlayer.css +1 -1
- package/dist/cjs/components/video-subtitle-player/VideoSubtitlePlayer.mobile.css +1 -1
- package/dist/cjs/components/video-subtitle-player/VideoSubtitlePlayer.pc.css +1 -1
- package/dist/cjs/components/video-subtitle-player/VideoSubtitlePlayer2.js +1 -0
- package/dist/cjs/components/video-subtitle-player/VideoSubtitlePlayerMobile.js +1 -1
- package/dist/cjs/components/video-subtitle-player/VideoSubtitlePlayerPC.js +1 -1
- package/dist/cjs/components/video-subtitle-player/layouts/VideoSubtitlePlayerLayoutMobile.js +1 -1
- package/dist/cjs/components/video-subtitle-player/layouts/VideoSubtitlePlayerLayoutPC.js +1 -1
- package/dist/cjs/components/video-subtitle-player/useVideoSubtitleStore.js +1 -1
- package/dist/cjs/components/video-subtitle-player/useXGPlayer.js +1 -1
- package/dist/cjs/hooks/useStayTimeReport.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.24_core-js@3.47.0/node_modules/xgplayer/dist/index.min.css +1 -1
- package/dist/cjs/packages/subtitle/lib/index.js +1 -0
- package/dist/cjs/packages/subtitle/lib/src/json-converter.js +1 -1
- package/dist/cjs/packages/subtitle/lib/src/parser.js +5 -5
- package/dist/cjs/react-components.css +27 -27
- package/dist/es/components/blur-fade/BlurFade.js +37 -49
- package/dist/es/components/blur-text/BlurText.js +67 -76
- package/dist/es/components/button/Button.css +1 -1
- package/dist/es/components/button/Button2.js +48 -0
- package/dist/es/components/comic-text/ComicText2.js +55 -0
- package/dist/es/components/confetti-button/index.js +63 -75
- package/dist/es/components/dock/Duck.css +1 -1
- package/dist/es/components/dock/Duck2.js +60 -0
- package/dist/es/components/flip-text/FlipText.css +1 -1
- package/dist/es/components/flip-text/FlipText2.js +41 -0
- package/dist/es/components/gradient-text/index.css +1 -1
- package/dist/es/components/gradient-text/index2.js +29 -0
- package/dist/es/components/hyper-text/HyperText.css +1 -1
- package/dist/es/components/hyper-text/index.js +51 -79
- package/dist/es/components/image-compare/ImageCompare.css +1 -1
- package/dist/es/components/image-compare/ImageCompare2.js +96 -0
- package/dist/es/components/image-viewer/ImageThumbnails.css +1 -1
- package/dist/es/components/image-viewer/ImageThumbnails2.js +40 -0
- package/dist/es/components/image-viewer/ImageViewer.css +1 -1
- package/dist/es/components/image-viewer/ImageViewer.d.ts +1 -1
- package/dist/es/components/image-viewer/ImageViewer2.js +151 -0
- package/dist/es/components/message/Message.css +1 -1
- package/dist/es/components/message/Message2.js +189 -0
- package/dist/es/components/pinch-content/PinchContent.js +120 -127
- package/dist/es/components/pinch-content/index.js +5 -5
- package/dist/es/components/pointer/Pointer.css +1 -1
- package/dist/es/components/pointer/Pointer2.js +61 -0
- package/dist/es/components/react-force-graph-3d/index.js +2 -0
- package/dist/es/components/scratch-to-reveal/ScratchToReveal.css +1 -1
- package/dist/es/components/scratch-to-reveal/ScratchToReveal2.js +88 -0
- package/dist/es/components/shimmer-button/ShimmerButton.css +1 -1
- package/dist/es/components/shimmer-button/ShimmerButton2.js +33 -0
- package/dist/es/components/shiny-button/ShinyButton.css +1 -1
- package/dist/es/components/shiny-button/ShinyButton2.js +53 -0
- package/dist/es/components/shiny-text/ShinyText2.js +61 -0
- package/dist/es/components/sparkles-text/SparklesText.css +1 -1
- package/dist/es/components/sparkles-text/SparklesText2.js +90 -0
- package/dist/es/components/split-text/SplitText.css +1 -1
- package/dist/es/components/split-text/SplitText2.js +109 -0
- package/dist/es/components/subtitle-player/CurrentMode.css +1 -1
- package/dist/es/components/subtitle-player/CurrentMode2.js +44 -0
- package/dist/es/components/subtitle-player/LyricsMode.css +1 -1
- package/dist/es/components/subtitle-player/LyricsMode2.js +114 -0
- package/dist/es/components/subtitle-player/SubtitlePlayer.css +1 -1
- package/dist/es/components/subtitle-player/SubtitlePlayer2.js +169 -0
- package/dist/es/components/subtitle-player/utils.js +63 -69
- package/dist/es/components/text-animate/TextAnimate.css +1 -1
- package/dist/es/components/text-animate/TextAnimate2.js +312 -0
- package/dist/es/components/text-type/TextType.css +1 -1
- package/dist/es/components/text-type/TextType2.js +80 -0
- package/dist/es/components/txt-editor/TxtEditor.js +60 -95
- package/dist/es/components/txt-reader/TxtReader.js +45 -74
- package/dist/es/components/txt-reader/index.module.css +1 -1
- package/dist/es/components/txt-reader/index.module.js +10 -0
- package/dist/es/components/typing-animation/index.css +1 -1
- package/dist/es/components/typing-animation/index2.js +43 -0
- package/dist/es/components/variable-proximity/index.css +1 -1
- package/dist/es/components/variable-proximity/index2.js +179 -0
- package/dist/es/components/video-dialog/VideoDialog.css +1 -1
- package/dist/es/components/video-dialog/VideoDialog2.js +168 -0
- package/dist/es/components/video-subtitle-player/VideoSubtitlePlayer.css +1 -1
- package/dist/es/components/video-subtitle-player/VideoSubtitlePlayer.mobile.css +1 -1
- package/dist/es/components/video-subtitle-player/VideoSubtitlePlayer.pc.css +1 -1
- package/dist/es/components/video-subtitle-player/VideoSubtitlePlayer2.js +43 -0
- package/dist/es/components/video-subtitle-player/VideoSubtitlePlayerMobile.js +29 -46
- package/dist/es/components/video-subtitle-player/VideoSubtitlePlayerPC.js +94 -74
- package/dist/es/components/video-subtitle-player/layouts/VideoSubtitlePlayerLayoutMobile.js +24 -21
- package/dist/es/components/video-subtitle-player/layouts/VideoSubtitlePlayerLayoutPC.js +58 -50
- package/dist/es/components/video-subtitle-player/useVideoSubtitleStore.js +61 -56
- package/dist/es/components/video-subtitle-player/useXGPlayer.js +38 -35
- package/dist/es/hooks/useStayTimeReport.js +29 -29
- package/dist/es/index.js +33 -70
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.24_core-js@3.47.0/node_modules/xgplayer/dist/index.min.css +1 -1
- package/dist/es/packages/subtitle/lib/index.js +2 -0
- package/dist/es/packages/subtitle/lib/src/json-converter.js +22 -23
- package/dist/es/packages/subtitle/lib/src/parser.js +41 -54
- package/dist/es/react-components.css +27 -27
- package/package.json +25 -27
- package/dist/cjs/components/button/Button.js +0 -1
- package/dist/cjs/components/comic-text/ComicText.js +0 -4
- package/dist/cjs/components/dock/Duck.js +0 -1
- package/dist/cjs/components/flip-text/FlipText.js +0 -1
- package/dist/cjs/components/gradient-text/index.js +0 -1
- package/dist/cjs/components/image-compare/ImageCompare.js +0 -1
- package/dist/cjs/components/image-viewer/ImageThumbnails.js +0 -1
- package/dist/cjs/components/image-viewer/ImageViewer.js +0 -1
- package/dist/cjs/components/message/Message.js +0 -1
- package/dist/cjs/components/pointer/Pointer.js +0 -1
- package/dist/cjs/components/scratch-to-reveal/ScratchToReveal.js +0 -1
- package/dist/cjs/components/shimmer-button/ShimmerButton.js +0 -1
- package/dist/cjs/components/shiny-button/ShinyButton.js +0 -1
- package/dist/cjs/components/shiny-text/ShinyText.js +0 -1
- package/dist/cjs/components/sparkles-text/SparklesText.js +0 -1
- package/dist/cjs/components/split-text/SplitText.js +0 -1
- package/dist/cjs/components/subtitle-player/CurrentMode.js +0 -2
- package/dist/cjs/components/subtitle-player/LyricsMode.js +0 -2
- package/dist/cjs/components/subtitle-player/SubtitlePlayer.js +0 -1
- package/dist/cjs/components/text-animate/TextAnimate.js +0 -2
- package/dist/cjs/components/text-type/TextType.js +0 -1
- package/dist/cjs/components/txt-reader/index.module.css.js +0 -1
- package/dist/cjs/components/typing-animation/index.js +0 -1
- package/dist/cjs/components/variable-proximity/index.js +0 -1
- package/dist/cjs/components/video-dialog/VideoDialog.js +0 -1
- package/dist/cjs/components/video-subtitle-player/VideoSubtitlePlayer.js +0 -1
- package/dist/es/components/button/Button.js +0 -72
- package/dist/es/components/comic-text/ComicText.js +0 -52
- package/dist/es/components/dock/Duck.js +0 -80
- package/dist/es/components/flip-text/FlipText.js +0 -38
- package/dist/es/components/gradient-text/index.js +0 -22
- package/dist/es/components/image-compare/ImageCompare.js +0 -127
- package/dist/es/components/image-viewer/ImageThumbnails.js +0 -73
- package/dist/es/components/image-viewer/ImageViewer.js +0 -141
- package/dist/es/components/message/Message.js +0 -220
- package/dist/es/components/pointer/Pointer.js +0 -75
- package/dist/es/components/scratch-to-reveal/ScratchToReveal.js +0 -97
- package/dist/es/components/shimmer-button/ShimmerButton.js +0 -42
- package/dist/es/components/shiny-button/ShinyButton.js +0 -61
- package/dist/es/components/shiny-text/ShinyText.js +0 -76
- package/dist/es/components/sparkles-text/SparklesText.js +0 -71
- package/dist/es/components/split-text/SplitText.js +0 -116
- package/dist/es/components/subtitle-player/CurrentMode.js +0 -78
- package/dist/es/components/subtitle-player/LyricsMode.js +0 -152
- package/dist/es/components/subtitle-player/SubtitlePlayer.js +0 -234
- package/dist/es/components/text-animate/TextAnimate.js +0 -310
- package/dist/es/components/text-type/TextType.js +0 -121
- package/dist/es/components/txt-reader/index.module.css.js +0 -10
- package/dist/es/components/typing-animation/index.js +0 -56
- package/dist/es/components/variable-proximity/index.js +0 -211
- package/dist/es/components/video-dialog/VideoDialog.js +0 -113
- package/dist/es/components/video-subtitle-player/VideoSubtitlePlayer.js +0 -74
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import './Pointer.css';/* empty css */
|
|
3
|
+
import { Fragment as e, jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
|
+
import { useEffect as r, useRef as i, useState as a } from "react";
|
|
5
|
+
import o from "clsx";
|
|
6
|
+
import { AnimatePresence as s, motion as c, useMotionValue as l } from "motion/react";
|
|
7
|
+
//#region src/components/pointer/Pointer.tsx
|
|
8
|
+
function u({ className: u, style: d, children: f, ...p }) {
|
|
9
|
+
let m = l(0), h = l(0), [g, _] = a(!1), v = i(null);
|
|
10
|
+
return r(() => {
|
|
11
|
+
if (typeof window < "u" && v.current) {
|
|
12
|
+
let e = v.current.parentElement;
|
|
13
|
+
if (e) {
|
|
14
|
+
e.style.cursor = "none";
|
|
15
|
+
let t = (e) => {
|
|
16
|
+
m.set(e.clientX), h.set(e.clientY);
|
|
17
|
+
}, n = () => {
|
|
18
|
+
_(!0);
|
|
19
|
+
}, r = () => {
|
|
20
|
+
_(!1);
|
|
21
|
+
};
|
|
22
|
+
return e.addEventListener("mousemove", t), e.addEventListener("mouseenter", n), e.addEventListener("mouseleave", r), () => {
|
|
23
|
+
e.style.cursor = "", e.removeEventListener("mousemove", t), e.removeEventListener("mouseenter", n), e.removeEventListener("mouseleave", r);
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}, [m, h]), /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("div", { ref: v }), /* @__PURE__ */ t(s, { children: g && /* @__PURE__ */ t(c.div, {
|
|
28
|
+
className: o("xiping-pointer", u),
|
|
29
|
+
style: {
|
|
30
|
+
top: h,
|
|
31
|
+
left: m,
|
|
32
|
+
...d
|
|
33
|
+
},
|
|
34
|
+
initial: {
|
|
35
|
+
scale: 0,
|
|
36
|
+
opacity: 0
|
|
37
|
+
},
|
|
38
|
+
animate: {
|
|
39
|
+
scale: 1,
|
|
40
|
+
opacity: 1
|
|
41
|
+
},
|
|
42
|
+
exit: {
|
|
43
|
+
scale: 0,
|
|
44
|
+
opacity: 0
|
|
45
|
+
},
|
|
46
|
+
...p,
|
|
47
|
+
children: f || /* @__PURE__ */ t("svg", {
|
|
48
|
+
stroke: "currentColor",
|
|
49
|
+
fill: "currentColor",
|
|
50
|
+
strokeWidth: "1",
|
|
51
|
+
viewBox: "0 0 16 16",
|
|
52
|
+
height: "24",
|
|
53
|
+
width: "24",
|
|
54
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
55
|
+
className: "xiping-pointer-icon",
|
|
56
|
+
children: /* @__PURE__ */ t("path", { d: "M14.082 2.182a.5.5 0 0 1 .103.557L8.528 15.467a.5.5 0 0 1-.917-.007L5.57 10.694.803 8.652a.5.5 0 0 1-.006-.916l12.728-5.657a.5.5 0 0 1 .556.103z" })
|
|
57
|
+
})
|
|
58
|
+
}) })] });
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
61
|
+
export { u as Pointer };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.xiping-scratch-to-reveal{
|
|
1
|
+
.xiping-scratch-to-reveal{-webkit-user-select:none;user-select:none;position:relative}.xiping-scratch-canvas{position:absolute;top:0;left:0}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import './ScratchToReveal.css';/* empty css */
|
|
3
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
4
|
+
import { useEffect as n, useRef as r, useState as i } from "react";
|
|
5
|
+
import a from "clsx";
|
|
6
|
+
import { motion as o, useAnimation as s } from "motion/react";
|
|
7
|
+
//#region src/components/scratch-to-reveal/ScratchToReveal.tsx
|
|
8
|
+
var c = ({ width: c, height: l, minScratchPercentage: u = 50, onComplete: d, children: f, className: p, gradientColors: m = [
|
|
9
|
+
"#A97CF8",
|
|
10
|
+
"#F38CB8",
|
|
11
|
+
"#FDCC92"
|
|
12
|
+
] }) => {
|
|
13
|
+
let h = r(null), [g, _] = i(!1), [v, y] = i(!1), b = s();
|
|
14
|
+
n(() => {
|
|
15
|
+
let e = h.current, t = e?.getContext("2d");
|
|
16
|
+
if (e && t) {
|
|
17
|
+
t.fillStyle = "#ccc", t.fillRect(0, 0, e.width, e.height);
|
|
18
|
+
let n = t.createLinearGradient(0, 0, e.width, e.height);
|
|
19
|
+
n.addColorStop(0, m[0]), n.addColorStop(.5, m[1]), n.addColorStop(1, m[2]), t.fillStyle = n, t.fillRect(0, 0, e.width, e.height);
|
|
20
|
+
}
|
|
21
|
+
}, [m]), n(() => {
|
|
22
|
+
let e = (e) => {
|
|
23
|
+
g && C(e.clientX, e.clientY);
|
|
24
|
+
}, t = (e) => {
|
|
25
|
+
if (!g) return;
|
|
26
|
+
let t = e.touches[0];
|
|
27
|
+
C(t.clientX, t.clientY);
|
|
28
|
+
}, n = () => {
|
|
29
|
+
_(!1), T();
|
|
30
|
+
}, r = () => {
|
|
31
|
+
_(!1), T();
|
|
32
|
+
};
|
|
33
|
+
return document.addEventListener("mousedown", e), document.addEventListener("mousemove", e), document.addEventListener("touchstart", t), document.addEventListener("touchmove", t), document.addEventListener("mouseup", n), document.addEventListener("touchend", r), document.addEventListener("touchcancel", r), () => {
|
|
34
|
+
document.removeEventListener("mousedown", e), document.removeEventListener("mousemove", e), document.removeEventListener("touchstart", t), document.removeEventListener("touchmove", t), document.removeEventListener("mouseup", n), document.removeEventListener("touchend", r), document.removeEventListener("touchcancel", r);
|
|
35
|
+
};
|
|
36
|
+
}, [g]);
|
|
37
|
+
let x = () => _(!0), S = () => _(!0), C = (e, t) => {
|
|
38
|
+
let n = h.current, r = n?.getContext("2d");
|
|
39
|
+
if (n && r) {
|
|
40
|
+
let i = n.getBoundingClientRect(), a = e - i.left + 16, o = t - i.top + 16;
|
|
41
|
+
r.globalCompositeOperation = "destination-out", r.beginPath(), r.arc(a, o, 30, 0, Math.PI * 2), r.fill();
|
|
42
|
+
}
|
|
43
|
+
}, w = async () => {
|
|
44
|
+
await b.start({
|
|
45
|
+
scale: [
|
|
46
|
+
1,
|
|
47
|
+
1.5,
|
|
48
|
+
1
|
|
49
|
+
],
|
|
50
|
+
rotate: [
|
|
51
|
+
0,
|
|
52
|
+
10,
|
|
53
|
+
-10,
|
|
54
|
+
10,
|
|
55
|
+
-10,
|
|
56
|
+
0
|
|
57
|
+
],
|
|
58
|
+
transition: { duration: .5 }
|
|
59
|
+
}), d && d();
|
|
60
|
+
}, T = () => {
|
|
61
|
+
if (v) return;
|
|
62
|
+
let e = h.current, t = e?.getContext("2d");
|
|
63
|
+
if (e && t) {
|
|
64
|
+
let n = t.getImageData(0, 0, e.width, e.height).data, r = n.length / 4, i = 0;
|
|
65
|
+
for (let e = 3; e < n.length; e += 4) n[e] === 0 && i++;
|
|
66
|
+
i / r * 100 >= u && (y(!0), t.clearRect(0, 0, e.width, e.height), w());
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
return /* @__PURE__ */ t(o.div, {
|
|
70
|
+
className: a("xiping-scratch-to-reveal", p),
|
|
71
|
+
style: {
|
|
72
|
+
width: c,
|
|
73
|
+
height: l,
|
|
74
|
+
cursor: "url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgdmlld0JveD0iMCAwIDMyIDMyIj4KICA8Y2lyY2xlIGN4PSIxNiIgY3k9IjE2IiByPSIxNSIgc3R5bGU9ImZpbGw6I2ZmZjtzdHJva2U6IzAwMDtzdHJva2Utd2lkdGg6MXB4OyIgLz4KPC9zdmc+'), auto"
|
|
75
|
+
},
|
|
76
|
+
animate: b,
|
|
77
|
+
children: [/* @__PURE__ */ e("canvas", {
|
|
78
|
+
ref: h,
|
|
79
|
+
width: c,
|
|
80
|
+
height: l,
|
|
81
|
+
className: "xiping-scratch-canvas",
|
|
82
|
+
onMouseDown: x,
|
|
83
|
+
onTouchStart: S
|
|
84
|
+
}), f]
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
//#endregion
|
|
88
|
+
export { c as ScratchToReveal };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.xiping-shimmer-button{
|
|
1
|
+
.xiping-shimmer-button{z-index:0;cursor:pointer;white-space:nowrap;color:#fff;background:var(--bg);border-radius:var(--radius);border:1px solid #ffffff1a;justify-content:center;align-items:center;padding:.75rem 1.5rem;transition:transform .3s ease-in-out;display:flex;position:relative;overflow:hidden;transform:translateZ(0)}.xiping-shimmer-button:active{transform:translateY(1px)translateZ(0)}@media (prefers-color-scheme:dark){.xiping-shimmer-button{color:#000}}.xiping-shimmer-button-spark-container{z-index:-30;filter:blur(2px);position:absolute;inset:0;overflow:visible;container-type:size}.xiping-shimmer-button-spark{aspect-ratio:1;height:100cqh;animation:xiping-shimmer-slide var(--speed) ease-in-out infinite alternate;border-radius:0;position:absolute;inset:0;-webkit-mask:none;mask:none}.xiping-shimmer-button-spark-before{background:conic-gradient(from calc(270deg - (var(--spread) * .5)), transparent 0, var(--shimmer-color) var(--spread), transparent var(--spread));width:auto;animation:xiping-spin-around calc(var(--speed) * 2) infinite linear;position:absolute;inset:-100%;transform:rotate(0)}.xiping-shimmer-button-highlight{border-radius:1rem;width:100%;height:100%;transition:all .3s ease-in-out;position:absolute;inset:0;transform:translateZ(0);box-shadow:inset 0 -8px 10px #ffffff1f}.xiping-shimmer-button:hover .xiping-shimmer-button-highlight{box-shadow:inset 0 -6px 10px #ffffff40}.xiping-shimmer-button:active .xiping-shimmer-button-highlight{box-shadow:inset 0 -10px 10px #ffffff40}.xiping-shimmer-button-backdrop{z-index:-20;background:var(--bg);border-radius:var(--radius);inset:var(--cut);position:absolute}@keyframes xiping-shimmer-slide{to{transform:translate(calc(100cqw - 100%))}}@keyframes xiping-spin-around{0%{transform:translateZ(0)rotate(0)}15%,35%{transform:translateZ(0)rotate(90deg)}65%,85%{transform:translateZ(0)rotate(270deg)}to{transform:translateZ(0)rotate(360deg)}}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import './ShimmerButton.css';/* empty css */
|
|
2
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
3
|
+
import n from "react";
|
|
4
|
+
import r from "clsx";
|
|
5
|
+
//#region src/components/shimmer-button/ShimmerButton.tsx
|
|
6
|
+
var i = n.forwardRef(({ shimmerColor: n = "#ffffff", shimmerSize: i = "0.05em", shimmerDuration: a = "3s", borderRadius: o = "100px", background: s = "rgba(0, 0, 0, 1)", className: c, children: l, ...u }, d) => /* @__PURE__ */ t("button", {
|
|
7
|
+
style: {
|
|
8
|
+
"--spread": "90deg",
|
|
9
|
+
"--shimmer-color": n,
|
|
10
|
+
"--radius": o,
|
|
11
|
+
"--speed": a,
|
|
12
|
+
"--cut": i,
|
|
13
|
+
"--bg": s
|
|
14
|
+
},
|
|
15
|
+
className: r("xiping-shimmer-button", c),
|
|
16
|
+
ref: d,
|
|
17
|
+
...u,
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ e("div", {
|
|
20
|
+
className: "xiping-shimmer-button-spark-container",
|
|
21
|
+
children: /* @__PURE__ */ e("div", {
|
|
22
|
+
className: "xiping-shimmer-button-spark",
|
|
23
|
+
children: /* @__PURE__ */ e("div", { className: "xiping-shimmer-button-spark-before" })
|
|
24
|
+
})
|
|
25
|
+
}),
|
|
26
|
+
l,
|
|
27
|
+
/* @__PURE__ */ e("div", { className: "xiping-shimmer-button-highlight" }),
|
|
28
|
+
/* @__PURE__ */ e("div", { className: "xiping-shimmer-button-backdrop" })
|
|
29
|
+
]
|
|
30
|
+
}));
|
|
31
|
+
i.displayName = "ShimmerButton";
|
|
32
|
+
//#endregion
|
|
33
|
+
export { i as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.xiping-shiny-button{
|
|
1
|
+
.xiping-shiny-button{cursor:pointer;-webkit-backdrop-filter:blur(24px);backdrop-filter:blur(24px);border:1px solid;border-radius:.5rem;padding:.5rem 1.5rem;font-weight:500;transition:box-shadow .3s ease-in-out;position:relative}.xiping-shiny-button:hover{box-shadow:0 1px 3px #0000001a,0 1px 2px -1px #0000001a}@media (prefers-color-scheme:dark){.xiping-shiny-button{background:radial-gradient(circle at 50% 0%, var(--primary) 10%, transparent 60%)}.xiping-shiny-button:hover{box-shadow:0 0 20px var(--primary) / 10%}}.xiping-shiny-button-text{text-transform:uppercase;letter-spacing:.05em;color:#000000a6;width:100%;height:100%;font-size:.875rem;display:block;position:relative}@media (prefers-color-scheme:dark){.xiping-shiny-button-text{color:#ffffffe6;font-weight:300}}.xiping-shiny-button-border{z-index:10;border-radius:inherit;padding:1px;display:block;position:absolute;inset:0}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import './ShinyButton.css';/* empty css */
|
|
3
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
4
|
+
import n from "react";
|
|
5
|
+
import r from "clsx";
|
|
6
|
+
import { motion as i } from "motion/react";
|
|
7
|
+
//#region src/components/shiny-button/ShinyButton.tsx
|
|
8
|
+
var a = {
|
|
9
|
+
initial: {
|
|
10
|
+
"--x": "100%",
|
|
11
|
+
scale: .8
|
|
12
|
+
},
|
|
13
|
+
animate: {
|
|
14
|
+
"--x": "-100%",
|
|
15
|
+
scale: 1
|
|
16
|
+
},
|
|
17
|
+
whileTap: { scale: .95 },
|
|
18
|
+
transition: {
|
|
19
|
+
repeat: Infinity,
|
|
20
|
+
repeatType: "loop",
|
|
21
|
+
repeatDelay: 1,
|
|
22
|
+
type: "spring",
|
|
23
|
+
stiffness: 20,
|
|
24
|
+
damping: 15,
|
|
25
|
+
mass: 2,
|
|
26
|
+
scale: {
|
|
27
|
+
type: "spring",
|
|
28
|
+
stiffness: 200,
|
|
29
|
+
damping: 5,
|
|
30
|
+
mass: .5
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}, o = n.forwardRef(({ children: n, className: o, ...s }, c) => /* @__PURE__ */ t(i.button, {
|
|
34
|
+
ref: c,
|
|
35
|
+
className: r("xiping-shiny-button", o),
|
|
36
|
+
...a,
|
|
37
|
+
...s,
|
|
38
|
+
children: [/* @__PURE__ */ e("span", {
|
|
39
|
+
className: "xiping-shiny-button-text",
|
|
40
|
+
style: { maskImage: "linear-gradient(-75deg,var(--primary) calc(var(--x) + 20%),transparent calc(var(--x) + 30%),var(--primary) calc(var(--x) + 100%))" },
|
|
41
|
+
children: n
|
|
42
|
+
}), /* @__PURE__ */ e("span", {
|
|
43
|
+
style: {
|
|
44
|
+
mask: "linear-gradient(rgb(0,0,0), rgb(0,0,0)) content-box exclude,linear-gradient(rgb(0,0,0), rgb(0,0,0))",
|
|
45
|
+
WebkitMask: "linear-gradient(rgb(0,0,0), rgb(0,0,0)) content-box exclude,linear-gradient(rgb(0,0,0), rgb(0,0,0))",
|
|
46
|
+
backgroundImage: "linear-gradient(-75deg,var(--primary)/10% calc(var(--x)+20%),var(--primary)/50% calc(var(--x)+25%),var(--primary)/10% calc(var(--x)+100%))"
|
|
47
|
+
},
|
|
48
|
+
className: "xiping-shiny-button-border"
|
|
49
|
+
})]
|
|
50
|
+
}));
|
|
51
|
+
o.displayName = "ShinyButton";
|
|
52
|
+
//#endregion
|
|
53
|
+
export { o as ShinyButton };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import './ShinyText.css';/* empty css */
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback as t, useEffect as n, useRef as r, useState as i } from "react";
|
|
4
|
+
import { motion as a, useAnimationFrame as o, useMotionValue as s, useTransform as c } from "motion/react";
|
|
5
|
+
//#region src/components/shiny-text/ShinyText.tsx
|
|
6
|
+
var l = ({ text: l, disabled: u = !1, speed: d = 2, className: f = "", color: p = "#b5b5b5", shineColor: m = "#ffffff", spread: h = 120, yoyo: g = !1, pauseOnHover: _ = !1, direction: v = "left", delay: y = 0 }) => {
|
|
7
|
+
let [b, x] = i(!1), S = s(0), C = r(0), w = r(null), T = r(v === "left" ? 1 : -1), E = d * 1e3, D = y * 1e3;
|
|
8
|
+
o((e) => {
|
|
9
|
+
if (u || b) {
|
|
10
|
+
w.current = null;
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
if (w.current === null) {
|
|
14
|
+
w.current = e;
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
let t = e - w.current;
|
|
18
|
+
if (w.current = e, C.current += t, g) {
|
|
19
|
+
let e = E + D, t = e * 2, n = C.current % t;
|
|
20
|
+
if (n < E) {
|
|
21
|
+
let e = n / E * 100;
|
|
22
|
+
S.set(T.current === 1 ? e : 100 - e);
|
|
23
|
+
} else if (n < e) S.set(T.current === 1 ? 100 : 0);
|
|
24
|
+
else if (n < e + E) {
|
|
25
|
+
let t = 100 - (n - e) / E * 100;
|
|
26
|
+
S.set(T.current === 1 ? t : 100 - t);
|
|
27
|
+
} else S.set(T.current === 1 ? 0 : 100);
|
|
28
|
+
} else {
|
|
29
|
+
let e = E + D, t = C.current % e;
|
|
30
|
+
if (t < E) {
|
|
31
|
+
let e = t / E * 100;
|
|
32
|
+
S.set(T.current === 1 ? e : 100 - e);
|
|
33
|
+
} else S.set(T.current === 1 ? 100 : 0);
|
|
34
|
+
}
|
|
35
|
+
}), n(() => {
|
|
36
|
+
T.current = v === "left" ? 1 : -1, C.current = 0, S.set(0);
|
|
37
|
+
}, [v]);
|
|
38
|
+
let O = c(S, (e) => `${150 - e * 2}% center`), k = t(() => {
|
|
39
|
+
_ && x(!0);
|
|
40
|
+
}, [_]), A = t(() => {
|
|
41
|
+
_ && x(!1);
|
|
42
|
+
}, [_]), j = {
|
|
43
|
+
backgroundImage: `linear-gradient(${h}deg, ${p} 0%, ${p} 35%, ${m} 50%, ${p} 65%, ${p} 100%)`,
|
|
44
|
+
backgroundSize: "200% auto",
|
|
45
|
+
WebkitBackgroundClip: "text",
|
|
46
|
+
backgroundClip: "text",
|
|
47
|
+
WebkitTextFillColor: "transparent"
|
|
48
|
+
};
|
|
49
|
+
return /* @__PURE__ */ e(a.span, {
|
|
50
|
+
className: `shiny-text ${f}`,
|
|
51
|
+
style: {
|
|
52
|
+
...j,
|
|
53
|
+
backgroundPosition: O
|
|
54
|
+
},
|
|
55
|
+
onMouseEnter: k,
|
|
56
|
+
onMouseLeave: A,
|
|
57
|
+
children: l
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
//#endregion
|
|
61
|
+
export { l as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.xiping-sparkle{pointer-events:none;
|
|
1
|
+
.xiping-sparkle{pointer-events:none;z-index:20;position:absolute}.xiping-sparkles-text{font-size:3.75rem;font-weight:700}.xiping-sparkles-text-wrapper{display:inline-block;position:relative}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import './SparklesText.css';/* empty css */
|
|
3
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
4
|
+
import { useEffect as n, useState as r } from "react";
|
|
5
|
+
import i from "clsx";
|
|
6
|
+
import { motion as a } from "motion/react";
|
|
7
|
+
//#region src/components/sparkles-text/SparklesText.tsx
|
|
8
|
+
var o = ({ id: t, x: n, y: r, color: i, delay: o, scale: s }) => /* @__PURE__ */ e(a.svg, {
|
|
9
|
+
className: "xiping-sparkle",
|
|
10
|
+
initial: {
|
|
11
|
+
opacity: 0,
|
|
12
|
+
left: n,
|
|
13
|
+
top: r
|
|
14
|
+
},
|
|
15
|
+
animate: {
|
|
16
|
+
opacity: [
|
|
17
|
+
0,
|
|
18
|
+
1,
|
|
19
|
+
0
|
|
20
|
+
],
|
|
21
|
+
scale: [
|
|
22
|
+
0,
|
|
23
|
+
s,
|
|
24
|
+
0
|
|
25
|
+
],
|
|
26
|
+
rotate: [
|
|
27
|
+
75,
|
|
28
|
+
120,
|
|
29
|
+
150
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
transition: {
|
|
33
|
+
duration: .8,
|
|
34
|
+
repeat: Infinity,
|
|
35
|
+
delay: o
|
|
36
|
+
},
|
|
37
|
+
width: "21",
|
|
38
|
+
height: "21",
|
|
39
|
+
viewBox: "0 0 21 21",
|
|
40
|
+
children: /* @__PURE__ */ e("path", {
|
|
41
|
+
d: "M9.82531 0.843845C10.0553 0.215178 10.9446 0.215178 11.1746 0.843845L11.8618 2.72026C12.4006 4.19229 12.3916 6.39157 13.5 7.5C14.6084 8.60843 16.8077 8.59935 18.2797 9.13822L20.1561 9.82534C20.7858 10.0553 20.7858 10.9447 20.1561 11.1747L18.2797 11.8618C16.8077 12.4007 14.6084 12.3916 13.5 13.5C12.3916 14.6084 12.4006 16.8077 11.8618 18.2798L11.1746 20.1562C10.9446 20.7858 10.0553 20.7858 9.82531 20.1562L9.13819 18.2798C8.59932 16.8077 8.60843 14.6084 7.5 13.5C6.39157 12.3916 4.19225 12.4007 2.72023 11.8618L0.843814 11.1747C0.215148 10.9447 0.215148 10.0553 0.843814 9.82534L2.72023 9.13822C4.19225 8.59935 6.39157 8.60843 7.5 7.5C8.60843 6.39157 8.59932 4.19229 9.13819 2.72026L9.82531 0.843845Z",
|
|
42
|
+
fill: i
|
|
43
|
+
})
|
|
44
|
+
}, t), s = ({ children: a, colors: s = {
|
|
45
|
+
first: "#9E7AFF",
|
|
46
|
+
second: "#FE8BBB"
|
|
47
|
+
}, className: c, sparklesCount: l = 10, ...u }) => {
|
|
48
|
+
let [d, f] = r([]);
|
|
49
|
+
return n(() => {
|
|
50
|
+
let e = () => {
|
|
51
|
+
let e = `${Math.random() * 100}%`, t = `${Math.random() * 100}%`, n = Math.random() > .5 ? s.first : s.second, r = Math.random() * 2, i = Math.random() * 1 + .3, a = Math.random() * 10 + 5;
|
|
52
|
+
return {
|
|
53
|
+
id: `${e}-${t}-${Date.now()}`,
|
|
54
|
+
x: e,
|
|
55
|
+
y: t,
|
|
56
|
+
color: n,
|
|
57
|
+
delay: r,
|
|
58
|
+
scale: i,
|
|
59
|
+
lifespan: a
|
|
60
|
+
};
|
|
61
|
+
}, t = () => {
|
|
62
|
+
f(Array.from({ length: l }, e));
|
|
63
|
+
}, n = () => {
|
|
64
|
+
f((t) => t.map((t) => t.lifespan <= 0 ? e() : {
|
|
65
|
+
...t,
|
|
66
|
+
lifespan: t.lifespan - .1
|
|
67
|
+
}));
|
|
68
|
+
};
|
|
69
|
+
t();
|
|
70
|
+
let r = setInterval(n, 100);
|
|
71
|
+
return () => clearInterval(r);
|
|
72
|
+
}, [
|
|
73
|
+
s.first,
|
|
74
|
+
s.second,
|
|
75
|
+
l
|
|
76
|
+
]), /* @__PURE__ */ e("div", {
|
|
77
|
+
className: i("xiping-sparkles-text", c),
|
|
78
|
+
...u,
|
|
79
|
+
style: {
|
|
80
|
+
"--sparkles-first-color": `${s.first}`,
|
|
81
|
+
"--sparkles-second-color": `${s.second}`
|
|
82
|
+
},
|
|
83
|
+
children: /* @__PURE__ */ t("span", {
|
|
84
|
+
className: "xiping-sparkles-text-wrapper",
|
|
85
|
+
children: [d.map((t) => /* @__PURE__ */ e(o, { ...t }, t.id)), /* @__PURE__ */ e("strong", { children: a })]
|
|
86
|
+
})
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
//#endregion
|
|
90
|
+
export { s as SparklesText };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.xiping-split-parent{
|
|
1
|
+
.xiping-split-parent{white-space:normal;display:inline-block;overflow:hidden}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import './SplitText.css';/* empty css */
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect as t, useRef as n } from "react";
|
|
4
|
+
import r from "clsx";
|
|
5
|
+
import { gsap as i } from "gsap";
|
|
6
|
+
import { ScrollTrigger as a } from "gsap/ScrollTrigger";
|
|
7
|
+
import { SplitText as o } from "gsap/SplitText";
|
|
8
|
+
//#region src/components/split-text/SplitText.tsx
|
|
9
|
+
i.registerPlugin(a, o);
|
|
10
|
+
var s = ({ text: a, className: s = "", delay: c = 100, duration: l = .6, ease: u = "power3.out", splitType: d = "chars", from: f = {
|
|
11
|
+
opacity: 0,
|
|
12
|
+
y: 40
|
|
13
|
+
}, to: p = {
|
|
14
|
+
opacity: 1,
|
|
15
|
+
y: 0
|
|
16
|
+
}, threshold: m = .1, rootMargin: h = "-100px", textAlign: g = "center", onLetterAnimationComplete: _ }) => {
|
|
17
|
+
let v = n(null), y = n(!1), b = n(null);
|
|
18
|
+
return t(() => {
|
|
19
|
+
if (typeof window > "u" || !v.current || !a) return;
|
|
20
|
+
let e = v.current;
|
|
21
|
+
y.current = !1;
|
|
22
|
+
let t = d === "lines";
|
|
23
|
+
t && (e.style.position = "relative");
|
|
24
|
+
let n;
|
|
25
|
+
try {
|
|
26
|
+
n = new o(e, {
|
|
27
|
+
type: d,
|
|
28
|
+
absolute: t,
|
|
29
|
+
linesClass: "split-line"
|
|
30
|
+
});
|
|
31
|
+
} catch (e) {
|
|
32
|
+
console.error("Failed to create SplitText:", e);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
let r;
|
|
36
|
+
switch (d) {
|
|
37
|
+
case "lines":
|
|
38
|
+
r = n.lines;
|
|
39
|
+
break;
|
|
40
|
+
case "words":
|
|
41
|
+
r = n.words;
|
|
42
|
+
break;
|
|
43
|
+
case "chars":
|
|
44
|
+
r = n.chars;
|
|
45
|
+
break;
|
|
46
|
+
default: r = n.chars;
|
|
47
|
+
}
|
|
48
|
+
if (!r || r.length === 0) {
|
|
49
|
+
console.warn("No targets found for SplitText animation"), n.revert();
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
r.forEach((e) => {
|
|
53
|
+
e.style.willChange = "transform, opacity";
|
|
54
|
+
});
|
|
55
|
+
let s = (1 - m) * 100, g = /^(-?\d+(?:\.\d+)?)(px|em|rem|%)?$/.exec(h), x = g ? parseFloat(g[1]) : 0, S = g && g[2] || "px", C = `top ${s}%${x < 0 ? `-=${Math.abs(x)}${S}` : `+=${x}${S}`}`, w = i.timeline({
|
|
56
|
+
scrollTrigger: {
|
|
57
|
+
trigger: e,
|
|
58
|
+
start: C,
|
|
59
|
+
toggleActions: "play none none none",
|
|
60
|
+
once: !0,
|
|
61
|
+
onToggle: (e) => {
|
|
62
|
+
b.current = e;
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
smoothChildTiming: !0,
|
|
66
|
+
onComplete: () => {
|
|
67
|
+
y.current = !0, i.set(r, {
|
|
68
|
+
...p,
|
|
69
|
+
clearProps: "willChange",
|
|
70
|
+
immediateRender: !0
|
|
71
|
+
}), _?.();
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
return w.set(r, {
|
|
75
|
+
...f,
|
|
76
|
+
immediateRender: !1,
|
|
77
|
+
force3D: !0
|
|
78
|
+
}), w.to(r, {
|
|
79
|
+
...p,
|
|
80
|
+
duration: l,
|
|
81
|
+
ease: u,
|
|
82
|
+
stagger: c / 1e3,
|
|
83
|
+
force3D: !0
|
|
84
|
+
}), () => {
|
|
85
|
+
w.kill(), b.current &&= (b.current.kill(), null), i.killTweensOf(r), n && n.revert();
|
|
86
|
+
};
|
|
87
|
+
}, [
|
|
88
|
+
a,
|
|
89
|
+
c,
|
|
90
|
+
l,
|
|
91
|
+
u,
|
|
92
|
+
d,
|
|
93
|
+
f,
|
|
94
|
+
p,
|
|
95
|
+
m,
|
|
96
|
+
h,
|
|
97
|
+
_
|
|
98
|
+
]), /* @__PURE__ */ e("p", {
|
|
99
|
+
ref: v,
|
|
100
|
+
className: r("xiping-split-parent", s),
|
|
101
|
+
style: {
|
|
102
|
+
textAlign: g,
|
|
103
|
+
wordWrap: "break-word"
|
|
104
|
+
},
|
|
105
|
+
children: a
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
//#endregion
|
|
109
|
+
export { s as SplitText };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.xiping-subtitle-player__current-item{
|
|
1
|
+
.xiping-subtitle-player__current-item{flex-direction:column;gap:.25rem;transition:all .2s;display:flex}.xiping-subtitle-player__current-label{color:#ffffffb3;text-transform:uppercase;letter-spacing:.05em;margin-bottom:.25rem;font-size:.75rem;font-weight:600}.xiping-subtitle-player__current-text{text-shadow:0 2px 4px #00000080;font-size:1rem;font-weight:500}.xiping-subtitle-player__current-line{margin:.25rem 0}.xiping-subtitle-player__current-line:first-child{margin-top:0}.xiping-subtitle-player__current-line:last-child{margin-bottom:0}.xiping-subtitle-player__current-hover-layer{pointer-events:none;position:absolute;inset:0}@media (width<=768px){.xiping-subtitle-player__current-text{font-size:.9rem}}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { renderTextWithWords as e } from "./utils.js";
|
|
2
|
+
import './CurrentMode.css';/* empty css */
|
|
3
|
+
import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import "react";
|
|
5
|
+
//#region src/components/subtitle-player/CurrentMode.tsx
|
|
6
|
+
var i = ({ currentEntries: i, wordHoverFactory: a, enableWordHover: o, overlayNode: s, onSubtitleClick: c, textAlign: l = "left" }) => i.some(({ entry: e }) => e !== null) ? /* @__PURE__ */ r(t, { children: [i.map(({ entry: t, label: i }) => {
|
|
7
|
+
if (!t) return null;
|
|
8
|
+
let s = t.text.split("\n"), u = o ? a(t, i) : void 0, d = s.reduce((r, i, a) => {
|
|
9
|
+
if (!t.words || t.words.length === 0) return r.content.push(/* @__PURE__ */ n("div", {
|
|
10
|
+
className: "xiping-subtitle-player__current-line",
|
|
11
|
+
children: i
|
|
12
|
+
}, a)), r;
|
|
13
|
+
let o = e(i, t.words, r.nextWordIndex, a, u);
|
|
14
|
+
return r.content.push(/* @__PURE__ */ n("div", {
|
|
15
|
+
className: "xiping-subtitle-player__current-line",
|
|
16
|
+
children: o.nodes
|
|
17
|
+
}, a)), {
|
|
18
|
+
content: r.content,
|
|
19
|
+
nextWordIndex: o.nextWordIndex
|
|
20
|
+
};
|
|
21
|
+
}, {
|
|
22
|
+
content: [],
|
|
23
|
+
nextWordIndex: 0
|
|
24
|
+
}).content, f = c ? (e) => c(e, t, i) : void 0;
|
|
25
|
+
return /* @__PURE__ */ r("div", {
|
|
26
|
+
className: "xiping-subtitle-player__current-item",
|
|
27
|
+
"data-label": i || void 0,
|
|
28
|
+
onClick: f,
|
|
29
|
+
style: c ? { cursor: "pointer" } : void 0,
|
|
30
|
+
children: [i && /* @__PURE__ */ n("span", {
|
|
31
|
+
className: "xiping-subtitle-player__current-label",
|
|
32
|
+
children: i
|
|
33
|
+
}), /* @__PURE__ */ n("div", {
|
|
34
|
+
className: "xiping-subtitle-player__current-text",
|
|
35
|
+
style: { textAlign: l },
|
|
36
|
+
children: d
|
|
37
|
+
})]
|
|
38
|
+
}, `${t.index}-${i || ""}`);
|
|
39
|
+
}), o && /* @__PURE__ */ n("div", {
|
|
40
|
+
className: "xiping-subtitle-player__current-hover-layer",
|
|
41
|
+
children: s
|
|
42
|
+
})] }) : null;
|
|
43
|
+
//#endregion
|
|
44
|
+
export { i as CurrentMode };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.xiping-subtitle-player__lyrics-time{
|
|
1
|
+
.xiping-subtitle-player__lyrics-time{color:#ffffff80;-webkit-user-select:none;user-select:none;margin-bottom:.25rem;font-family:Monaco,Menlo,Ubuntu Mono,monospace;font-size:.7rem;font-weight:500}.xiping-subtitle-player__lyrics-item{flex-direction:column;gap:.25rem;transition:all .2s;display:flex}.xiping-subtitle-player__lyrics-item--active{color:#fbbf24;font-weight:600;transition:all .3s;position:relative}.xiping-subtitle-player__lyrics-item--active:before{content:"";background:#fbbf24;border-radius:2px;width:4px;height:92%;position:absolute;top:50%;left:-1rem;transform:translateY(-50%)}.xiping-subtitle-player__lyrics-item--past{opacity:.5;color:#fff9}.xiping-subtitle-player__lyrics-label{color:#ffffffb3;text-transform:uppercase;letter-spacing:.05em;margin-bottom:.25rem;font-size:.75rem;font-weight:600}.xiping-subtitle-player__lyrics-text{text-shadow:0 2px 4px #00000080;font-size:1rem;font-weight:500}.xiping-subtitle-player__lyrics-line{margin:.25rem 0}.xiping-subtitle-player__lyrics-line:first-child{margin-top:0}.xiping-subtitle-player__lyrics-line:last-child{margin-bottom:0}.xiping-subtitle-player__lyrics-hover-layer{pointer-events:none;position:absolute;inset:0}.xiping-subtitle-player--lyrics{scroll-behavior:smooth;gap:.5rem;max-height:600px;overflow-y:auto}.xiping-subtitle-player--lyrics::-webkit-scrollbar{width:8px}.xiping-subtitle-player--lyrics::-webkit-scrollbar-track{background:#ffffff1a;border-radius:4px}.xiping-subtitle-player--lyrics::-webkit-scrollbar-thumb{background:#ffffff4d;border-radius:4px}.xiping-subtitle-player--lyrics::-webkit-scrollbar-thumb:hover{background:#ffffff80}.xiping-subtitle-player__group{border-radius:.5rem;flex-direction:column;gap:.5rem;width:100%;margin:-.5rem;padding:.5rem;transition:all .2s;display:flex}.xiping-subtitle-player__group:hover{background-color:#ffffff1a}.xiping-subtitle-player__group:hover .xiping-subtitle-player__lyrics-item{transform:translate(4px)}.xiping-subtitle-player__group:hover .xiping-subtitle-player__lyrics-item--active{background-color:#fbbf2426}.xiping-subtitle-player__lyrics-item--active .xiping-subtitle-word{color:#fbbf24;font-weight:600}@media (width<=768px){.xiping-subtitle-player__lyrics-text{font-size:.9rem}}
|