修复 #389 ;并优化了引导页面

This commit is contained in:
cc
2026-03-14 22:23:10 +08:00
parent 0a23ed6ef4
commit 641abc57b9
8 changed files with 274 additions and 67 deletions

View File

@@ -0,0 +1,123 @@
.confirm-dialog-overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
backdrop-filter: blur(4px);
display: flex;
align-items: center;
justify-content: center;
z-index: 100;
animation: fadeIn 0.2s ease-out;
.confirm-dialog {
width: 480px;
background: var(--bg-primary);
border-radius: 20px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
position: relative;
animation: slideUp 0.2s ease-out;
overflow: hidden;
.close-btn {
position: absolute;
top: 16px;
right: 16px;
background: rgba(0, 0, 0, 0.05);
border: none;
color: var(--text-secondary);
cursor: pointer;
width: 32px;
height: 32px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s;
&:hover {
background: rgba(0, 0, 0, 0.1);
color: var(--text-primary);
}
}
.dialog-title {
padding: 40px 40px 16px;
font-size: 18px;
font-weight: 600;
color: var(--text-primary);
}
.dialog-content {
padding: 0 40px 24px;
p {
font-size: 15px;
color: var(--text-primary);
line-height: 1.6;
margin: 0 0 16px 0;
&:last-child {
margin-bottom: 0;
}
}
}
.dialog-actions {
padding: 0 40px 40px;
display: flex;
justify-content: flex-end;
gap: 12px;
button {
padding: 12px 24px;
border-radius: 12px;
font-size: 15px;
font-weight: 600;
cursor: pointer;
transition: all 0.2s;
border: none;
&.btn-cancel {
background: var(--bg-tertiary);
color: var(--text-secondary);
&:hover {
background: var(--bg-hover);
}
}
&.btn-confirm {
background: var(--primary);
color: var(--on-primary);
&:hover {
background: var(--primary-hover);
}
&:active {
transform: scale(0.98);
}
}
}
}
}
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
@keyframes slideUp {
from {
transform: translateY(20px);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
}

View File

@@ -0,0 +1,32 @@
import { X } from 'lucide-react'
import './ConfirmDialog.scss'
interface ConfirmDialogProps {
open: boolean
title?: string
message: string
onConfirm: () => void
onCancel: () => void
}
export default function ConfirmDialog({ open, title, message, onConfirm, onCancel }: ConfirmDialogProps) {
if (!open) return null
return (
<div className="confirm-dialog-overlay" onClick={onCancel}>
<div className="confirm-dialog" onClick={e => e.stopPropagation()}>
<button className="close-btn" onClick={onCancel}>
<X size={20} />
</button>
{title && <div className="dialog-title">{title}</div>}
<div className="dialog-content">
<p style={{ whiteSpace: 'pre-line' }}>{message}</p>
</div>
<div className="dialog-actions">
<button className="btn-cancel" onClick={onCancel}></button>
<button className="btn-confirm" onClick={onConfirm}></button>
</div>
</div>
</div>
)
}