main #4

Merged
lan merged 8 commits from uNagi/carrotskin:main into main 2026-01-11 18:54:01 +08:00
2 changed files with 20 additions and 14 deletions
Showing only changes of commit d7e627a8db - Show all commits

View File

@@ -146,7 +146,7 @@ export default function SkinCard({
}} }}
> >
{/* 3D预览区域 */} {/* 3D预览区域 */}
<div className="relative aspect-square bg-gradient-to-br from-orange-50 to-amber-50 dark:from-gray-700 dark:to-gray-600 overflow-hidden"> <div className="relative aspect-square bg-gradient-to-br from-orange-100 to-amber-100 dark:from-gray-600 dark:to-gray-500 overflow-hidden">
{/* 加载状态 */} {/* 加载状态 */}
<AnimatePresence> <AnimatePresence>
{!imageLoaded && ( {!imageLoaded && (
@@ -171,6 +171,7 @@ export default function SkinCard({
</AnimatePresence> </AnimatePresence>
{texture.type === 'SKIN' ? ( {texture.type === 'SKIN' ? (
<div className="relative w-full h-full bg-white dark:bg-gray-800">
<SkinViewer <SkinViewer
skinUrl={texture.url} skinUrl={texture.url}
isSlim={texture.is_slim} isSlim={texture.is_slim}
@@ -183,6 +184,7 @@ export default function SkinCard({
walking={false} walking={false}
onImageLoaded={() => setImageLoaded(true)} onImageLoaded={() => setImageLoaded(true)}
/> />
</div>
) : ( ) : (
<div className="absolute inset-0 flex items-center justify-center"> <div className="absolute inset-0 flex items-center justify-center">
<motion.div <motion.div
@@ -208,7 +210,7 @@ export default function SkinCard({
initial={{ opacity: 0 }} initial={{ opacity: 0 }}
animate={{ opacity: isHovered ? 1 : 0 }} animate={{ opacity: isHovered ? 1 : 0 }}
transition={{ duration: 0.3 }} transition={{ duration: 0.3 }}
className="absolute inset-0 bg-gradient-to-br from-black/40 via-black/30 to-transparent flex items-center justify-center" className="absolute inset-0 bg-gradient-to-br from-black/10 via-black/5 to-transparent flex items-center justify-center"
> >
<div className="flex gap-3"> <div className="flex gap-3">
<motion.button <motion.button

View File

@@ -101,6 +101,10 @@ export default function SkinViewer({
viewer.background = null; // 透明背景 viewer.background = null; // 透明背景
viewer.autoRotate = false; // 完全禁用自动旋转 viewer.autoRotate = false; // 完全禁用自动旋转
// 调整光照设置,避免皮肤发黑
viewer.globalLight.intensity = 0.8; // 增加环境光强度
viewer.cameraLight.intensity = 0.4; // 降低相机光源强度,避免过强的阴影
// 外部预览时禁用所有动画和旋转 // 外部预览时禁用所有动画和旋转
if (isExternalPreview) { if (isExternalPreview) {
viewer.autoRotate = false; viewer.autoRotate = false;