@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,18 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as P, jsx as R } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import { useAnimation as z, motion as A } from "motion/react";
|
|
4
|
+
import { useRef as b, useState as I, useEffect as x } from "react";
|
|
5
|
+
import j from "clsx";
|
|
6
|
+
import './ScratchToReveal.css';/* empty css */
|
|
7
|
+
const T = ({
|
|
8
|
+
width: m,
|
|
9
|
+
height: l,
|
|
9
10
|
minScratchPercentage: E = 50,
|
|
10
11
|
onComplete: h,
|
|
11
12
|
children: L,
|
|
12
13
|
className: M,
|
|
13
14
|
gradientColors: a = ["#A97CF8", "#F38CB8", "#FDCC92"]
|
|
14
15
|
}) => {
|
|
15
|
-
const i =
|
|
16
|
+
const i = b(null), [d, r] = I(!1), [S, C] = I(!1), v = z();
|
|
16
17
|
x(() => {
|
|
17
18
|
const t = i.current, e = t?.getContext("2d");
|
|
18
19
|
if (t && e) {
|
|
@@ -44,8 +45,8 @@ const B = ({
|
|
|
44
45
|
const D = () => r(!0), w = () => r(!0), f = (t, e) => {
|
|
45
46
|
const o = i.current, n = o?.getContext("2d");
|
|
46
47
|
if (o && n) {
|
|
47
|
-
const c = o.getBoundingClientRect(), s = t - c.left + 16,
|
|
48
|
-
n.globalCompositeOperation = "destination-out", n.beginPath(), n.arc(s,
|
|
48
|
+
const c = o.getBoundingClientRect(), s = t - c.left + 16, p = e - c.top + 16;
|
|
49
|
+
n.globalCompositeOperation = "destination-out", n.beginPath(), n.arc(s, p, 30, 0, Math.PI * 2), n.fill();
|
|
49
50
|
}
|
|
50
51
|
}, y = async () => {
|
|
51
52
|
await v.start({
|
|
@@ -67,10 +68,10 @@ const B = ({
|
|
|
67
68
|
return /* @__PURE__ */ P(
|
|
68
69
|
A.div,
|
|
69
70
|
{
|
|
70
|
-
className:
|
|
71
|
+
className: j("xiping-scratch-to-reveal", M),
|
|
71
72
|
style: {
|
|
72
|
-
width:
|
|
73
|
-
height:
|
|
73
|
+
width: m,
|
|
74
|
+
height: l,
|
|
74
75
|
cursor: "url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgdmlld0JveD0iMCAwIDMyIDMyIj4KICA8Y2lyY2xlIGN4PSIxNiIgY3k9IjE2IiByPSIxNSIgc3R5bGU9ImZpbGw6I2ZmZjtzdHJva2U6IzAwMDtzdHJva2Utd2lkdGg6MXB4OyIgLz4KPC9zdmc+'), auto"
|
|
75
76
|
},
|
|
76
77
|
animate: v,
|
|
@@ -79,9 +80,9 @@ const B = ({
|
|
|
79
80
|
"canvas",
|
|
80
81
|
{
|
|
81
82
|
ref: i,
|
|
82
|
-
width:
|
|
83
|
-
height:
|
|
84
|
-
className: "
|
|
83
|
+
width: m,
|
|
84
|
+
height: l,
|
|
85
|
+
className: "xiping-scratch-canvas",
|
|
85
86
|
onMouseDown: D,
|
|
86
87
|
onTouchStart: w
|
|
87
88
|
}
|
|
@@ -92,5 +93,5 @@ const B = ({
|
|
|
92
93
|
);
|
|
93
94
|
};
|
|
94
95
|
export {
|
|
95
|
-
|
|
96
|
+
T as ScratchToReveal
|
|
96
97
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.xiping-shimmer-button{position:relative;z-index:0;display:flex;cursor:pointer;align-items:center;justify-content:center;overflow:hidden;white-space:nowrap;border:1px solid rgba(255,255,255,.1);padding:.75rem 1.5rem;color:#fff;background:var(--bg);border-radius:var(--radius);transform:translateZ(0);transition:transform .3s ease-in-out}.xiping-shimmer-button:active{transform:translateY(1px) translateZ(0)}@media(prefers-color-scheme:dark){.xiping-shimmer-button{color:#000}}.xiping-shimmer-button-spark-container{position:absolute;z-index:-30;inset:0;overflow:visible;filter:blur(2px);container-type:size}.xiping-shimmer-button-spark{position:absolute;inset:0;height:100cqh;aspect-ratio:1;border-radius:0;-webkit-mask:none;mask:none;animation:xiping-shimmer-slide var(--speed) ease-in-out infinite alternate}.xiping-shimmer-button-spark-before{position:absolute;inset:-100%;width:auto;transform:rotate(0);background:conic-gradient(from calc(270deg - (var(--spread) * .5)),transparent 0,var(--shimmer-color) var(--spread),transparent var(--spread));animation:xiping-spin-around calc(var(--speed) * 2) infinite linear}.xiping-shimmer-button-highlight{position:absolute;inset:0;width:100%;height:100%;border-radius:1rem;box-shadow:inset 0 -8px 10px #ffffff1f;transform:translateZ(0);transition:all .3s ease-in-out}.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{position:absolute;z-index:-20;background:var(--bg);border-radius:var(--radius);inset:var(--cut)}@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)}}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsxs as c, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import d from "react";
|
|
3
|
-
import
|
|
4
|
-
|
|
3
|
+
import h from "clsx";
|
|
4
|
+
import './ShimmerButton.css';/* empty css */
|
|
5
5
|
const l = d.forwardRef(
|
|
6
6
|
({
|
|
7
7
|
shimmerColor: r = "#ffffff",
|
|
8
|
-
shimmerSize:
|
|
9
|
-
shimmerDuration:
|
|
10
|
-
borderRadius:
|
|
8
|
+
shimmerSize: s = "0.05em",
|
|
9
|
+
shimmerDuration: e = "3s",
|
|
10
|
+
borderRadius: m = "100px",
|
|
11
11
|
background: t = "rgba(0, 0, 0, 1)",
|
|
12
12
|
className: a,
|
|
13
13
|
children: o,
|
|
@@ -18,9 +18,9 @@ const l = d.forwardRef(
|
|
|
18
18
|
style: {
|
|
19
19
|
"--spread": "90deg",
|
|
20
20
|
"--shimmer-color": r,
|
|
21
|
-
"--radius":
|
|
22
|
-
"--speed":
|
|
23
|
-
"--cut":
|
|
21
|
+
"--radius": m,
|
|
22
|
+
"--speed": e,
|
|
23
|
+
"--cut": s,
|
|
24
24
|
"--bg": t
|
|
25
25
|
},
|
|
26
26
|
className: h("xiping-shimmer-button", a),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.xiping-shiny-button{position:relative;cursor:pointer;border-radius:.5rem;padding:.5rem 1.5rem;font-weight:500;-webkit-backdrop-filter:blur(24px);backdrop-filter:blur(24px);border:1px solid;transition:box-shadow .3s ease-in-out}.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{position:relative;display:block;width:100%;height:100%;font-size:.875rem;text-transform:uppercase;letter-spacing:.05em;color:#000000a6}@media(prefers-color-scheme:dark){.xiping-shiny-button-text{font-weight:300;color:#ffffffe5}}.xiping-shiny-button-border{position:absolute;inset:0;z-index:10;display:block;border-radius:inherit;padding:1px}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as t, jsx as a } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
const
|
|
3
|
+
import { motion as s } from "motion/react";
|
|
4
|
+
import o from "react";
|
|
5
|
+
import l from "clsx";
|
|
6
|
+
import './ShinyButton.css';/* empty css */
|
|
7
|
+
const p = {
|
|
8
8
|
initial: { "--x": "100%", scale: 0.8 },
|
|
9
9
|
animate: { "--x": "-100%", scale: 1 },
|
|
10
10
|
whileTap: { scale: 0.95 },
|
|
@@ -23,13 +23,13 @@ const c = {
|
|
|
23
23
|
mass: 0.5
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
},
|
|
27
|
-
|
|
26
|
+
}, c = o.forwardRef(({ children: r, className: e, ...i }, n) => /* @__PURE__ */ t(
|
|
27
|
+
s.button,
|
|
28
28
|
{
|
|
29
|
-
ref:
|
|
30
|
-
className:
|
|
31
|
-
...
|
|
32
|
-
...
|
|
29
|
+
ref: n,
|
|
30
|
+
className: l("xiping-shiny-button", e),
|
|
31
|
+
...p,
|
|
32
|
+
...i,
|
|
33
33
|
children: [
|
|
34
34
|
/* @__PURE__ */ a(
|
|
35
35
|
"span",
|
|
@@ -55,7 +55,7 @@ const c = {
|
|
|
55
55
|
]
|
|
56
56
|
}
|
|
57
57
|
));
|
|
58
|
-
|
|
58
|
+
c.displayName = "ShinyButton";
|
|
59
59
|
export {
|
|
60
|
-
|
|
60
|
+
c as ShinyButton
|
|
61
61
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.shiny-text{display:inline-block}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface ShinyTextProps {
|
|
3
|
+
text: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
speed?: number;
|
|
6
|
+
className?: string;
|
|
7
|
+
color?: string;
|
|
8
|
+
shineColor?: string;
|
|
9
|
+
spread?: number;
|
|
10
|
+
yoyo?: boolean;
|
|
11
|
+
pauseOnHover?: boolean;
|
|
12
|
+
direction?: 'left' | 'right';
|
|
13
|
+
delay?: number;
|
|
14
|
+
}
|
|
15
|
+
declare const ShinyText: React.FC<ShinyTextProps>;
|
|
16
|
+
export default ShinyText;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { jsx as L } from "react/jsx-runtime";
|
|
2
|
+
import { useState as W, useRef as d, useEffect as j, useCallback as y } from "react";
|
|
3
|
+
import { useMotionValue as v, useAnimationFrame as z, useTransform as A, motion as B } from "motion/react";
|
|
4
|
+
import './ShinyText.css';/* empty css */
|
|
5
|
+
const G = ({
|
|
6
|
+
text: T,
|
|
7
|
+
disabled: k = !1,
|
|
8
|
+
speed: $ = 2,
|
|
9
|
+
className: x = "",
|
|
10
|
+
color: u = "#b5b5b5",
|
|
11
|
+
shineColor: h = "#ffffff",
|
|
12
|
+
spread: C = 120,
|
|
13
|
+
yoyo: M = !1,
|
|
14
|
+
pauseOnHover: l = !1,
|
|
15
|
+
direction: f = "left",
|
|
16
|
+
delay: D = 0
|
|
17
|
+
}) => {
|
|
18
|
+
const [R, p] = W(!1), e = v(0), a = d(0), c = d(null), r = d(f === "left" ? 1 : -1), t = $ * 1e3, b = D * 1e3;
|
|
19
|
+
z((o) => {
|
|
20
|
+
if (k || R) {
|
|
21
|
+
c.current = null;
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
if (c.current === null) {
|
|
25
|
+
c.current = o;
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const I = o - c.current;
|
|
29
|
+
if (c.current = o, a.current += I, M) {
|
|
30
|
+
const s = t + b, i = s * 2, n = a.current % i;
|
|
31
|
+
if (n < t) {
|
|
32
|
+
const m = n / t * 100;
|
|
33
|
+
e.set(r.current === 1 ? m : 100 - m);
|
|
34
|
+
} else if (n < s)
|
|
35
|
+
e.set(r.current === 1 ? 100 : 0);
|
|
36
|
+
else if (n < s + t) {
|
|
37
|
+
const g = 100 - (n - s) / t * 100;
|
|
38
|
+
e.set(r.current === 1 ? g : 100 - g);
|
|
39
|
+
} else
|
|
40
|
+
e.set(r.current === 1 ? 0 : 100);
|
|
41
|
+
} else {
|
|
42
|
+
const s = t + b, i = a.current % s;
|
|
43
|
+
if (i < t) {
|
|
44
|
+
const n = i / t * 100;
|
|
45
|
+
e.set(r.current === 1 ? n : 100 - n);
|
|
46
|
+
} else
|
|
47
|
+
e.set(r.current === 1 ? 100 : 0);
|
|
48
|
+
}
|
|
49
|
+
}), j(() => {
|
|
50
|
+
r.current = f === "left" ? 1 : -1, a.current = 0, e.set(0);
|
|
51
|
+
}, [f]);
|
|
52
|
+
const S = A(e, (o) => `${150 - o * 2}% center`), E = y(() => {
|
|
53
|
+
l && p(!0);
|
|
54
|
+
}, [l]), P = y(() => {
|
|
55
|
+
l && p(!1);
|
|
56
|
+
}, [l]), F = {
|
|
57
|
+
backgroundImage: `linear-gradient(${C}deg, ${u} 0%, ${u} 35%, ${h} 50%, ${u} 65%, ${u} 100%)`,
|
|
58
|
+
backgroundSize: "200% auto",
|
|
59
|
+
WebkitBackgroundClip: "text",
|
|
60
|
+
backgroundClip: "text",
|
|
61
|
+
WebkitTextFillColor: "transparent"
|
|
62
|
+
};
|
|
63
|
+
return /* @__PURE__ */ L(
|
|
64
|
+
B.span,
|
|
65
|
+
{
|
|
66
|
+
className: `shiny-text ${x}`,
|
|
67
|
+
style: { ...F, backgroundPosition: S },
|
|
68
|
+
onMouseEnter: E,
|
|
69
|
+
onMouseLeave: P,
|
|
70
|
+
children: T
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
};
|
|
74
|
+
export {
|
|
75
|
+
G as default
|
|
76
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.xiping-sparkle{pointer-events:none;position:absolute;z-index:20}.xiping-sparkles-text{font-size:3.75rem;font-weight:700}.xiping-sparkles-text-wrapper{position:relative;display:inline-block}
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
import { jsx as r, jsxs as g } from "react/jsx-runtime";
|
|
3
3
|
import { motion as k } from "motion/react";
|
|
4
4
|
import { useState as L, useEffect as S } from "react";
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
const M = ({ id: i, x: t, y: o, color: s, delay:
|
|
5
|
+
import y from "clsx";
|
|
6
|
+
import './SparklesText.css';/* empty css */
|
|
7
|
+
const M = ({ id: i, x: t, y: o, color: s, delay: l, scale: c }) => /* @__PURE__ */ r(
|
|
8
8
|
k.svg,
|
|
9
9
|
{
|
|
10
10
|
className: "xiping-sparkle",
|
|
11
11
|
initial: { opacity: 0, left: t, top: o },
|
|
12
12
|
animate: {
|
|
13
13
|
opacity: [0, 1, 0],
|
|
14
|
-
scale: [0,
|
|
14
|
+
scale: [0, c, 0],
|
|
15
15
|
rotate: [75, 120, 150]
|
|
16
16
|
},
|
|
17
|
-
transition: { duration: 0.8, repeat: 1 / 0, delay:
|
|
17
|
+
transition: { duration: 0.8, repeat: 1 / 0, delay: l },
|
|
18
18
|
width: "21",
|
|
19
19
|
height: "21",
|
|
20
20
|
viewBox: "0 0 21 21",
|
|
@@ -32,19 +32,19 @@ const M = ({ id: i, x: t, y: o, color: s, delay: c, scale: l }) => /* @__PURE__
|
|
|
32
32
|
colors: t = { first: "#9E7AFF", second: "#FE8BBB" },
|
|
33
33
|
className: o,
|
|
34
34
|
sparklesCount: s = 10,
|
|
35
|
-
...
|
|
35
|
+
...l
|
|
36
36
|
}) => {
|
|
37
|
-
const [
|
|
37
|
+
const [c, p] = L([]);
|
|
38
38
|
return S(() => {
|
|
39
|
-
const
|
|
40
|
-
const e = `${Math.random() * 100}%`,
|
|
41
|
-
return { id: `${e}-${
|
|
39
|
+
const n = () => {
|
|
40
|
+
const e = `${Math.random() * 100}%`, a = `${Math.random() * 100}%`, h = Math.random() > 0.5 ? t.first : t.second, x = Math.random() * 2, C = Math.random() * 1 + 0.3, u = Math.random() * 10 + 5;
|
|
41
|
+
return { id: `${e}-${a}-${Date.now()}`, x: e, y: a, color: h, delay: x, scale: C, lifespan: u };
|
|
42
42
|
}, d = () => {
|
|
43
|
-
const e = Array.from({ length: s },
|
|
43
|
+
const e = Array.from({ length: s }, n);
|
|
44
44
|
p(e);
|
|
45
45
|
}, m = () => {
|
|
46
46
|
p(
|
|
47
|
-
(e) => e.map((
|
|
47
|
+
(e) => e.map((a) => a.lifespan <= 0 ? n() : { ...a, lifespan: a.lifespan - 0.1 })
|
|
48
48
|
);
|
|
49
49
|
};
|
|
50
50
|
d();
|
|
@@ -54,13 +54,13 @@ const M = ({ id: i, x: t, y: o, color: s, delay: c, scale: l }) => /* @__PURE__
|
|
|
54
54
|
"div",
|
|
55
55
|
{
|
|
56
56
|
className: y("xiping-sparkles-text", o),
|
|
57
|
-
...
|
|
57
|
+
...l,
|
|
58
58
|
style: {
|
|
59
59
|
"--sparkles-first-color": `${t.first}`,
|
|
60
60
|
"--sparkles-second-color": `${t.second}`
|
|
61
61
|
},
|
|
62
62
|
children: /* @__PURE__ */ g("span", { className: "xiping-sparkles-text-wrapper", children: [
|
|
63
|
-
|
|
63
|
+
c.map((n) => /* @__PURE__ */ r(M, { ...n }, n.id)),
|
|
64
64
|
/* @__PURE__ */ r("strong", { children: i })
|
|
65
65
|
] })
|
|
66
66
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.xiping-split-parent{overflow:hidden;display:inline-block;white-space:normal}
|
|
@@ -4,7 +4,7 @@ import { gsap as i } from "gsap";
|
|
|
4
4
|
import { ScrollTrigger as N } from "gsap/ScrollTrigger";
|
|
5
5
|
import { SplitText as S } from "gsap/SplitText";
|
|
6
6
|
import j from "clsx";
|
|
7
|
-
|
|
7
|
+
import './SplitText.css';/* empty css */
|
|
8
8
|
i.registerPlugin(N, S);
|
|
9
9
|
const A = ({
|
|
10
10
|
text: l,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.xiping-subtitle-player__current-item{display:flex;flex-direction:column;gap:.25rem;transition:all .2s ease}.xiping-subtitle-player__current-label{font-size:.75rem;font-weight:600;color:#ffffffb3;text-transform:uppercase;letter-spacing:.05em;margin-bottom:.25rem}.xiping-subtitle-player__current-text{font-size:1rem;font-weight:500;text-shadow:0 2px 4px rgba(0,0,0,.5)}.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{position:absolute;inset:0;pointer-events:none}@media(max-width:768px){.xiping-subtitle-player__current-text{font-size:.9rem}}
|
|
@@ -15,6 +15,8 @@ export interface CurrentModeProps {
|
|
|
15
15
|
overlayNode: React.ReactNode;
|
|
16
16
|
/** 整条字幕点击处理器 */
|
|
17
17
|
onSubtitleClick?: (event: React.MouseEvent<HTMLDivElement>, entry: SubtitleEntry, label?: string) => void;
|
|
18
|
+
/** 文本对齐方式 */
|
|
19
|
+
textAlign?: "left" | "center";
|
|
18
20
|
}
|
|
19
21
|
/**
|
|
20
22
|
* 当前模式组件:只显示当前时间对应的字幕
|
|
@@ -1,43 +1,78 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { renderTextWithWords as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
import { jsxs as u, Fragment as v, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { renderTextWithWords as g } from "./utils.js";
|
|
3
|
+
import './CurrentMode.css';/* empty css */
|
|
4
|
+
const C = ({
|
|
5
|
+
currentEntries: l,
|
|
6
|
+
wordHoverFactory: p,
|
|
7
|
+
enableWordHover: o,
|
|
8
|
+
overlayNode: a,
|
|
9
|
+
onSubtitleClick: i,
|
|
10
|
+
textAlign: x = "left"
|
|
11
|
+
}) => l.some(({ entry: e }) => e !== null) ? /* @__PURE__ */ u(v, { children: [
|
|
12
|
+
l.map(({ entry: e, label: n }) => {
|
|
13
|
+
if (!e)
|
|
14
|
+
return null;
|
|
15
|
+
const h = e.text.split(`
|
|
16
|
+
`), m = o ? p(e, n) : void 0, _ = h.reduce(
|
|
17
|
+
(t, d, s) => {
|
|
18
|
+
if (!e.words || e.words.length === 0)
|
|
19
|
+
return t.content.push(
|
|
20
|
+
/* @__PURE__ */ r(
|
|
21
|
+
"div",
|
|
22
|
+
{
|
|
23
|
+
className: "xiping-subtitle-player__current-line",
|
|
24
|
+
children: d
|
|
25
|
+
},
|
|
26
|
+
s
|
|
27
|
+
)
|
|
28
|
+
), t;
|
|
29
|
+
const c = g(
|
|
30
|
+
d,
|
|
31
|
+
e.words,
|
|
32
|
+
t.nextWordIndex,
|
|
33
|
+
s,
|
|
34
|
+
m
|
|
35
|
+
);
|
|
36
|
+
return t.content.push(
|
|
37
|
+
/* @__PURE__ */ r(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
className: "xiping-subtitle-player__current-line",
|
|
41
|
+
children: c.nodes
|
|
42
|
+
},
|
|
43
|
+
s
|
|
44
|
+
)
|
|
45
|
+
), {
|
|
46
|
+
content: t.content,
|
|
47
|
+
nextWordIndex: c.nextWordIndex
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
{ content: [], nextWordIndex: 0 }
|
|
51
|
+
).content;
|
|
52
|
+
return /* @__PURE__ */ u(
|
|
53
|
+
"div",
|
|
54
|
+
{
|
|
55
|
+
className: "xiping-subtitle-player__current-item",
|
|
56
|
+
"data-label": n || void 0,
|
|
57
|
+
onClick: i ? (t) => i(t, e, n) : void 0,
|
|
58
|
+
style: i ? { cursor: "pointer" } : void 0,
|
|
59
|
+
children: [
|
|
60
|
+
n && /* @__PURE__ */ r("span", { className: "xiping-subtitle-player__current-label", children: n }),
|
|
61
|
+
/* @__PURE__ */ r(
|
|
62
|
+
"div",
|
|
63
|
+
{
|
|
64
|
+
className: "xiping-subtitle-player__current-text",
|
|
65
|
+
style: { textAlign: x },
|
|
66
|
+
children: _
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
`${e.index}-${n || ""}`
|
|
72
|
+
);
|
|
73
|
+
}),
|
|
74
|
+
o && /* @__PURE__ */ r("div", { className: "xiping-subtitle-player__current-hover-layer", children: a })
|
|
40
75
|
] }) : null;
|
|
41
76
|
export {
|
|
42
|
-
|
|
77
|
+
C as CurrentMode
|
|
43
78
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.xiping-subtitle-player__lyrics-time{font-size:.7rem;font-weight:500;color:#ffffff80;font-family:Monaco,Menlo,Ubuntu Mono,monospace;margin-bottom:.25rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}.xiping-subtitle-player__lyrics-item{display:flex;flex-direction:column;gap:.25rem;transition:all .2s ease}.xiping-subtitle-player__lyrics-item--active{color:#fbbf24;font-weight:600;transition:all .3s ease;position:relative}.xiping-subtitle-player__lyrics-item--active:before{content:"";position:absolute;left:-1rem;top:50%;transform:translateY(-50%);width:4px;height:92%;background:#fbbf24;border-radius:2px}.xiping-subtitle-player__lyrics-item--past{opacity:.5;color:#fff9}.xiping-subtitle-player__lyrics-label{font-size:.75rem;font-weight:600;color:#ffffffb3;text-transform:uppercase;letter-spacing:.05em;margin-bottom:.25rem}.xiping-subtitle-player__lyrics-text{font-size:1rem;font-weight:500;text-shadow:0 2px 4px rgba(0,0,0,.5)}.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{position:absolute;inset:0;pointer-events:none}.xiping-subtitle-player--lyrics{max-height:600px;overflow-y:auto;gap:.5rem;scroll-behavior:smooth}.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{display:flex;flex-direction:column;gap:.5rem;width:100%;border-radius:.5rem;padding:.5rem;margin:-.5rem;transition:all .2s ease}.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(max-width:768px){.xiping-subtitle-player__lyrics-text{font-size:.9rem}}
|
|
@@ -21,6 +21,8 @@ export interface LyricsModeProps {
|
|
|
21
21
|
containerRef: React.RefObject<HTMLDivElement | null>;
|
|
22
22
|
/** 整条字幕点击处理器 */
|
|
23
23
|
onSubtitleClick?: (event: React.MouseEvent<HTMLDivElement>, entry: SubtitleEntry, label?: string) => void;
|
|
24
|
+
/** 文本对齐方式 */
|
|
25
|
+
textAlign?: "left" | "center";
|
|
24
26
|
}
|
|
25
27
|
/**
|
|
26
28
|
* 歌词模式组件:显示全部字幕并高亮当前字幕
|