实现完美的浮动通知系统

- 添加自定义通知组件替代阻塞式alert
- 浮动定位不影响页面布局,宽度自适应内容
- 支持成功/错误两种样式,渐变背景+阴影效果
- 实现完整的淡入淡出动画,原地显示隐藏
- 重启提示显示4秒,普通操作反馈2-3秒
- 智能定时器管理,支持动画完成后清理

用户体验:切换供应商后优雅提示"请重启Claude Code终端以生效"
This commit is contained in:
farion1231
2025-08-06 16:16:09 +08:00
parent 6c7d4c158f
commit e87f206905
2 changed files with 111 additions and 13 deletions

View File

@@ -88,4 +88,64 @@
.browse-btn:hover {
background: #2980b9;
}
/* 供应商列表区域 - 相对定位容器 */
.provider-section {
position: relative;
}
/* 浮动通知 - 绝对定位,不占据空间 */
.notification-floating {
position: absolute;
top: -10px;
left: 50%;
transform: translateX(-50%);
z-index: 100;
padding: 0.75rem 1.25rem;
border-radius: 6px;
font-size: 0.9rem;
font-weight: 500;
width: fit-content;
white-space: nowrap;
}
.fade-in {
animation: fadeIn 0.3s ease-out;
}
.fade-out {
animation: fadeOut 0.3s ease-out;
}
.notification-success {
background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
color: white;
box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}
.notification-error {
background: linear-gradient(135deg, #e74c3c 0%, #ec7063 100%);
color: white;
box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@keyframes fadeOut {
from {
opacity: 1;
}
to {
opacity: 0;
}
}