forked from CarrotSkin/carrotskin
fix: update dependencies and improve animation transitions
- Updated @types/react to version 19.2.7 in package.json and package-lock.json. - Refined animation transitions in EnhancedButton, EnhancedInput, LoadingStates, Navbar, PageTransition, SkinCard, SkinDetailModal, and SkinViewer components by removing unnecessary ease properties for smoother animations. - Added size prop to EnhancedInput for better customization. - Enhanced SkinDetailModal and SkinCard styles for improved UI consistency.
This commit is contained in:
@@ -16,6 +16,7 @@ interface SkinViewerProps {
|
||||
jumping?: boolean; // 新增:跳跃动画
|
||||
rotation?: boolean; // 新增:旋转控制
|
||||
isExternalPreview?: boolean; // 新增:是否为外部预览
|
||||
onImageLoaded?: () => void; // 新增:图片加载完成回调
|
||||
}
|
||||
|
||||
export default function SkinViewer({
|
||||
@@ -31,6 +32,7 @@ export default function SkinViewer({
|
||||
jumping = false,
|
||||
rotation = true,
|
||||
isExternalPreview = false, // 新增:默认为false
|
||||
onImageLoaded, // 新增:图片加载完成回调
|
||||
}: SkinViewerProps) {
|
||||
const canvasRef = useRef<HTMLCanvasElement>(null);
|
||||
const viewerRef = useRef<SkinViewer3D | null>(null);
|
||||
@@ -53,6 +55,9 @@ export default function SkinViewer({
|
||||
console.log('皮肤图片加载成功:', skinUrl);
|
||||
setImageLoaded(true);
|
||||
setIsLoading(false);
|
||||
if (onImageLoaded) {
|
||||
onImageLoaded();
|
||||
}
|
||||
};
|
||||
|
||||
img.onerror = (error) => {
|
||||
|
||||
Reference in New Issue
Block a user