sa2kit 1.6.12 → 1.6.13
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/mmd/index.d.mts +50 -1
- package/dist/mmd/index.d.ts +50 -1
- package/dist/mmd/index.js +882 -510
- package/dist/mmd/index.js.map +1 -1
- package/dist/mmd/index.mjs +680 -311
- package/dist/mmd/index.mjs.map +1 -1
- package/package.json +18 -20
package/dist/mmd/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var chunkL5PW2YTI_js = require('../chunk-L5PW2YTI.js');
|
|
4
4
|
require('../chunk-2ODO4HEI.js');
|
|
5
5
|
require('../chunk-DGUM43GV.js');
|
|
6
|
-
var
|
|
6
|
+
var React24 = require('react');
|
|
7
7
|
var THREE3 = require('three');
|
|
8
8
|
var threeStdlib = require('three-stdlib');
|
|
9
9
|
var lucideReact = require('lucide-react');
|
|
@@ -29,7 +29,7 @@ function _interopNamespace(e) {
|
|
|
29
29
|
return Object.freeze(n);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var React24__default = /*#__PURE__*/_interopDefault(React24);
|
|
33
33
|
var THREE3__namespace = /*#__PURE__*/_interopNamespace(THREE3);
|
|
34
34
|
|
|
35
35
|
// src/mmd/utils/ammo-loader.ts
|
|
@@ -1735,7 +1735,7 @@ async function waitForMaterialsReady(object, renderer, scene, camera) {
|
|
|
1735
1735
|
});
|
|
1736
1736
|
}
|
|
1737
1737
|
}
|
|
1738
|
-
var MMDPlayerBase =
|
|
1738
|
+
var MMDPlayerBase = React24.forwardRef((props, ref) => {
|
|
1739
1739
|
const {
|
|
1740
1740
|
resources,
|
|
1741
1741
|
stage = {},
|
|
@@ -1761,43 +1761,43 @@ var MMDPlayerBase = React21.forwardRef((props, ref) => {
|
|
|
1761
1761
|
const fxPath = props.fxPath || stage.fxPath;
|
|
1762
1762
|
const fxTexturePath = props.fxTexturePath || stage.fxTexturePath;
|
|
1763
1763
|
const fxConfigs = props.fxConfigs || stage.fxConfigs;
|
|
1764
|
-
const containerRef =
|
|
1765
|
-
const sceneRef =
|
|
1766
|
-
const cameraRef =
|
|
1767
|
-
const rendererRef =
|
|
1768
|
-
const outlineEffectRef =
|
|
1769
|
-
const controlsRef =
|
|
1770
|
-
const helperRef =
|
|
1771
|
-
const axesHelperRef =
|
|
1772
|
-
const clockRef =
|
|
1773
|
-
const animationIdRef =
|
|
1774
|
-
const resizeObserverRef =
|
|
1775
|
-
const fxEffectRef =
|
|
1776
|
-
const fxAdapterRef =
|
|
1777
|
-
const multiFXAdapterRef =
|
|
1778
|
-
const isReadyRef =
|
|
1779
|
-
const isPlayingRef =
|
|
1780
|
-
const initIdRef =
|
|
1781
|
-
const durationRef =
|
|
1782
|
-
const animationClipRef =
|
|
1783
|
-
const loopRef =
|
|
1784
|
-
const audioRef =
|
|
1785
|
-
const audioListenerRef =
|
|
1786
|
-
const audioLoaderRef =
|
|
1787
|
-
const latestCallbacks =
|
|
1788
|
-
|
|
1764
|
+
const containerRef = React24.useRef(null);
|
|
1765
|
+
const sceneRef = React24.useRef(null);
|
|
1766
|
+
const cameraRef = React24.useRef(null);
|
|
1767
|
+
const rendererRef = React24.useRef(null);
|
|
1768
|
+
const outlineEffectRef = React24.useRef(null);
|
|
1769
|
+
const controlsRef = React24.useRef(null);
|
|
1770
|
+
const helperRef = React24.useRef(null);
|
|
1771
|
+
const axesHelperRef = React24.useRef(null);
|
|
1772
|
+
const clockRef = React24.useRef(new THREE3__namespace.Clock());
|
|
1773
|
+
const animationIdRef = React24.useRef(null);
|
|
1774
|
+
const resizeObserverRef = React24.useRef(null);
|
|
1775
|
+
const fxEffectRef = React24.useRef(null);
|
|
1776
|
+
const fxAdapterRef = React24.useRef(null);
|
|
1777
|
+
const multiFXAdapterRef = React24.useRef(null);
|
|
1778
|
+
const isReadyRef = React24.useRef(false);
|
|
1779
|
+
const isPlayingRef = React24.useRef(false);
|
|
1780
|
+
const initIdRef = React24.useRef(0);
|
|
1781
|
+
const durationRef = React24.useRef(0);
|
|
1782
|
+
const animationClipRef = React24.useRef(null);
|
|
1783
|
+
const loopRef = React24.useRef(loop);
|
|
1784
|
+
const audioRef = React24.useRef(null);
|
|
1785
|
+
const audioListenerRef = React24.useRef(null);
|
|
1786
|
+
const audioLoaderRef = React24.useRef(new THREE3__namespace.AudioLoader());
|
|
1787
|
+
const latestCallbacks = React24.useRef({ onPlay, onPause, onEnded, onTimeUpdate });
|
|
1788
|
+
React24.useEffect(() => {
|
|
1789
1789
|
latestCallbacks.current = { onPlay, onPause, onEnded, onTimeUpdate };
|
|
1790
1790
|
}, [onPlay, onPause, onEnded, onTimeUpdate]);
|
|
1791
|
-
const physicsComponentsRef =
|
|
1791
|
+
const physicsComponentsRef = React24.useRef({
|
|
1792
1792
|
configs: [],
|
|
1793
1793
|
dispatchers: [],
|
|
1794
1794
|
caches: [],
|
|
1795
1795
|
solvers: [],
|
|
1796
1796
|
worlds: []
|
|
1797
1797
|
});
|
|
1798
|
-
const startTimeRef =
|
|
1799
|
-
const modelSwitchCountRef =
|
|
1800
|
-
|
|
1798
|
+
const startTimeRef = React24.useRef(Date.now());
|
|
1799
|
+
const modelSwitchCountRef = React24.useRef(0);
|
|
1800
|
+
React24.useImperativeHandle(ref, () => ({
|
|
1801
1801
|
play: () => {
|
|
1802
1802
|
if (!isReadyRef.current) return;
|
|
1803
1803
|
isPlayingRef.current = true;
|
|
@@ -1854,7 +1854,7 @@ var MMDPlayerBase = React21.forwardRef((props, ref) => {
|
|
|
1854
1854
|
onCameraChange?.(false);
|
|
1855
1855
|
}
|
|
1856
1856
|
}));
|
|
1857
|
-
|
|
1857
|
+
React24.useEffect(() => {
|
|
1858
1858
|
if (!containerRef.current) return;
|
|
1859
1859
|
const init = async () => {
|
|
1860
1860
|
const myId = ++initIdRef.current;
|
|
@@ -2116,7 +2116,7 @@ var MMDPlayerBase = React21.forwardRef((props, ref) => {
|
|
|
2116
2116
|
durationRef.current = animation.duration;
|
|
2117
2117
|
}
|
|
2118
2118
|
mesh.castShadow = true;
|
|
2119
|
-
mesh.receiveShadow =
|
|
2119
|
+
mesh.receiveShadow = false;
|
|
2120
2120
|
const tempScene = new THREE3__namespace.Scene();
|
|
2121
2121
|
tempScene.add(mesh);
|
|
2122
2122
|
await waitForMaterialsReady(mesh, renderer, tempScene, camera);
|
|
@@ -2296,7 +2296,7 @@ var MMDPlayerBase = React21.forwardRef((props, ref) => {
|
|
|
2296
2296
|
let stageMaterialCount = 0;
|
|
2297
2297
|
stageMesh.traverse((child) => {
|
|
2298
2298
|
if (child instanceof THREE3__namespace.Mesh) {
|
|
2299
|
-
child.castShadow =
|
|
2299
|
+
child.castShadow = false;
|
|
2300
2300
|
child.receiveShadow = true;
|
|
2301
2301
|
const mesh2 = child;
|
|
2302
2302
|
const materials = Array.isArray(mesh2.material) ? mesh2.material : [mesh2.material];
|
|
@@ -2758,7 +2758,7 @@ ${errorMessage}
|
|
|
2758
2758
|
}
|
|
2759
2759
|
};
|
|
2760
2760
|
}, [resources.modelPath, resources.motionPath, resources.stageModelPath, stage.enablePhysics, stage.physicsPath]);
|
|
2761
|
-
|
|
2761
|
+
React24.useEffect(() => {
|
|
2762
2762
|
if (!audioListenerRef.current || !helperRef.current || !resources.audioPath) return;
|
|
2763
2763
|
const listener = audioListenerRef.current;
|
|
2764
2764
|
const helper = helperRef.current;
|
|
@@ -2790,7 +2790,7 @@ ${errorMessage}
|
|
|
2790
2790
|
(err) => console.error("[MMDPlayerBase] Failed to load audio track:", err)
|
|
2791
2791
|
);
|
|
2792
2792
|
}, [resources.audioPath, volume]);
|
|
2793
|
-
|
|
2793
|
+
React24.useEffect(() => {
|
|
2794
2794
|
if (!sceneRef.current) return;
|
|
2795
2795
|
if (showAxes && !axesHelperRef.current) {
|
|
2796
2796
|
const axesHelper = new THREE3__namespace.AxesHelper(20);
|
|
@@ -2802,13 +2802,13 @@ ${errorMessage}
|
|
|
2802
2802
|
axesHelperRef.current = null;
|
|
2803
2803
|
}
|
|
2804
2804
|
}, [showAxes]);
|
|
2805
|
-
|
|
2805
|
+
React24.useEffect(() => {
|
|
2806
2806
|
loopRef.current = loop;
|
|
2807
2807
|
if (audioRef.current && audioRef.current.buffer) {
|
|
2808
2808
|
audioRef.current.setLoop(loop);
|
|
2809
2809
|
}
|
|
2810
2810
|
}, [loop]);
|
|
2811
|
-
|
|
2811
|
+
React24.useEffect(() => {
|
|
2812
2812
|
if (outlineEffectRef.current) {
|
|
2813
2813
|
outlineEffectRef.current.defaultThickness = outlineOptions.thickness ?? 3e-3;
|
|
2814
2814
|
outlineEffectRef.current.defaultColor = new THREE3__namespace.Color(outlineOptions.color ?? "#000000").toArray();
|
|
@@ -2831,7 +2831,7 @@ ${errorMessage}
|
|
|
2831
2831
|
}
|
|
2832
2832
|
}
|
|
2833
2833
|
}, [outlineOptions.thickness, outlineOptions.color]);
|
|
2834
|
-
|
|
2834
|
+
React24.useEffect(() => {
|
|
2835
2835
|
if (!isReadyRef.current) return;
|
|
2836
2836
|
if (sceneRef.current) {
|
|
2837
2837
|
if (stage.backgroundColor) {
|
|
@@ -2890,7 +2890,7 @@ ${errorMessage}
|
|
|
2890
2890
|
}
|
|
2891
2891
|
}
|
|
2892
2892
|
};
|
|
2893
|
-
return /* @__PURE__ */
|
|
2893
|
+
return /* @__PURE__ */ React24__default.default.createElement(
|
|
2894
2894
|
"div",
|
|
2895
2895
|
{
|
|
2896
2896
|
ref: containerRef,
|
|
@@ -2929,78 +2929,78 @@ var ControlPanel = ({
|
|
|
2929
2929
|
onNext,
|
|
2930
2930
|
onResetCamera
|
|
2931
2931
|
}) => {
|
|
2932
|
-
return /* @__PURE__ */
|
|
2932
|
+
return /* @__PURE__ */ React24__default.default.createElement("div", { className: "absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 to-transparent p-4 transition-opacity duration-300 hover:opacity-100" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex items-center justify-between text-white" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex items-center gap-2" }, showPrevNext && onPrevious && /* @__PURE__ */ React24__default.default.createElement(
|
|
2933
2933
|
"button",
|
|
2934
2934
|
{
|
|
2935
2935
|
onClick: onPrevious,
|
|
2936
2936
|
className: "rounded-full p-2 hover:bg-white/20 transition-colors",
|
|
2937
2937
|
title: "\u4E0A\u4E00\u4E2A"
|
|
2938
2938
|
},
|
|
2939
|
-
/* @__PURE__ */
|
|
2940
|
-
), /* @__PURE__ */
|
|
2939
|
+
/* @__PURE__ */ React24__default.default.createElement(lucideReact.SkipBack, { size: 20 })
|
|
2940
|
+
), /* @__PURE__ */ React24__default.default.createElement(
|
|
2941
2941
|
"button",
|
|
2942
2942
|
{
|
|
2943
2943
|
onClick: onPlayPause,
|
|
2944
2944
|
className: "rounded-full p-2 hover:bg-white/20 transition-colors",
|
|
2945
2945
|
title: isPlaying ? "\u6682\u505C" : "\u64AD\u653E"
|
|
2946
2946
|
},
|
|
2947
|
-
isPlaying ? /* @__PURE__ */
|
|
2948
|
-
), showPrevNext && onNext && /* @__PURE__ */
|
|
2947
|
+
isPlaying ? /* @__PURE__ */ React24__default.default.createElement(lucideReact.Pause, { size: 24 }) : /* @__PURE__ */ React24__default.default.createElement(lucideReact.Play, { size: 24 })
|
|
2948
|
+
), showPrevNext && onNext && /* @__PURE__ */ React24__default.default.createElement(
|
|
2949
2949
|
"button",
|
|
2950
2950
|
{
|
|
2951
2951
|
onClick: onNext,
|
|
2952
2952
|
className: "rounded-full p-2 hover:bg-white/20 transition-colors",
|
|
2953
2953
|
title: "\u4E0B\u4E00\u4E2A"
|
|
2954
2954
|
},
|
|
2955
|
-
/* @__PURE__ */
|
|
2956
|
-
)), /* @__PURE__ */
|
|
2955
|
+
/* @__PURE__ */ React24__default.default.createElement(lucideReact.SkipForward, { size: 20 })
|
|
2956
|
+
)), /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex items-center gap-4" }, (title || subtitle) && /* @__PURE__ */ React24__default.default.createElement("div", { className: "hidden text-sm font-medium opacity-80 md:block" }, title, subtitle && /* @__PURE__ */ React24__default.default.createElement("span", { className: "ml-2 text-xs opacity-60" }, subtitle)), onToggleListLoop && /* @__PURE__ */ React24__default.default.createElement(
|
|
2957
2957
|
"button",
|
|
2958
2958
|
{
|
|
2959
2959
|
onClick: onToggleListLoop,
|
|
2960
2960
|
className: `rounded-full p-2 transition-colors ${isListLooping ? "bg-green-500/30 hover:bg-green-500/50" : "hover:bg-white/20"}`,
|
|
2961
2961
|
title: isListLooping ? "\u5217\u8868\u5FAA\u73AF\uFF1A\u5F00\u542F" : "\u5217\u8868\u5FAA\u73AF\uFF1A\u5173\u95ED"
|
|
2962
2962
|
},
|
|
2963
|
-
/* @__PURE__ */
|
|
2964
|
-
), /* @__PURE__ */
|
|
2963
|
+
/* @__PURE__ */ React24__default.default.createElement(lucideReact.Repeat, { size: 20 })
|
|
2964
|
+
), /* @__PURE__ */ React24__default.default.createElement(
|
|
2965
2965
|
"button",
|
|
2966
2966
|
{
|
|
2967
2967
|
onClick: onToggleLoop,
|
|
2968
2968
|
className: `rounded-full p-2 transition-colors ${isLooping ? "bg-blue-500/30 hover:bg-blue-500/50" : "hover:bg-white/20"}`,
|
|
2969
2969
|
title: isLooping ? "\u5355\u66F2\u5FAA\u73AF\uFF1A\u5F00\u542F" : "\u5355\u66F2\u5FAA\u73AF\uFF1A\u5173\u95ED"
|
|
2970
2970
|
},
|
|
2971
|
-
/* @__PURE__ */
|
|
2972
|
-
), isCameraManual && onResetCamera && /* @__PURE__ */
|
|
2971
|
+
/* @__PURE__ */ React24__default.default.createElement(lucideReact.Repeat1, { size: 20 })
|
|
2972
|
+
), isCameraManual && onResetCamera && /* @__PURE__ */ React24__default.default.createElement(
|
|
2973
2973
|
"button",
|
|
2974
2974
|
{
|
|
2975
2975
|
onClick: onResetCamera,
|
|
2976
2976
|
className: "rounded-full p-2 bg-blue-500/30 text-blue-400 hover:bg-blue-500/50 hover:text-blue-300 transition-all animate-in zoom-in duration-300",
|
|
2977
2977
|
title: "\u6062\u590D\u521D\u59CB\u89C6\u89D2"
|
|
2978
2978
|
},
|
|
2979
|
-
/* @__PURE__ */
|
|
2980
|
-
), onToggleAxes && /* @__PURE__ */
|
|
2979
|
+
/* @__PURE__ */ React24__default.default.createElement(lucideReact.Camera, { size: 20 })
|
|
2980
|
+
), onToggleAxes && /* @__PURE__ */ React24__default.default.createElement(
|
|
2981
2981
|
"button",
|
|
2982
2982
|
{
|
|
2983
2983
|
onClick: onToggleAxes,
|
|
2984
2984
|
className: `rounded-full p-2 transition-colors ${showAxes ? "bg-blue-500/30 hover:bg-blue-500/50" : "hover:bg-white/20"}`,
|
|
2985
2985
|
title: "\u663E\u793A/\u9690\u85CF\u5750\u6807\u8F74"
|
|
2986
2986
|
},
|
|
2987
|
-
/* @__PURE__ */
|
|
2988
|
-
), showSettings && /* @__PURE__ */
|
|
2987
|
+
/* @__PURE__ */ React24__default.default.createElement(lucideReact.Grid3x3, { size: 20 })
|
|
2988
|
+
), showSettings && /* @__PURE__ */ React24__default.default.createElement(
|
|
2989
2989
|
"button",
|
|
2990
2990
|
{
|
|
2991
2991
|
onClick: onOpenSettings,
|
|
2992
2992
|
className: "rounded-full p-2 hover:bg-white/20 transition-colors",
|
|
2993
2993
|
title: "\u8D44\u6E90\u8BBE\u7F6E"
|
|
2994
2994
|
},
|
|
2995
|
-
/* @__PURE__ */
|
|
2996
|
-
), /* @__PURE__ */
|
|
2995
|
+
/* @__PURE__ */ React24__default.default.createElement(lucideReact.Settings, { size: 20 })
|
|
2996
|
+
), /* @__PURE__ */ React24__default.default.createElement(
|
|
2997
2997
|
"button",
|
|
2998
2998
|
{
|
|
2999
2999
|
onClick: onToggleFullscreen,
|
|
3000
3000
|
className: "rounded-full p-2 hover:bg-white/20 transition-colors",
|
|
3001
3001
|
title: isFullscreen ? "\u9000\u51FA\u5168\u5C4F" : "\u5168\u5C4F"
|
|
3002
3002
|
},
|
|
3003
|
-
isFullscreen ? /* @__PURE__ */
|
|
3003
|
+
isFullscreen ? /* @__PURE__ */ React24__default.default.createElement(lucideReact.Minimize, { size: 20 }) : /* @__PURE__ */ React24__default.default.createElement(lucideReact.Maximize, { size: 20 })
|
|
3004
3004
|
))));
|
|
3005
3005
|
};
|
|
3006
3006
|
var SettingsPanel = ({
|
|
@@ -3015,44 +3015,44 @@ var SettingsPanel = ({
|
|
|
3015
3015
|
}) => {
|
|
3016
3016
|
const renderListMode = () => {
|
|
3017
3017
|
if (!items) return null;
|
|
3018
|
-
return /* @__PURE__ */
|
|
3018
|
+
return /* @__PURE__ */ React24__default.default.createElement("div", { className: "grid grid-cols-1 gap-2 p-4 sm:grid-cols-2" }, items.map((item) => /* @__PURE__ */ React24__default.default.createElement(
|
|
3019
3019
|
"button",
|
|
3020
3020
|
{
|
|
3021
3021
|
key: item.id,
|
|
3022
3022
|
onClick: () => onSelectId?.(item.id),
|
|
3023
3023
|
className: `group flex items-center gap-3 rounded-lg p-3 transition-all ${currentId === item.id ? "bg-blue-500/20 ring-1 ring-blue-500" : "bg-white/5 hover:bg-white/10"}`
|
|
3024
3024
|
},
|
|
3025
|
-
/* @__PURE__ */
|
|
3026
|
-
/* @__PURE__ */
|
|
3027
|
-
currentId === item.id && /* @__PURE__ */
|
|
3025
|
+
/* @__PURE__ */ React24__default.default.createElement("div", { className: "flex h-12 w-12 flex-shrink-0 items-center justify-center rounded bg-black/20 overflow-hidden" }, item.thumbnail ? /* @__PURE__ */ React24__default.default.createElement("img", { src: item.thumbnail, alt: item.name, className: "h-full w-full object-cover" }) : /* @__PURE__ */ React24__default.default.createElement(lucideReact.Video, { size: 20, className: "opacity-50" })),
|
|
3026
|
+
/* @__PURE__ */ React24__default.default.createElement("div", { className: "flex-1 text-left" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: `font-medium ${currentId === item.id ? "text-blue-400" : "text-white"}` }, item.name), item.description && /* @__PURE__ */ React24__default.default.createElement("div", { className: "text-xs text-white/50 truncate" }, item.description)),
|
|
3027
|
+
currentId === item.id && /* @__PURE__ */ React24__default.default.createElement(lucideReact.Check, { size: 16, className: "text-blue-400" })
|
|
3028
3028
|
)));
|
|
3029
3029
|
};
|
|
3030
3030
|
const renderOptionGroup = (title, icon, type, list = [], currentVal) => {
|
|
3031
3031
|
if (!list || list.length === 0) return null;
|
|
3032
|
-
return /* @__PURE__ */
|
|
3032
|
+
return /* @__PURE__ */ React24__default.default.createElement("div", { className: "mb-6" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "mb-3 flex items-center gap-2 text-sm font-medium text-white/70" }, icon, /* @__PURE__ */ React24__default.default.createElement("span", null, title)), /* @__PURE__ */ React24__default.default.createElement("div", { className: "grid grid-cols-2 gap-2 sm:grid-cols-3" }, list.map((opt) => /* @__PURE__ */ React24__default.default.createElement(
|
|
3033
3033
|
"button",
|
|
3034
3034
|
{
|
|
3035
3035
|
key: opt.id,
|
|
3036
3036
|
onClick: () => onSelectOption?.(type, opt.id),
|
|
3037
3037
|
className: `relative flex flex-col items-center gap-2 rounded-lg p-2 text-center transition-all ${currentVal === opt.id ? "bg-blue-500/20 ring-1 ring-blue-500" : "bg-white/5 hover:bg-white/10"}`
|
|
3038
3038
|
},
|
|
3039
|
-
opt.thumbnail ? /* @__PURE__ */
|
|
3040
|
-
/* @__PURE__ */
|
|
3041
|
-
currentVal === opt.id && /* @__PURE__ */
|
|
3039
|
+
opt.thumbnail ? /* @__PURE__ */ React24__default.default.createElement("img", { src: opt.thumbnail, alt: opt.name, className: "h-16 w-full rounded object-cover bg-black/20" }) : /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex h-16 w-full items-center justify-center rounded bg-black/20" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "text-xs opacity-30" }, opt.name.slice(0, 2))),
|
|
3040
|
+
/* @__PURE__ */ React24__default.default.createElement("div", { className: `w-full truncate text-xs ${currentVal === opt.id ? "text-blue-400" : "text-white/80"}` }, opt.name),
|
|
3041
|
+
currentVal === opt.id && /* @__PURE__ */ React24__default.default.createElement("div", { className: "absolute top-1 right-1 rounded-full bg-blue-500 p-0.5" }, /* @__PURE__ */ React24__default.default.createElement(lucideReact.Check, { size: 10, className: "text-white" }))
|
|
3042
3042
|
))));
|
|
3043
3043
|
};
|
|
3044
3044
|
const renderOptionsMode = () => {
|
|
3045
3045
|
if (!options) return null;
|
|
3046
|
-
return /* @__PURE__ */
|
|
3046
|
+
return /* @__PURE__ */ React24__default.default.createElement("div", { className: "p-4" }, renderOptionGroup("\u6A21\u578B", /* @__PURE__ */ React24__default.default.createElement(lucideReact.User, { size: 16 }), "models", options.models, currentSelection?.modelId), renderOptionGroup("\u52A8\u4F5C", /* @__PURE__ */ React24__default.default.createElement(lucideReact.Video, { size: 16 }), "motions", options.motions, currentSelection?.motionId), renderOptionGroup("\u955C\u5934", /* @__PURE__ */ React24__default.default.createElement(lucideReact.Image, { size: 16 }), "cameras", options.cameras, currentSelection?.cameraId), renderOptionGroup("\u97F3\u9891", /* @__PURE__ */ React24__default.default.createElement(lucideReact.Music, { size: 16 }), "audios", options.audios, currentSelection?.audioId), renderOptionGroup("\u821E\u53F0", /* @__PURE__ */ React24__default.default.createElement(lucideReact.Image, { size: 16 }), "stages", options.stages, currentSelection?.stageId));
|
|
3047
3047
|
};
|
|
3048
|
-
return /* @__PURE__ */
|
|
3048
|
+
return /* @__PURE__ */ React24__default.default.createElement("div", { className: "absolute right-0 top-0 h-full w-full max-w-sm transform bg-[#1a1a1e]/95 backdrop-blur-md shadow-2xl transition-transform duration-300 ease-in-out overflow-y-auto z-20 border-l border-white/10" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "sticky top-0 z-10 flex items-center justify-between border-b border-white/10 bg-[#1a1a1e]/95 p-4 backdrop-blur-md" }, /* @__PURE__ */ React24__default.default.createElement("h2", { className: "text-lg font-semibold text-white" }, mode === "list" ? "\u64AD\u653E\u5217\u8868" : "\u81EA\u5B9A\u4E49\u573A\u666F"), /* @__PURE__ */ React24__default.default.createElement(
|
|
3049
3049
|
"button",
|
|
3050
3050
|
{
|
|
3051
3051
|
onClick: onClose,
|
|
3052
3052
|
className: "rounded-full p-2 text-white/50 hover:bg-white/10 hover:text-white"
|
|
3053
3053
|
},
|
|
3054
|
-
/* @__PURE__ */
|
|
3055
|
-
)), /* @__PURE__ */
|
|
3054
|
+
/* @__PURE__ */ React24__default.default.createElement(lucideReact.X, { size: 20 })
|
|
3055
|
+
)), /* @__PURE__ */ React24__default.default.createElement("div", { className: "pb-20" }, mode === "list" ? renderListMode() : renderOptionsMode()));
|
|
3056
3056
|
};
|
|
3057
3057
|
var MMDPlayerEnhancedDebugInfo = ({
|
|
3058
3058
|
isPlaying,
|
|
@@ -3065,8 +3065,8 @@ var MMDPlayerEnhancedDebugInfo = ({
|
|
|
3065
3065
|
mode,
|
|
3066
3066
|
totalResources
|
|
3067
3067
|
}) => {
|
|
3068
|
-
const [memoryInfo, setMemoryInfo] =
|
|
3069
|
-
|
|
3068
|
+
const [memoryInfo, setMemoryInfo] = React24.useState(null);
|
|
3069
|
+
React24.useEffect(() => {
|
|
3070
3070
|
const timer = setInterval(() => {
|
|
3071
3071
|
if (performance.memory) {
|
|
3072
3072
|
const used = (performance.memory.usedJSHeapSize / 1048576).toFixed(1);
|
|
@@ -3077,7 +3077,7 @@ var MMDPlayerEnhancedDebugInfo = ({
|
|
|
3077
3077
|
}, 1e3);
|
|
3078
3078
|
return () => clearInterval(timer);
|
|
3079
3079
|
}, []);
|
|
3080
|
-
return /* @__PURE__ */
|
|
3080
|
+
return /* @__PURE__ */ React24__default.default.createElement("div", { className: "text-white text-xs font-mono" }, /* @__PURE__ */ React24__default.default.createElement("h3", { className: "text-sm font-bold mb-3 pb-2 border-b border-gray-700" }, "\u{1F3AE} MMDPlayerEnhanced Debug"), /* @__PURE__ */ React24__default.default.createElement("div", { className: "mb-4" }, /* @__PURE__ */ React24__default.default.createElement("h4", { className: "text-gray-400 mb-2" }, "\u64AD\u653E\u72B6\u6001"), /* @__PURE__ */ React24__default.default.createElement("div", { className: "space-y-1 pl-2" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-gray-400" }, "\u64AD\u653E\u4E2D:"), /* @__PURE__ */ React24__default.default.createElement(StatusBadge, { active: isPlaying, label: isPlaying ? "Playing" : "Paused" })), /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-gray-400" }, "\u5FAA\u73AF:"), /* @__PURE__ */ React24__default.default.createElement(StatusBadge, { active: isLooping, label: isLooping ? "On" : "Off" })), /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-gray-400" }, "\u52A0\u8F7D\u4E2D:"), /* @__PURE__ */ React24__default.default.createElement(StatusBadge, { active: isLoading, label: isLoading ? "Loading" : "Ready" })))), /* @__PURE__ */ React24__default.default.createElement("div", { className: "mb-4" }, /* @__PURE__ */ React24__default.default.createElement("h4", { className: "text-gray-400 mb-2" }, "\u89C6\u56FE\u72B6\u6001"), /* @__PURE__ */ React24__default.default.createElement("div", { className: "space-y-1 pl-2" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-gray-400" }, "\u5168\u5C4F:"), /* @__PURE__ */ React24__default.default.createElement(StatusBadge, { active: isFullscreen, label: isFullscreen ? "Yes" : "No" })), /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-gray-400" }, "\u5750\u6807\u8F74:"), /* @__PURE__ */ React24__default.default.createElement(StatusBadge, { active: showAxes, label: showAxes ? "Show" : "Hide" })))), /* @__PURE__ */ React24__default.default.createElement("div", { className: "mb-4" }, /* @__PURE__ */ React24__default.default.createElement("h4", { className: "text-gray-400 mb-2" }, "\u8D44\u6E90\u4FE1\u606F"), /* @__PURE__ */ React24__default.default.createElement("div", { className: "space-y-1 pl-2" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-gray-400" }, "\u6A21\u5F0F:"), /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-blue-400 uppercase" }, mode)), mode === "list" && /* @__PURE__ */ React24__default.default.createElement(React24__default.default.Fragment, null, /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-gray-400" }, "\u603B\u6570:"), /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-green-400" }, totalResources)), currentResourceId && /* @__PURE__ */ React24__default.default.createElement("div", { className: "mt-2 p-2 bg-gray-800 rounded" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "text-gray-400 text-[10px]" }, "\u5F53\u524D\u8D44\u6E90"), /* @__PURE__ */ React24__default.default.createElement("div", { className: "text-white truncate" }, currentResourceName || currentResourceId), /* @__PURE__ */ React24__default.default.createElement("div", { className: "text-gray-500 text-[10px] mt-1 truncate" }, "ID: ", currentResourceId))))), memoryInfo && /* @__PURE__ */ React24__default.default.createElement("div", { className: "mb-4" }, /* @__PURE__ */ React24__default.default.createElement("h4", { className: "text-gray-400 mb-2" }, "\u5185\u5B58\u76D1\u63A7 (Chrome only)"), /* @__PURE__ */ React24__default.default.createElement("div", { className: "space-y-2 p-2 bg-gray-800 rounded" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex items-center justify-between text-[10px]" }, /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-gray-400" }, "\u5DF2\u7528:"), /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-yellow-400 font-bold" }, memoryInfo.used, " MB")), /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex items-center justify-between text-[10px]" }, /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-gray-400" }, "\u603B\u8BA1:"), /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-blue-400" }, memoryInfo.total, " MB")), /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex items-center justify-between text-[10px]" }, /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-gray-400" }, "\u9650\u5236:"), /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-gray-400" }, memoryInfo.limit, " MB")), /* @__PURE__ */ React24__default.default.createElement("div", { className: "mt-2" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "bg-gray-700 rounded-full h-2 overflow-hidden" }, /* @__PURE__ */ React24__default.default.createElement(
|
|
3081
3081
|
"div",
|
|
3082
3082
|
{
|
|
3083
3083
|
className: `h-full transition-all duration-300 ${parseFloat(memoryInfo.used) / parseFloat(memoryInfo.limit) * 100 > 80 ? "bg-red-500" : parseFloat(memoryInfo.used) / parseFloat(memoryInfo.limit) * 100 > 60 ? "bg-yellow-500" : "bg-green-500"}`,
|
|
@@ -3085,9 +3085,9 @@ var MMDPlayerEnhancedDebugInfo = ({
|
|
|
3085
3085
|
width: `${Math.min(100, parseFloat(memoryInfo.used) / parseFloat(memoryInfo.limit) * 100)}%`
|
|
3086
3086
|
}
|
|
3087
3087
|
}
|
|
3088
|
-
)), /* @__PURE__ */
|
|
3088
|
+
)), /* @__PURE__ */ React24__default.default.createElement("div", { className: "text-[9px] text-gray-500 mt-1 text-center" }, (parseFloat(memoryInfo.used) / parseFloat(memoryInfo.limit) * 100).toFixed(1), "%")))), /* @__PURE__ */ React24__default.default.createElement("div", { className: "mt-auto pt-4 border-t border-gray-700" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "text-gray-500 text-[10px]" }, "Last Update: ", (/* @__PURE__ */ new Date()).toLocaleTimeString())));
|
|
3089
3089
|
};
|
|
3090
|
-
var StatusBadge = ({ active, label }) => /* @__PURE__ */
|
|
3090
|
+
var StatusBadge = ({ active, label }) => /* @__PURE__ */ React24__default.default.createElement(
|
|
3091
3091
|
"span",
|
|
3092
3092
|
{
|
|
3093
3093
|
className: `px-2 py-0.5 rounded text-[10px] font-bold ${active ? "bg-green-600 text-white" : "bg-gray-700 text-gray-400"}`
|
|
@@ -3118,20 +3118,20 @@ var MMDPlayerEnhanced = ({
|
|
|
3118
3118
|
...rest
|
|
3119
3119
|
}) => {
|
|
3120
3120
|
const mode = resourcesList ? "list" : resourceOptions ? "options" : "single";
|
|
3121
|
-
const [currentResources, setCurrentResources] =
|
|
3122
|
-
const [currentId, setCurrentId] =
|
|
3123
|
-
const [selection, setSelection] =
|
|
3124
|
-
const [isPlaying, setIsPlaying] =
|
|
3125
|
-
const [volume, setVolume] =
|
|
3126
|
-
const [isMuted, setIsMuted] =
|
|
3127
|
-
const [isLoading, setIsLoading] =
|
|
3128
|
-
const [isFullscreen, setIsFullscreen] =
|
|
3129
|
-
const [showSettings, setShowSettings] =
|
|
3130
|
-
const [showAxes, setShowAxes] =
|
|
3131
|
-
const [isLooping, setIsLooping] =
|
|
3132
|
-
const playerRef =
|
|
3133
|
-
const containerRef =
|
|
3134
|
-
|
|
3121
|
+
const [currentResources, setCurrentResources] = React24.useState(propResources);
|
|
3122
|
+
const [currentId, setCurrentId] = React24.useState(defaultResourceId);
|
|
3123
|
+
const [selection, setSelection] = React24.useState(defaultSelection || {});
|
|
3124
|
+
const [isPlaying, setIsPlaying] = React24.useState(autoPlay);
|
|
3125
|
+
const [volume, setVolume] = React24.useState(initialVolume);
|
|
3126
|
+
const [isMuted, setIsMuted] = React24.useState(initialMuted);
|
|
3127
|
+
const [isLoading, setIsLoading] = React24.useState(true);
|
|
3128
|
+
const [isFullscreen, setIsFullscreen] = React24.useState(false);
|
|
3129
|
+
const [showSettings, setShowSettings] = React24.useState(false);
|
|
3130
|
+
const [showAxes, setShowAxes] = React24.useState(false);
|
|
3131
|
+
const [isLooping, setIsLooping] = React24.useState(loop);
|
|
3132
|
+
const playerRef = React24.useRef(null);
|
|
3133
|
+
const containerRef = React24.useRef(null);
|
|
3134
|
+
React24.useEffect(() => {
|
|
3135
3135
|
if (mode === "list" && resourcesList) {
|
|
3136
3136
|
const targetId = currentId || resourcesList[0]?.id;
|
|
3137
3137
|
const item = resourcesList.find((i) => i.id === targetId);
|
|
@@ -3172,7 +3172,7 @@ var MMDPlayerEnhanced = ({
|
|
|
3172
3172
|
setCurrentResources(propResources);
|
|
3173
3173
|
}
|
|
3174
3174
|
}, [mode, resourcesList, resourceOptions, currentId, selection, propResources]);
|
|
3175
|
-
const toggleFullscreen =
|
|
3175
|
+
const toggleFullscreen = React24.useCallback(() => {
|
|
3176
3176
|
if (!containerRef.current) return;
|
|
3177
3177
|
if (!document.fullscreenElement) {
|
|
3178
3178
|
containerRef.current.requestFullscreen().catch((err) => {
|
|
@@ -3184,7 +3184,7 @@ var MMDPlayerEnhanced = ({
|
|
|
3184
3184
|
setIsFullscreen(false);
|
|
3185
3185
|
}
|
|
3186
3186
|
}, []);
|
|
3187
|
-
|
|
3187
|
+
React24.useEffect(() => {
|
|
3188
3188
|
const handleFsChange = () => {
|
|
3189
3189
|
setIsFullscreen(!!document.fullscreenElement);
|
|
3190
3190
|
};
|
|
@@ -3216,16 +3216,16 @@ var MMDPlayerEnhanced = ({
|
|
|
3216
3216
|
});
|
|
3217
3217
|
};
|
|
3218
3218
|
if (!currentResources) {
|
|
3219
|
-
return /* @__PURE__ */
|
|
3219
|
+
return /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex h-full w-full items-center justify-center bg-black text-white" }, "No Resources Configured");
|
|
3220
3220
|
}
|
|
3221
|
-
return /* @__PURE__ */
|
|
3221
|
+
return /* @__PURE__ */ React24__default.default.createElement(
|
|
3222
3222
|
"div",
|
|
3223
3223
|
{
|
|
3224
3224
|
ref: containerRef,
|
|
3225
3225
|
className: `relative overflow-hidden bg-black group flex ${className}`,
|
|
3226
3226
|
style
|
|
3227
3227
|
},
|
|
3228
|
-
/* @__PURE__ */
|
|
3228
|
+
/* @__PURE__ */ React24__default.default.createElement("div", { className: "flex-1 relative" }, /* @__PURE__ */ React24__default.default.createElement(
|
|
3229
3229
|
MMDPlayerBase,
|
|
3230
3230
|
{
|
|
3231
3231
|
key: mode === "list" ? currentId : JSON.stringify(currentResources),
|
|
@@ -3257,7 +3257,7 @@ var MMDPlayerEnhanced = ({
|
|
|
3257
3257
|
},
|
|
3258
3258
|
...rest
|
|
3259
3259
|
}
|
|
3260
|
-
), isLoading && /* @__PURE__ */
|
|
3260
|
+
), isLoading && /* @__PURE__ */ React24__default.default.createElement("div", { className: "absolute inset-0 z-10 flex items-center justify-center bg-black/50 backdrop-blur-sm" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "h-10 w-10 animate-spin rounded-full border-4 border-white/20 border-t-blue-500" })), /* @__PURE__ */ React24__default.default.createElement("div", { className: `transition-opacity duration-300 ${isPlaying && !showSettings ? "opacity-0 group-hover:opacity-100" : "opacity-100"}` }, /* @__PURE__ */ React24__default.default.createElement(
|
|
3261
3261
|
ControlPanel,
|
|
3262
3262
|
{
|
|
3263
3263
|
isPlaying,
|
|
@@ -3272,7 +3272,7 @@ var MMDPlayerEnhanced = ({
|
|
|
3272
3272
|
onToggleAxes: () => setShowAxes(!showAxes),
|
|
3273
3273
|
onOpenSettings: () => setShowSettings(true)
|
|
3274
3274
|
}
|
|
3275
|
-
)), showSettings && (mode === "list" || mode === "options") && /* @__PURE__ */
|
|
3275
|
+
)), showSettings && (mode === "list" || mode === "options") && /* @__PURE__ */ React24__default.default.createElement(
|
|
3276
3276
|
SettingsPanel,
|
|
3277
3277
|
{
|
|
3278
3278
|
mode,
|
|
@@ -3285,7 +3285,7 @@ var MMDPlayerEnhanced = ({
|
|
|
3285
3285
|
onClose: () => setShowSettings(false)
|
|
3286
3286
|
}
|
|
3287
3287
|
)),
|
|
3288
|
-
showDebugInfo && /* @__PURE__ */
|
|
3288
|
+
showDebugInfo && /* @__PURE__ */ React24__default.default.createElement("div", { className: "w-96 bg-gray-900/95 border-l border-gray-700 p-4 overflow-y-auto" }, /* @__PURE__ */ React24__default.default.createElement(
|
|
3289
3289
|
MMDPlayerEnhancedDebugInfo,
|
|
3290
3290
|
{
|
|
3291
3291
|
isPlaying,
|
|
@@ -3315,8 +3315,8 @@ var MMDPlaylistDebugInfo = ({
|
|
|
3315
3315
|
showAxes,
|
|
3316
3316
|
preloadedNodes
|
|
3317
3317
|
}) => {
|
|
3318
|
-
const [memoryInfo, setMemoryInfo] =
|
|
3319
|
-
|
|
3318
|
+
const [memoryInfo, setMemoryInfo] = React24.useState(null);
|
|
3319
|
+
React24.useEffect(() => {
|
|
3320
3320
|
const timer = setInterval(() => {
|
|
3321
3321
|
if (performance.memory) {
|
|
3322
3322
|
const used = (performance.memory.usedJSHeapSize / 1048576).toFixed(1);
|
|
@@ -3327,14 +3327,14 @@ var MMDPlaylistDebugInfo = ({
|
|
|
3327
3327
|
}, 1e3);
|
|
3328
3328
|
return () => clearInterval(timer);
|
|
3329
3329
|
}, []);
|
|
3330
|
-
return /* @__PURE__ */
|
|
3330
|
+
return /* @__PURE__ */ React24__default.default.createElement("div", { className: "text-white text-xs font-mono" }, /* @__PURE__ */ React24__default.default.createElement("h3", { className: "text-sm font-bold mb-3 pb-2 border-b border-gray-700" }, "\u{1F3AD} MMDPlaylist Debug"), /* @__PURE__ */ React24__default.default.createElement("div", { className: "mb-4" }, /* @__PURE__ */ React24__default.default.createElement("h4", { className: "text-gray-400 mb-2" }, "\u64AD\u653E\u5217\u8868"), /* @__PURE__ */ React24__default.default.createElement("div", { className: "space-y-1 pl-2" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "text-white truncate" }, playlistName), /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-gray-400" }, "\u8FDB\u5EA6:"), /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-blue-400" }, currentIndex + 1, " / ", totalNodes)), /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-gray-400" }, "\u5217\u8868\u5FAA\u73AF:"), /* @__PURE__ */ React24__default.default.createElement(StatusBadge2, { active: isListLooping, label: isListLooping ? "On" : "Off" })))), /* @__PURE__ */ React24__default.default.createElement("div", { className: "mb-4" }, /* @__PURE__ */ React24__default.default.createElement("h4", { className: "text-gray-400 mb-2" }, "\u5F53\u524D\u8282\u70B9"), /* @__PURE__ */ React24__default.default.createElement("div", { className: "p-2 bg-gray-800 rounded space-y-1" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "text-white font-semibold truncate" }, currentNode.name), /* @__PURE__ */ React24__default.default.createElement("div", { className: "text-gray-500 text-[10px] truncate" }, "ID: ", currentNode.id), currentNode.duration && /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-gray-400" }, "\u65F6\u957F:"), /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-green-400" }, currentNode.duration, "s")), /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-gray-400" }, "\u8282\u70B9\u5FAA\u73AF:"), /* @__PURE__ */ React24__default.default.createElement(StatusBadge2, { active: isNodeLooping, label: isNodeLooping ? "On" : "Off" })))), /* @__PURE__ */ React24__default.default.createElement("div", { className: "mb-4" }, /* @__PURE__ */ React24__default.default.createElement("h4", { className: "text-gray-400 mb-2" }, "\u64AD\u653E\u72B6\u6001"), /* @__PURE__ */ React24__default.default.createElement("div", { className: "space-y-1 pl-2" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-gray-400" }, "\u64AD\u653E\u4E2D:"), /* @__PURE__ */ React24__default.default.createElement(StatusBadge2, { active: isPlaying, label: isPlaying ? "Playing" : "Paused" })), /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-gray-400" }, "\u52A0\u8F7D\u4E2D:"), /* @__PURE__ */ React24__default.default.createElement(StatusBadge2, { active: isLoading, label: isLoading ? "Loading" : "Ready" })))), /* @__PURE__ */ React24__default.default.createElement("div", { className: "mb-4" }, /* @__PURE__ */ React24__default.default.createElement("h4", { className: "text-gray-400 mb-2" }, "\u9884\u52A0\u8F7D\u7B56\u7565"), /* @__PURE__ */ React24__default.default.createElement("div", { className: "space-y-1 pl-2" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-gray-400" }, "\u7B56\u7565:"), /* @__PURE__ */ React24__default.default.createElement("span", { className: `px-2 py-0.5 rounded text-[10px] font-bold uppercase ${preloadStrategy === "all" ? "bg-red-600 text-white" : preloadStrategy === "next" ? "bg-yellow-600 text-white" : "bg-gray-700 text-gray-400"}` }, preloadStrategy)), /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-gray-400" }, "\u5DF2\u9884\u52A0\u8F7D:"), /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-purple-400" }, preloadedNodes.length)), preloadedNodes.length > 0 && /* @__PURE__ */ React24__default.default.createElement("div", { className: "mt-2 p-2 bg-gray-800 rounded" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "text-gray-400 text-[10px] mb-1" }, "\u9884\u52A0\u8F7D\u8282\u70B9\u7D22\u5F15"), /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex flex-wrap gap-1" }, preloadedNodes.map((idx) => /* @__PURE__ */ React24__default.default.createElement(
|
|
3331
3331
|
"span",
|
|
3332
3332
|
{
|
|
3333
3333
|
key: idx,
|
|
3334
3334
|
className: `px-1.5 py-0.5 rounded text-[10px] ${idx === currentIndex ? "bg-green-600 text-white font-bold" : "bg-gray-700 text-gray-300"}`
|
|
3335
3335
|
},
|
|
3336
3336
|
idx
|
|
3337
|
-
)))))), /* @__PURE__ */
|
|
3337
|
+
)))))), /* @__PURE__ */ React24__default.default.createElement("div", { className: "mb-4" }, /* @__PURE__ */ React24__default.default.createElement("h4", { className: "text-gray-400 mb-2" }, "\u89C6\u56FE\u72B6\u6001"), /* @__PURE__ */ React24__default.default.createElement("div", { className: "space-y-1 pl-2" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-gray-400" }, "\u5168\u5C4F:"), /* @__PURE__ */ React24__default.default.createElement(StatusBadge2, { active: isFullscreen, label: isFullscreen ? "Yes" : "No" })), /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-gray-400" }, "\u5750\u6807\u8F74:"), /* @__PURE__ */ React24__default.default.createElement(StatusBadge2, { active: showAxes, label: showAxes ? "Show" : "Hide" })))), memoryInfo && /* @__PURE__ */ React24__default.default.createElement("div", { className: "mb-4" }, /* @__PURE__ */ React24__default.default.createElement("h4", { className: "text-gray-400 mb-2" }, "\u5185\u5B58\u76D1\u63A7 (Chrome only)"), /* @__PURE__ */ React24__default.default.createElement("div", { className: "space-y-2 p-2 bg-gray-800 rounded" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex items-center justify-between text-[10px]" }, /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-gray-400" }, "\u5DF2\u7528:"), /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-yellow-400 font-bold" }, memoryInfo.used, " MB")), /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex items-center justify-between text-[10px]" }, /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-gray-400" }, "\u603B\u8BA1:"), /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-blue-400" }, memoryInfo.total, " MB")), /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex items-center justify-between text-[10px]" }, /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-gray-400" }, "\u9650\u5236:"), /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-gray-400" }, memoryInfo.limit, " MB")), /* @__PURE__ */ React24__default.default.createElement("div", { className: "mt-2" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "bg-gray-700 rounded-full h-2 overflow-hidden" }, /* @__PURE__ */ React24__default.default.createElement(
|
|
3338
3338
|
"div",
|
|
3339
3339
|
{
|
|
3340
3340
|
className: `h-full transition-all duration-300 ${parseFloat(memoryInfo.used) / parseFloat(memoryInfo.limit) * 100 > 80 ? "bg-red-500" : parseFloat(memoryInfo.used) / parseFloat(memoryInfo.limit) * 100 > 60 ? "bg-yellow-500" : "bg-green-500"}`,
|
|
@@ -3342,18 +3342,18 @@ var MMDPlaylistDebugInfo = ({
|
|
|
3342
3342
|
width: `${Math.min(100, parseFloat(memoryInfo.used) / parseFloat(memoryInfo.limit) * 100)}%`
|
|
3343
3343
|
}
|
|
3344
3344
|
}
|
|
3345
|
-
)), /* @__PURE__ */
|
|
3345
|
+
)), /* @__PURE__ */ React24__default.default.createElement("div", { className: "text-[9px] text-gray-500 mt-1 text-center" }, (parseFloat(memoryInfo.used) / parseFloat(memoryInfo.limit) * 100).toFixed(1), "%")))), /* @__PURE__ */ React24__default.default.createElement("div", { className: "mb-4" }, /* @__PURE__ */ React24__default.default.createElement("h4", { className: "text-gray-400 mb-2" }, "\u8282\u70B9\u5217\u8868"), /* @__PURE__ */ React24__default.default.createElement("div", { className: "space-y-1 max-h-40 overflow-y-auto" }, Array.from({ length: totalNodes }).map((_, idx) => /* @__PURE__ */ React24__default.default.createElement(
|
|
3346
3346
|
"div",
|
|
3347
3347
|
{
|
|
3348
3348
|
key: idx,
|
|
3349
3349
|
className: `px-2 py-1 rounded text-[10px] flex items-center justify-between ${idx === currentIndex ? "bg-blue-600 text-white font-bold" : preloadedNodes.includes(idx) ? "bg-yellow-900/50 text-yellow-300" : "bg-gray-800 text-gray-400"}`
|
|
3350
3350
|
},
|
|
3351
|
-
/* @__PURE__ */
|
|
3352
|
-
idx === currentIndex && /* @__PURE__ */
|
|
3353
|
-
preloadedNodes.includes(idx) && idx !== currentIndex && /* @__PURE__ */
|
|
3354
|
-
)))), /* @__PURE__ */
|
|
3351
|
+
/* @__PURE__ */ React24__default.default.createElement("span", null, "\u8282\u70B9 ", idx),
|
|
3352
|
+
idx === currentIndex && /* @__PURE__ */ React24__default.default.createElement("span", null, "\u25B6"),
|
|
3353
|
+
preloadedNodes.includes(idx) && idx !== currentIndex && /* @__PURE__ */ React24__default.default.createElement("span", null, "\u23F3")
|
|
3354
|
+
)))), /* @__PURE__ */ React24__default.default.createElement("div", { className: "mt-auto pt-4 border-t border-gray-700" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "text-gray-500 text-[10px]" }, "Last Update: ", (/* @__PURE__ */ new Date()).toLocaleTimeString())));
|
|
3355
3355
|
};
|
|
3356
|
-
var StatusBadge2 = ({ active, label }) => /* @__PURE__ */
|
|
3356
|
+
var StatusBadge2 = ({ active, label }) => /* @__PURE__ */ React24__default.default.createElement(
|
|
3357
3357
|
"span",
|
|
3358
3358
|
{
|
|
3359
3359
|
className: `px-2 py-0.5 rounded text-[10px] font-bold ${active ? "bg-green-600 text-white" : "bg-gray-700 text-gray-400"}`
|
|
@@ -3374,21 +3374,21 @@ var MMDPlaylist = ({
|
|
|
3374
3374
|
style
|
|
3375
3375
|
}) => {
|
|
3376
3376
|
const { nodes, loop = false, preload = "none", autoPlay = false } = playlist;
|
|
3377
|
-
const [currentIndex, setCurrentIndex] =
|
|
3378
|
-
const [isPlaying, setIsPlaying] =
|
|
3379
|
-
const [isLoading, setIsLoading] =
|
|
3380
|
-
const [isFullscreen, setIsFullscreen] =
|
|
3381
|
-
const [showAxes, setShowAxes] =
|
|
3382
|
-
const [isLooping, setIsLooping] =
|
|
3383
|
-
const [isListLooping, setIsListLooping] =
|
|
3384
|
-
const [showPlaylist, setShowPlaylist] =
|
|
3385
|
-
const [isTransitioning, setIsTransitioning] =
|
|
3386
|
-
const [isCameraManual, setIsCameraManual] =
|
|
3387
|
-
const playerRef =
|
|
3388
|
-
const containerRef =
|
|
3389
|
-
const preloadedRef =
|
|
3377
|
+
const [currentIndex, setCurrentIndex] = React24.useState(0);
|
|
3378
|
+
const [isPlaying, setIsPlaying] = React24.useState(autoPlay);
|
|
3379
|
+
const [isLoading, setIsLoading] = React24.useState(true);
|
|
3380
|
+
const [isFullscreen, setIsFullscreen] = React24.useState(false);
|
|
3381
|
+
const [showAxes, setShowAxes] = React24.useState(false);
|
|
3382
|
+
const [isLooping, setIsLooping] = React24.useState(false);
|
|
3383
|
+
const [isListLooping, setIsListLooping] = React24.useState(loop);
|
|
3384
|
+
const [showPlaylist, setShowPlaylist] = React24.useState(false);
|
|
3385
|
+
const [isTransitioning, setIsTransitioning] = React24.useState(false);
|
|
3386
|
+
const [isCameraManual, setIsCameraManual] = React24.useState(false);
|
|
3387
|
+
const playerRef = React24.useRef(null);
|
|
3388
|
+
const containerRef = React24.useRef(null);
|
|
3389
|
+
const preloadedRef = React24.useRef(/* @__PURE__ */ new Set());
|
|
3390
3390
|
const currentNode = nodes[currentIndex];
|
|
3391
|
-
const goToNode =
|
|
3391
|
+
const goToNode = React24.useCallback(
|
|
3392
3392
|
(index) => {
|
|
3393
3393
|
if (index < 0 || index >= nodes.length) return;
|
|
3394
3394
|
if (isTransitioning) return;
|
|
@@ -3422,7 +3422,7 @@ var MMDPlaylist = ({
|
|
|
3422
3422
|
},
|
|
3423
3423
|
[nodes, isPlaying, isTransitioning, onNodeChange]
|
|
3424
3424
|
);
|
|
3425
|
-
const handlePrevious =
|
|
3425
|
+
const handlePrevious = React24.useCallback(() => {
|
|
3426
3426
|
const prevIndex = currentIndex - 1;
|
|
3427
3427
|
if (prevIndex >= 0) {
|
|
3428
3428
|
goToNode(prevIndex);
|
|
@@ -3430,7 +3430,7 @@ var MMDPlaylist = ({
|
|
|
3430
3430
|
goToNode(nodes.length - 1);
|
|
3431
3431
|
}
|
|
3432
3432
|
}, [currentIndex, isListLooping, nodes.length, goToNode]);
|
|
3433
|
-
const handleNext =
|
|
3433
|
+
const handleNext = React24.useCallback(() => {
|
|
3434
3434
|
const nextIndex = currentIndex + 1;
|
|
3435
3435
|
if (nextIndex < nodes.length) {
|
|
3436
3436
|
goToNode(nextIndex);
|
|
@@ -3441,7 +3441,7 @@ var MMDPlaylist = ({
|
|
|
3441
3441
|
onPlaylistComplete?.();
|
|
3442
3442
|
}
|
|
3443
3443
|
}, [currentIndex, isListLooping, nodes.length, goToNode, onPlaylistComplete]);
|
|
3444
|
-
const handlePlayPause =
|
|
3444
|
+
const handlePlayPause = React24.useCallback(() => {
|
|
3445
3445
|
if (isPlaying) {
|
|
3446
3446
|
playerRef.current?.pause();
|
|
3447
3447
|
setIsPlaying(false);
|
|
@@ -3450,7 +3450,7 @@ var MMDPlaylist = ({
|
|
|
3450
3450
|
setIsPlaying(true);
|
|
3451
3451
|
}
|
|
3452
3452
|
}, [isPlaying]);
|
|
3453
|
-
const toggleFullscreen =
|
|
3453
|
+
const toggleFullscreen = React24.useCallback(() => {
|
|
3454
3454
|
if (!containerRef.current) return;
|
|
3455
3455
|
if (!document.fullscreenElement) {
|
|
3456
3456
|
containerRef.current.requestFullscreen().catch((err) => {
|
|
@@ -3462,21 +3462,21 @@ var MMDPlaylist = ({
|
|
|
3462
3462
|
setIsFullscreen(false);
|
|
3463
3463
|
}
|
|
3464
3464
|
}, []);
|
|
3465
|
-
|
|
3465
|
+
React24.useEffect(() => {
|
|
3466
3466
|
const handleFsChange = () => {
|
|
3467
3467
|
setIsFullscreen(!!document.fullscreenElement);
|
|
3468
3468
|
};
|
|
3469
3469
|
document.addEventListener("fullscreenchange", handleFsChange);
|
|
3470
3470
|
return () => document.removeEventListener("fullscreenchange", handleFsChange);
|
|
3471
3471
|
}, []);
|
|
3472
|
-
const handleEnded =
|
|
3472
|
+
const handleEnded = React24.useCallback(() => {
|
|
3473
3473
|
if (isLooping) {
|
|
3474
3474
|
playerRef.current?.play();
|
|
3475
3475
|
} else {
|
|
3476
3476
|
handleNext();
|
|
3477
3477
|
}
|
|
3478
3478
|
}, [isLooping, handleNext]);
|
|
3479
|
-
|
|
3479
|
+
React24.useEffect(() => {
|
|
3480
3480
|
if (preload === "none") return;
|
|
3481
3481
|
if (preload === "all") {
|
|
3482
3482
|
nodes.forEach((node, idx) => {
|
|
@@ -3494,7 +3494,7 @@ var MMDPlaylist = ({
|
|
|
3494
3494
|
}
|
|
3495
3495
|
}
|
|
3496
3496
|
}, [currentIndex, nodes, preload]);
|
|
3497
|
-
|
|
3497
|
+
React24.useEffect(() => {
|
|
3498
3498
|
if (preload === "none" || preload === "all") return;
|
|
3499
3499
|
if (nodes.length === 0) return;
|
|
3500
3500
|
const nextIndex = (currentIndex + 1) % nodes.length;
|
|
@@ -3512,24 +3512,24 @@ var MMDPlaylist = ({
|
|
|
3512
3512
|
});
|
|
3513
3513
|
}
|
|
3514
3514
|
}, [currentIndex, nodes.length, preload]);
|
|
3515
|
-
|
|
3515
|
+
React24.useEffect(() => {
|
|
3516
3516
|
return () => {
|
|
3517
3517
|
console.log("[MMDPlaylist] Component unmounted, clearing all preload marks");
|
|
3518
3518
|
preloadedRef.current.clear();
|
|
3519
3519
|
};
|
|
3520
3520
|
}, []);
|
|
3521
3521
|
if (!currentNode) {
|
|
3522
|
-
return /* @__PURE__ */
|
|
3522
|
+
return /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex h-full w-full items-center justify-center bg-black text-white" }, "\u64AD\u653E\u5217\u8868\u4E3A\u7A7A");
|
|
3523
3523
|
}
|
|
3524
3524
|
const showPrevNext = nodes.length > 1;
|
|
3525
|
-
return /* @__PURE__ */
|
|
3525
|
+
return /* @__PURE__ */ React24__default.default.createElement(
|
|
3526
3526
|
"div",
|
|
3527
3527
|
{
|
|
3528
3528
|
ref: containerRef,
|
|
3529
3529
|
className: `relative overflow-hidden bg-black group flex h-full ${className}`,
|
|
3530
3530
|
style
|
|
3531
3531
|
},
|
|
3532
|
-
/* @__PURE__ */
|
|
3532
|
+
/* @__PURE__ */ React24__default.default.createElement("div", { className: "flex-1 relative" }, !isTransitioning && /* @__PURE__ */ React24__default.default.createElement(
|
|
3533
3533
|
MMDPlayerBase,
|
|
3534
3534
|
{
|
|
3535
3535
|
key: currentNode.id,
|
|
@@ -3552,12 +3552,12 @@ var MMDPlaylist = ({
|
|
|
3552
3552
|
onEnded: handleEnded,
|
|
3553
3553
|
onError
|
|
3554
3554
|
}
|
|
3555
|
-
), (isLoading || isTransitioning) && /* @__PURE__ */
|
|
3555
|
+
), (isLoading || isTransitioning) && /* @__PURE__ */ React24__default.default.createElement("div", { className: "absolute inset-0 z-10 flex items-center justify-center bg-black/50 backdrop-blur-sm" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex flex-col items-center gap-3" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "h-10 w-10 animate-spin rounded-full border-4 border-white/20 border-t-blue-500" }), /* @__PURE__ */ React24__default.default.createElement("div", { className: "text-sm text-white/80" }, isTransitioning ? "\u5207\u6362\u4E2D..." : `\u6B63\u5728\u52A0\u8F7D ${currentIndex + 1} / ${nodes.length}`))), /* @__PURE__ */ React24__default.default.createElement(
|
|
3556
3556
|
"div",
|
|
3557
3557
|
{
|
|
3558
3558
|
className: `transition-opacity duration-300 ${isPlaying && !showPlaylist ? "opacity-0 group-hover:opacity-100" : "opacity-100"}`
|
|
3559
3559
|
},
|
|
3560
|
-
/* @__PURE__ */
|
|
3560
|
+
/* @__PURE__ */ React24__default.default.createElement(
|
|
3561
3561
|
ControlPanel,
|
|
3562
3562
|
{
|
|
3563
3563
|
isPlaying,
|
|
@@ -3584,15 +3584,15 @@ var MMDPlaylist = ({
|
|
|
3584
3584
|
}
|
|
3585
3585
|
}
|
|
3586
3586
|
)
|
|
3587
|
-
), showPlaylist && /* @__PURE__ */
|
|
3587
|
+
), showPlaylist && /* @__PURE__ */ React24__default.default.createElement("div", { className: "absolute inset-0 z-20 flex items-end bg-black/80 backdrop-blur-sm" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "w-full max-h-[60vh] overflow-y-auto bg-gray-900/95 rounded-t-xl" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "sticky top-0 flex items-center justify-between bg-gray-800 px-4 py-3 border-b border-gray-700" }, /* @__PURE__ */ React24__default.default.createElement("div", null, /* @__PURE__ */ React24__default.default.createElement("h3", { className: "text-white font-semibold" }, playlist.name), /* @__PURE__ */ React24__default.default.createElement("p", { className: "text-xs text-gray-400 mt-0.5" }, "\u5171 ", nodes.length, " \u4E2A\u8282\u70B9")), /* @__PURE__ */ React24__default.default.createElement(
|
|
3588
3588
|
"button",
|
|
3589
3589
|
{
|
|
3590
3590
|
onClick: () => setShowPlaylist(false),
|
|
3591
3591
|
className: "p-2 hover:bg-white/10 rounded-lg transition-colors",
|
|
3592
3592
|
"aria-label": "\u5173\u95ED\u64AD\u653E\u5217\u8868"
|
|
3593
3593
|
},
|
|
3594
|
-
/* @__PURE__ */
|
|
3595
|
-
)), /* @__PURE__ */
|
|
3594
|
+
/* @__PURE__ */ React24__default.default.createElement("svg", { className: "w-5 h-5 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor" }, /* @__PURE__ */ React24__default.default.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }))
|
|
3595
|
+
)), /* @__PURE__ */ React24__default.default.createElement("div", { className: "p-2" }, nodes.map((node, index) => /* @__PURE__ */ React24__default.default.createElement(
|
|
3596
3596
|
"button",
|
|
3597
3597
|
{
|
|
3598
3598
|
key: node.id,
|
|
@@ -3602,17 +3602,17 @@ var MMDPlaylist = ({
|
|
|
3602
3602
|
},
|
|
3603
3603
|
className: `w-full flex items-center gap-3 p-3 rounded-lg mb-2 transition-all ${index === currentIndex ? "bg-blue-600 text-white" : "bg-gray-800 text-gray-300 hover:bg-gray-700"}`
|
|
3604
3604
|
},
|
|
3605
|
-
/* @__PURE__ */
|
|
3605
|
+
/* @__PURE__ */ React24__default.default.createElement(
|
|
3606
3606
|
"div",
|
|
3607
3607
|
{
|
|
3608
3608
|
className: `flex-shrink-0 w-8 h-8 rounded-full flex items-center justify-center text-sm font-semibold ${index === currentIndex ? "bg-white/20" : "bg-gray-700"}`
|
|
3609
3609
|
},
|
|
3610
3610
|
index + 1
|
|
3611
3611
|
),
|
|
3612
|
-
/* @__PURE__ */
|
|
3613
|
-
index === currentIndex && /* @__PURE__ */
|
|
3612
|
+
/* @__PURE__ */ React24__default.default.createElement("div", { className: "flex-1 text-left" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "font-medium" }, node.name), node.duration && /* @__PURE__ */ React24__default.default.createElement("div", { className: "text-xs opacity-75 mt-0.5" }, Math.floor(node.duration / 60), ":", String(Math.floor(node.duration % 60)).padStart(2, "0"))),
|
|
3613
|
+
index === currentIndex && /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex-shrink-0" }, /* @__PURE__ */ React24__default.default.createElement("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 24 24" }, /* @__PURE__ */ React24__default.default.createElement("path", { d: "M8 5v14l11-7z" })))
|
|
3614
3614
|
)))))),
|
|
3615
|
-
showDebugInfo && /* @__PURE__ */
|
|
3615
|
+
showDebugInfo && /* @__PURE__ */ React24__default.default.createElement("div", { className: "w-96 flex-shrink-0 bg-gray-900/95 border-l border-gray-700 p-4 overflow-y-auto h-full" }, /* @__PURE__ */ React24__default.default.createElement(
|
|
3616
3616
|
MMDPlaylistDebugInfo,
|
|
3617
3617
|
{
|
|
3618
3618
|
playlistName: playlist.name,
|
|
@@ -3663,13 +3663,13 @@ if (typeof document !== "undefined" && !document.getElementById("dialogue-box-an
|
|
|
3663
3663
|
document.head.appendChild(style);
|
|
3664
3664
|
}
|
|
3665
3665
|
var defaultTheme = {
|
|
3666
|
-
backgroundColor: "rgba(
|
|
3667
|
-
borderColor: "rgba(
|
|
3668
|
-
textColor: "#
|
|
3669
|
-
speakerBgColor: "rgba(
|
|
3670
|
-
speakerTextColor: "#
|
|
3671
|
-
opacity:
|
|
3672
|
-
blur: "
|
|
3666
|
+
backgroundColor: "rgba(248, 250, 252, 0.95)",
|
|
3667
|
+
borderColor: "rgba(203, 213, 225, 0.8)",
|
|
3668
|
+
textColor: "#22c55e",
|
|
3669
|
+
speakerBgColor: "rgba(148, 163, 184, 0.9)",
|
|
3670
|
+
speakerTextColor: "#22c55e",
|
|
3671
|
+
opacity: 1,
|
|
3672
|
+
blur: "16px",
|
|
3673
3673
|
continueHint: "\u70B9\u51FB\u7EE7\u7EED \u25BC",
|
|
3674
3674
|
showContinueHint: true
|
|
3675
3675
|
};
|
|
@@ -3692,15 +3692,15 @@ var DialogueBox = ({
|
|
|
3692
3692
|
className
|
|
3693
3693
|
}) => {
|
|
3694
3694
|
const theme = { ...defaultTheme, ...userTheme };
|
|
3695
|
-
const [displayedText, setDisplayedText] =
|
|
3696
|
-
const [isComplete, setIsComplete] =
|
|
3697
|
-
const [isMounted, setIsMounted] =
|
|
3698
|
-
const typingRef =
|
|
3699
|
-
const currentTextRef =
|
|
3700
|
-
|
|
3695
|
+
const [displayedText, setDisplayedText] = React24.useState("");
|
|
3696
|
+
const [isComplete, setIsComplete] = React24.useState(false);
|
|
3697
|
+
const [isMounted, setIsMounted] = React24.useState(false);
|
|
3698
|
+
const typingRef = React24.useRef(null);
|
|
3699
|
+
const currentTextRef = React24.useRef("");
|
|
3700
|
+
React24.useEffect(() => {
|
|
3701
3701
|
setIsMounted(true);
|
|
3702
3702
|
}, []);
|
|
3703
|
-
|
|
3703
|
+
React24.useEffect(() => {
|
|
3704
3704
|
if (!dialogue) {
|
|
3705
3705
|
setDisplayedText("");
|
|
3706
3706
|
setIsComplete(false);
|
|
@@ -3731,7 +3731,7 @@ var DialogueBox = ({
|
|
|
3731
3731
|
}
|
|
3732
3732
|
};
|
|
3733
3733
|
}, [dialogue]);
|
|
3734
|
-
const handleSkipTyping =
|
|
3734
|
+
const handleSkipTyping = React24.useCallback(() => {
|
|
3735
3735
|
if (typingRef.current) {
|
|
3736
3736
|
clearTimeout(typingRef.current);
|
|
3737
3737
|
}
|
|
@@ -3741,7 +3741,7 @@ var DialogueBox = ({
|
|
|
3741
3741
|
}
|
|
3742
3742
|
onSkipTyping?.();
|
|
3743
3743
|
}, [dialogue, onSkipTyping]);
|
|
3744
|
-
const handleClick =
|
|
3744
|
+
const handleClick = React24.useCallback(() => {
|
|
3745
3745
|
if (!isComplete) {
|
|
3746
3746
|
handleSkipTyping();
|
|
3747
3747
|
} else {
|
|
@@ -3758,7 +3758,14 @@ var DialogueBox = ({
|
|
|
3758
3758
|
displayedText,
|
|
3759
3759
|
isComplete
|
|
3760
3760
|
});
|
|
3761
|
-
|
|
3761
|
+
console.log("[DialogueBox] Theme colors:", {
|
|
3762
|
+
textColor: theme.textColor,
|
|
3763
|
+
backgroundColor: theme.backgroundColor,
|
|
3764
|
+
speakerBgColor: theme.speakerBgColor,
|
|
3765
|
+
speakerTextColor: theme.speakerTextColor,
|
|
3766
|
+
fullTheme: theme
|
|
3767
|
+
});
|
|
3768
|
+
const dialogueContent = /* @__PURE__ */ React24__default.default.createElement(
|
|
3762
3769
|
"div",
|
|
3763
3770
|
{
|
|
3764
3771
|
className: `${className || ""}`,
|
|
@@ -3774,7 +3781,7 @@ var DialogueBox = ({
|
|
|
3774
3781
|
pointerEvents: "auto"
|
|
3775
3782
|
}
|
|
3776
3783
|
},
|
|
3777
|
-
/* @__PURE__ */
|
|
3784
|
+
/* @__PURE__ */ React24__default.default.createElement(
|
|
3778
3785
|
"div",
|
|
3779
3786
|
{
|
|
3780
3787
|
className: "w-full h-full rounded-t-3xl border cursor-pointer select-none transition-all hover:border-white/50 hover:shadow-2xl flex flex-col relative overflow-hidden",
|
|
@@ -3788,128 +3795,128 @@ var DialogueBox = ({
|
|
|
3788
3795
|
position: "relative",
|
|
3789
3796
|
display: "flex",
|
|
3790
3797
|
background: `linear-gradient(135deg,
|
|
3791
|
-
rgba(
|
|
3792
|
-
rgba(
|
|
3793
|
-
rgba(
|
|
3798
|
+
rgba(248, 250, 252, 0.98) 0%,
|
|
3799
|
+
rgba(241, 245, 249, 0.95) 50%,
|
|
3800
|
+
rgba(226, 232, 240, 0.92) 100%)`,
|
|
3794
3801
|
boxShadow: `
|
|
3795
|
-
0 -8px 40px rgba(
|
|
3796
|
-
0 -4px 16px rgba(
|
|
3797
|
-
inset 0 1px 0 rgba(255, 255, 255, 0.
|
|
3798
|
-
inset 0 -1px 0 rgba(
|
|
3802
|
+
0 -8px 40px rgba(148, 163, 184, 0.2),
|
|
3803
|
+
0 -4px 16px rgba(100, 116, 139, 0.15),
|
|
3804
|
+
inset 0 1px 0 rgba(255, 255, 255, 0.8),
|
|
3805
|
+
inset 0 -1px 0 rgba(203, 213, 225, 0.5)
|
|
3799
3806
|
`
|
|
3800
3807
|
}
|
|
3801
3808
|
},
|
|
3802
|
-
/* @__PURE__ */
|
|
3809
|
+
/* @__PURE__ */ React24__default.default.createElement(
|
|
3803
3810
|
"div",
|
|
3804
3811
|
{
|
|
3805
|
-
className: "absolute inset-0 opacity-
|
|
3812
|
+
className: "absolute inset-0 opacity-8 pointer-events-none",
|
|
3806
3813
|
style: {
|
|
3807
3814
|
background: `linear-gradient(45deg,
|
|
3808
|
-
rgba(
|
|
3809
|
-
rgba(
|
|
3810
|
-
rgba(
|
|
3811
|
-
rgba(
|
|
3812
|
-
rgba(
|
|
3815
|
+
rgba(226, 232, 240, 0.3) 0%,
|
|
3816
|
+
rgba(203, 213, 225, 0.3) 25%,
|
|
3817
|
+
rgba(241, 245, 249, 0.3) 50%,
|
|
3818
|
+
rgba(226, 232, 240, 0.3) 75%,
|
|
3819
|
+
rgba(203, 213, 225, 0.3) 100%)`,
|
|
3813
3820
|
backgroundSize: "400% 400%",
|
|
3814
3821
|
animation: "gradientShift 15s ease infinite"
|
|
3815
3822
|
}
|
|
3816
3823
|
}
|
|
3817
3824
|
),
|
|
3818
|
-
/* @__PURE__ */
|
|
3825
|
+
/* @__PURE__ */ React24__default.default.createElement(
|
|
3819
3826
|
"div",
|
|
3820
3827
|
{
|
|
3821
3828
|
className: "absolute top-0 left-0 right-0 h-1",
|
|
3822
3829
|
style: {
|
|
3823
|
-
background: "linear-gradient(90deg, transparent, rgba(255,255,255,0.
|
|
3830
|
+
background: "linear-gradient(90deg, transparent, rgba(255,255,255,0.9), transparent)"
|
|
3824
3831
|
}
|
|
3825
3832
|
}
|
|
3826
3833
|
),
|
|
3827
|
-
/* @__PURE__ */
|
|
3834
|
+
/* @__PURE__ */ React24__default.default.createElement(
|
|
3828
3835
|
"div",
|
|
3829
3836
|
{
|
|
3830
3837
|
className: "absolute bottom-0 left-0 right-0 h-px",
|
|
3831
3838
|
style: {
|
|
3832
|
-
background: "linear-gradient(90deg, transparent, rgba(
|
|
3839
|
+
background: "linear-gradient(90deg, transparent, rgba(203, 213, 225, 0.6), transparent)"
|
|
3833
3840
|
}
|
|
3834
3841
|
}
|
|
3835
3842
|
),
|
|
3836
|
-
showControls && /* @__PURE__ */
|
|
3843
|
+
showControls && /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex justify-end gap-3 px-6 pt-4 pb-2 shrink-0 relative z-10" }, showHistoryButton && /* @__PURE__ */ React24__default.default.createElement(
|
|
3837
3844
|
"button",
|
|
3838
3845
|
{
|
|
3839
3846
|
onClick: (e) => {
|
|
3840
3847
|
e.stopPropagation();
|
|
3841
3848
|
onOpenHistory?.();
|
|
3842
3849
|
},
|
|
3843
|
-
className: "px-4 py-2 text-xs rounded-xl text-
|
|
3850
|
+
className: "px-4 py-2 text-xs rounded-xl text-slate-700 font-medium hover:text-slate-900 transition-all backdrop-blur-lg border border-slate-300 hover:border-slate-400 hover:scale-105 active:scale-95 shadow-lg",
|
|
3844
3851
|
style: {
|
|
3845
|
-
background: "linear-gradient(135deg, rgba(
|
|
3846
|
-
boxShadow: "0 4px 16px rgba(
|
|
3852
|
+
background: "linear-gradient(135deg, rgba(241, 245, 249, 0.95), rgba(226, 232, 240, 0.9))",
|
|
3853
|
+
boxShadow: "0 4px 16px rgba(100, 116, 139, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.8)"
|
|
3847
3854
|
},
|
|
3848
3855
|
title: "\u5386\u53F2\u8BB0\u5F55"
|
|
3849
3856
|
},
|
|
3850
3857
|
"\u{1F4DC} \u5386\u53F2"
|
|
3851
|
-
), isCameraManual && /* @__PURE__ */
|
|
3858
|
+
), isCameraManual && /* @__PURE__ */ React24__default.default.createElement(
|
|
3852
3859
|
"button",
|
|
3853
3860
|
{
|
|
3854
3861
|
onClick: (e) => {
|
|
3855
3862
|
e.stopPropagation();
|
|
3856
3863
|
onResetCamera?.();
|
|
3857
3864
|
},
|
|
3858
|
-
className: "px-4 py-2 text-xs rounded-xl text-white font-medium hover:text-white transition-all backdrop-blur-lg border border-blue-
|
|
3865
|
+
className: "px-4 py-2 text-xs rounded-xl text-white font-medium hover:text-white transition-all backdrop-blur-lg border border-blue-300 hover:border-blue-400 hover:scale-105 active:scale-95 shadow-lg animate-in zoom-in duration-300",
|
|
3859
3866
|
style: {
|
|
3860
|
-
background: "linear-gradient(135deg, rgba(59, 130, 246, 0.
|
|
3861
|
-
boxShadow: "0 4px 16px rgba(59, 130, 246, 0.
|
|
3867
|
+
background: "linear-gradient(135deg, rgba(59, 130, 246, 0.85), rgba(37, 99, 235, 0.75))",
|
|
3868
|
+
boxShadow: "0 4px 16px rgba(59, 130, 246, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.4)"
|
|
3862
3869
|
},
|
|
3863
3870
|
title: "\u6062\u590D\u521D\u59CB\u89C6\u89D2"
|
|
3864
3871
|
},
|
|
3865
3872
|
"\u{1F3A5} \u6062\u590D\u89C6\u89D2"
|
|
3866
|
-
), showAutoButton && /* @__PURE__ */
|
|
3873
|
+
), showAutoButton && /* @__PURE__ */ React24__default.default.createElement(
|
|
3867
3874
|
"button",
|
|
3868
3875
|
{
|
|
3869
3876
|
onClick: (e) => {
|
|
3870
3877
|
e.stopPropagation();
|
|
3871
3878
|
onToggleAuto?.();
|
|
3872
3879
|
},
|
|
3873
|
-
className: `px-4 py-2 text-xs rounded-xl font-medium transition-all backdrop-blur-lg border hover:scale-105 active:scale-95 shadow-lg ${isAutoMode ? "border-
|
|
3880
|
+
className: `px-4 py-2 text-xs rounded-xl font-medium transition-all backdrop-blur-lg border hover:scale-105 active:scale-95 shadow-lg ${isAutoMode ? "border-slate-400 text-slate-900" : "border-slate-300 hover:border-slate-400 text-slate-700"}`,
|
|
3874
3881
|
style: {
|
|
3875
|
-
background: isAutoMode ? "linear-gradient(135deg, rgba(
|
|
3876
|
-
boxShadow: isAutoMode ? "0 4px 20px rgba(
|
|
3882
|
+
background: isAutoMode ? "linear-gradient(135deg, rgba(203, 213, 225, 0.95), rgba(148, 163, 184, 0.85))" : "linear-gradient(135deg, rgba(241, 245, 249, 0.95), rgba(226, 232, 240, 0.9))",
|
|
3883
|
+
boxShadow: isAutoMode ? "0 4px 20px rgba(100, 116, 139, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.8)" : "0 4px 16px rgba(100, 116, 139, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.8)"
|
|
3877
3884
|
},
|
|
3878
3885
|
title: "\u81EA\u52A8\u64AD\u653E"
|
|
3879
3886
|
},
|
|
3880
3887
|
"\u25B6 \u81EA\u52A8"
|
|
3881
|
-
), showSkipButton && /* @__PURE__ */
|
|
3888
|
+
), showSkipButton && /* @__PURE__ */ React24__default.default.createElement(
|
|
3882
3889
|
"button",
|
|
3883
3890
|
{
|
|
3884
3891
|
onClick: (e) => {
|
|
3885
3892
|
e.stopPropagation();
|
|
3886
3893
|
onSkip?.();
|
|
3887
3894
|
},
|
|
3888
|
-
className: "px-4 py-2 text-xs rounded-xl text-
|
|
3895
|
+
className: "px-4 py-2 text-xs rounded-xl text-slate-700 font-medium hover:text-slate-900 transition-all backdrop-blur-lg border border-slate-300 hover:border-slate-400 hover:scale-105 active:scale-95 shadow-lg",
|
|
3889
3896
|
style: {
|
|
3890
|
-
background: "linear-gradient(135deg, rgba(
|
|
3891
|
-
boxShadow: "0 4px 16px rgba(
|
|
3897
|
+
background: "linear-gradient(135deg, rgba(241, 245, 249, 0.95), rgba(226, 232, 240, 0.9))",
|
|
3898
|
+
boxShadow: "0 4px 16px rgba(100, 116, 139, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.8)"
|
|
3892
3899
|
},
|
|
3893
3900
|
title: "\u5FEB\u8FDB"
|
|
3894
3901
|
},
|
|
3895
3902
|
"\u23E9 \u5FEB\u8FDB"
|
|
3896
3903
|
)),
|
|
3897
|
-
/* @__PURE__ */
|
|
3904
|
+
/* @__PURE__ */ React24__default.default.createElement("div", { className: "px-8 pb-6 pt-4 flex-1 flex flex-col justify-start overflow-y-auto relative z-10" }, dialogue.speaker && /* @__PURE__ */ React24__default.default.createElement(
|
|
3898
3905
|
"div",
|
|
3899
3906
|
{
|
|
3900
3907
|
className: "inline-block px-6 py-2.5 rounded-2xl mb-4 text-sm font-bold shadow-2xl self-start relative overflow-hidden transition-all hover:scale-105",
|
|
3901
3908
|
style: {
|
|
3902
3909
|
color: "#ffffff",
|
|
3903
3910
|
background: `linear-gradient(135deg,
|
|
3904
|
-
rgba(
|
|
3905
|
-
rgba(
|
|
3906
|
-
backdropFilter: "blur(
|
|
3907
|
-
WebkitBackdropFilter: "blur(
|
|
3908
|
-
boxShadow: "0
|
|
3909
|
-
border: "1px solid rgba(
|
|
3911
|
+
rgba(100, 116, 139, 0.95) 0%,
|
|
3912
|
+
rgba(71, 85, 105, 0.9) 100%)`,
|
|
3913
|
+
backdropFilter: "blur(12px)",
|
|
3914
|
+
WebkitBackdropFilter: "blur(12px)",
|
|
3915
|
+
boxShadow: "0 4px 16px rgba(100, 116, 139, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3)",
|
|
3916
|
+
border: "1px solid rgba(148, 163, 184, 0.5)"
|
|
3910
3917
|
}
|
|
3911
3918
|
},
|
|
3912
|
-
/* @__PURE__ */
|
|
3919
|
+
/* @__PURE__ */ React24__default.default.createElement(
|
|
3913
3920
|
"div",
|
|
3914
3921
|
{
|
|
3915
3922
|
className: "absolute inset-0 opacity-30",
|
|
@@ -3920,40 +3927,40 @@ var DialogueBox = ({
|
|
|
3920
3927
|
}
|
|
3921
3928
|
}
|
|
3922
3929
|
),
|
|
3923
|
-
/* @__PURE__ */
|
|
3924
|
-
), /* @__PURE__ */
|
|
3930
|
+
/* @__PURE__ */ React24__default.default.createElement("span", { className: "relative z-10 drop-shadow-lg" }, dialogue.speaker)
|
|
3931
|
+
), /* @__PURE__ */ React24__default.default.createElement(
|
|
3925
3932
|
"div",
|
|
3926
3933
|
{
|
|
3927
3934
|
className: "text-lg leading-relaxed relative",
|
|
3928
3935
|
style: {
|
|
3929
3936
|
color: theme.textColor,
|
|
3930
|
-
textShadow: "0 2px
|
|
3937
|
+
textShadow: "0 1px 2px rgba(0, 0, 0, 0.1)"
|
|
3931
3938
|
}
|
|
3932
3939
|
},
|
|
3933
|
-
/* @__PURE__ */
|
|
3940
|
+
/* @__PURE__ */ React24__default.default.createElement("span", { className: "inline-block", style: {
|
|
3934
3941
|
animation: !isComplete ? "textFadeIn 0.3s ease-out" : "none"
|
|
3935
3942
|
} }, displayedText),
|
|
3936
|
-
!isComplete && /* @__PURE__ */
|
|
3943
|
+
!isComplete && /* @__PURE__ */ React24__default.default.createElement(
|
|
3937
3944
|
"span",
|
|
3938
3945
|
{
|
|
3939
3946
|
className: "inline-block w-1 h-6 ml-1 align-middle",
|
|
3940
3947
|
style: {
|
|
3941
|
-
background: "linear-gradient(to bottom,
|
|
3948
|
+
background: "linear-gradient(to bottom, #22c55e, #4ade80)",
|
|
3942
3949
|
animation: "cursorBlink 1s ease-in-out infinite",
|
|
3943
|
-
boxShadow: "0 0
|
|
3950
|
+
boxShadow: "0 0 8px rgba(34, 197, 94, 0.6)"
|
|
3944
3951
|
}
|
|
3945
3952
|
}
|
|
3946
3953
|
)
|
|
3947
|
-
),
|
|
3954
|
+
), /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex justify-end mt-4 h-10 relative" }, isComplete && theme.showContinueHint && /* @__PURE__ */ React24__default.default.createElement(
|
|
3948
3955
|
"span",
|
|
3949
3956
|
{
|
|
3950
|
-
className: "text-sm px-4 py-2 rounded-full backdrop-blur-lg font-medium",
|
|
3957
|
+
className: "text-sm px-4 py-2 rounded-full backdrop-blur-lg font-medium absolute right-0",
|
|
3951
3958
|
style: {
|
|
3952
|
-
background: "linear-gradient(135deg, rgba(
|
|
3953
|
-
color: "rgba(
|
|
3959
|
+
background: "linear-gradient(135deg, rgba(203, 213, 225, 0.9), rgba(226, 232, 240, 0.85))",
|
|
3960
|
+
color: "rgba(71, 85, 105, 0.9)",
|
|
3954
3961
|
animation: "bounce 2s ease-in-out infinite",
|
|
3955
|
-
boxShadow: "0 4px 16px rgba(
|
|
3956
|
-
border: "1px solid rgba(
|
|
3962
|
+
boxShadow: "0 4px 16px rgba(100, 116, 139, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.6)",
|
|
3963
|
+
border: "1px solid rgba(148, 163, 184, 0.4)"
|
|
3957
3964
|
}
|
|
3958
3965
|
},
|
|
3959
3966
|
theme.continueHint
|
|
@@ -3978,11 +3985,11 @@ var HistoryPanel = ({
|
|
|
3978
3985
|
onClose,
|
|
3979
3986
|
className
|
|
3980
3987
|
}) => {
|
|
3981
|
-
const [isMounted, setIsMounted] =
|
|
3982
|
-
|
|
3988
|
+
const [isMounted, setIsMounted] = React24.useState(false);
|
|
3989
|
+
React24.useEffect(() => {
|
|
3983
3990
|
setIsMounted(true);
|
|
3984
3991
|
}, []);
|
|
3985
|
-
const historyContent = /* @__PURE__ */
|
|
3992
|
+
const historyContent = /* @__PURE__ */ React24__default.default.createElement(
|
|
3986
3993
|
"div",
|
|
3987
3994
|
{
|
|
3988
3995
|
className: `fixed inset-0 flex flex-col ${className}`,
|
|
@@ -3993,7 +4000,7 @@ var HistoryPanel = ({
|
|
|
3993
4000
|
},
|
|
3994
4001
|
onClick: onClose
|
|
3995
4002
|
},
|
|
3996
|
-
/* @__PURE__ */
|
|
4003
|
+
/* @__PURE__ */ React24__default.default.createElement(
|
|
3997
4004
|
"div",
|
|
3998
4005
|
{
|
|
3999
4006
|
className: "absolute inset-0 opacity-25 pointer-events-none",
|
|
@@ -4009,7 +4016,7 @@ var HistoryPanel = ({
|
|
|
4009
4016
|
}
|
|
4010
4017
|
}
|
|
4011
4018
|
),
|
|
4012
|
-
/* @__PURE__ */
|
|
4019
|
+
/* @__PURE__ */ React24__default.default.createElement(
|
|
4013
4020
|
"div",
|
|
4014
4021
|
{
|
|
4015
4022
|
className: "absolute inset-0 pointer-events-none",
|
|
@@ -4019,7 +4026,7 @@ var HistoryPanel = ({
|
|
|
4019
4026
|
}
|
|
4020
4027
|
}
|
|
4021
4028
|
),
|
|
4022
|
-
/* @__PURE__ */
|
|
4029
|
+
/* @__PURE__ */ React24__default.default.createElement("div", { className: "relative z-10 flex flex-col h-full", onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ React24__default.default.createElement(
|
|
4023
4030
|
"div",
|
|
4024
4031
|
{
|
|
4025
4032
|
className: "flex items-center justify-between px-8 py-6 border-b relative",
|
|
@@ -4031,8 +4038,8 @@ var HistoryPanel = ({
|
|
|
4031
4038
|
boxShadow: "0 4px 24px rgba(255, 255, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.3)"
|
|
4032
4039
|
}
|
|
4033
4040
|
},
|
|
4034
|
-
/* @__PURE__ */
|
|
4035
|
-
/* @__PURE__ */
|
|
4041
|
+
/* @__PURE__ */ React24__default.default.createElement("h2", { className: "text-2xl font-bold text-white flex items-center gap-3" }, /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-3xl" }, "\u{1F4DC}"), /* @__PURE__ */ React24__default.default.createElement("span", { style: { textShadow: "0 2px 12px rgba(255, 255, 255, 0.3)" } }, "\u5BF9\u8BDD\u5386\u53F2")),
|
|
4042
|
+
/* @__PURE__ */ React24__default.default.createElement(
|
|
4036
4043
|
"button",
|
|
4037
4044
|
{
|
|
4038
4045
|
onClick: onClose,
|
|
@@ -4046,9 +4053,9 @@ var HistoryPanel = ({
|
|
|
4046
4053
|
},
|
|
4047
4054
|
"aria-label": "\u5173\u95ED"
|
|
4048
4055
|
},
|
|
4049
|
-
/* @__PURE__ */
|
|
4056
|
+
/* @__PURE__ */ React24__default.default.createElement("svg", { className: "w-6 h-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor" }, /* @__PURE__ */ React24__default.default.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }))
|
|
4050
4057
|
)
|
|
4051
|
-
), /* @__PURE__ */
|
|
4058
|
+
), /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex-1 overflow-y-auto p-6 space-y-4" }, history.length === 0 ? /* @__PURE__ */ React24__default.default.createElement("div", { className: "text-center text-white/70 py-20 text-lg font-medium", style: { textShadow: "0 2px 8px rgba(0, 0, 0, 0.3)" } }, "\u6682\u65E0\u5BF9\u8BDD\u5386\u53F2") : history.map((item, index) => /* @__PURE__ */ React24__default.default.createElement(
|
|
4052
4059
|
"div",
|
|
4053
4060
|
{
|
|
4054
4061
|
key: `${item.nodeIndex}-${item.dialogueIndex}-${index}`,
|
|
@@ -4061,7 +4068,7 @@ var HistoryPanel = ({
|
|
|
4061
4068
|
boxShadow: "0 8px 24px rgba(255, 255, 255, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.25)"
|
|
4062
4069
|
}
|
|
4063
4070
|
},
|
|
4064
|
-
/* @__PURE__ */
|
|
4071
|
+
/* @__PURE__ */ React24__default.default.createElement(
|
|
4065
4072
|
"div",
|
|
4066
4073
|
{
|
|
4067
4074
|
className: "absolute top-0 left-0 right-0 h-0.5",
|
|
@@ -4070,7 +4077,7 @@ var HistoryPanel = ({
|
|
|
4070
4077
|
}
|
|
4071
4078
|
}
|
|
4072
4079
|
),
|
|
4073
|
-
item.speaker && /* @__PURE__ */
|
|
4080
|
+
item.speaker && /* @__PURE__ */ React24__default.default.createElement(
|
|
4074
4081
|
"div",
|
|
4075
4082
|
{
|
|
4076
4083
|
className: "inline-block px-5 py-2 rounded-xl mb-3 text-sm font-bold shadow-lg relative overflow-hidden",
|
|
@@ -4083,7 +4090,7 @@ var HistoryPanel = ({
|
|
|
4083
4090
|
border: "1px solid rgba(255, 255, 255, 0.25)"
|
|
4084
4091
|
}
|
|
4085
4092
|
},
|
|
4086
|
-
/* @__PURE__ */
|
|
4093
|
+
/* @__PURE__ */ React24__default.default.createElement(
|
|
4087
4094
|
"div",
|
|
4088
4095
|
{
|
|
4089
4096
|
className: "absolute inset-0 opacity-30",
|
|
@@ -4094,9 +4101,9 @@ var HistoryPanel = ({
|
|
|
4094
4101
|
}
|
|
4095
4102
|
}
|
|
4096
4103
|
),
|
|
4097
|
-
/* @__PURE__ */
|
|
4104
|
+
/* @__PURE__ */ React24__default.default.createElement("span", { className: "relative z-10 drop-shadow-lg" }, item.speaker)
|
|
4098
4105
|
),
|
|
4099
|
-
/* @__PURE__ */
|
|
4106
|
+
/* @__PURE__ */ React24__default.default.createElement(
|
|
4100
4107
|
"p",
|
|
4101
4108
|
{
|
|
4102
4109
|
className: "text-base leading-relaxed",
|
|
@@ -4107,7 +4114,7 @@ var HistoryPanel = ({
|
|
|
4107
4114
|
},
|
|
4108
4115
|
item.text
|
|
4109
4116
|
)
|
|
4110
|
-
))), /* @__PURE__ */
|
|
4117
|
+
))), /* @__PURE__ */ React24__default.default.createElement(
|
|
4111
4118
|
"div",
|
|
4112
4119
|
{
|
|
4113
4120
|
className: "px-8 py-4 border-t text-center",
|
|
@@ -4119,7 +4126,7 @@ var HistoryPanel = ({
|
|
|
4119
4126
|
boxShadow: "inset 0 1px 0 rgba(255, 255, 255, 0.2)"
|
|
4120
4127
|
}
|
|
4121
4128
|
},
|
|
4122
|
-
/* @__PURE__ */
|
|
4129
|
+
/* @__PURE__ */ React24__default.default.createElement(
|
|
4123
4130
|
"span",
|
|
4124
4131
|
{
|
|
4125
4132
|
className: "text-sm px-5 py-2.5 rounded-full inline-block font-medium",
|
|
@@ -4154,8 +4161,8 @@ var LoadingScreen = ({
|
|
|
4154
4161
|
loadingText = "\u6B63\u5728\u51C6\u5907\u573A\u666F\u4E2D...",
|
|
4155
4162
|
className = ""
|
|
4156
4163
|
}) => {
|
|
4157
|
-
const [isMounted, setIsMounted] =
|
|
4158
|
-
|
|
4164
|
+
const [isMounted, setIsMounted] = React24.useState(false);
|
|
4165
|
+
React24.useEffect(() => {
|
|
4159
4166
|
setIsMounted(true);
|
|
4160
4167
|
}, []);
|
|
4161
4168
|
console.log("[LoadingScreen] Render state:", {
|
|
@@ -4169,7 +4176,7 @@ var LoadingScreen = ({
|
|
|
4169
4176
|
console.log("[LoadingScreen] Not showing, returning null");
|
|
4170
4177
|
return null;
|
|
4171
4178
|
}
|
|
4172
|
-
const content = /* @__PURE__ */
|
|
4179
|
+
const content = /* @__PURE__ */ React24__default.default.createElement(
|
|
4173
4180
|
"div",
|
|
4174
4181
|
{
|
|
4175
4182
|
className: `fixed inset-0 w-screen h-screen flex items-center justify-center ${className}`,
|
|
@@ -4181,7 +4188,7 @@ var LoadingScreen = ({
|
|
|
4181
4188
|
padding: 0
|
|
4182
4189
|
}
|
|
4183
4190
|
},
|
|
4184
|
-
/* @__PURE__ */
|
|
4191
|
+
/* @__PURE__ */ React24__default.default.createElement(
|
|
4185
4192
|
"div",
|
|
4186
4193
|
{
|
|
4187
4194
|
className: "absolute inset-0 w-full h-full pointer-events-none",
|
|
@@ -4191,7 +4198,7 @@ var LoadingScreen = ({
|
|
|
4191
4198
|
WebkitBackdropFilter: "blur(32px) saturate(200%)"
|
|
4192
4199
|
}
|
|
4193
4200
|
},
|
|
4194
|
-
/* @__PURE__ */
|
|
4201
|
+
/* @__PURE__ */ React24__default.default.createElement(
|
|
4195
4202
|
"div",
|
|
4196
4203
|
{
|
|
4197
4204
|
className: "flex items-center justify-center flex-col inset-0 w-full h-full pointer-events-none",
|
|
@@ -4206,7 +4213,7 @@ var LoadingScreen = ({
|
|
|
4206
4213
|
animation: "gradientShift 15s ease infinite"
|
|
4207
4214
|
}
|
|
4208
4215
|
},
|
|
4209
|
-
/* @__PURE__ */
|
|
4216
|
+
/* @__PURE__ */ React24__default.default.createElement(
|
|
4210
4217
|
"div",
|
|
4211
4218
|
{
|
|
4212
4219
|
className: "text-lg font-medium text-white text-center px-6 py-3 rounded-2xl"
|
|
@@ -4241,39 +4248,53 @@ var LoadingScreen = ({
|
|
|
4241
4248
|
LoadingScreen.displayName = "LoadingScreen";
|
|
4242
4249
|
var VNModal = ({ title, show, onClose, children }) => {
|
|
4243
4250
|
if (!show) return null;
|
|
4244
|
-
return /* @__PURE__ */
|
|
4251
|
+
return /* @__PURE__ */ React24__default.default.createElement(
|
|
4245
4252
|
"div",
|
|
4246
4253
|
{
|
|
4247
|
-
className: "fixed inset-0 flex items-center justify-center
|
|
4254
|
+
className: "fixed inset-0 flex items-center justify-center backdrop-blur-xl z-[1000000] pointer-events-auto transition-all animate-in fade-in zoom-in-95 duration-300 px-4",
|
|
4255
|
+
style: { background: "rgba(100, 116, 139, 0.3)" },
|
|
4248
4256
|
onClick: onClose
|
|
4249
4257
|
},
|
|
4250
|
-
/* @__PURE__ */
|
|
4258
|
+
/* @__PURE__ */ React24__default.default.createElement(
|
|
4251
4259
|
"div",
|
|
4252
4260
|
{
|
|
4253
|
-
className: "w-full max-w-lg
|
|
4261
|
+
className: "w-full max-w-lg p-4 sm:p-6 md:p-8 rounded-3xl sm:rounded-[2.5rem] border relative overflow-hidden max-h-[90vh] overflow-y-auto",
|
|
4254
4262
|
style: {
|
|
4255
|
-
background: "linear-gradient(135deg, rgba(
|
|
4263
|
+
background: "linear-gradient(135deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.95))",
|
|
4256
4264
|
backdropFilter: "blur(40px) saturate(200%)",
|
|
4257
|
-
WebkitBackdropFilter: "blur(40px) saturate(200%)"
|
|
4265
|
+
WebkitBackdropFilter: "blur(40px) saturate(200%)",
|
|
4266
|
+
borderColor: "rgba(203, 213, 225, 0.8)",
|
|
4267
|
+
boxShadow: "0 20px 80px rgba(100, 116, 139, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.8)"
|
|
4258
4268
|
},
|
|
4259
4269
|
onClick: (e) => e.stopPropagation()
|
|
4260
4270
|
},
|
|
4261
|
-
/* @__PURE__ */
|
|
4262
|
-
/* @__PURE__ */
|
|
4263
|
-
/* @__PURE__ */
|
|
4271
|
+
/* @__PURE__ */ React24__default.default.createElement("div", { className: "absolute -top-24 -right-24 w-64 h-64 bg-slate-300/15 rounded-full blur-3xl pointer-events-none" }),
|
|
4272
|
+
/* @__PURE__ */ React24__default.default.createElement("div", { className: "absolute -bottom-24 -left-24 w-64 h-64 bg-slate-400/15 rounded-full blur-3xl pointer-events-none" }),
|
|
4273
|
+
/* @__PURE__ */ React24__default.default.createElement("div", { className: "flex items-center justify-between mb-6 sm:mb-8 relative" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React24__default.default.createElement("h2", { className: "text-xl sm:text-2xl font-bold tracking-wider drop-shadow-sm", style: { color: "#22c55e" } }, title), /* @__PURE__ */ React24__default.default.createElement("div", { className: "h-1 sm:h-1.5 w-12 sm:w-16 bg-green-500/80 rounded-full mt-2 shadow-[0_0_10px_rgba(34,197,94,0.4)]" })), /* @__PURE__ */ React24__default.default.createElement(
|
|
4264
4274
|
"button",
|
|
4265
4275
|
{
|
|
4266
4276
|
onClick: onClose,
|
|
4267
|
-
className: "w-12 h-12 rounded-full flex items-center justify-center
|
|
4277
|
+
className: "w-10 h-10 sm:w-12 sm:h-12 rounded-full flex items-center justify-center transition-all border shadow-inner touch-manipulation shrink-0",
|
|
4278
|
+
style: {
|
|
4279
|
+
background: "rgba(241, 245, 249, 0.8)",
|
|
4280
|
+
borderColor: "rgba(203, 213, 225, 0.6)",
|
|
4281
|
+
color: "#64748b"
|
|
4282
|
+
}
|
|
4268
4283
|
},
|
|
4269
4284
|
"\u2715"
|
|
4270
4285
|
)),
|
|
4271
|
-
/* @__PURE__ */
|
|
4272
|
-
/* @__PURE__ */
|
|
4286
|
+
/* @__PURE__ */ React24__default.default.createElement("div", { className: "leading-relaxed max-h-[40vh] sm:max-h-[50vh] overflow-y-auto pr-2 sm:pr-4 custom-scrollbar relative font-medium text-sm sm:text-base", style: { color: "#475569" } }, children),
|
|
4287
|
+
/* @__PURE__ */ React24__default.default.createElement("div", { className: "mt-6 sm:mt-10 flex justify-center relative" }, /* @__PURE__ */ React24__default.default.createElement(
|
|
4273
4288
|
"button",
|
|
4274
4289
|
{
|
|
4275
4290
|
onClick: onClose,
|
|
4276
|
-
className: "px-14 py-3.5 rounded-
|
|
4291
|
+
className: "px-10 sm:px-14 py-3 sm:py-3.5 rounded-xl sm:rounded-2xl font-bold transition-all border hover:scale-105 active:scale-95 tracking-[0.15em] sm:tracking-[0.2em] uppercase text-xs sm:text-sm touch-manipulation",
|
|
4292
|
+
style: {
|
|
4293
|
+
background: "linear-gradient(135deg, rgba(248, 250, 252, 0.98), rgba(226, 232, 240, 0.95))",
|
|
4294
|
+
borderColor: "rgba(203, 213, 225, 0.8)",
|
|
4295
|
+
color: "#22c55e",
|
|
4296
|
+
boxShadow: "0 4px 16px rgba(100, 116, 139, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.8)"
|
|
4297
|
+
}
|
|
4277
4298
|
},
|
|
4278
4299
|
"Confirm"
|
|
4279
4300
|
))
|
|
@@ -4289,105 +4310,128 @@ var StartScreen = ({
|
|
|
4289
4310
|
onStart,
|
|
4290
4311
|
className = ""
|
|
4291
4312
|
}) => {
|
|
4292
|
-
const [isMounted, setIsMounted] =
|
|
4293
|
-
const [showSettings, setShowSettings] =
|
|
4294
|
-
const [showAbout, setShowAbout] =
|
|
4295
|
-
|
|
4313
|
+
const [isMounted, setIsMounted] = React24.useState(false);
|
|
4314
|
+
const [showSettings, setShowSettings] = React24.useState(false);
|
|
4315
|
+
const [showAbout, setShowAbout] = React24.useState(false);
|
|
4316
|
+
React24.useEffect(() => {
|
|
4296
4317
|
setIsMounted(true);
|
|
4297
4318
|
}, []);
|
|
4298
4319
|
if (!isMounted) return null;
|
|
4299
4320
|
if (!showStartScreen) return null;
|
|
4300
|
-
const content = /* @__PURE__ */
|
|
4321
|
+
const content = /* @__PURE__ */ React24__default.default.createElement(
|
|
4301
4322
|
"div",
|
|
4302
4323
|
{
|
|
4303
4324
|
className: `fixed inset-0 w-screen h-screen flex items-center justify-center overflow-hidden ${className}`,
|
|
4304
4325
|
style: {
|
|
4305
4326
|
zIndex: 999999,
|
|
4306
4327
|
pointerEvents: "auto",
|
|
4307
|
-
backgroundColor: "#
|
|
4328
|
+
backgroundColor: "#f1f5f9",
|
|
4308
4329
|
margin: 0,
|
|
4309
4330
|
padding: 0
|
|
4310
4331
|
}
|
|
4311
4332
|
},
|
|
4312
|
-
/* @__PURE__ */
|
|
4333
|
+
/* @__PURE__ */ React24__default.default.createElement("div", { className: "absolute inset-0 w-full h-full overflow-hidden" }, /* @__PURE__ */ React24__default.default.createElement(
|
|
4313
4334
|
"div",
|
|
4314
4335
|
{
|
|
4315
|
-
className: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[150vw] h-[150vw] opacity-
|
|
4336
|
+
className: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[150vw] h-[150vw] opacity-20 pointer-events-none",
|
|
4316
4337
|
style: {
|
|
4317
|
-
background: "radial-gradient(circle at center, rgba(
|
|
4338
|
+
background: "radial-gradient(circle at center, rgba(226, 232, 240, 0.6) 0%, rgba(203, 213, 225, 0.3) 30%, transparent 70%)",
|
|
4318
4339
|
filter: "blur(60px)",
|
|
4319
4340
|
animation: "pulse 10s ease-in-out infinite"
|
|
4320
4341
|
}
|
|
4321
4342
|
}
|
|
4322
|
-
), /* @__PURE__ */
|
|
4343
|
+
), /* @__PURE__ */ React24__default.default.createElement("div", { className: "absolute inset-0 transition-opacity duration-1000" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "absolute top-[-10%] left-[-10%] w-[60%] h-[60%] bg-slate-300/20 rounded-full blur-[120px] animate-blob" }), /* @__PURE__ */ React24__default.default.createElement("div", { className: "absolute bottom-[-10%] right-[-10%] w-[60%] h-[60%] bg-slate-400/15 rounded-full blur-[120px] animate-blob animation-delay-2000" }), /* @__PURE__ */ React24__default.default.createElement("div", { className: "absolute top-[20%] right-[10%] w-[40%] h-[40%] bg-slate-300/15 rounded-full blur-[100px] animate-blob animation-delay-4000" })), /* @__PURE__ */ React24__default.default.createElement("div", { className: "absolute inset-0 opacity-30" }, [...Array(typeof window !== "undefined" && window.innerWidth < 768 ? 20 : 40)].map((_, i) => /* @__PURE__ */ React24__default.default.createElement(
|
|
4323
4344
|
"div",
|
|
4324
4345
|
{
|
|
4325
4346
|
key: i,
|
|
4326
|
-
className: "absolute bg-
|
|
4347
|
+
className: "absolute bg-slate-400/60 rounded-full",
|
|
4327
4348
|
style: {
|
|
4328
4349
|
width: Math.random() * 3 + 1 + "px",
|
|
4329
4350
|
height: Math.random() * 3 + 1 + "px",
|
|
4330
4351
|
top: Math.random() * 100 + "%",
|
|
4331
4352
|
left: Math.random() * 100 + "%",
|
|
4332
|
-
boxShadow: "0 0 10px rgba(
|
|
4353
|
+
boxShadow: "0 0 10px rgba(148, 163, 184, 0.3)",
|
|
4333
4354
|
animation: `floatParticle ${Math.random() * 10 + 10}s linear infinite`,
|
|
4334
4355
|
animationDelay: `-${Math.random() * 20}s`
|
|
4335
4356
|
}
|
|
4336
4357
|
}
|
|
4337
4358
|
)))),
|
|
4338
|
-
/* @__PURE__ */
|
|
4359
|
+
/* @__PURE__ */ React24__default.default.createElement("div", { className: "relative z-10 w-full max-w-5xl mx-auto px-4 sm:px-6 flex flex-col items-center" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "text-center mb-12 sm:mb-20 md:mb-32 group flex flex-col items-center" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "w-24 sm:w-40 h-px bg-gradient-to-r from-transparent via-slate-400/60 to-transparent mb-6 sm:mb-10 shadow-[0_0_15px_rgba(148,163,184,0.3)]" }), /* @__PURE__ */ React24__default.default.createElement(
|
|
4339
4360
|
"h1",
|
|
4340
4361
|
{
|
|
4341
|
-
className: "text-
|
|
4362
|
+
className: "text-4xl sm:text-5xl md:text-6xl lg:text-8xl font-black tracking-[0.1em] sm:tracking-[0.15em] leading-tight select-none px-4",
|
|
4342
4363
|
style: {
|
|
4343
|
-
|
|
4344
|
-
|
|
4364
|
+
color: "#22c55e",
|
|
4365
|
+
filter: "drop-shadow(0 0 20px rgba(34, 197, 94, 0.4))",
|
|
4366
|
+
textShadow: "0 4px 12px rgba(100, 116, 139, 0.3)"
|
|
4345
4367
|
}
|
|
4346
4368
|
},
|
|
4347
4369
|
scriptName || "VISUAL NOVEL"
|
|
4348
|
-
), /* @__PURE__ */
|
|
4370
|
+
), /* @__PURE__ */ React24__default.default.createElement("div", { className: "mt-6 sm:mt-10 flex flex-col items-center gap-3 sm:gap-4" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "h-0.5 sm:h-1 w-20 sm:w-32 bg-green-500 rounded-full opacity-80 shadow-[0_0_20px_rgba(34,197,94,0.5)]" }), /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-xs sm:text-sm md:text-base tracking-[0.5em] sm:tracking-[0.8em] font-medium uppercase translate-x-[0.25em] sm:translate-x-[0.4em]", style: { color: "#64748b" } }, "Adventure System"))), /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex flex-col gap-6 sm:gap-10 items-center w-full max-w-sm px-4 sm:px-0" }, /* @__PURE__ */ React24__default.default.createElement(
|
|
4349
4371
|
"button",
|
|
4350
4372
|
{
|
|
4351
4373
|
onClick: onStart,
|
|
4352
|
-
className: "group relative w-full h-20 flex items-center justify-center transition-all duration-500 active:scale-95"
|
|
4374
|
+
className: "group relative w-full h-16 sm:h-20 flex items-center justify-center transition-all duration-500 active:scale-95 touch-manipulation"
|
|
4353
4375
|
},
|
|
4354
|
-
/* @__PURE__ */
|
|
4376
|
+
/* @__PURE__ */ React24__default.default.createElement(
|
|
4355
4377
|
"div",
|
|
4356
4378
|
{
|
|
4357
|
-
className: "absolute inset-0
|
|
4379
|
+
className: "absolute inset-0 backdrop-blur-2xl border-2 rounded-3xl transition-all duration-500 group-hover:-inset-1",
|
|
4380
|
+
style: {
|
|
4381
|
+
background: "linear-gradient(135deg, rgba(248, 250, 252, 0.98), rgba(226, 232, 240, 0.95))",
|
|
4382
|
+
borderColor: "rgba(203, 213, 225, 0.8)",
|
|
4383
|
+
boxShadow: "0 8px 40px rgba(148, 163, 184, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.8)"
|
|
4384
|
+
}
|
|
4358
4385
|
}
|
|
4359
4386
|
),
|
|
4360
|
-
/* @__PURE__ */
|
|
4361
|
-
/* @__PURE__ */
|
|
4362
|
-
), /* @__PURE__ */
|
|
4363
|
-
{ text: settingsText, onClick: () => setShowSettings(true)
|
|
4364
|
-
{ text: aboutText, onClick: () => setShowAbout(true)
|
|
4365
|
-
].map((btn, idx) => /* @__PURE__ */
|
|
4387
|
+
/* @__PURE__ */ React24__default.default.createElement("div", { className: "absolute inset-0 overflow-hidden rounded-3xl pointer-events-none" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity duration-700 bg-gradient-to-r from-transparent via-slate-300/30 to-transparent -skew-x-[25deg] -translate-x-[200%] group-hover:translate-x-[200%] transition-transform duration-1000 ease-in-out" })),
|
|
4388
|
+
/* @__PURE__ */ React24__default.default.createElement("div", { className: "relative flex items-center gap-3 sm:gap-6" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "w-2 h-2 sm:w-3 sm:h-3 rounded-full bg-green-500 animate-ping opacity-75" }), /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-lg sm:text-2xl font-black tracking-[0.3em] sm:tracking-[0.4em] drop-shadow-sm", style: { color: "#22c55e" } }, startText), /* @__PURE__ */ React24__default.default.createElement("div", { className: "w-2 h-2 sm:w-3 sm:h-3 rounded-full bg-green-600 animate-ping opacity-75" }))
|
|
4389
|
+
), /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex gap-4 sm:gap-8 w-full justify-center" }, [
|
|
4390
|
+
{ text: settingsText, onClick: () => setShowSettings(true) },
|
|
4391
|
+
{ text: aboutText, onClick: () => setShowAbout(true) }
|
|
4392
|
+
].map((btn, idx) => /* @__PURE__ */ React24__default.default.createElement(
|
|
4366
4393
|
"button",
|
|
4367
4394
|
{
|
|
4368
4395
|
key: idx,
|
|
4369
4396
|
onClick: btn.onClick,
|
|
4370
|
-
className: "group relative flex-1 h-14 flex items-center justify-center transition-all duration-300 active:scale-95 overflow-hidden rounded-2xl"
|
|
4397
|
+
className: "group relative flex-1 h-12 sm:h-14 flex items-center justify-center transition-all duration-300 active:scale-95 overflow-hidden rounded-xl sm:rounded-2xl touch-manipulation"
|
|
4371
4398
|
},
|
|
4372
|
-
/* @__PURE__ */
|
|
4399
|
+
/* @__PURE__ */ React24__default.default.createElement(
|
|
4373
4400
|
"div",
|
|
4374
4401
|
{
|
|
4375
|
-
className: "absolute inset-0
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
className: "absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity",
|
|
4382
|
-
style: { background: btn.color }
|
|
4402
|
+
className: "absolute inset-0 backdrop-blur-xl border transition-all duration-300",
|
|
4403
|
+
style: {
|
|
4404
|
+
background: "linear-gradient(135deg, rgba(241, 245, 249, 0.95), rgba(226, 232, 240, 0.9))",
|
|
4405
|
+
borderColor: "rgba(203, 213, 225, 0.6)",
|
|
4406
|
+
boxShadow: "0 4px 16px rgba(100, 116, 139, 0.15)"
|
|
4407
|
+
}
|
|
4383
4408
|
}
|
|
4384
4409
|
),
|
|
4385
|
-
/* @__PURE__ */
|
|
4410
|
+
/* @__PURE__ */ React24__default.default.createElement("span", { className: "relative text-xs sm:text-sm md:text-base font-bold tracking-[0.15em] sm:tracking-[0.25em] transition-colors uppercase", style: { color: "#64748b" } }, btn.text)
|
|
4386
4411
|
))))),
|
|
4387
|
-
/* @__PURE__ */
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
/* @__PURE__ */
|
|
4412
|
+
/* @__PURE__ */ React24__default.default.createElement("div", { className: "fixed bottom-4 sm:bottom-10 left-0 right-0 text-center pointer-events-none select-none px-4" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "inline-block px-3 sm:px-6 py-1.5 sm:py-2 rounded-full backdrop-blur-md border", style: {
|
|
4413
|
+
background: "rgba(248, 250, 252, 0.8)",
|
|
4414
|
+
borderColor: "rgba(203, 213, 225, 0.3)"
|
|
4415
|
+
} }, /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-[8px] sm:text-[10px] md:text-xs tracking-[0.3em] sm:tracking-[0.5em] font-light uppercase", style: { color: "rgba(100, 116, 139, 0.5)" } }, "Ver 1.6.2 \u2014 ENGINE POWERED BY SA2KIT"))),
|
|
4416
|
+
/* @__PURE__ */ React24__default.default.createElement(VNModal, { title: settingsText, show: showSettings, onClose: () => setShowSettings(false) }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "space-y-6 sm:space-y-8 py-2 sm:py-4" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "space-y-3 sm:space-y-4" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex justify-between items-center text-xs sm:text-sm font-bold tracking-wider sm:tracking-widest", style: { color: "#64748b" } }, /* @__PURE__ */ React24__default.default.createElement("span", null, "MUSIC VOLUME"), /* @__PURE__ */ React24__default.default.createElement("span", null, "80%")), /* @__PURE__ */ React24__default.default.createElement("div", { className: "h-2.5 sm:h-3 rounded-full p-0.5 border", style: { background: "rgba(241, 245, 249, 0.5)", borderColor: "rgba(203, 213, 225, 0.4)" } }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "h-full w-[80%] rounded-full", style: { background: "linear-gradient(to right, #22c55e, #4ade80)", boxShadow: "0 0 15px rgba(34, 197, 94, 0.5)" } }))), /* @__PURE__ */ React24__default.default.createElement("div", { className: "space-y-3 sm:space-y-4" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex justify-between items-center text-xs sm:text-sm font-bold tracking-wider sm:tracking-widest", style: { color: "#64748b" } }, /* @__PURE__ */ React24__default.default.createElement("span", null, "TEXT SPEED"), /* @__PURE__ */ React24__default.default.createElement("span", null, "NORMAL")), /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex gap-2 sm:gap-3" }, ["SLOW", "NORMAL", "FAST"].map((s, i) => /* @__PURE__ */ React24__default.default.createElement(
|
|
4417
|
+
"div",
|
|
4418
|
+
{
|
|
4419
|
+
key: s,
|
|
4420
|
+
className: "flex-1 py-2.5 sm:py-3 rounded-lg sm:rounded-xl border text-center text-[10px] sm:text-xs font-bold transition-all cursor-pointer touch-manipulation",
|
|
4421
|
+
style: i === 1 ? {
|
|
4422
|
+
background: "rgba(34, 197, 94, 0.15)",
|
|
4423
|
+
borderColor: "#22c55e",
|
|
4424
|
+
color: "#22c55e"
|
|
4425
|
+
} : {
|
|
4426
|
+
background: "rgba(241, 245, 249, 0.5)",
|
|
4427
|
+
borderColor: "rgba(203, 213, 225, 0.4)",
|
|
4428
|
+
color: "rgba(100, 116, 139, 0.6)"
|
|
4429
|
+
}
|
|
4430
|
+
},
|
|
4431
|
+
s
|
|
4432
|
+
)))), /* @__PURE__ */ React24__default.default.createElement("div", { className: "pt-3 sm:pt-4 flex flex-col sm:flex-row items-center justify-between gap-2 sm:gap-0 opacity-50 italic text-[10px] sm:text-xs border-t", style: { borderColor: "rgba(203, 213, 225, 0.3)" } }, /* @__PURE__ */ React24__default.default.createElement("span", null, "Auto Save Enabled"), /* @__PURE__ */ React24__default.default.createElement("span", null, "Cloud Sync Active")))),
|
|
4433
|
+
/* @__PURE__ */ React24__default.default.createElement(VNModal, { title: aboutText, show: showAbout, onClose: () => setShowAbout(false) }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "space-y-6 sm:space-y-8 py-2 sm:py-4" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex items-center gap-3 sm:gap-6 p-4 sm:p-6 rounded-2xl sm:rounded-3xl border", style: { background: "rgba(241, 245, 249, 0.6)", borderColor: "rgba(203, 213, 225, 0.4)" } }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "w-14 h-14 sm:w-20 sm:h-20 rounded-xl sm:rounded-2xl flex items-center justify-center text-2xl sm:text-3xl font-black text-white shadow-lg shrink-0", style: { background: "linear-gradient(to bottom right, #22c55e, #4ade80)" } }, "S2"), /* @__PURE__ */ React24__default.default.createElement("div", null, /* @__PURE__ */ React24__default.default.createElement("h3", { className: "text-lg sm:text-2xl font-black tracking-tight", style: { color: "#22c55e" } }, scriptName || "Project SA2"), /* @__PURE__ */ React24__default.default.createElement("p", { className: "text-[10px] sm:text-xs font-bold tracking-wider sm:tracking-widest mt-1 uppercase", style: { color: "rgba(100, 116, 139, 0.6)" } }, "Visual Novel Experience"))), /* @__PURE__ */ React24__default.default.createElement("div", { className: "space-y-3 sm:space-y-4 px-1 sm:px-2" }, /* @__PURE__ */ React24__default.default.createElement("p", { className: "font-medium leading-relaxed text-sm sm:text-base", style: { color: "#475569" } }, "\u91C7\u7528 sa2kit \u5F15\u64CE\u6784\u5EFA\u7684\u65B0\u4E00\u4EE3\u5B9E\u65F6 3D \u89C6\u89C9\u5C0F\u8BF4\u3002\u7ED3\u5408\u4E86 MMD \u5B9E\u65F6\u6E32\u67D3\u6280\u672F\u4E0E\u4EA4\u4E92\u5F0F\u5267\u60C5\u5206\u652F\u7CFB\u7EDF\uFF0C\u81F4\u529B\u4E8E\u6253\u9020\u6781\u81F4\u7684\u6C89\u6D78\u5F0F\u53D9\u4E8B\u4F53\u9A8C\u3002")), /* @__PURE__ */ React24__default.default.createElement("div", { className: "grid grid-cols-2 gap-3 sm:gap-4 pt-4 sm:pt-6 border-t", style: { borderColor: "rgba(203, 213, 225, 0.3)" } }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex flex-col gap-1" }, /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-[9px] sm:text-[10px] font-bold tracking-wider sm:tracking-widest", style: { color: "rgba(100, 116, 139, 0.5)" } }, "DEVELOPER"), /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-xs font-bold", style: { color: "#64748b" } }, "SA2KIT TEAM")), /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex flex-col gap-1 text-right" }, /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-[9px] sm:text-[10px] font-bold tracking-wider sm:tracking-widest", style: { color: "rgba(100, 116, 139, 0.5)" } }, "ENGINE"), /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-xs font-bold", style: { color: "#64748b" } }, "THREE.JS / REACT"))))),
|
|
4434
|
+
/* @__PURE__ */ React24__default.default.createElement("style", null, `
|
|
4391
4435
|
@keyframes floatParticle {
|
|
4392
4436
|
from { transform: translateY(0) translateX(0); opacity: 0; }
|
|
4393
4437
|
20% { opacity: 1; }
|
|
@@ -4472,14 +4516,14 @@ var LoadingOverlay = ({
|
|
|
4472
4516
|
onStart,
|
|
4473
4517
|
className = ""
|
|
4474
4518
|
}) => {
|
|
4475
|
-
return /* @__PURE__ */
|
|
4519
|
+
return /* @__PURE__ */ React24__default.default.createElement(React24__default.default.Fragment, null, /* @__PURE__ */ React24__default.default.createElement(
|
|
4476
4520
|
LoadingScreen,
|
|
4477
4521
|
{
|
|
4478
4522
|
isLoading,
|
|
4479
4523
|
loadingText,
|
|
4480
4524
|
className
|
|
4481
4525
|
}
|
|
4482
|
-
), /* @__PURE__ */
|
|
4526
|
+
), /* @__PURE__ */ React24__default.default.createElement(
|
|
4483
4527
|
StartScreen,
|
|
4484
4528
|
{
|
|
4485
4529
|
showStartScreen,
|
|
@@ -4497,18 +4541,18 @@ var SkipConfirmDialog = ({
|
|
|
4497
4541
|
onConfirm,
|
|
4498
4542
|
onCancel
|
|
4499
4543
|
}) => {
|
|
4500
|
-
const [isMounted, setIsMounted] =
|
|
4501
|
-
|
|
4544
|
+
const [isMounted, setIsMounted] = React24__default.default.useState(false);
|
|
4545
|
+
React24__default.default.useEffect(() => {
|
|
4502
4546
|
setIsMounted(true);
|
|
4503
4547
|
}, []);
|
|
4504
4548
|
if (!isMounted) return null;
|
|
4505
|
-
const content = /* @__PURE__ */
|
|
4549
|
+
const content = /* @__PURE__ */ React24__default.default.createElement(
|
|
4506
4550
|
"div",
|
|
4507
4551
|
{
|
|
4508
4552
|
className: "fixed inset-0 flex items-center justify-center bg-black/40 backdrop-blur-sm pointer-events-auto",
|
|
4509
4553
|
style: { zIndex: 999999 }
|
|
4510
4554
|
},
|
|
4511
|
-
/* @__PURE__ */
|
|
4555
|
+
/* @__PURE__ */ React24__default.default.createElement(
|
|
4512
4556
|
"div",
|
|
4513
4557
|
{
|
|
4514
4558
|
className: "p-8 rounded-3xl border border-white/30 shadow-2xl max-w-sm w-full mx-4 overflow-hidden relative",
|
|
@@ -4520,16 +4564,16 @@ var SkipConfirmDialog = ({
|
|
|
4520
4564
|
WebkitBackdropFilter: "blur(32px) saturate(200%)"
|
|
4521
4565
|
}
|
|
4522
4566
|
},
|
|
4523
|
-
/* @__PURE__ */
|
|
4524
|
-
/* @__PURE__ */
|
|
4525
|
-
/* @__PURE__ */
|
|
4567
|
+
/* @__PURE__ */ React24__default.default.createElement("h3", { className: "text-xl font-bold text-white mb-4 drop-shadow-md" }, "\u52A8\u753B\u5C1A\u672A\u64AD\u653E\u5B8C\u6210"),
|
|
4568
|
+
/* @__PURE__ */ React24__default.default.createElement("p", { className: "text-white/90 mb-8 leading-relaxed drop-shadow-sm" }, "\u5F53\u524D\u573A\u666F\u7684\u52A8\u753B\u8FD8\u6CA1\u6709\u5B8C\u6574\u64AD\u653E\u4E00\u904D\uFF0C\u662F\u5426\u76F4\u63A5\u8DF3\u8F6C\u5230\u4E0B\u4E00\u4E2A\u573A\u666F\uFF1F"),
|
|
4569
|
+
/* @__PURE__ */ React24__default.default.createElement("div", { className: "flex justify-end gap-4" }, /* @__PURE__ */ React24__default.default.createElement(
|
|
4526
4570
|
"button",
|
|
4527
4571
|
{
|
|
4528
4572
|
onClick: onCancel,
|
|
4529
4573
|
className: "px-6 py-2.5 rounded-2xl text-white/80 font-medium hover:text-white hover:bg-white/10 transition-all border border-white/10 hover:border-white/30"
|
|
4530
4574
|
},
|
|
4531
4575
|
"\u53D6\u6D88"
|
|
4532
|
-
), /* @__PURE__ */
|
|
4576
|
+
), /* @__PURE__ */ React24__default.default.createElement(
|
|
4533
4577
|
"button",
|
|
4534
4578
|
{
|
|
4535
4579
|
onClick: onConfirm,
|
|
@@ -4553,34 +4597,51 @@ var ChoiceMenu = ({
|
|
|
4553
4597
|
onSelect,
|
|
4554
4598
|
theme
|
|
4555
4599
|
}) => {
|
|
4556
|
-
const [isMounted, setIsMounted] =
|
|
4557
|
-
|
|
4600
|
+
const [isMounted, setIsMounted] = React24__default.default.useState(false);
|
|
4601
|
+
React24__default.default.useEffect(() => {
|
|
4558
4602
|
setIsMounted(true);
|
|
4559
4603
|
}, []);
|
|
4560
4604
|
if (!isMounted) return null;
|
|
4561
|
-
const content = /* @__PURE__ */
|
|
4605
|
+
const content = /* @__PURE__ */ React24__default.default.createElement(
|
|
4562
4606
|
"div",
|
|
4563
4607
|
{
|
|
4564
4608
|
className: "fixed inset-0 flex flex-col items-center justify-center bg-black/20 backdrop-blur-sm pointer-events-auto transition-all animate-in fade-in duration-500",
|
|
4565
4609
|
style: { zIndex: 1e6 }
|
|
4566
4610
|
},
|
|
4567
|
-
/* @__PURE__ */
|
|
4611
|
+
/* @__PURE__ */ React24__default.default.createElement("div", { className: "flex flex-col gap-4 w-full max-w-md px-6" }, choices.map((choice, index) => /* @__PURE__ */ React24__default.default.createElement(
|
|
4568
4612
|
"button",
|
|
4569
4613
|
{
|
|
4570
4614
|
key: index,
|
|
4571
4615
|
onClick: () => onSelect(choice),
|
|
4572
|
-
className: "w-full py-4 px-8 rounded-2xl
|
|
4616
|
+
className: "w-full py-4 px-8 rounded-2xl font-bold text-lg transition-all border shadow-xl hover:scale-105 active:scale-95 group relative overflow-hidden",
|
|
4573
4617
|
style: {
|
|
4574
4618
|
background: `linear-gradient(135deg,
|
|
4575
|
-
rgba(
|
|
4576
|
-
rgba(
|
|
4577
|
-
|
|
4578
|
-
|
|
4619
|
+
rgba(248, 250, 252, 0.98) 0%,
|
|
4620
|
+
rgba(241, 245, 249, 0.95) 50%,
|
|
4621
|
+
rgba(226, 232, 240, 0.92) 100%)`,
|
|
4622
|
+
backdropFilter: "blur(16px) saturate(200%)",
|
|
4623
|
+
WebkitBackdropFilter: "blur(16px) saturate(200%)",
|
|
4624
|
+
borderColor: "rgba(203, 213, 225, 0.8)",
|
|
4625
|
+
color: "#22c55e",
|
|
4626
|
+
boxShadow: `
|
|
4627
|
+
0 8px 40px rgba(148, 163, 184, 0.2),
|
|
4628
|
+
0 4px 16px rgba(100, 116, 139, 0.15),
|
|
4629
|
+
inset 0 1px 0 rgba(255, 255, 255, 0.8),
|
|
4630
|
+
inset 0 -1px 0 rgba(203, 213, 225, 0.5)
|
|
4631
|
+
`
|
|
4579
4632
|
}
|
|
4580
4633
|
},
|
|
4581
|
-
/* @__PURE__ */
|
|
4582
|
-
|
|
4583
|
-
|
|
4634
|
+
/* @__PURE__ */ React24__default.default.createElement(
|
|
4635
|
+
"div",
|
|
4636
|
+
{
|
|
4637
|
+
className: "absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity",
|
|
4638
|
+
style: {
|
|
4639
|
+
background: "linear-gradient(135deg, rgba(226, 232, 240, 0.5), rgba(203, 213, 225, 0.3))"
|
|
4640
|
+
}
|
|
4641
|
+
}
|
|
4642
|
+
),
|
|
4643
|
+
/* @__PURE__ */ React24__default.default.createElement("div", { className: "absolute inset-0 bg-gradient-to-r from-transparent via-white/30 to-transparent -translate-x-full group-hover:translate-x-full transition-transform duration-1000 ease-in-out" }),
|
|
4644
|
+
/* @__PURE__ */ React24__default.default.createElement("span", { className: "relative z-10 " }, choice.text)
|
|
4584
4645
|
)))
|
|
4585
4646
|
);
|
|
4586
4647
|
let portalContainer = document.getElementById("dialogue-portal-root");
|
|
@@ -4592,9 +4653,271 @@ var ChoiceMenu = ({
|
|
|
4592
4653
|
}
|
|
4593
4654
|
return reactDom.createPortal(content, portalContainer);
|
|
4594
4655
|
};
|
|
4656
|
+
var LoopConfirmDialog = ({
|
|
4657
|
+
onRestart,
|
|
4658
|
+
onBackToStart,
|
|
4659
|
+
onCancel
|
|
4660
|
+
}) => {
|
|
4661
|
+
return /* @__PURE__ */ React24__default.default.createElement("div", { className: "fixed inset-0 z-[9999] flex items-center justify-center bg-black/70 backdrop-blur-sm" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "mx-4 w-full max-w-md rounded-lg bg-gradient-to-br from-slate-800 to-slate-900 p-6 shadow-2xl border border-slate-700" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "mb-6 text-center" }, /* @__PURE__ */ React24__default.default.createElement("h3", { className: "text-2xl font-bold text-white mb-2" }, "\u{1F3AC} \u5267\u672C\u5DF2\u64AD\u653E\u5B8C\u6BD5"), /* @__PURE__ */ React24__default.default.createElement("p", { className: "text-slate-300 text-sm" }, "\u4F60\u60F3\u8981\u505A\u4EC0\u4E48\u5462\uFF1F")), /* @__PURE__ */ React24__default.default.createElement("div", { className: "space-y-3" }, /* @__PURE__ */ React24__default.default.createElement(
|
|
4662
|
+
"button",
|
|
4663
|
+
{
|
|
4664
|
+
onClick: onRestart,
|
|
4665
|
+
className: "w-full rounded-lg bg-gradient-to-r from-blue-500 to-blue-600 px-6 py-4 text-white font-medium shadow-lg hover:from-blue-600 hover:to-blue-700 transition-all duration-200 hover:shadow-xl hover:scale-105 active:scale-95"
|
|
4666
|
+
},
|
|
4667
|
+
/* @__PURE__ */ React24__default.default.createElement("div", { className: "flex items-center justify-center gap-2" }, /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-xl" }, "\u{1F504}"), /* @__PURE__ */ React24__default.default.createElement("div", { className: "text-left" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "font-bold" }, "\u91CD\u65B0\u5F00\u59CB"), /* @__PURE__ */ React24__default.default.createElement("div", { className: "text-xs text-blue-100 opacity-90" }, "\u4ECE\u7B2C\u4E00\u4E2A\u8282\u70B9\u7EE7\u7EED\u64AD\u653E")))
|
|
4668
|
+
), /* @__PURE__ */ React24__default.default.createElement(
|
|
4669
|
+
"button",
|
|
4670
|
+
{
|
|
4671
|
+
onClick: onBackToStart,
|
|
4672
|
+
className: "w-full rounded-lg bg-gradient-to-r from-purple-500 to-purple-600 px-6 py-4 text-white font-medium shadow-lg hover:from-purple-600 hover:to-purple-700 transition-all duration-200 hover:shadow-xl hover:scale-105 active:scale-95"
|
|
4673
|
+
},
|
|
4674
|
+
/* @__PURE__ */ React24__default.default.createElement("div", { className: "flex items-center justify-center gap-2" }, /* @__PURE__ */ React24__default.default.createElement("span", { className: "text-xl" }, "\u{1F3E0}"), /* @__PURE__ */ React24__default.default.createElement("div", { className: "text-left" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "font-bold" }, "\u56DE\u5230\u5F00\u59CB\u9875\u9762"), /* @__PURE__ */ React24__default.default.createElement("div", { className: "text-xs text-purple-100 opacity-90" }, "\u8FD4\u56DE\u6807\u9898\u754C\u9762")))
|
|
4675
|
+
), onCancel && /* @__PURE__ */ React24__default.default.createElement(
|
|
4676
|
+
"button",
|
|
4677
|
+
{
|
|
4678
|
+
onClick: onCancel,
|
|
4679
|
+
className: "w-full rounded-lg bg-slate-700 px-6 py-3 text-slate-300 font-medium hover:bg-slate-600 transition-all duration-200"
|
|
4680
|
+
},
|
|
4681
|
+
"\u53D6\u6D88"
|
|
4682
|
+
)), /* @__PURE__ */ React24__default.default.createElement("div", { className: "mt-4 text-center text-xs text-slate-400" }, "\u{1F4A1} \u63D0\u793A\uFF1A\u4F60\u4E5F\u53EF\u4EE5\u4F7F\u7528\u5FEB\u8FDB\u6309\u94AE\u8DF3\u8FC7\u5DF2\u770B\u8FC7\u7684\u5185\u5BB9")));
|
|
4683
|
+
};
|
|
4684
|
+
var CheerButton = ({
|
|
4685
|
+
onClick,
|
|
4686
|
+
text = "\u5E94\u63F4",
|
|
4687
|
+
show,
|
|
4688
|
+
className = ""
|
|
4689
|
+
}) => {
|
|
4690
|
+
if (!show) return null;
|
|
4691
|
+
return /* @__PURE__ */ React24__default.default.createElement(
|
|
4692
|
+
"button",
|
|
4693
|
+
{
|
|
4694
|
+
onClick,
|
|
4695
|
+
className: `
|
|
4696
|
+
fixed bottom-32 right-8
|
|
4697
|
+
px-6 py-3 rounded-full
|
|
4698
|
+
bg-gradient-to-r from-pink-500 to-purple-500
|
|
4699
|
+
hover:from-pink-600 hover:to-purple-600
|
|
4700
|
+
active:scale-95
|
|
4701
|
+
text-white font-bold text-lg
|
|
4702
|
+
shadow-lg hover:shadow-xl
|
|
4703
|
+
transition-all duration-200
|
|
4704
|
+
flex items-center gap-2
|
|
4705
|
+
${className}
|
|
4706
|
+
`,
|
|
4707
|
+
style: {
|
|
4708
|
+
animation: "cheer-pulse 2s ease-in-out infinite",
|
|
4709
|
+
zIndex: 1e6
|
|
4710
|
+
// 高于对话框的 z-index (999999)
|
|
4711
|
+
}
|
|
4712
|
+
},
|
|
4713
|
+
/* @__PURE__ */ React24__default.default.createElement("span", { className: "text-2xl" }, "\u{1F389}"),
|
|
4714
|
+
/* @__PURE__ */ React24__default.default.createElement("span", null, text),
|
|
4715
|
+
/* @__PURE__ */ React24__default.default.createElement("style", null, `
|
|
4716
|
+
@keyframes cheer-pulse {
|
|
4717
|
+
0%, 100% {
|
|
4718
|
+
transform: scale(1);
|
|
4719
|
+
box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.7);
|
|
4720
|
+
}
|
|
4721
|
+
50% {
|
|
4722
|
+
transform: scale(1.05);
|
|
4723
|
+
box-shadow: 0 0 20px 10px rgba(236, 72, 153, 0);
|
|
4724
|
+
}
|
|
4725
|
+
}
|
|
4726
|
+
`)
|
|
4727
|
+
);
|
|
4728
|
+
};
|
|
4729
|
+
var CheerParticles = React24.forwardRef(
|
|
4730
|
+
({ className = "" }, ref) => {
|
|
4731
|
+
const containerRef = React24.useRef(null);
|
|
4732
|
+
const sceneRef = React24.useRef(null);
|
|
4733
|
+
const cameraRef = React24.useRef(null);
|
|
4734
|
+
const rendererRef = React24.useRef(null);
|
|
4735
|
+
const particlesRef = React24.useRef([]);
|
|
4736
|
+
const animationFrameRef = React24.useRef(null);
|
|
4737
|
+
React24.useEffect(() => {
|
|
4738
|
+
if (!containerRef.current) return;
|
|
4739
|
+
const container = containerRef.current;
|
|
4740
|
+
const width = container.clientWidth;
|
|
4741
|
+
const height = container.clientHeight;
|
|
4742
|
+
const scene = new THREE3__namespace.Scene();
|
|
4743
|
+
sceneRef.current = scene;
|
|
4744
|
+
const camera = new THREE3__namespace.OrthographicCamera(
|
|
4745
|
+
-width / 2,
|
|
4746
|
+
width / 2,
|
|
4747
|
+
height / 2,
|
|
4748
|
+
-height / 2,
|
|
4749
|
+
1,
|
|
4750
|
+
1e3
|
|
4751
|
+
);
|
|
4752
|
+
camera.position.z = 100;
|
|
4753
|
+
cameraRef.current = camera;
|
|
4754
|
+
const renderer = new THREE3__namespace.WebGLRenderer({
|
|
4755
|
+
alpha: true,
|
|
4756
|
+
antialias: true
|
|
4757
|
+
});
|
|
4758
|
+
renderer.setSize(width, height);
|
|
4759
|
+
renderer.setPixelRatio(window.devicePixelRatio);
|
|
4760
|
+
container.appendChild(renderer.domElement);
|
|
4761
|
+
rendererRef.current = renderer;
|
|
4762
|
+
const animate = () => {
|
|
4763
|
+
animationFrameRef.current = requestAnimationFrame(animate);
|
|
4764
|
+
updateParticles();
|
|
4765
|
+
if (rendererRef.current && sceneRef.current && cameraRef.current) {
|
|
4766
|
+
rendererRef.current.render(sceneRef.current, cameraRef.current);
|
|
4767
|
+
}
|
|
4768
|
+
};
|
|
4769
|
+
animate();
|
|
4770
|
+
const handleResize = () => {
|
|
4771
|
+
if (!containerRef.current || !cameraRef.current || !rendererRef.current) return;
|
|
4772
|
+
const newWidth = containerRef.current.clientWidth;
|
|
4773
|
+
const newHeight = containerRef.current.clientHeight;
|
|
4774
|
+
cameraRef.current.left = -newWidth / 2;
|
|
4775
|
+
cameraRef.current.right = newWidth / 2;
|
|
4776
|
+
cameraRef.current.top = newHeight / 2;
|
|
4777
|
+
cameraRef.current.bottom = -newHeight / 2;
|
|
4778
|
+
cameraRef.current.updateProjectionMatrix();
|
|
4779
|
+
rendererRef.current.setSize(newWidth, newHeight);
|
|
4780
|
+
};
|
|
4781
|
+
window.addEventListener("resize", handleResize);
|
|
4782
|
+
return () => {
|
|
4783
|
+
window.removeEventListener("resize", handleResize);
|
|
4784
|
+
if (animationFrameRef.current) {
|
|
4785
|
+
cancelAnimationFrame(animationFrameRef.current);
|
|
4786
|
+
}
|
|
4787
|
+
if (rendererRef.current) {
|
|
4788
|
+
container.removeChild(rendererRef.current.domElement);
|
|
4789
|
+
rendererRef.current.dispose();
|
|
4790
|
+
}
|
|
4791
|
+
clearParticles();
|
|
4792
|
+
};
|
|
4793
|
+
}, []);
|
|
4794
|
+
const createParticle = (position, velocity, color) => {
|
|
4795
|
+
const shapes = [
|
|
4796
|
+
new THREE3__namespace.SphereGeometry(8, 8, 8),
|
|
4797
|
+
new THREE3__namespace.BoxGeometry(10, 10, 10),
|
|
4798
|
+
new THREE3__namespace.ConeGeometry(5, 15, 6)
|
|
4799
|
+
];
|
|
4800
|
+
const geometry = shapes[Math.floor(Math.random() * shapes.length)];
|
|
4801
|
+
const material = new THREE3__namespace.MeshBasicMaterial({
|
|
4802
|
+
color,
|
|
4803
|
+
transparent: true,
|
|
4804
|
+
opacity: 1
|
|
4805
|
+
});
|
|
4806
|
+
const mesh = new THREE3__namespace.Mesh(geometry, material);
|
|
4807
|
+
mesh.position.copy(position);
|
|
4808
|
+
const initialScale = 1 + Math.random() * 0.5;
|
|
4809
|
+
mesh.scale.set(initialScale, initialScale, initialScale);
|
|
4810
|
+
return {
|
|
4811
|
+
mesh,
|
|
4812
|
+
velocity: velocity.clone(),
|
|
4813
|
+
acceleration: new THREE3__namespace.Vector3(0, -500, 0),
|
|
4814
|
+
// 重力
|
|
4815
|
+
lifetime: 0,
|
|
4816
|
+
maxLifetime: 2 + Math.random() * 1,
|
|
4817
|
+
// 2-3秒
|
|
4818
|
+
initialScale
|
|
4819
|
+
};
|
|
4820
|
+
};
|
|
4821
|
+
const triggerParticles = () => {
|
|
4822
|
+
if (!sceneRef.current || !containerRef.current) return;
|
|
4823
|
+
const scene = sceneRef.current;
|
|
4824
|
+
containerRef.current.clientWidth;
|
|
4825
|
+
const height = containerRef.current.clientHeight;
|
|
4826
|
+
const colors = [
|
|
4827
|
+
16738740,
|
|
4828
|
+
// 粉红
|
|
4829
|
+
16766720,
|
|
4830
|
+
// 金黄
|
|
4831
|
+
65535,
|
|
4832
|
+
// 青色
|
|
4833
|
+
16716947,
|
|
4834
|
+
// 深粉
|
|
4835
|
+
9662683,
|
|
4836
|
+
// 紫色
|
|
4837
|
+
16737095,
|
|
4838
|
+
// 番茄红
|
|
4839
|
+
8388564,
|
|
4840
|
+
// 青绿色
|
|
4841
|
+
16753920
|
|
4842
|
+
// 橙色
|
|
4843
|
+
];
|
|
4844
|
+
const particleCount = 100;
|
|
4845
|
+
for (let i = 0; i < particleCount; i++) {
|
|
4846
|
+
const angle = Math.PI * 2 * i / particleCount;
|
|
4847
|
+
const speed = 200 + Math.random() * 300;
|
|
4848
|
+
const spreadZ = (Math.random() - 0.5) * 200;
|
|
4849
|
+
const velocity = new THREE3__namespace.Vector3(
|
|
4850
|
+
Math.cos(angle) * speed,
|
|
4851
|
+
Math.sin(angle) * speed + Math.random() * 200,
|
|
4852
|
+
spreadZ
|
|
4853
|
+
);
|
|
4854
|
+
const color = colors[Math.floor(Math.random() * colors.length)] ?? 16738740;
|
|
4855
|
+
const position = new THREE3__namespace.Vector3(0, -height / 4, 0);
|
|
4856
|
+
const particle = createParticle(position, velocity, color);
|
|
4857
|
+
scene.add(particle.mesh);
|
|
4858
|
+
particlesRef.current.push(particle);
|
|
4859
|
+
}
|
|
4860
|
+
};
|
|
4861
|
+
const updateParticles = () => {
|
|
4862
|
+
const deltaTime = 1 / 60;
|
|
4863
|
+
const particles = particlesRef.current;
|
|
4864
|
+
for (let i = particles.length - 1; i >= 0; i--) {
|
|
4865
|
+
const particle = particles[i];
|
|
4866
|
+
if (!particle) continue;
|
|
4867
|
+
particle.lifetime += deltaTime;
|
|
4868
|
+
if (particle.lifetime >= particle.maxLifetime) {
|
|
4869
|
+
if (sceneRef.current) {
|
|
4870
|
+
sceneRef.current.remove(particle.mesh);
|
|
4871
|
+
}
|
|
4872
|
+
particle.mesh.geometry.dispose();
|
|
4873
|
+
particle.mesh.material.dispose();
|
|
4874
|
+
particles.splice(i, 1);
|
|
4875
|
+
continue;
|
|
4876
|
+
}
|
|
4877
|
+
particle.velocity.add(
|
|
4878
|
+
particle.acceleration.clone().multiplyScalar(deltaTime)
|
|
4879
|
+
);
|
|
4880
|
+
particle.mesh.position.add(
|
|
4881
|
+
particle.velocity.clone().multiplyScalar(deltaTime)
|
|
4882
|
+
);
|
|
4883
|
+
particle.mesh.rotation.x += deltaTime * 2;
|
|
4884
|
+
particle.mesh.rotation.y += deltaTime * 3;
|
|
4885
|
+
const progress = particle.lifetime / particle.maxLifetime;
|
|
4886
|
+
const opacity = Math.max(0, 1 - progress);
|
|
4887
|
+
particle.mesh.material.opacity = opacity;
|
|
4888
|
+
const scale = particle.initialScale * (1 - progress * 0.5);
|
|
4889
|
+
particle.mesh.scale.set(scale, scale, scale);
|
|
4890
|
+
}
|
|
4891
|
+
};
|
|
4892
|
+
const clearParticles = () => {
|
|
4893
|
+
const particles = particlesRef.current;
|
|
4894
|
+
particles.forEach((particle) => {
|
|
4895
|
+
if (sceneRef.current) {
|
|
4896
|
+
sceneRef.current.remove(particle.mesh);
|
|
4897
|
+
}
|
|
4898
|
+
particle.mesh.geometry.dispose();
|
|
4899
|
+
particle.mesh.material.dispose();
|
|
4900
|
+
});
|
|
4901
|
+
particlesRef.current = [];
|
|
4902
|
+
};
|
|
4903
|
+
React24.useImperativeHandle(ref, () => ({
|
|
4904
|
+
trigger: triggerParticles,
|
|
4905
|
+
clear: clearParticles
|
|
4906
|
+
}));
|
|
4907
|
+
return /* @__PURE__ */ React24__default.default.createElement(
|
|
4908
|
+
"div",
|
|
4909
|
+
{
|
|
4910
|
+
ref: containerRef,
|
|
4911
|
+
className: `pointer-events-none absolute inset-0 ${className}`,
|
|
4912
|
+
style: { zIndex: 999998 }
|
|
4913
|
+
}
|
|
4914
|
+
);
|
|
4915
|
+
}
|
|
4916
|
+
);
|
|
4917
|
+
CheerParticles.displayName = "CheerParticles";
|
|
4595
4918
|
|
|
4596
4919
|
// src/mmd/visual-novel/MMDVisualNovel.tsx
|
|
4597
|
-
var MMDVisualNovel =
|
|
4920
|
+
var MMDVisualNovel = React24.forwardRef(
|
|
4598
4921
|
({
|
|
4599
4922
|
script,
|
|
4600
4923
|
stage,
|
|
@@ -4618,33 +4941,35 @@ var MMDVisualNovel = React21.forwardRef(
|
|
|
4618
4941
|
style
|
|
4619
4942
|
}, ref) => {
|
|
4620
4943
|
const { nodes, loop = false } = script;
|
|
4621
|
-
const [currentNodeIndex, setCurrentNodeIndex] =
|
|
4622
|
-
const [currentDialogueIndex, setCurrentDialogueIndex] =
|
|
4623
|
-
const [isLoading, setIsLoading] =
|
|
4624
|
-
const [isAnimationPlaying, setIsAnimationPlaying] =
|
|
4625
|
-
const [isTransitioning, setIsTransitioning] =
|
|
4626
|
-
const [isAutoMode, setIsAutoMode] =
|
|
4627
|
-
const [isTyping, setIsTyping] =
|
|
4628
|
-
const [showHistory, setShowHistory] =
|
|
4629
|
-
const [history, setHistory] =
|
|
4630
|
-
const [isStarted, setIsStarted] =
|
|
4631
|
-
const [isVmdFinished, setIsVmdFinished] =
|
|
4632
|
-
const [pendingNodeIndex, setPendingNodeIndex] =
|
|
4633
|
-
const [showChoices, setShowChoices] =
|
|
4634
|
-
const [isCameraManual, setIsCameraManual] =
|
|
4635
|
-
const [variables, setVariables] =
|
|
4636
|
-
const [activeEffect, setActiveEffect] =
|
|
4637
|
-
const
|
|
4638
|
-
const
|
|
4639
|
-
const
|
|
4640
|
-
const
|
|
4641
|
-
const
|
|
4642
|
-
const
|
|
4643
|
-
const
|
|
4644
|
-
const
|
|
4944
|
+
const [currentNodeIndex, setCurrentNodeIndex] = React24.useState(initialNodeIndex);
|
|
4945
|
+
const [currentDialogueIndex, setCurrentDialogueIndex] = React24.useState(initialDialogueIndex);
|
|
4946
|
+
const [isLoading, setIsLoading] = React24.useState(true);
|
|
4947
|
+
const [isAnimationPlaying, setIsAnimationPlaying] = React24.useState(false);
|
|
4948
|
+
const [isTransitioning, setIsTransitioning] = React24.useState(false);
|
|
4949
|
+
const [isAutoMode, setIsAutoMode] = React24.useState(false);
|
|
4950
|
+
const [isTyping, setIsTyping] = React24.useState(false);
|
|
4951
|
+
const [showHistory, setShowHistory] = React24.useState(false);
|
|
4952
|
+
const [history, setHistory] = React24.useState([]);
|
|
4953
|
+
const [isStarted, setIsStarted] = React24.useState(autoStart);
|
|
4954
|
+
const [isVmdFinished, setIsVmdFinished] = React24.useState(false);
|
|
4955
|
+
const [pendingNodeIndex, setPendingNodeIndex] = React24.useState(null);
|
|
4956
|
+
const [showChoices, setShowChoices] = React24.useState(false);
|
|
4957
|
+
const [isCameraManual, setIsCameraManual] = React24.useState(false);
|
|
4958
|
+
const [variables, setVariables] = React24.useState({});
|
|
4959
|
+
const [activeEffect, setActiveEffect] = React24.useState(null);
|
|
4960
|
+
const [showLoopConfirm, setShowLoopConfirm] = React24.useState(false);
|
|
4961
|
+
const playerRef = React24.useRef(null);
|
|
4962
|
+
const containerRef = React24.useRef(null);
|
|
4963
|
+
const autoTimerRef = React24.useRef(null);
|
|
4964
|
+
const typingCompleteRef = React24.useRef(false);
|
|
4965
|
+
const isStartedRef = React24.useRef(autoStart);
|
|
4966
|
+
const lastAnimationTimeRef = React24.useRef(0);
|
|
4967
|
+
const isVmdFinishedRef = React24.useRef(false);
|
|
4968
|
+
const effectTimerRef = React24.useRef(null);
|
|
4969
|
+
const cheerParticlesRef = React24.useRef(null);
|
|
4645
4970
|
const currentNode = nodes[currentNodeIndex];
|
|
4646
4971
|
const currentDialogue = currentNode?.dialogues[currentDialogueIndex] || null;
|
|
4647
|
-
const addToHistory =
|
|
4972
|
+
const addToHistory = React24.useCallback((dialogue, nodeIndex, dialogueIndex) => {
|
|
4648
4973
|
setHistory((prev) => [
|
|
4649
4974
|
...prev,
|
|
4650
4975
|
{
|
|
@@ -4656,7 +4981,7 @@ var MMDVisualNovel = React21.forwardRef(
|
|
|
4656
4981
|
}
|
|
4657
4982
|
]);
|
|
4658
4983
|
}, []);
|
|
4659
|
-
const triggerEffect =
|
|
4984
|
+
const triggerEffect = React24.useCallback((effect) => {
|
|
4660
4985
|
if (!effect) return;
|
|
4661
4986
|
if (effectTimerRef.current) {
|
|
4662
4987
|
clearTimeout(effectTimerRef.current);
|
|
@@ -4667,7 +4992,7 @@ var MMDVisualNovel = React21.forwardRef(
|
|
|
4667
4992
|
effectTimerRef.current = null;
|
|
4668
4993
|
}, effect.duration || 1e3);
|
|
4669
4994
|
}, []);
|
|
4670
|
-
const goToNode =
|
|
4995
|
+
const goToNode = React24.useCallback(
|
|
4671
4996
|
(nodeIndex, force = false) => {
|
|
4672
4997
|
if (nodeIndex < 0 || nodeIndex >= nodes.length) return;
|
|
4673
4998
|
if (isTransitioning) return;
|
|
@@ -4707,7 +5032,7 @@ var MMDVisualNovel = React21.forwardRef(
|
|
|
4707
5032
|
},
|
|
4708
5033
|
[nodes, isTransitioning, addToHistory, onNodeChange, onDialogueChange, currentNodeIndex]
|
|
4709
5034
|
);
|
|
4710
|
-
const triggerNodeTransition =
|
|
5035
|
+
const triggerNodeTransition = React24.useCallback(() => {
|
|
4711
5036
|
if (!currentNode) return;
|
|
4712
5037
|
let nextNodeIndex = currentNodeIndex + 1;
|
|
4713
5038
|
if (currentNode.nextCondition) {
|
|
@@ -4723,12 +5048,13 @@ var MMDVisualNovel = React21.forwardRef(
|
|
|
4723
5048
|
if (nextNodeIndex < nodes.length && nextNodeIndex >= 0) {
|
|
4724
5049
|
goToNode(nextNodeIndex);
|
|
4725
5050
|
} else if (loop) {
|
|
4726
|
-
|
|
5051
|
+
console.log("[MMDVisualNovel] \u5230\u8FBE\u6700\u540E\u4E00\u4E2A\u8282\u70B9\uFF0C\u663E\u793A\u5FAA\u73AF\u786E\u8BA4\u5BF9\u8BDD\u6846");
|
|
5052
|
+
setShowLoopConfirm(true);
|
|
4727
5053
|
} else {
|
|
4728
5054
|
onScriptComplete?.();
|
|
4729
5055
|
}
|
|
4730
5056
|
}, [currentNode, currentNodeIndex, nodes.length, loop, variables, goToNode, onScriptComplete]);
|
|
4731
|
-
const goToNextDialogue =
|
|
5057
|
+
const goToNextDialogue = React24.useCallback(() => {
|
|
4732
5058
|
if (!currentNode) return;
|
|
4733
5059
|
if (currentDialogue?.choices && currentDialogue.choices.length > 0 && !showChoices) {
|
|
4734
5060
|
setShowChoices(true);
|
|
@@ -4751,7 +5077,7 @@ var MMDVisualNovel = React21.forwardRef(
|
|
|
4751
5077
|
triggerNodeTransition();
|
|
4752
5078
|
}
|
|
4753
5079
|
}, [currentNode, currentDialogue, currentDialogueIndex, currentNodeIndex, nodes.length, loop, addToHistory, onDialogueChange, onScriptComplete, showChoices, variables, goToNode, triggerNodeTransition]);
|
|
4754
|
-
const goToDialogue =
|
|
5080
|
+
const goToDialogue = React24.useCallback(
|
|
4755
5081
|
(dialogueIndex) => {
|
|
4756
5082
|
if (!currentNode) return;
|
|
4757
5083
|
const dialogue = currentNode.dialogues[dialogueIndex];
|
|
@@ -4763,14 +5089,14 @@ var MMDVisualNovel = React21.forwardRef(
|
|
|
4763
5089
|
},
|
|
4764
5090
|
[currentNode, currentNodeIndex, addToHistory, onDialogueChange]
|
|
4765
5091
|
);
|
|
4766
|
-
const handleDialogueClick =
|
|
5092
|
+
const handleDialogueClick = React24.useCallback(() => {
|
|
4767
5093
|
if (!typingCompleteRef.current) {
|
|
4768
5094
|
typingCompleteRef.current = true;
|
|
4769
5095
|
return;
|
|
4770
5096
|
}
|
|
4771
5097
|
goToNextDialogue();
|
|
4772
5098
|
}, [goToNextDialogue]);
|
|
4773
|
-
const handleTypingComplete =
|
|
5099
|
+
const handleTypingComplete = React24.useCallback(() => {
|
|
4774
5100
|
typingCompleteRef.current = true;
|
|
4775
5101
|
setIsTyping(false);
|
|
4776
5102
|
if (isAutoMode || currentDialogue?.waitForClick === false) {
|
|
@@ -4780,7 +5106,7 @@ var MMDVisualNovel = React21.forwardRef(
|
|
|
4780
5106
|
}, delay);
|
|
4781
5107
|
}
|
|
4782
5108
|
}, [isAutoMode, currentDialogue, goToNextDialogue]);
|
|
4783
|
-
|
|
5109
|
+
React24.useEffect(() => {
|
|
4784
5110
|
if (currentDialogue) {
|
|
4785
5111
|
setIsTyping(true);
|
|
4786
5112
|
typingCompleteRef.current = false;
|
|
@@ -4794,15 +5120,18 @@ var MMDVisualNovel = React21.forwardRef(
|
|
|
4794
5120
|
}
|
|
4795
5121
|
return void 0;
|
|
4796
5122
|
}, [currentDialogue, handleTypingComplete]);
|
|
4797
|
-
|
|
5123
|
+
React24.useEffect(() => {
|
|
4798
5124
|
if (currentDialogue?.effect) {
|
|
4799
5125
|
triggerEffect(currentDialogue.effect);
|
|
4800
5126
|
}
|
|
4801
5127
|
}, [currentNodeIndex, currentDialogueIndex, triggerEffect]);
|
|
4802
|
-
const toggleAutoMode =
|
|
5128
|
+
const toggleAutoMode = React24.useCallback(() => {
|
|
4803
5129
|
setIsAutoMode((prev) => !prev);
|
|
4804
5130
|
}, []);
|
|
4805
|
-
const handleSkip =
|
|
5131
|
+
const handleSkip = React24.useCallback(() => {
|
|
5132
|
+
if (showLoopConfirm) {
|
|
5133
|
+
return;
|
|
5134
|
+
}
|
|
4806
5135
|
if (currentNode?.choices && currentNode.choices.length > 0) {
|
|
4807
5136
|
setShowChoices(true);
|
|
4808
5137
|
return;
|
|
@@ -4811,12 +5140,13 @@ var MMDVisualNovel = React21.forwardRef(
|
|
|
4811
5140
|
if (nextNodeIndex < nodes.length) {
|
|
4812
5141
|
goToNode(nextNodeIndex);
|
|
4813
5142
|
} else if (loop) {
|
|
4814
|
-
|
|
5143
|
+
console.log("[MMDVisualNovel] \u5FEB\u8FDB\u5230\u6700\u540E\uFF0C\u663E\u793A\u5FAA\u73AF\u786E\u8BA4\u5BF9\u8BDD\u6846");
|
|
5144
|
+
setShowLoopConfirm(true);
|
|
4815
5145
|
} else {
|
|
4816
5146
|
onScriptComplete?.();
|
|
4817
5147
|
}
|
|
4818
|
-
}, [currentNodeIndex, nodes.length, loop, goToNode, onScriptComplete]);
|
|
4819
|
-
const handleStart =
|
|
5148
|
+
}, [currentNode, currentNodeIndex, nodes.length, loop, goToNode, onScriptComplete, showLoopConfirm]);
|
|
5149
|
+
const handleStart = React24.useCallback(() => {
|
|
4820
5150
|
setIsStarted(true);
|
|
4821
5151
|
isStartedRef.current = true;
|
|
4822
5152
|
if (currentNode && currentNode.dialogues.length > 0 && currentNode?.dialogues[0] !== void 0) {
|
|
@@ -4826,7 +5156,29 @@ var MMDVisualNovel = React21.forwardRef(
|
|
|
4826
5156
|
playerRef.current?.play();
|
|
4827
5157
|
}, 100);
|
|
4828
5158
|
}, [currentNode, currentNodeIndex, addToHistory]);
|
|
4829
|
-
|
|
5159
|
+
const handleBackToStart = React24.useCallback(() => {
|
|
5160
|
+
setShowLoopConfirm(false);
|
|
5161
|
+
setIsStarted(false);
|
|
5162
|
+
isStartedRef.current = false;
|
|
5163
|
+
setCurrentNodeIndex(initialNodeIndex);
|
|
5164
|
+
setCurrentDialogueIndex(initialDialogueIndex);
|
|
5165
|
+
setHistory([]);
|
|
5166
|
+
setVariables({});
|
|
5167
|
+
setIsLoading(true);
|
|
5168
|
+
setIsAnimationPlaying(false);
|
|
5169
|
+
typingCompleteRef.current = false;
|
|
5170
|
+
console.log("[MMDVisualNovel] \u56DE\u5230\u5F00\u59CB\u9875\u9762");
|
|
5171
|
+
}, [initialNodeIndex, initialDialogueIndex]);
|
|
5172
|
+
const handleCheer = React24.useCallback(() => {
|
|
5173
|
+
console.log("[MMDVisualNovel] \u89E6\u53D1\u5E94\u63F4\u6548\u679C");
|
|
5174
|
+
cheerParticlesRef.current?.trigger();
|
|
5175
|
+
}, []);
|
|
5176
|
+
const handleRestartLoop = React24.useCallback(() => {
|
|
5177
|
+
setShowLoopConfirm(false);
|
|
5178
|
+
goToNode(0, true);
|
|
5179
|
+
console.log("[MMDVisualNovel] \u91CD\u65B0\u5F00\u59CB\u5FAA\u73AF");
|
|
5180
|
+
}, [goToNode]);
|
|
5181
|
+
React24.useImperativeHandle(
|
|
4830
5182
|
ref,
|
|
4831
5183
|
() => ({
|
|
4832
5184
|
goToNode,
|
|
@@ -4846,12 +5198,12 @@ var MMDVisualNovel = React21.forwardRef(
|
|
|
4846
5198
|
}),
|
|
4847
5199
|
[goToNode, goToDialogue, currentNodeIndex, currentDialogueIndex, history, triggerEffect]
|
|
4848
5200
|
);
|
|
4849
|
-
|
|
5201
|
+
React24.useEffect(() => {
|
|
4850
5202
|
if (autoStart && currentNode && currentNode.dialogues.length > 0 && history.length === 0 && currentNode?.dialogues[0] !== void 0) {
|
|
4851
5203
|
addToHistory(currentNode?.dialogues[0], currentNodeIndex, 0);
|
|
4852
5204
|
}
|
|
4853
5205
|
}, [autoStart, currentNode, currentNodeIndex, history.length, addToHistory]);
|
|
4854
|
-
|
|
5206
|
+
React24.useEffect(() => {
|
|
4855
5207
|
return () => {
|
|
4856
5208
|
if (autoTimerRef.current) {
|
|
4857
5209
|
clearTimeout(autoTimerRef.current);
|
|
@@ -4862,16 +5214,16 @@ var MMDVisualNovel = React21.forwardRef(
|
|
|
4862
5214
|
};
|
|
4863
5215
|
}, []);
|
|
4864
5216
|
if (!currentNode) {
|
|
4865
|
-
return /* @__PURE__ */
|
|
5217
|
+
return /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex h-full w-full items-center justify-center bg-black text-white" }, "\u5267\u672C\u4E3A\u7A7A");
|
|
4866
5218
|
}
|
|
4867
|
-
return /* @__PURE__ */
|
|
5219
|
+
return /* @__PURE__ */ React24__default.default.createElement(
|
|
4868
5220
|
"div",
|
|
4869
5221
|
{
|
|
4870
5222
|
ref: containerRef,
|
|
4871
5223
|
className: `relative bg-black ${className}`,
|
|
4872
5224
|
style: { width: "100%", height: "100%", overflow: "hidden", ...style }
|
|
4873
5225
|
},
|
|
4874
|
-
/* @__PURE__ */
|
|
5226
|
+
/* @__PURE__ */ React24__default.default.createElement(
|
|
4875
5227
|
"div",
|
|
4876
5228
|
{
|
|
4877
5229
|
className: "absolute inset-0 w-full h-full",
|
|
@@ -4882,7 +5234,7 @@ var MMDVisualNovel = React21.forwardRef(
|
|
|
4882
5234
|
transition: "opacity 0.3s ease-in-out"
|
|
4883
5235
|
}
|
|
4884
5236
|
},
|
|
4885
|
-
!isTransitioning && /* @__PURE__ */
|
|
5237
|
+
!isTransitioning && /* @__PURE__ */ React24__default.default.createElement(
|
|
4886
5238
|
MMDPlayerBase,
|
|
4887
5239
|
{
|
|
4888
5240
|
key: currentNode.id,
|
|
@@ -4931,13 +5283,13 @@ var MMDVisualNovel = React21.forwardRef(
|
|
|
4931
5283
|
}
|
|
4932
5284
|
)
|
|
4933
5285
|
),
|
|
4934
|
-
activeEffect && /* @__PURE__ */
|
|
5286
|
+
activeEffect && /* @__PURE__ */ React24__default.default.createElement(
|
|
4935
5287
|
"div",
|
|
4936
5288
|
{
|
|
4937
5289
|
className: "pointer-events-none absolute inset-0 flex items-center justify-center",
|
|
4938
5290
|
style: { zIndex: 999 }
|
|
4939
5291
|
},
|
|
4940
|
-
activeEffect.type === "flash" && /* @__PURE__ */
|
|
5292
|
+
activeEffect.type === "flash" && /* @__PURE__ */ React24__default.default.createElement(
|
|
4941
5293
|
"div",
|
|
4942
5294
|
{
|
|
4943
5295
|
className: "h-full w-full",
|
|
@@ -4947,7 +5299,7 @@ var MMDVisualNovel = React21.forwardRef(
|
|
|
4947
5299
|
}
|
|
4948
5300
|
}
|
|
4949
5301
|
),
|
|
4950
|
-
activeEffect.type === "gif" && activeEffect.url && /* @__PURE__ */
|
|
5302
|
+
activeEffect.type === "gif" && activeEffect.url && /* @__PURE__ */ React24__default.default.createElement(
|
|
4951
5303
|
"img",
|
|
4952
5304
|
{
|
|
4953
5305
|
src: activeEffect.url,
|
|
@@ -4955,7 +5307,7 @@ var MMDVisualNovel = React21.forwardRef(
|
|
|
4955
5307
|
className: activeEffect.position === "full" ? "h-full w-full object-cover" : "max-h-full max-w-full"
|
|
4956
5308
|
}
|
|
4957
5309
|
),
|
|
4958
|
-
/* @__PURE__ */
|
|
5310
|
+
/* @__PURE__ */ React24__default.default.createElement("style", null, `
|
|
4959
5311
|
@keyframes flash-anim {
|
|
4960
5312
|
0% { opacity: 0; }
|
|
4961
5313
|
25% { opacity: 1; }
|
|
@@ -4963,7 +5315,7 @@ var MMDVisualNovel = React21.forwardRef(
|
|
|
4963
5315
|
}
|
|
4964
5316
|
`)
|
|
4965
5317
|
),
|
|
4966
|
-
/* @__PURE__ */
|
|
5318
|
+
/* @__PURE__ */ React24__default.default.createElement(
|
|
4967
5319
|
LoadingOverlay,
|
|
4968
5320
|
{
|
|
4969
5321
|
isLoading: (() => {
|
|
@@ -4987,17 +5339,18 @@ var MMDVisualNovel = React21.forwardRef(
|
|
|
4987
5339
|
}
|
|
4988
5340
|
),
|
|
4989
5341
|
(() => {
|
|
4990
|
-
const shouldShow = isStarted && isAnimationPlaying && currentDialogue && !showHistory && !showChoices;
|
|
5342
|
+
const shouldShow = isStarted && isAnimationPlaying && currentDialogue && !showHistory && !showChoices && !showLoopConfirm;
|
|
4991
5343
|
console.log("[MMDVisualNovel] DialogueBox render condition:", {
|
|
4992
5344
|
isStarted,
|
|
4993
5345
|
isAnimationPlaying,
|
|
4994
5346
|
hasDialogue: !!currentDialogue,
|
|
4995
5347
|
showHistory,
|
|
4996
5348
|
showChoices,
|
|
5349
|
+
showLoopConfirm,
|
|
4997
5350
|
shouldShow,
|
|
4998
5351
|
dialogue: currentDialogue
|
|
4999
5352
|
});
|
|
5000
|
-
return shouldShow ? /* @__PURE__ */
|
|
5353
|
+
return shouldShow ? /* @__PURE__ */ React24__default.default.createElement(
|
|
5001
5354
|
DialogueBox,
|
|
5002
5355
|
{
|
|
5003
5356
|
dialogue: currentDialogue,
|
|
@@ -5023,7 +5376,7 @@ var MMDVisualNovel = React21.forwardRef(
|
|
|
5023
5376
|
}
|
|
5024
5377
|
) : null;
|
|
5025
5378
|
})(),
|
|
5026
|
-
pendingNodeIndex !== null && /* @__PURE__ */
|
|
5379
|
+
pendingNodeIndex !== null && /* @__PURE__ */ React24__default.default.createElement(
|
|
5027
5380
|
SkipConfirmDialog,
|
|
5028
5381
|
{
|
|
5029
5382
|
onConfirm: () => {
|
|
@@ -5036,7 +5389,7 @@ var MMDVisualNovel = React21.forwardRef(
|
|
|
5036
5389
|
}
|
|
5037
5390
|
}
|
|
5038
5391
|
),
|
|
5039
|
-
showChoices && (currentDialogue?.choices || currentNode.choices) && /* @__PURE__ */
|
|
5392
|
+
showChoices && (currentDialogue?.choices || currentNode.choices) && /* @__PURE__ */ React24__default.default.createElement(
|
|
5040
5393
|
ChoiceMenu,
|
|
5041
5394
|
{
|
|
5042
5395
|
choices: currentDialogue?.choices || currentNode.choices,
|
|
@@ -5075,13 +5428,29 @@ var MMDVisualNovel = React21.forwardRef(
|
|
|
5075
5428
|
}
|
|
5076
5429
|
}
|
|
5077
5430
|
),
|
|
5078
|
-
showHistory && /* @__PURE__ */
|
|
5431
|
+
showHistory && /* @__PURE__ */ React24__default.default.createElement(
|
|
5079
5432
|
HistoryPanel,
|
|
5080
5433
|
{
|
|
5081
5434
|
history,
|
|
5082
5435
|
theme: dialogueTheme,
|
|
5083
5436
|
onClose: () => setShowHistory(false)
|
|
5084
5437
|
}
|
|
5438
|
+
),
|
|
5439
|
+
showLoopConfirm && /* @__PURE__ */ React24__default.default.createElement(
|
|
5440
|
+
LoopConfirmDialog,
|
|
5441
|
+
{
|
|
5442
|
+
onRestart: handleRestartLoop,
|
|
5443
|
+
onBackToStart: handleBackToStart
|
|
5444
|
+
}
|
|
5445
|
+
),
|
|
5446
|
+
/* @__PURE__ */ React24__default.default.createElement(CheerParticles, { ref: cheerParticlesRef }),
|
|
5447
|
+
/* @__PURE__ */ React24__default.default.createElement(
|
|
5448
|
+
CheerButton,
|
|
5449
|
+
{
|
|
5450
|
+
show: isStarted && isAnimationPlaying && !showHistory && !showChoices && !showLoopConfirm && currentNode?.supportCheer === true,
|
|
5451
|
+
onClick: handleCheer,
|
|
5452
|
+
text: "\u5E94\u63F4"
|
|
5453
|
+
}
|
|
5085
5454
|
)
|
|
5086
5455
|
);
|
|
5087
5456
|
}
|
|
@@ -5108,18 +5477,18 @@ var MusicControls = ({
|
|
|
5108
5477
|
return `${mins}:${secs.toString().padStart(2, "0")}`;
|
|
5109
5478
|
};
|
|
5110
5479
|
const progress = duration > 0 ? currentTime / duration * 100 : 0;
|
|
5111
|
-
return /* @__PURE__ */
|
|
5480
|
+
return /* @__PURE__ */ React24__default.default.createElement(
|
|
5112
5481
|
"div",
|
|
5113
5482
|
{
|
|
5114
5483
|
className: `w-full max-w-4xl mx-auto px-6 py-4 bg-white/10 backdrop-blur-xl border border-white/20 rounded-2xl shadow-2xl pointer-events-auto transition-all group ${className}`
|
|
5115
5484
|
},
|
|
5116
|
-
/* @__PURE__ */
|
|
5485
|
+
/* @__PURE__ */ React24__default.default.createElement("div", { className: "relative w-full h-1.5 bg-white/20 rounded-full mb-4 cursor-pointer group/progress overflow-hidden" }, /* @__PURE__ */ React24__default.default.createElement(
|
|
5117
5486
|
"div",
|
|
5118
5487
|
{
|
|
5119
5488
|
className: "absolute h-full bg-blue-500 rounded-full transition-all duration-300",
|
|
5120
5489
|
style: { width: `${progress}%` }
|
|
5121
5490
|
}
|
|
5122
|
-
), /* @__PURE__ */
|
|
5491
|
+
), /* @__PURE__ */ React24__default.default.createElement(
|
|
5123
5492
|
"input",
|
|
5124
5493
|
{
|
|
5125
5494
|
type: "range",
|
|
@@ -5130,52 +5499,52 @@ var MusicControls = ({
|
|
|
5130
5499
|
className: "absolute inset-0 w-full h-full opacity-0 cursor-pointer"
|
|
5131
5500
|
}
|
|
5132
5501
|
)),
|
|
5133
|
-
/* @__PURE__ */
|
|
5502
|
+
/* @__PURE__ */ React24__default.default.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex items-center gap-2 text-xs font-mono text-white/60 w-32" }, /* @__PURE__ */ React24__default.default.createElement("span", null, formatTime(currentTime)), /* @__PURE__ */ React24__default.default.createElement("span", null, "/"), /* @__PURE__ */ React24__default.default.createElement("span", null, formatTime(duration))), /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex items-center gap-6" }, /* @__PURE__ */ React24__default.default.createElement(
|
|
5134
5503
|
"button",
|
|
5135
5504
|
{
|
|
5136
5505
|
onClick: onPrevious,
|
|
5137
5506
|
className: "text-white/80 hover:text-white transition-colors"
|
|
5138
5507
|
},
|
|
5139
|
-
/* @__PURE__ */
|
|
5140
|
-
), /* @__PURE__ */
|
|
5508
|
+
/* @__PURE__ */ React24__default.default.createElement(lucideReact.SkipBack, { className: "w-6 h-6 fill-current" })
|
|
5509
|
+
), /* @__PURE__ */ React24__default.default.createElement(
|
|
5141
5510
|
"button",
|
|
5142
5511
|
{
|
|
5143
5512
|
onClick: onPlayPause,
|
|
5144
5513
|
className: "w-12 h-12 flex items-center justify-center bg-blue-500 hover:bg-blue-400 text-white rounded-full shadow-lg shadow-blue-500/20 transition-all hover:scale-105 active:scale-95"
|
|
5145
5514
|
},
|
|
5146
|
-
isPlaying ? /* @__PURE__ */
|
|
5147
|
-
), /* @__PURE__ */
|
|
5515
|
+
isPlaying ? /* @__PURE__ */ React24__default.default.createElement(lucideReact.Pause, { className: "w-6 h-6 fill-current" }) : /* @__PURE__ */ React24__default.default.createElement(lucideReact.Play, { className: "w-6 h-6 fill-current ml-1" })
|
|
5516
|
+
), /* @__PURE__ */ React24__default.default.createElement(
|
|
5148
5517
|
"button",
|
|
5149
5518
|
{
|
|
5150
5519
|
onClick: onNext,
|
|
5151
5520
|
className: "text-white/80 hover:text-white transition-colors"
|
|
5152
5521
|
},
|
|
5153
|
-
/* @__PURE__ */
|
|
5154
|
-
)), /* @__PURE__ */
|
|
5522
|
+
/* @__PURE__ */ React24__default.default.createElement(lucideReact.SkipForward, { className: "w-6 h-6 fill-current" })
|
|
5523
|
+
)), /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex items-center gap-4 w-32 justify-end" }, isCameraManual && /* @__PURE__ */ React24__default.default.createElement(
|
|
5155
5524
|
"button",
|
|
5156
5525
|
{
|
|
5157
5526
|
onClick: onResetCamera,
|
|
5158
5527
|
className: "text-blue-400 hover:text-blue-300 transition-colors animate-in zoom-in duration-300",
|
|
5159
5528
|
title: "\u6062\u590D\u521D\u59CB\u89C6\u89D2"
|
|
5160
5529
|
},
|
|
5161
|
-
/* @__PURE__ */
|
|
5162
|
-
), /* @__PURE__ */
|
|
5530
|
+
/* @__PURE__ */ React24__default.default.createElement(lucideReact.Camera, { className: "w-5 h-5" })
|
|
5531
|
+
), /* @__PURE__ */ React24__default.default.createElement(
|
|
5163
5532
|
"button",
|
|
5164
5533
|
{
|
|
5165
5534
|
onClick: onToggleLoop,
|
|
5166
5535
|
className: "text-white/60 hover:text-white transition-colors",
|
|
5167
5536
|
title: loopMode
|
|
5168
5537
|
},
|
|
5169
|
-
loopMode === "list" && /* @__PURE__ */
|
|
5170
|
-
loopMode === "single" && /* @__PURE__ */
|
|
5171
|
-
loopMode === "shuffle" && /* @__PURE__ */
|
|
5172
|
-
), /* @__PURE__ */
|
|
5538
|
+
loopMode === "list" && /* @__PURE__ */ React24__default.default.createElement(lucideReact.Repeat, { className: "w-5 h-5" }),
|
|
5539
|
+
loopMode === "single" && /* @__PURE__ */ React24__default.default.createElement(lucideReact.Repeat1, { className: "w-5 h-5 text-blue-400" }),
|
|
5540
|
+
loopMode === "shuffle" && /* @__PURE__ */ React24__default.default.createElement(lucideReact.Shuffle, { className: "w-5 h-5 text-orange-400" })
|
|
5541
|
+
), /* @__PURE__ */ React24__default.default.createElement(
|
|
5173
5542
|
"button",
|
|
5174
5543
|
{
|
|
5175
5544
|
onClick: onTogglePlaylist,
|
|
5176
5545
|
className: "text-white/60 hover:text-white transition-colors"
|
|
5177
5546
|
},
|
|
5178
|
-
/* @__PURE__ */
|
|
5547
|
+
/* @__PURE__ */ React24__default.default.createElement(lucideReact.ListMusic, { className: "w-5 h-5" })
|
|
5179
5548
|
)))
|
|
5180
5549
|
);
|
|
5181
5550
|
};
|
|
@@ -5190,25 +5559,25 @@ var PlaylistPanel = ({
|
|
|
5190
5559
|
onSearch,
|
|
5191
5560
|
isSearching
|
|
5192
5561
|
}) => {
|
|
5193
|
-
const [searchValue, setSearchValue] =
|
|
5562
|
+
const [searchValue, setSearchValue] = React24__default.default.useState("");
|
|
5194
5563
|
if (!isOpen) return null;
|
|
5195
5564
|
const handleSearchSubmit = (e) => {
|
|
5196
5565
|
e.preventDefault();
|
|
5197
5566
|
onSearch?.(searchValue);
|
|
5198
5567
|
};
|
|
5199
|
-
return /* @__PURE__ */
|
|
5568
|
+
return /* @__PURE__ */ React24__default.default.createElement(
|
|
5200
5569
|
"div",
|
|
5201
5570
|
{
|
|
5202
5571
|
className: `fixed inset-y-0 right-0 w-80 bg-gray-900/90 backdrop-blur-2xl border-l border-white/10 shadow-2xl z-50 flex flex-col pointer-events-auto transform transition-transform duration-500 ease-out ${isOpen ? "translate-x-0" : "translate-x-full"} ${className}`
|
|
5203
5572
|
},
|
|
5204
|
-
/* @__PURE__ */
|
|
5573
|
+
/* @__PURE__ */ React24__default.default.createElement("div", { className: "flex flex-col p-6 border-b border-white/10 gap-4" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex items-center gap-3" }, /* @__PURE__ */ React24__default.default.createElement(lucideReact.Music, { className: "w-5 h-5 text-blue-400" }), /* @__PURE__ */ React24__default.default.createElement("h3", { className: "text-lg font-bold text-white" }, mikuMode ? "Miku \u6B4C\u66F2\u5E93" : "\u64AD\u653E\u5217\u8868")), /* @__PURE__ */ React24__default.default.createElement(
|
|
5205
5574
|
"button",
|
|
5206
5575
|
{
|
|
5207
5576
|
onClick: onClose,
|
|
5208
5577
|
className: "p-2 text-white/60 hover:text-white transition-colors"
|
|
5209
5578
|
},
|
|
5210
|
-
/* @__PURE__ */
|
|
5211
|
-
)), mikuMode && /* @__PURE__ */
|
|
5579
|
+
/* @__PURE__ */ React24__default.default.createElement(lucideReact.X, { className: "w-5 h-5" })
|
|
5580
|
+
)), mikuMode && /* @__PURE__ */ React24__default.default.createElement("form", { onSubmit: handleSearchSubmit, className: "relative" }, /* @__PURE__ */ React24__default.default.createElement(
|
|
5212
5581
|
"input",
|
|
5213
5582
|
{
|
|
5214
5583
|
type: "text",
|
|
@@ -5217,23 +5586,23 @@ var PlaylistPanel = ({
|
|
|
5217
5586
|
placeholder: "\u641C\u7D22 Miku \u6B4C\u66F2...",
|
|
5218
5587
|
className: "w-full bg-white/5 border border-white/10 rounded-lg py-2 pl-10 pr-4 text-sm text-white placeholder:text-white/20 focus:outline-none focus:border-blue-500/50 transition-colors"
|
|
5219
5588
|
}
|
|
5220
|
-
), /* @__PURE__ */
|
|
5221
|
-
/* @__PURE__ */
|
|
5589
|
+
), /* @__PURE__ */ React24__default.default.createElement(lucideReact.Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-white/20" }), isSearching && /* @__PURE__ */ React24__default.default.createElement(lucideReact.Loader2, { className: "absolute right-3 top-1/2 -translate-y-1/2 w-4 h-4 text-blue-400 animate-spin" }))),
|
|
5590
|
+
/* @__PURE__ */ React24__default.default.createElement("div", { className: "flex-1 overflow-y-auto p-4 space-y-2 custom-scrollbar" }, tracks.map((track, index) => {
|
|
5222
5591
|
const isActive = index === currentIndex;
|
|
5223
|
-
return /* @__PURE__ */
|
|
5592
|
+
return /* @__PURE__ */ React24__default.default.createElement(
|
|
5224
5593
|
"button",
|
|
5225
5594
|
{
|
|
5226
5595
|
key: track.id,
|
|
5227
5596
|
onClick: () => onSelectTrack(index),
|
|
5228
5597
|
className: `w-full flex items-center gap-4 p-3 rounded-xl transition-all group ${isActive ? "bg-blue-500/20 border border-blue-500/30" : "hover:bg-white/5 border border-transparent"}`
|
|
5229
5598
|
},
|
|
5230
|
-
/* @__PURE__ */
|
|
5231
|
-
/* @__PURE__ */
|
|
5232
|
-
!isActive && /* @__PURE__ */
|
|
5599
|
+
/* @__PURE__ */ React24__default.default.createElement("div", { className: "relative w-12 h-12 flex-shrink-0 rounded-lg overflow-hidden bg-gray-800" }, track.coverUrl ? /* @__PURE__ */ React24__default.default.createElement("img", { src: track.coverUrl, alt: track.title, className: "w-full h-full object-cover" }) : /* @__PURE__ */ React24__default.default.createElement("div", { className: "w-full h-full flex items-center justify-center text-white/20" }, /* @__PURE__ */ React24__default.default.createElement(lucideReact.Music, { className: "w-6 h-6" })), isActive && /* @__PURE__ */ React24__default.default.createElement("div", { className: "absolute inset-0 bg-blue-500/40 flex items-center justify-center" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex gap-1 items-end h-4" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "w-1 bg-white animate-music-bar-1" }), /* @__PURE__ */ React24__default.default.createElement("div", { className: "w-1 bg-white animate-music-bar-2" }), /* @__PURE__ */ React24__default.default.createElement("div", { className: "w-1 bg-white animate-music-bar-3" })))),
|
|
5600
|
+
/* @__PURE__ */ React24__default.default.createElement("div", { className: "flex-1 text-left min-w-0" }, /* @__PURE__ */ React24__default.default.createElement("h4", { className: `text-sm font-bold truncate ${isActive ? "text-blue-400" : "text-white/90"}` }, track.title), /* @__PURE__ */ React24__default.default.createElement("p", { className: "text-xs text-white/40 truncate mt-0.5" }, track.artist || "\u672A\u77E5\u827A\u672F\u5BB6")),
|
|
5601
|
+
!isActive && /* @__PURE__ */ React24__default.default.createElement("div", { className: "opacity-0 group-hover:opacity-100 transition-opacity" }, /* @__PURE__ */ React24__default.default.createElement(lucideReact.Play, { className: "w-4 h-4 text-white/40 fill-current" }))
|
|
5233
5602
|
);
|
|
5234
5603
|
})),
|
|
5235
|
-
/* @__PURE__ */
|
|
5236
|
-
/* @__PURE__ */
|
|
5604
|
+
/* @__PURE__ */ React24__default.default.createElement("div", { className: "p-6 border-t border-white/10" }, /* @__PURE__ */ React24__default.default.createElement("p", { className: "text-xs text-gray-500 text-center" }, "\u5171 ", tracks.length, " \u9996\u66F2\u76EE")),
|
|
5605
|
+
/* @__PURE__ */ React24__default.default.createElement("style", { dangerouslySetInnerHTML: { __html: `
|
|
5237
5606
|
.custom-scrollbar::-webkit-scrollbar {
|
|
5238
5607
|
width: 4px;
|
|
5239
5608
|
}
|
|
@@ -5266,11 +5635,11 @@ var PlaylistPanel = ({
|
|
|
5266
5635
|
);
|
|
5267
5636
|
};
|
|
5268
5637
|
var TrackInfo = ({ track, className = "" }) => {
|
|
5269
|
-
return /* @__PURE__ */
|
|
5638
|
+
return /* @__PURE__ */ React24__default.default.createElement("div", { className: `flex flex-col items-center text-center gap-2 ${className}` }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "px-4 py-1.5 bg-black/40 backdrop-blur-md rounded-full border border-white/10 shadow-lg" }, /* @__PURE__ */ React24__default.default.createElement("h2", { className: "text-lg font-bold text-white tracking-wider truncate max-w-md" }, track.title)), /* @__PURE__ */ React24__default.default.createElement("p", { className: "text-sm font-medium text-white/60 drop-shadow-md" }, track.artist || "\u672A\u77E5\u827A\u672F\u5BB6"));
|
|
5270
5639
|
};
|
|
5271
5640
|
|
|
5272
5641
|
// src/mmd/music-player/MMDMusicPlayer.tsx
|
|
5273
|
-
var MMDMusicPlayer =
|
|
5642
|
+
var MMDMusicPlayer = React24.forwardRef(
|
|
5274
5643
|
({
|
|
5275
5644
|
config,
|
|
5276
5645
|
stage,
|
|
@@ -5286,25 +5655,25 @@ var MMDMusicPlayer = React21.forwardRef(
|
|
|
5286
5655
|
style
|
|
5287
5656
|
}, ref) => {
|
|
5288
5657
|
const { tracks: initialTracks, autoPlay = false, defaultLoopMode = "list" } = config;
|
|
5289
|
-
const [tracks, setTracks] =
|
|
5290
|
-
const [currentIndex, setCurrentIndex] =
|
|
5291
|
-
const [isPlaying, setIsPlaying] =
|
|
5292
|
-
const [isLoading, setIsLoading] =
|
|
5293
|
-
const [isTransitioning, setIsTransitioning] =
|
|
5294
|
-
const [currentTime, setCurrentTime] =
|
|
5295
|
-
const [duration, setDuration] =
|
|
5296
|
-
const [loopMode, setLoopMode] =
|
|
5297
|
-
const [showPlaylist, setShowPlaylist] =
|
|
5298
|
-
const [isUIVisible, setIsUIVisible] =
|
|
5299
|
-
const [isCameraManual, setIsCameraManual] =
|
|
5300
|
-
const [searchKeyword, setSearchKeyword] =
|
|
5658
|
+
const [tracks, setTracks] = React24.useState(initialTracks);
|
|
5659
|
+
const [currentIndex, setCurrentIndex] = React24.useState(initialTrackIndex);
|
|
5660
|
+
const [isPlaying, setIsPlaying] = React24.useState(autoPlay);
|
|
5661
|
+
const [isLoading, setIsLoading] = React24.useState(true);
|
|
5662
|
+
const [isTransitioning, setIsTransitioning] = React24.useState(false);
|
|
5663
|
+
const [currentTime, setCurrentTime] = React24.useState(0);
|
|
5664
|
+
const [duration, setDuration] = React24.useState(0);
|
|
5665
|
+
const [loopMode, setLoopMode] = React24.useState(defaultLoopMode);
|
|
5666
|
+
const [showPlaylist, setShowPlaylist] = React24.useState(false);
|
|
5667
|
+
const [isUIVisible, setIsUIVisible] = React24.useState(true);
|
|
5668
|
+
const [isCameraManual, setIsCameraManual] = React24.useState(false);
|
|
5669
|
+
const [searchKeyword, setSearchKeyword] = React24.useState("");
|
|
5301
5670
|
const { search, searchResult, isSearching, getSongUrl } = chunkL5PW2YTI_js.useMusic();
|
|
5302
|
-
|
|
5671
|
+
React24.useEffect(() => {
|
|
5303
5672
|
if (mikuMode && tracks.length === 0) {
|
|
5304
5673
|
search({ keyword: "", miku: true });
|
|
5305
5674
|
}
|
|
5306
5675
|
}, [mikuMode]);
|
|
5307
|
-
|
|
5676
|
+
React24.useEffect(() => {
|
|
5308
5677
|
if (searchResult && searchResult.tracks.length > 0) {
|
|
5309
5678
|
const newTracks = searchResult.tracks.map((t) => ({
|
|
5310
5679
|
id: t.id,
|
|
@@ -5348,12 +5717,12 @@ var MMDMusicPlayer = React21.forwardRef(
|
|
|
5348
5717
|
goToTrack(index, currentTracksList);
|
|
5349
5718
|
}
|
|
5350
5719
|
};
|
|
5351
|
-
const playerRef =
|
|
5352
|
-
const containerRef =
|
|
5353
|
-
const isStartedRef =
|
|
5354
|
-
const uiTimeoutRef =
|
|
5720
|
+
const playerRef = React24.useRef(null);
|
|
5721
|
+
const containerRef = React24.useRef(null);
|
|
5722
|
+
const isStartedRef = React24.useRef(autoPlay);
|
|
5723
|
+
const uiTimeoutRef = React24.useRef(null);
|
|
5355
5724
|
const currentTrack = tracks[currentIndex];
|
|
5356
|
-
const goToTrack =
|
|
5725
|
+
const goToTrack = React24.useCallback(
|
|
5357
5726
|
(index, tracksList = tracks) => {
|
|
5358
5727
|
if (index < 0 || index >= tracksList.length) return;
|
|
5359
5728
|
const track = tracksList[index];
|
|
@@ -5393,7 +5762,7 @@ var MMDMusicPlayer = React21.forwardRef(
|
|
|
5393
5762
|
},
|
|
5394
5763
|
[tracks, currentTrack, isTransitioning, isPlaying, onTrackChange, fixedResources]
|
|
5395
5764
|
);
|
|
5396
|
-
const next =
|
|
5765
|
+
const next = React24.useCallback(() => {
|
|
5397
5766
|
let nextIndex = currentIndex + 1;
|
|
5398
5767
|
if (loopMode === "shuffle") {
|
|
5399
5768
|
nextIndex = Math.floor(Math.random() * tracks.length);
|
|
@@ -5402,14 +5771,14 @@ var MMDMusicPlayer = React21.forwardRef(
|
|
|
5402
5771
|
}
|
|
5403
5772
|
fetchAndGoToTrack(nextIndex);
|
|
5404
5773
|
}, [currentIndex, tracks.length, loopMode, fetchAndGoToTrack]);
|
|
5405
|
-
const previous =
|
|
5774
|
+
const previous = React24.useCallback(() => {
|
|
5406
5775
|
let prevIndex = currentIndex - 1;
|
|
5407
5776
|
if (prevIndex < 0) {
|
|
5408
5777
|
prevIndex = tracks.length - 1;
|
|
5409
5778
|
}
|
|
5410
5779
|
fetchAndGoToTrack(prevIndex);
|
|
5411
5780
|
}, [currentIndex, tracks.length, fetchAndGoToTrack]);
|
|
5412
|
-
|
|
5781
|
+
React24.useImperativeHandle(
|
|
5413
5782
|
ref,
|
|
5414
5783
|
() => ({
|
|
5415
5784
|
play: () => {
|
|
@@ -5436,7 +5805,7 @@ var MMDMusicPlayer = React21.forwardRef(
|
|
|
5436
5805
|
}),
|
|
5437
5806
|
[next, previous, goToTrack, currentIndex, isPlaying, currentTime, duration, loopMode]
|
|
5438
5807
|
);
|
|
5439
|
-
const handleEnded =
|
|
5808
|
+
const handleEnded = React24.useCallback(() => {
|
|
5440
5809
|
if (loopMode === "single") {
|
|
5441
5810
|
playerRef.current?.seek(0);
|
|
5442
5811
|
playerRef.current?.play();
|
|
@@ -5444,7 +5813,7 @@ var MMDMusicPlayer = React21.forwardRef(
|
|
|
5444
5813
|
next();
|
|
5445
5814
|
}
|
|
5446
5815
|
}, [loopMode, next]);
|
|
5447
|
-
const handleTimeUpdate =
|
|
5816
|
+
const handleTimeUpdate = React24.useCallback((time) => {
|
|
5448
5817
|
setCurrentTime(time);
|
|
5449
5818
|
if (playerRef.current) {
|
|
5450
5819
|
const total = playerRef.current.getDuration();
|
|
@@ -5452,7 +5821,7 @@ var MMDMusicPlayer = React21.forwardRef(
|
|
|
5452
5821
|
onProgress?.(time, total);
|
|
5453
5822
|
}
|
|
5454
5823
|
}, [onProgress]);
|
|
5455
|
-
const resetUITimeout =
|
|
5824
|
+
const resetUITimeout = React24.useCallback(() => {
|
|
5456
5825
|
setIsUIVisible(true);
|
|
5457
5826
|
if (uiTimeoutRef.current) clearTimeout(uiTimeoutRef.current);
|
|
5458
5827
|
if (isPlaying) {
|
|
@@ -5461,16 +5830,16 @@ var MMDMusicPlayer = React21.forwardRef(
|
|
|
5461
5830
|
}, 5e3);
|
|
5462
5831
|
}
|
|
5463
5832
|
}, [isPlaying, showPlaylist]);
|
|
5464
|
-
|
|
5833
|
+
React24.useEffect(() => {
|
|
5465
5834
|
resetUITimeout();
|
|
5466
5835
|
return () => {
|
|
5467
5836
|
if (uiTimeoutRef.current) clearTimeout(uiTimeoutRef.current);
|
|
5468
5837
|
};
|
|
5469
5838
|
}, [resetUITimeout]);
|
|
5470
5839
|
if (!currentTrack) {
|
|
5471
|
-
return /* @__PURE__ */
|
|
5840
|
+
return /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex h-full w-full items-center justify-center bg-black text-white" }, "\u64AD\u653E\u5217\u8868\u4E3A\u7A7A");
|
|
5472
5841
|
}
|
|
5473
|
-
return /* @__PURE__ */
|
|
5842
|
+
return /* @__PURE__ */ React24__default.default.createElement(
|
|
5474
5843
|
"div",
|
|
5475
5844
|
{
|
|
5476
5845
|
ref: containerRef,
|
|
@@ -5479,7 +5848,7 @@ var MMDMusicPlayer = React21.forwardRef(
|
|
|
5479
5848
|
onMouseMove: resetUITimeout,
|
|
5480
5849
|
onClick: resetUITimeout
|
|
5481
5850
|
},
|
|
5482
|
-
/* @__PURE__ */
|
|
5851
|
+
/* @__PURE__ */ React24__default.default.createElement(
|
|
5483
5852
|
"div",
|
|
5484
5853
|
{
|
|
5485
5854
|
className: "absolute inset-0 w-full h-full",
|
|
@@ -5489,7 +5858,7 @@ var MMDMusicPlayer = React21.forwardRef(
|
|
|
5489
5858
|
transition: "opacity 0.5s ease-in-out"
|
|
5490
5859
|
}
|
|
5491
5860
|
},
|
|
5492
|
-
!isTransitioning && /* @__PURE__ */
|
|
5861
|
+
!isTransitioning && /* @__PURE__ */ React24__default.default.createElement(
|
|
5493
5862
|
MMDPlayerBase,
|
|
5494
5863
|
{
|
|
5495
5864
|
ref: playerRef,
|
|
@@ -5523,14 +5892,14 @@ var MMDMusicPlayer = React21.forwardRef(
|
|
|
5523
5892
|
}
|
|
5524
5893
|
)
|
|
5525
5894
|
),
|
|
5526
|
-
(isLoading || isTransitioning) && /* @__PURE__ */
|
|
5527
|
-
/* @__PURE__ */
|
|
5895
|
+
(isLoading || isTransitioning) && /* @__PURE__ */ React24__default.default.createElement("div", { className: "absolute inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-md" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex flex-col items-center gap-4" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "h-12 w-12 animate-spin rounded-full border-4 border-white/20 border-t-blue-500" }), /* @__PURE__ */ React24__default.default.createElement("div", { className: "text-white font-medium" }, isTransitioning ? "\u51C6\u5907\u4E0B\u4E00\u9996..." : "\u6B63\u5728\u52A0\u8F7D\u821E\u53F0..."))),
|
|
5896
|
+
/* @__PURE__ */ React24__default.default.createElement(
|
|
5528
5897
|
"div",
|
|
5529
5898
|
{
|
|
5530
5899
|
className: `absolute inset-0 z-10 flex flex-col justify-between transition-opacity duration-700 pointer-events-none ${isUIVisible ? "opacity-100" : "opacity-0"}`
|
|
5531
5900
|
},
|
|
5532
|
-
/* @__PURE__ */
|
|
5533
|
-
/* @__PURE__ */
|
|
5901
|
+
/* @__PURE__ */ React24__default.default.createElement("div", { className: "pt-12 px-8 flex justify-center" }, /* @__PURE__ */ React24__default.default.createElement(TrackInfo, { track: currentTrack })),
|
|
5902
|
+
/* @__PURE__ */ React24__default.default.createElement("div", { className: "pb-12 px-8" }, /* @__PURE__ */ React24__default.default.createElement(
|
|
5534
5903
|
MusicControls,
|
|
5535
5904
|
{
|
|
5536
5905
|
isPlaying,
|
|
@@ -5555,7 +5924,7 @@ var MMDMusicPlayer = React21.forwardRef(
|
|
|
5555
5924
|
}
|
|
5556
5925
|
))
|
|
5557
5926
|
),
|
|
5558
|
-
/* @__PURE__ */
|
|
5927
|
+
/* @__PURE__ */ React24__default.default.createElement(
|
|
5559
5928
|
PlaylistPanel,
|
|
5560
5929
|
{
|
|
5561
5930
|
tracks,
|
|
@@ -5575,7 +5944,7 @@ var MMDMusicPlayer = React21.forwardRef(
|
|
|
5575
5944
|
}
|
|
5576
5945
|
);
|
|
5577
5946
|
MMDMusicPlayer.displayName = "MMDMusicPlayer";
|
|
5578
|
-
var MMDARPlayer =
|
|
5947
|
+
var MMDARPlayer = React24.forwardRef((props, ref) => {
|
|
5579
5948
|
const {
|
|
5580
5949
|
resources,
|
|
5581
5950
|
stage = {},
|
|
@@ -5593,24 +5962,24 @@ var MMDARPlayer = React21.forwardRef((props, ref) => {
|
|
|
5593
5962
|
className,
|
|
5594
5963
|
style
|
|
5595
5964
|
} = props;
|
|
5596
|
-
const videoRef =
|
|
5597
|
-
const playerRef =
|
|
5598
|
-
const streamRef =
|
|
5599
|
-
const [isCameraStarted, setIsCameraStarted] =
|
|
5600
|
-
const [cameraError, setCameraError] =
|
|
5601
|
-
const [facingMode, setFacingMode] =
|
|
5602
|
-
const [isLoading, setIsLoading] =
|
|
5603
|
-
const [isSettingsOpen, setIsSettingsOpen] =
|
|
5604
|
-
const [currentResources, setCurrentResources] =
|
|
5605
|
-
const [tempResources, setTempResources] =
|
|
5606
|
-
|
|
5965
|
+
const videoRef = React24.useRef(null);
|
|
5966
|
+
const playerRef = React24.useRef(null);
|
|
5967
|
+
const streamRef = React24.useRef(null);
|
|
5968
|
+
const [isCameraStarted, setIsCameraStarted] = React24.useState(false);
|
|
5969
|
+
const [cameraError, setCameraError] = React24.useState(null);
|
|
5970
|
+
const [facingMode, setFacingMode] = React24.useState(cameraConfig.facingMode || "user");
|
|
5971
|
+
const [isLoading, setIsLoading] = React24.useState(true);
|
|
5972
|
+
const [isSettingsOpen, setIsSettingsOpen] = React24.useState(false);
|
|
5973
|
+
const [currentResources, setCurrentResources] = React24.useState(resources);
|
|
5974
|
+
const [tempResources, setTempResources] = React24.useState(resources);
|
|
5975
|
+
React24.useEffect(() => {
|
|
5607
5976
|
if (!isSettingsOpen) {
|
|
5608
5977
|
setCurrentResources(resources);
|
|
5609
5978
|
setTempResources(resources);
|
|
5610
5979
|
}
|
|
5611
5980
|
}, [resources, isSettingsOpen]);
|
|
5612
5981
|
const shouldMirror = mirrored !== void 0 ? mirrored : facingMode === "user";
|
|
5613
|
-
const startCamera =
|
|
5982
|
+
const startCamera = React24.useCallback(async (mode = facingMode) => {
|
|
5614
5983
|
try {
|
|
5615
5984
|
setCameraError(null);
|
|
5616
5985
|
if (streamRef.current) {
|
|
@@ -5640,7 +6009,7 @@ var MMDARPlayer = React21.forwardRef((props, ref) => {
|
|
|
5640
6009
|
onCameraError?.(err instanceof Error ? err : new Error(errorMsg));
|
|
5641
6010
|
}
|
|
5642
6011
|
}, [facingMode, cameraConfig, onCameraReady, onCameraError]);
|
|
5643
|
-
const stopCamera =
|
|
6012
|
+
const stopCamera = React24.useCallback(() => {
|
|
5644
6013
|
if (streamRef.current) {
|
|
5645
6014
|
streamRef.current.getTracks().forEach((track) => track.stop());
|
|
5646
6015
|
streamRef.current = null;
|
|
@@ -5650,11 +6019,11 @@ var MMDARPlayer = React21.forwardRef((props, ref) => {
|
|
|
5650
6019
|
}
|
|
5651
6020
|
setIsCameraStarted(false);
|
|
5652
6021
|
}, []);
|
|
5653
|
-
const switchCamera =
|
|
6022
|
+
const switchCamera = React24.useCallback(async () => {
|
|
5654
6023
|
const newMode = facingMode === "user" ? "environment" : "user";
|
|
5655
6024
|
await startCamera(newMode);
|
|
5656
6025
|
}, [facingMode, startCamera]);
|
|
5657
|
-
const snapshot =
|
|
6026
|
+
const snapshot = React24.useCallback(async () => {
|
|
5658
6027
|
if (!videoRef.current || !playerRef.current) return "";
|
|
5659
6028
|
const canvas = document.createElement("canvas");
|
|
5660
6029
|
const video = videoRef.current;
|
|
@@ -5681,25 +6050,25 @@ var MMDARPlayer = React21.forwardRef((props, ref) => {
|
|
|
5681
6050
|
});
|
|
5682
6051
|
return canvas.toDataURL("image/png");
|
|
5683
6052
|
}, [shouldMirror]);
|
|
5684
|
-
|
|
6053
|
+
React24.useImperativeHandle(ref, () => ({
|
|
5685
6054
|
startCamera,
|
|
5686
6055
|
stopCamera,
|
|
5687
6056
|
switchCamera,
|
|
5688
6057
|
snapshot
|
|
5689
6058
|
}));
|
|
5690
|
-
|
|
6059
|
+
React24.useEffect(() => {
|
|
5691
6060
|
if (autoPlay) {
|
|
5692
6061
|
startCamera();
|
|
5693
6062
|
}
|
|
5694
6063
|
return () => stopCamera();
|
|
5695
6064
|
}, [autoPlay, startCamera, stopCamera]);
|
|
5696
|
-
return /* @__PURE__ */
|
|
6065
|
+
return /* @__PURE__ */ React24__default.default.createElement(
|
|
5697
6066
|
"div",
|
|
5698
6067
|
{
|
|
5699
6068
|
className: `relative w-full h-full bg-black overflow-hidden ${className}`,
|
|
5700
6069
|
style
|
|
5701
6070
|
},
|
|
5702
|
-
/* @__PURE__ */
|
|
6071
|
+
/* @__PURE__ */ React24__default.default.createElement(
|
|
5703
6072
|
"video",
|
|
5704
6073
|
{
|
|
5705
6074
|
ref: videoRef,
|
|
@@ -5710,13 +6079,13 @@ var MMDARPlayer = React21.forwardRef((props, ref) => {
|
|
|
5710
6079
|
style: { zIndex: 0 }
|
|
5711
6080
|
}
|
|
5712
6081
|
),
|
|
5713
|
-
/* @__PURE__ */
|
|
6082
|
+
/* @__PURE__ */ React24__default.default.createElement(
|
|
5714
6083
|
"div",
|
|
5715
6084
|
{
|
|
5716
6085
|
className: "absolute inset-0 w-full h-full",
|
|
5717
6086
|
style: { zIndex: 1 }
|
|
5718
6087
|
},
|
|
5719
|
-
/* @__PURE__ */
|
|
6088
|
+
/* @__PURE__ */ React24__default.default.createElement(
|
|
5720
6089
|
MMDPlayerBase,
|
|
5721
6090
|
{
|
|
5722
6091
|
ref: playerRef,
|
|
@@ -5739,45 +6108,45 @@ var MMDARPlayer = React21.forwardRef((props, ref) => {
|
|
|
5739
6108
|
}
|
|
5740
6109
|
)
|
|
5741
6110
|
),
|
|
5742
|
-
/* @__PURE__ */
|
|
6111
|
+
/* @__PURE__ */ React24__default.default.createElement("div", { className: "absolute inset-0 z-10 pointer-events-none flex flex-col justify-between p-6" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex justify-between items-start pointer-events-auto" }, cameraError ? /* @__PURE__ */ React24__default.default.createElement("div", { className: "bg-red-500/80 backdrop-blur-md text-white px-4 py-2 rounded-full flex items-center gap-2 text-sm" }, /* @__PURE__ */ React24__default.default.createElement(lucideReact.AlertCircle, { className: "w-4 h-4" }), cameraError, /* @__PURE__ */ React24__default.default.createElement(
|
|
5743
6112
|
"button",
|
|
5744
6113
|
{
|
|
5745
6114
|
onClick: () => startCamera(),
|
|
5746
6115
|
className: "ml-2 underline"
|
|
5747
6116
|
},
|
|
5748
6117
|
"\u91CD\u8BD5"
|
|
5749
|
-
)) : /* @__PURE__ */
|
|
6118
|
+
)) : /* @__PURE__ */ React24__default.default.createElement("div", { className: "bg-black/40 backdrop-blur-md text-white px-4 py-2 rounded-full flex items-center gap-2 text-sm" }, /* @__PURE__ */ React24__default.default.createElement(lucideReact.Camera, { className: "w-4 h-4 text-green-400" }), isCameraStarted ? "\u5B9E\u666F AR \u6A21\u5F0F\u5DF2\u5F00\u542F" : "\u7B49\u5F85\u6444\u50CF\u5934..."), /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex flex-col gap-2" }, showSettings && /* @__PURE__ */ React24__default.default.createElement(
|
|
5750
6119
|
"button",
|
|
5751
6120
|
{
|
|
5752
6121
|
onClick: () => setIsSettingsOpen(!isSettingsOpen),
|
|
5753
6122
|
className: `p-3 backdrop-blur-md rounded-full text-white transition-all active:scale-95 pointer-events-auto ${isSettingsOpen ? "bg-blue-500" : "bg-white/10 hover:bg-white/20"}`,
|
|
5754
6123
|
title: "\u8BBE\u7F6E\u6A21\u578B\u4E0E\u52A8\u4F5C"
|
|
5755
6124
|
},
|
|
5756
|
-
/* @__PURE__ */
|
|
5757
|
-
), /* @__PURE__ */
|
|
6125
|
+
/* @__PURE__ */ React24__default.default.createElement(lucideReact.Settings, { className: "w-5 h-5" })
|
|
6126
|
+
), /* @__PURE__ */ React24__default.default.createElement(
|
|
5758
6127
|
"button",
|
|
5759
6128
|
{
|
|
5760
6129
|
onClick: switchCamera,
|
|
5761
6130
|
className: "p-3 bg-white/10 hover:bg-white/20 backdrop-blur-md rounded-full text-white transition-all active:scale-95 pointer-events-auto",
|
|
5762
6131
|
title: "\u5207\u6362\u524D\u540E\u6444\u50CF\u5934"
|
|
5763
6132
|
},
|
|
5764
|
-
/* @__PURE__ */
|
|
5765
|
-
), /* @__PURE__ */
|
|
6133
|
+
/* @__PURE__ */ React24__default.default.createElement(lucideReact.RefreshCw, { className: "w-5 h-5" })
|
|
6134
|
+
), /* @__PURE__ */ React24__default.default.createElement(
|
|
5766
6135
|
"button",
|
|
5767
6136
|
{
|
|
5768
6137
|
onClick: isCameraStarted ? stopCamera : () => startCamera(),
|
|
5769
6138
|
className: `p-3 backdrop-blur-md rounded-full text-white transition-all active:scale-95 pointer-events-auto ${isCameraStarted ? "bg-red-500/20 hover:bg-red-500/40" : "bg-green-500/20 hover:bg-green-500/40"}`,
|
|
5770
6139
|
title: isCameraStarted ? "\u5173\u95ED\u6444\u50CF\u5934" : "\u5F00\u542F\u6444\u50CF\u5934"
|
|
5771
6140
|
},
|
|
5772
|
-
isCameraStarted ? /* @__PURE__ */
|
|
5773
|
-
))), isSettingsOpen && /* @__PURE__ */
|
|
6141
|
+
isCameraStarted ? /* @__PURE__ */ React24__default.default.createElement(lucideReact.CameraOff, { className: "w-5 h-5" }) : /* @__PURE__ */ React24__default.default.createElement(lucideReact.Camera, { className: "w-5 h-5" })
|
|
6142
|
+
))), isSettingsOpen && /* @__PURE__ */ React24__default.default.createElement("div", { className: "absolute top-20 right-6 w-80 bg-black/80 backdrop-blur-xl border border-white/10 rounded-2xl p-6 pointer-events-auto shadow-2xl animate-in slide-in-from-right-4 duration-300" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex items-center justify-between mb-6" }, /* @__PURE__ */ React24__default.default.createElement("h3", { className: "text-white font-bold flex items-center gap-2" }, /* @__PURE__ */ React24__default.default.createElement(lucideReact.Settings, { className: "w-4 h-4" }), "\u8D44\u6E90\u8BBE\u7F6E"), /* @__PURE__ */ React24__default.default.createElement(
|
|
5774
6143
|
"button",
|
|
5775
6144
|
{
|
|
5776
6145
|
onClick: () => setIsSettingsOpen(false),
|
|
5777
6146
|
className: "p-1 hover:bg-white/10 rounded-full transition-colors text-white/60"
|
|
5778
6147
|
},
|
|
5779
|
-
/* @__PURE__ */
|
|
5780
|
-
)), /* @__PURE__ */
|
|
6148
|
+
/* @__PURE__ */ React24__default.default.createElement(lucideReact.X, { className: "w-4 h-4" })
|
|
6149
|
+
)), /* @__PURE__ */ React24__default.default.createElement("div", { className: "space-y-4" }, /* @__PURE__ */ React24__default.default.createElement("div", null, /* @__PURE__ */ React24__default.default.createElement("label", { className: "block text-xs font-medium text-white/50 mb-1.5 ml-1 uppercase tracking-wider" }, "\u6A21\u578B\u8DEF\u5F84 (.pmx)"), /* @__PURE__ */ React24__default.default.createElement(
|
|
5781
6150
|
"input",
|
|
5782
6151
|
{
|
|
5783
6152
|
type: "text",
|
|
@@ -5786,7 +6155,7 @@ var MMDARPlayer = React21.forwardRef((props, ref) => {
|
|
|
5786
6155
|
placeholder: "\u8BF7\u8F93\u5165\u6A21\u578B URL...",
|
|
5787
6156
|
className: "w-full bg-white/5 border border-white/10 rounded-xl px-4 py-2.5 text-sm text-white placeholder:text-white/10 focus:outline-none focus:border-blue-500/50 transition-colors"
|
|
5788
6157
|
}
|
|
5789
|
-
)), /* @__PURE__ */
|
|
6158
|
+
)), /* @__PURE__ */ React24__default.default.createElement("div", null, /* @__PURE__ */ React24__default.default.createElement("label", { className: "block text-xs font-medium text-white/50 mb-1.5 ml-1 uppercase tracking-wider" }, "\u52A8\u4F5C\u8DEF\u5F84 (.vmd)"), /* @__PURE__ */ React24__default.default.createElement(
|
|
5790
6159
|
"input",
|
|
5791
6160
|
{
|
|
5792
6161
|
type: "text",
|
|
@@ -5795,7 +6164,7 @@ var MMDARPlayer = React21.forwardRef((props, ref) => {
|
|
|
5795
6164
|
placeholder: "\u8BF7\u8F93\u5165\u52A8\u4F5C URL...",
|
|
5796
6165
|
className: "w-full bg-white/5 border border-white/10 rounded-xl px-4 py-2.5 text-sm text-white placeholder:text-white/10 focus:outline-none focus:border-blue-500/50 transition-colors"
|
|
5797
6166
|
}
|
|
5798
|
-
)), /* @__PURE__ */
|
|
6167
|
+
)), /* @__PURE__ */ React24__default.default.createElement("div", { className: "pt-2" }, /* @__PURE__ */ React24__default.default.createElement(
|
|
5799
6168
|
"button",
|
|
5800
6169
|
{
|
|
5801
6170
|
onClick: () => {
|
|
@@ -5806,9 +6175,9 @@ var MMDARPlayer = React21.forwardRef((props, ref) => {
|
|
|
5806
6175
|
},
|
|
5807
6176
|
className: "w-full bg-blue-500 hover:bg-blue-600 text-white font-bold py-3 rounded-xl flex items-center justify-center gap-2 transition-all active:scale-95 shadow-lg shadow-blue-500/20"
|
|
5808
6177
|
},
|
|
5809
|
-
/* @__PURE__ */
|
|
6178
|
+
/* @__PURE__ */ React24__default.default.createElement(lucideReact.Check, { className: "w-4 h-4" }),
|
|
5810
6179
|
"\u5E94\u7528\u66F4\u6539"
|
|
5811
|
-
)))), isLoading && /* @__PURE__ */
|
|
6180
|
+
)))), isLoading && /* @__PURE__ */ React24__default.default.createElement("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "flex flex-col items-center gap-3" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "w-12 h-12 border-4 border-blue-500/30 border-t-blue-500 rounded-full animate-spin" }), /* @__PURE__ */ React24__default.default.createElement("div", { className: "text-white text-sm font-medium bg-black/40 px-3 py-1 rounded-full backdrop-blur-sm" }, "\u6B63\u5728\u52A0\u8F7D Miku \u8D44\u6E90..."))))
|
|
5812
6181
|
);
|
|
5813
6182
|
});
|
|
5814
6183
|
MMDARPlayer.displayName = "MMDARPlayer";
|
|
@@ -6030,12 +6399,12 @@ var FXViewer = ({
|
|
|
6030
6399
|
onError,
|
|
6031
6400
|
className = ""
|
|
6032
6401
|
}) => {
|
|
6033
|
-
const [effect, setEffect] =
|
|
6034
|
-
const [summary, setSummary] =
|
|
6035
|
-
const [loading, setLoading] =
|
|
6036
|
-
const [error, setError] =
|
|
6037
|
-
const [activeTab, setActiveTab] =
|
|
6038
|
-
|
|
6402
|
+
const [effect, setEffect] = React24.useState(null);
|
|
6403
|
+
const [summary, setSummary] = React24.useState(null);
|
|
6404
|
+
const [loading, setLoading] = React24.useState(true);
|
|
6405
|
+
const [error, setError] = React24.useState(null);
|
|
6406
|
+
const [activeTab, setActiveTab] = React24.useState("summary");
|
|
6407
|
+
React24.useEffect(() => {
|
|
6039
6408
|
const parse = async () => {
|
|
6040
6409
|
try {
|
|
6041
6410
|
setLoading(true);
|
|
@@ -6061,20 +6430,20 @@ var FXViewer = ({
|
|
|
6061
6430
|
parse();
|
|
6062
6431
|
}, [source, isContent, fileName, onParsed, onError]);
|
|
6063
6432
|
if (loading) {
|
|
6064
|
-
return /* @__PURE__ */
|
|
6433
|
+
return /* @__PURE__ */ React24__default.default.createElement("div", { className: `fx-viewer loading ${className}` }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "fx-viewer-spinner" }, "\u52A0\u8F7D\u4E2D..."));
|
|
6065
6434
|
}
|
|
6066
6435
|
if (error || !effect || !summary) {
|
|
6067
|
-
return /* @__PURE__ */
|
|
6436
|
+
return /* @__PURE__ */ React24__default.default.createElement("div", { className: `fx-viewer error ${className}` }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "fx-viewer-error" }, /* @__PURE__ */ React24__default.default.createElement("h3", null, "\u274C \u89E3\u6790\u9519\u8BEF"), /* @__PURE__ */ React24__default.default.createElement("p", null, error || "\u672A\u77E5\u9519\u8BEF")));
|
|
6068
6437
|
}
|
|
6069
6438
|
const validation = validateFXEffect(effect);
|
|
6070
|
-
return /* @__PURE__ */
|
|
6439
|
+
return /* @__PURE__ */ React24__default.default.createElement("div", { className: `fx-viewer ${className}` }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "fx-viewer-header" }, /* @__PURE__ */ React24__default.default.createElement("h2", null, effect.fileName), /* @__PURE__ */ React24__default.default.createElement("p", { className: "fx-viewer-config-summary" }, getConfigSummaryText(effect))), /* @__PURE__ */ React24__default.default.createElement("div", { className: "fx-viewer-tabs" }, /* @__PURE__ */ React24__default.default.createElement(
|
|
6071
6440
|
"button",
|
|
6072
6441
|
{
|
|
6073
6442
|
className: activeTab === "summary" ? "active" : "",
|
|
6074
6443
|
onClick: () => setActiveTab("summary")
|
|
6075
6444
|
},
|
|
6076
6445
|
"\u6458\u8981"
|
|
6077
|
-
), /* @__PURE__ */
|
|
6446
|
+
), /* @__PURE__ */ React24__default.default.createElement(
|
|
6078
6447
|
"button",
|
|
6079
6448
|
{
|
|
6080
6449
|
className: activeTab === "defines" ? "active" : "",
|
|
@@ -6083,7 +6452,7 @@ var FXViewer = ({
|
|
|
6083
6452
|
"\u5B8F\u5B9A\u4E49 (",
|
|
6084
6453
|
summary.defineCount,
|
|
6085
6454
|
")"
|
|
6086
|
-
), /* @__PURE__ */
|
|
6455
|
+
), /* @__PURE__ */ React24__default.default.createElement(
|
|
6087
6456
|
"button",
|
|
6088
6457
|
{
|
|
6089
6458
|
className: activeTab === "textures" ? "active" : "",
|
|
@@ -6092,7 +6461,7 @@ var FXViewer = ({
|
|
|
6092
6461
|
"\u7EB9\u7406 (",
|
|
6093
6462
|
summary.textureCount,
|
|
6094
6463
|
")"
|
|
6095
|
-
), /* @__PURE__ */
|
|
6464
|
+
), /* @__PURE__ */ React24__default.default.createElement(
|
|
6096
6465
|
"button",
|
|
6097
6466
|
{
|
|
6098
6467
|
className: activeTab === "parameters" ? "active" : "",
|
|
@@ -6101,20 +6470,20 @@ var FXViewer = ({
|
|
|
6101
6470
|
"\u53C2\u6570 (",
|
|
6102
6471
|
summary.parameterCount,
|
|
6103
6472
|
")"
|
|
6104
|
-
), /* @__PURE__ */
|
|
6473
|
+
), /* @__PURE__ */ React24__default.default.createElement(
|
|
6105
6474
|
"button",
|
|
6106
6475
|
{
|
|
6107
6476
|
className: activeTab === "validation" ? "active" : "",
|
|
6108
6477
|
onClick: () => setActiveTab("validation")
|
|
6109
6478
|
},
|
|
6110
6479
|
"\u9A8C\u8BC1"
|
|
6111
|
-
)), /* @__PURE__ */
|
|
6480
|
+
)), /* @__PURE__ */ React24__default.default.createElement("div", { className: "fx-viewer-content" }, activeTab === "summary" && /* @__PURE__ */ React24__default.default.createElement(SummaryTab, { summary, effect }), activeTab === "defines" && /* @__PURE__ */ React24__default.default.createElement(DefinesTab, { effect }), activeTab === "textures" && /* @__PURE__ */ React24__default.default.createElement(TexturesTab, { effect }), activeTab === "parameters" && /* @__PURE__ */ React24__default.default.createElement(ParametersTab, { effect }), activeTab === "validation" && /* @__PURE__ */ React24__default.default.createElement(ValidationTab, { validation })));
|
|
6112
6481
|
};
|
|
6113
|
-
var SummaryTab = ({ summary, effect }) => /* @__PURE__ */
|
|
6114
|
-
var DefinesTab = ({ effect }) => /* @__PURE__ */
|
|
6115
|
-
var TexturesTab = ({ effect }) => /* @__PURE__ */
|
|
6116
|
-
var ParametersTab = ({ effect }) => /* @__PURE__ */
|
|
6117
|
-
var ValidationTab = ({ validation }) => /* @__PURE__ */
|
|
6482
|
+
var SummaryTab = ({ summary, effect }) => /* @__PURE__ */ React24__default.default.createElement("div", { className: "fx-tab-summary" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "fx-stats-grid" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "fx-stat-card" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "fx-stat-label" }, "\u5B8F\u5B9A\u4E49"), /* @__PURE__ */ React24__default.default.createElement("div", { className: "fx-stat-value" }, summary.defineCount)), /* @__PURE__ */ React24__default.default.createElement("div", { className: "fx-stat-card" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "fx-stat-label" }, "\u53C2\u6570"), /* @__PURE__ */ React24__default.default.createElement("div", { className: "fx-stat-value" }, summary.parameterCount)), /* @__PURE__ */ React24__default.default.createElement("div", { className: "fx-stat-card" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "fx-stat-label" }, "\u7EB9\u7406"), /* @__PURE__ */ React24__default.default.createElement("div", { className: "fx-stat-value" }, summary.textureCount)), /* @__PURE__ */ React24__default.default.createElement("div", { className: "fx-stat-card" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "fx-stat-label" }, "Technique"), /* @__PURE__ */ React24__default.default.createElement("div", { className: "fx-stat-value" }, summary.techniqueCount))), /* @__PURE__ */ React24__default.default.createElement("div", { className: "fx-features" }, /* @__PURE__ */ React24__default.default.createElement("h3", null, "\u529F\u80FD\u7279\u6027"), /* @__PURE__ */ React24__default.default.createElement("div", { className: "fx-feature-list" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: `fx-feature ${summary.hasLocalShadow ? "enabled" : "disabled"}` }, summary.hasLocalShadow ? "\u2713" : "\u2717", " LocalShadow"), /* @__PURE__ */ React24__default.default.createElement("div", { className: `fx-feature ${summary.hasExcellentShadow ? "enabled" : "disabled"}` }, summary.hasExcellentShadow ? "\u2713" : "\u2717", " ExcellentShadow"), /* @__PURE__ */ React24__default.default.createElement("div", { className: `fx-feature ${summary.hasHgShadow ? "enabled" : "disabled"}` }, summary.hasHgShadow ? "\u2713" : "\u2717", " HgShadow"))), effect.includes.length > 0 && /* @__PURE__ */ React24__default.default.createElement("div", { className: "fx-includes" }, /* @__PURE__ */ React24__default.default.createElement("h3", null, "\u5305\u542B\u6587\u4EF6"), /* @__PURE__ */ React24__default.default.createElement("ul", null, effect.includes.map((inc, idx) => /* @__PURE__ */ React24__default.default.createElement("li", { key: idx }, /* @__PURE__ */ React24__default.default.createElement("code", null, inc))))), effect.controllers.length > 0 && /* @__PURE__ */ React24__default.default.createElement("div", { className: "fx-controllers" }, /* @__PURE__ */ React24__default.default.createElement("h3", null, "\u63A7\u5236\u5668"), /* @__PURE__ */ React24__default.default.createElement("ul", null, effect.controllers.map((ctrl, idx) => /* @__PURE__ */ React24__default.default.createElement("li", { key: idx }, /* @__PURE__ */ React24__default.default.createElement("strong", null, ctrl.name), ": ", ctrl.objectName, " / ", ctrl.itemName)))));
|
|
6483
|
+
var DefinesTab = ({ effect }) => /* @__PURE__ */ React24__default.default.createElement("div", { className: "fx-tab-defines" }, /* @__PURE__ */ React24__default.default.createElement("table", { className: "fx-table" }, /* @__PURE__ */ React24__default.default.createElement("thead", null, /* @__PURE__ */ React24__default.default.createElement("tr", null, /* @__PURE__ */ React24__default.default.createElement("th", null, "\u540D\u79F0"), /* @__PURE__ */ React24__default.default.createElement("th", null, "\u503C"), /* @__PURE__ */ React24__default.default.createElement("th", null, "\u72B6\u6001"), /* @__PURE__ */ React24__default.default.createElement("th", null, "\u884C\u53F7"))), /* @__PURE__ */ React24__default.default.createElement("tbody", null, effect.defines.map((define, idx) => /* @__PURE__ */ React24__default.default.createElement("tr", { key: idx, className: define.isCommented ? "disabled" : "enabled" }, /* @__PURE__ */ React24__default.default.createElement("td", null, /* @__PURE__ */ React24__default.default.createElement("code", null, define.name)), /* @__PURE__ */ React24__default.default.createElement("td", null, define.value || "-"), /* @__PURE__ */ React24__default.default.createElement("td", null, /* @__PURE__ */ React24__default.default.createElement("span", { className: `status-badge ${define.isCommented ? "disabled" : "enabled"}` }, define.isCommented ? "\u7981\u7528" : "\u542F\u7528")), /* @__PURE__ */ React24__default.default.createElement("td", null, define.lineNumber))))));
|
|
6484
|
+
var TexturesTab = ({ effect }) => /* @__PURE__ */ React24__default.default.createElement("div", { className: "fx-tab-textures" }, effect.textures.length === 0 ? /* @__PURE__ */ React24__default.default.createElement("p", { className: "fx-empty-message" }, "\u672A\u627E\u5230\u7EB9\u7406\u5B9A\u4E49") : /* @__PURE__ */ React24__default.default.createElement("table", { className: "fx-table" }, /* @__PURE__ */ React24__default.default.createElement("thead", null, /* @__PURE__ */ React24__default.default.createElement("tr", null, /* @__PURE__ */ React24__default.default.createElement("th", null, "\u540D\u79F0"), /* @__PURE__ */ React24__default.default.createElement("th", null, "\u8DEF\u5F84"), /* @__PURE__ */ React24__default.default.createElement("th", null, "\u5C3A\u5BF8"), /* @__PURE__ */ React24__default.default.createElement("th", null, "\u7528\u9014"))), /* @__PURE__ */ React24__default.default.createElement("tbody", null, effect.textures.map((texture, idx) => /* @__PURE__ */ React24__default.default.createElement("tr", { key: idx }, /* @__PURE__ */ React24__default.default.createElement("td", null, /* @__PURE__ */ React24__default.default.createElement("code", null, texture.name)), /* @__PURE__ */ React24__default.default.createElement("td", null, texture.path), /* @__PURE__ */ React24__default.default.createElement("td", null, texture.width && texture.height ? `${texture.width}\xD7${texture.height}` : "-"), /* @__PURE__ */ React24__default.default.createElement("td", null, texture.purpose || "-"))))));
|
|
6485
|
+
var ParametersTab = ({ effect }) => /* @__PURE__ */ React24__default.default.createElement("div", { className: "fx-tab-parameters" }, /* @__PURE__ */ React24__default.default.createElement("table", { className: "fx-table" }, /* @__PURE__ */ React24__default.default.createElement("thead", null, /* @__PURE__ */ React24__default.default.createElement("tr", null, /* @__PURE__ */ React24__default.default.createElement("th", null, "\u540D\u79F0"), /* @__PURE__ */ React24__default.default.createElement("th", null, "\u7C7B\u578B"), /* @__PURE__ */ React24__default.default.createElement("th", null, "\u8BED\u4E49"), /* @__PURE__ */ React24__default.default.createElement("th", null, "\u9ED8\u8BA4\u503C"), /* @__PURE__ */ React24__default.default.createElement("th", null, "\u884C\u53F7"))), /* @__PURE__ */ React24__default.default.createElement("tbody", null, effect.parameters.map((param, idx) => /* @__PURE__ */ React24__default.default.createElement("tr", { key: idx }, /* @__PURE__ */ React24__default.default.createElement("td", null, /* @__PURE__ */ React24__default.default.createElement("code", null, param.name)), /* @__PURE__ */ React24__default.default.createElement("td", null, /* @__PURE__ */ React24__default.default.createElement("code", null, param.type)), /* @__PURE__ */ React24__default.default.createElement("td", null, param.semantic || "-"), /* @__PURE__ */ React24__default.default.createElement("td", null, param.defaultValue || "-"), /* @__PURE__ */ React24__default.default.createElement("td", null, param.lineNumber))))));
|
|
6486
|
+
var ValidationTab = ({ validation }) => /* @__PURE__ */ React24__default.default.createElement("div", { className: "fx-tab-validation" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: `fx-validation-status ${validation.isValid ? "valid" : "invalid"}` }, /* @__PURE__ */ React24__default.default.createElement("h3", null, validation.isValid ? "\u2713 \u9A8C\u8BC1\u901A\u8FC7" : "\u2717 \u9A8C\u8BC1\u5931\u8D25")), validation.errors.length > 0 && /* @__PURE__ */ React24__default.default.createElement("div", { className: "fx-validation-section fx-errors" }, /* @__PURE__ */ React24__default.default.createElement("h4", null, "\u9519\u8BEF (", validation.errors.length, ")"), /* @__PURE__ */ React24__default.default.createElement("ul", null, validation.errors.map((error, idx) => /* @__PURE__ */ React24__default.default.createElement("li", { key: idx, className: "fx-error-item" }, error)))), validation.warnings.length > 0 && /* @__PURE__ */ React24__default.default.createElement("div", { className: "fx-validation-section fx-warnings" }, /* @__PURE__ */ React24__default.default.createElement("h4", null, "\u8B66\u544A (", validation.warnings.length, ")"), /* @__PURE__ */ React24__default.default.createElement("ul", null, validation.warnings.map((warning, idx) => /* @__PURE__ */ React24__default.default.createElement("li", { key: idx, className: "fx-warning-item" }, warning)))), validation.isValid && validation.warnings.length === 0 && /* @__PURE__ */ React24__default.default.createElement("p", { className: "fx-success-message" }, "FX\u6587\u4EF6\u7ED3\u6784\u5B8C\u6574\uFF0C\u6CA1\u6709\u53D1\u73B0\u95EE\u9898\u3002"));
|
|
6118
6487
|
FXViewer.displayName = "FXViewer";
|
|
6119
6488
|
var FXThreePreview = ({
|
|
6120
6489
|
effect,
|
|
@@ -6123,17 +6492,17 @@ var FXThreePreview = ({
|
|
|
6123
6492
|
className = "",
|
|
6124
6493
|
showInfo = true
|
|
6125
6494
|
}) => {
|
|
6126
|
-
const containerRef =
|
|
6127
|
-
const sceneRef =
|
|
6128
|
-
const rendererRef =
|
|
6129
|
-
const cameraRef =
|
|
6130
|
-
const controlsRef =
|
|
6131
|
-
const animationIdRef =
|
|
6132
|
-
const meshRef =
|
|
6133
|
-
const [loading, setLoading] =
|
|
6134
|
-
const [error, setError] =
|
|
6135
|
-
const [adapterInfo, setAdapterInfo] =
|
|
6136
|
-
|
|
6495
|
+
const containerRef = React24.useRef(null);
|
|
6496
|
+
const sceneRef = React24.useRef(null);
|
|
6497
|
+
const rendererRef = React24.useRef(null);
|
|
6498
|
+
const cameraRef = React24.useRef(null);
|
|
6499
|
+
const controlsRef = React24.useRef(null);
|
|
6500
|
+
const animationIdRef = React24.useRef(null);
|
|
6501
|
+
const meshRef = React24.useRef(null);
|
|
6502
|
+
const [loading, setLoading] = React24.useState(true);
|
|
6503
|
+
const [error, setError] = React24.useState(null);
|
|
6504
|
+
const [adapterInfo, setAdapterInfo] = React24.useState(null);
|
|
6505
|
+
React24.useEffect(() => {
|
|
6137
6506
|
if (!containerRef.current) return;
|
|
6138
6507
|
const init = async () => {
|
|
6139
6508
|
try {
|
|
@@ -6240,12 +6609,12 @@ var FXThreePreview = ({
|
|
|
6240
6609
|
};
|
|
6241
6610
|
}, [effect, texturePath, objectType]);
|
|
6242
6611
|
if (loading) {
|
|
6243
|
-
return /* @__PURE__ */
|
|
6612
|
+
return /* @__PURE__ */ React24__default.default.createElement("div", { className: `fx-three-preview loading ${className}` }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "preview-loading" }, "\u52A0\u8F7D\u4E2D..."));
|
|
6244
6613
|
}
|
|
6245
6614
|
if (error) {
|
|
6246
|
-
return /* @__PURE__ */
|
|
6615
|
+
return /* @__PURE__ */ React24__default.default.createElement("div", { className: `fx-three-preview error ${className}` }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "preview-error" }, /* @__PURE__ */ React24__default.default.createElement("h3", null, "\u274C \u6E32\u67D3\u5931\u8D25"), /* @__PURE__ */ React24__default.default.createElement("p", null, error)));
|
|
6247
6616
|
}
|
|
6248
|
-
return /* @__PURE__ */
|
|
6617
|
+
return /* @__PURE__ */ React24__default.default.createElement("div", { className: `fx-three-preview ${className}` }, /* @__PURE__ */ React24__default.default.createElement(
|
|
6249
6618
|
"div",
|
|
6250
6619
|
{
|
|
6251
6620
|
ref: containerRef,
|
|
@@ -6257,7 +6626,7 @@ var FXThreePreview = ({
|
|
|
6257
6626
|
position: "relative"
|
|
6258
6627
|
}
|
|
6259
6628
|
}
|
|
6260
|
-
), showInfo && adapterInfo && /* @__PURE__ */
|
|
6629
|
+
), showInfo && adapterInfo && /* @__PURE__ */ React24__default.default.createElement("div", { className: "preview-info" }, /* @__PURE__ */ React24__default.default.createElement("div", { className: "info-section" }, /* @__PURE__ */ React24__default.default.createElement("h4", null, "\u{1F3A8} \u5E94\u7528\u7684FX\u53C2\u6570"), /* @__PURE__ */ React24__default.default.createElement("div", { className: "info-badges" }, /* @__PURE__ */ React24__default.default.createElement("span", { className: "badge" }, adapterInfo.materialParams.length, " \u4E2A\u6750\u8D28\u53C2\u6570"), /* @__PURE__ */ React24__default.default.createElement("span", { className: "badge" }, adapterInfo.textures.length, " \u4E2A\u7EB9\u7406"), /* @__PURE__ */ React24__default.default.createElement("span", { className: "badge" }, adapterInfo.renderFeatures.length, " \u4E2A\u6E32\u67D3\u7279\u6027"))), adapterInfo.renderFeatures.length > 0 && /* @__PURE__ */ React24__default.default.createElement("div", { className: "info-section" }, /* @__PURE__ */ React24__default.default.createElement("h5", null, "\u542F\u7528\u7684\u7279\u6027:"), /* @__PURE__ */ React24__default.default.createElement("div", { className: "feature-list" }, adapterInfo.renderFeatures.map((feature, idx) => /* @__PURE__ */ React24__default.default.createElement("span", { key: idx, className: "feature-tag" }, feature))))), /* @__PURE__ */ React24__default.default.createElement("style", null, `
|
|
6261
6630
|
.fx-three-preview {
|
|
6262
6631
|
display: flex;
|
|
6263
6632
|
flex-direction: column;
|
|
@@ -6357,6 +6726,8 @@ var FXThreePreview = ({
|
|
|
6357
6726
|
};
|
|
6358
6727
|
FXThreePreview.displayName = "FXThreePreview";
|
|
6359
6728
|
|
|
6729
|
+
exports.CheerButton = CheerButton;
|
|
6730
|
+
exports.CheerParticles = CheerParticles;
|
|
6360
6731
|
exports.ChoiceMenu = ChoiceMenu;
|
|
6361
6732
|
exports.DialogueBox = DialogueBox;
|
|
6362
6733
|
exports.FXParser = FXParser;
|
|
@@ -6367,6 +6738,7 @@ exports.HLSLToGLSLConverter = HLSLToGLSLConverter;
|
|
|
6367
6738
|
exports.HistoryPanel = HistoryPanel;
|
|
6368
6739
|
exports.LoadingOverlay = LoadingOverlay;
|
|
6369
6740
|
exports.LoadingScreen = LoadingScreen;
|
|
6741
|
+
exports.LoopConfirmDialog = LoopConfirmDialog;
|
|
6370
6742
|
exports.MMDARPlayer = MMDARPlayer;
|
|
6371
6743
|
exports.MMDMusicPlayer = MMDMusicPlayer;
|
|
6372
6744
|
exports.MMDPlayerBase = MMDPlayerBase;
|