diff --git a/client/src/components/ConfirmDeleteDialog.tsx b/client/src/components/ConfirmDeleteDialog.tsx index 6a47144..ede65f2 100644 --- a/client/src/components/ConfirmDeleteDialog.tsx +++ b/client/src/components/ConfirmDeleteDialog.tsx @@ -1,4 +1,4 @@ -import React from 'react' +import React, { useState, useEffect } from 'react' import { X, AlertTriangle, Folder, Trash2 } from 'lucide-react' interface ConfirmDeleteDialogProps { @@ -17,26 +17,54 @@ export const ConfirmDeleteDialog: React.FC = ({ onCancel }) => { const [deleteDirectory, setDeleteDirectory] = React.useState(false) + const [isVisible, setIsVisible] = useState(false) + const [isAnimating, setIsAnimating] = useState(false) - if (!isOpen) return null + useEffect(() => { + if (isOpen) { + setIsVisible(true) + setTimeout(() => setIsAnimating(true), 10) + } else { + setIsAnimating(false) + setTimeout(() => setIsVisible(false), 200) + } + }, [isOpen]) + + const handleCancel = () => { + setIsAnimating(false) + setTimeout(() => { + onCancel() + }, 200) + } const handleConfirm = () => { - onConfirm(deleteDirectory) + setIsAnimating(false) + setTimeout(() => { + onConfirm(deleteDirectory) + }, 200) } + if (!isVisible) return null + + + return (
{/* 背景遮罩 */}
{/* 对话框内容 */} -
+
{/* 关闭按钮 */}
-
-
- ))} + ) + })}
) } diff --git a/client/src/index.css b/client/src/index.css index 1806528..b035fbe 100644 --- a/client/src/index.css +++ b/client/src/index.css @@ -264,6 +264,65 @@ font-family: 'Consolas', 'Monaco', 'Courier New', monospace; } +/* 通知动画 */ +@keyframes slideInRight { + from { + transform: translateX(100%); + opacity: 0; + } + to { + transform: translateX(0); + opacity: 1; + } +} + +@keyframes slideOutRight { + from { + transform: translateX(0); + opacity: 1; + } + to { + transform: translateX(100%); + opacity: 0; + } +} + +.animate-slide-in-right { + animation: slideInRight 0.3s ease-out forwards; +} + +.animate-slide-out-right { + animation: slideOutRight 0.3s ease-in forwards; +} + +@keyframes fadeIn { + from { + opacity: 0; + } + to { + opacity: 1; + } +} + +@keyframes scaleIn { + from { + transform: scale(0.95); + opacity: 0; + } + to { + transform: scale(1); + opacity: 1; + } +} + +.animate-fade-in { + animation: fadeIn 0.2s ease-out forwards; +} + +.animate-scale-in { + animation: scaleIn 0.3s ease-out forwards; +} + /* 游戏字体 - 使用系统字体 */ .font-game { font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; diff --git a/client/src/pages/GameDeploymentPage.tsx b/client/src/pages/GameDeploymentPage.tsx index 1d90728..aaa8594 100644 --- a/client/src/pages/GameDeploymentPage.tsx +++ b/client/src/pages/GameDeploymentPage.tsx @@ -1264,8 +1264,8 @@ const GameDeploymentPage: React.FC = () => { {/* 安装配置对话框 */} {showInstallModal && selectedGame && ( -
-
+
+

安装 {selectedGame.info.game_nameCN} @@ -1404,8 +1404,8 @@ const GameDeploymentPage: React.FC = () => { {/* 创建Minecraft实例对话框 */} {showCreateInstanceModal && downloadResult && ( -
-
+
+

创建Minecraft实例 diff --git a/client/src/pages/InstanceManagerPage.tsx b/client/src/pages/InstanceManagerPage.tsx index 9e07043..25713a3 100644 --- a/client/src/pages/InstanceManagerPage.tsx +++ b/client/src/pages/InstanceManagerPage.tsx @@ -742,8 +742,8 @@ const InstanceManagerPage: React.FC = () => { {/* 创建/编辑实例模态框 */} {showCreateModal && ( -
-
+
+

{editingInstance ? '编辑实例' : '创建实例'}

@@ -855,8 +855,8 @@ const InstanceManagerPage: React.FC = () => { {/* 安装实例模态框 */} {showInstallModal && selectedMarketInstance && ( -
-
+
+

安装实例: {selectedMarketInstance.name}

diff --git a/client/src/pages/ScheduledTasksPage.tsx b/client/src/pages/ScheduledTasksPage.tsx index 1ba9002..e64fc90 100644 --- a/client/src/pages/ScheduledTasksPage.tsx +++ b/client/src/pages/ScheduledTasksPage.tsx @@ -390,8 +390,8 @@ const ScheduledTasksPage: React.FC = () => { {/* 新建/编辑任务模态框 */} {showModal && ( -
-
+
+

{editingTask ? '编辑任务' : '新建任务'}