|
@@ -1,113 +1,315 @@
|
|
|
-// 层级与断点
|
|
|
-$z-index-backdrop: 9990;
|
|
|
-$z-index-modal: 9991;
|
|
|
-$z-index-toast: 1050;
|
|
|
-
|
|
|
-$mobile: 768px;
|
|
|
-$tablet: 1024px;
|
|
|
-
|
|
|
-.gp-backdrop {
|
|
|
- position: fixed;
|
|
|
- inset: 0;
|
|
|
- background: rgba(0,0,0,0.5);
|
|
|
- backdrop-filter: blur(2px);
|
|
|
- z-index: $z-index-backdrop;
|
|
|
-}
|
|
|
+// 全局提示组件样式
|
|
|
+.gp-container {
|
|
|
+ // 基础层级定义
|
|
|
+ $z-index-backdrop: 10000;
|
|
|
+ $z-index-modal: 10001;
|
|
|
+ $z-index-toast: 10002;
|
|
|
|
|
|
-.gp-modal {
|
|
|
- position: fixed;
|
|
|
- top: 50%;
|
|
|
- left: 50%;
|
|
|
- transform: translate(-50%, -50%);
|
|
|
- z-index: $z-index-modal;
|
|
|
- width: min(560px, 90vw);
|
|
|
- background: #fff;
|
|
|
- border-radius: 16px;
|
|
|
- box-shadow: 0 24px 64px rgba(0,0,0,0.18);
|
|
|
- overflow: hidden;
|
|
|
-}
|
|
|
+ // 全屏模式背景遮罩
|
|
|
+ .gp-backdrop {
|
|
|
+ position: fixed;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+ bottom: 0;
|
|
|
+ z-index: $z-index-backdrop;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ transition: all 0.3s ease;
|
|
|
+
|
|
|
+ &.gp-backdrop-visible {
|
|
|
+ background: rgba(0, 0, 0, 0.5);
|
|
|
+ backdrop-filter: blur(4px);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
-.gp-header {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- gap: 12px;
|
|
|
- padding: 16px 20px;
|
|
|
- border-bottom: 1px solid #eee;
|
|
|
-}
|
|
|
+ // 模态框背景遮罩
|
|
|
+ .gp-modal-backdrop {
|
|
|
+ background: rgba(0, 0, 0, 0.6);
|
|
|
+ backdrop-filter: blur(2px);
|
|
|
+ }
|
|
|
|
|
|
-.gp-icon {
|
|
|
- width: 24px;
|
|
|
- height: 24px;
|
|
|
- border-radius: 50%;
|
|
|
- &.success { background: #10B981; }
|
|
|
- &.info { background: #3B82F6; }
|
|
|
- &.warning { background: #F59E0B; }
|
|
|
-}
|
|
|
+ // 全屏模式模态框
|
|
|
+ .gp-modal {
|
|
|
+ position: relative;
|
|
|
+ background: white;
|
|
|
+ border-radius: 12px;
|
|
|
+ box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
|
|
+ max-width: 90vw;
|
|
|
+ max-height: 90vh;
|
|
|
+ overflow: hidden;
|
|
|
+ animation: modalSlideIn 0.3s ease-out;
|
|
|
+
|
|
|
+ &.gp-modal-dialog {
|
|
|
+ min-width: 320px;
|
|
|
+ }
|
|
|
|
|
|
-.gp-title {
|
|
|
- font-size: 16px;
|
|
|
- font-weight: 600;
|
|
|
- color: #1f2937;
|
|
|
-}
|
|
|
+ .gp-header {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding: 20px 24px 16px;
|
|
|
+ border-bottom: 1px solid #f1f5f9;
|
|
|
|
|
|
-.gp-close {
|
|
|
- margin-left: auto;
|
|
|
- border: none;
|
|
|
- background: transparent;
|
|
|
- font-size: 18px;
|
|
|
- line-height: 1;
|
|
|
- cursor: pointer;
|
|
|
- color: #6b7280;
|
|
|
-}
|
|
|
+ .gp-title {
|
|
|
+ margin: 0;
|
|
|
+ font-size: 18px;
|
|
|
+ font-weight: 600;
|
|
|
+ color: #1e293b;
|
|
|
+ }
|
|
|
|
|
|
-.gp-content {
|
|
|
- padding: 16px 20px;
|
|
|
- color: #374151;
|
|
|
- font-size: 14px;
|
|
|
-}
|
|
|
+ .gp-close-btn {
|
|
|
+ background: none;
|
|
|
+ border: none;
|
|
|
+ padding: 4px;
|
|
|
+ cursor: pointer;
|
|
|
+ color: #64748b;
|
|
|
+ border-radius: 4px;
|
|
|
+ transition: all 0.2s ease;
|
|
|
|
|
|
-.gp-actions {
|
|
|
- display: flex;
|
|
|
- justify-content: flex-end;
|
|
|
- gap: 8px;
|
|
|
- padding: 0 20px 16px 20px;
|
|
|
-}
|
|
|
+ &:hover {
|
|
|
+ background: #f1f5f9;
|
|
|
+ color: #334155;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
-.btn-primary {
|
|
|
- padding: 8px 14px;
|
|
|
- border-radius: 8px;
|
|
|
- border: none;
|
|
|
- background: #007aff;
|
|
|
- color: #fff;
|
|
|
- cursor: pointer;
|
|
|
-}
|
|
|
+ .gp-content {
|
|
|
+ padding: 20px 24px;
|
|
|
+ text-align: center;
|
|
|
|
|
|
-.gp-toast {
|
|
|
- position: fixed;
|
|
|
- z-index: $z-index-toast;
|
|
|
- &.top-right { top: 16px; right: 16px; }
|
|
|
- &.bottom-right { bottom: 16px; right: 16px; }
|
|
|
-}
|
|
|
+ &.gp-modal-content {
|
|
|
+ text-align: left;
|
|
|
+ min-height: 60px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .gp-icon {
|
|
|
+ margin-bottom: 16px;
|
|
|
+
|
|
|
+ &.text-green-500 { color: #22c55e; }
|
|
|
+ &.text-blue-500 { color: #3b82f6; }
|
|
|
+ &.text-orange-500 { color: #f97316; }
|
|
|
+ &.text-red-500 { color: #ef4444; }
|
|
|
+ }
|
|
|
+
|
|
|
+ .gp-message {
|
|
|
+ font-size: 16px;
|
|
|
+ line-height: 1.5;
|
|
|
+ color: #475569;
|
|
|
+ margin: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .gp-actions {
|
|
|
+ padding: 16px 24px 20px;
|
|
|
+ display: flex;
|
|
|
+ gap: 12px;
|
|
|
+ justify-content: flex-end;
|
|
|
+
|
|
|
+ .gp-action-btn {
|
|
|
+ padding: 10px 20px;
|
|
|
+ border-radius: 6px;
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: 500;
|
|
|
+ cursor: pointer;
|
|
|
+ transition: all 0.2s ease;
|
|
|
+ border: 1px solid transparent;
|
|
|
+
|
|
|
+ &.gp-btn-primary {
|
|
|
+ background: #3b82f6;
|
|
|
+ color: white;
|
|
|
+
|
|
|
+ &:hover {
|
|
|
+ background: #2563eb;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ &.gp-btn-secondary {
|
|
|
+ background: #f8fafc;
|
|
|
+ color: #64748b;
|
|
|
+ border-color: #e2e8f0;
|
|
|
+
|
|
|
+ &:hover {
|
|
|
+ background: #f1f5f9;
|
|
|
+ color: #475569;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 角落提示模式
|
|
|
+ .gp-toast {
|
|
|
+ position: fixed;
|
|
|
+ z-index: $z-index-toast;
|
|
|
+ background: white;
|
|
|
+ border-radius: 8px;
|
|
|
+ box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
|
|
|
+ border: 1px solid #e2e8f0;
|
|
|
+ overflow: hidden;
|
|
|
+ animation: toastSlideIn 0.3s ease-out;
|
|
|
+ max-width: 400px;
|
|
|
+ min-width: 300px;
|
|
|
+
|
|
|
+ .gp-toast-content {
|
|
|
+ display: flex;
|
|
|
+ align-items: flex-start;
|
|
|
+ padding: 16px;
|
|
|
+ gap: 12px;
|
|
|
+
|
|
|
+ .gp-toast-icon {
|
|
|
+ flex-shrink: 0;
|
|
|
+ margin-top: 2px;
|
|
|
+
|
|
|
+ &.text-green-500 { color: #22c55e; }
|
|
|
+ &.text-blue-500 { color: #3b82f6; }
|
|
|
+ &.text-orange-500 { color: #f97316; }
|
|
|
+ &.text-red-500 { color: #ef4444; }
|
|
|
+ }
|
|
|
+
|
|
|
+ .gp-toast-text {
|
|
|
+ flex: 1;
|
|
|
+ min-width: 0;
|
|
|
+
|
|
|
+ .gp-toast-title {
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: 600;
|
|
|
+ color: #1e293b;
|
|
|
+ margin-bottom: 4px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .gp-toast-message {
|
|
|
+ font-size: 13px;
|
|
|
+ color: #64748b;
|
|
|
+ line-height: 1.4;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .gp-toast-close {
|
|
|
+ background: none;
|
|
|
+ border: none;
|
|
|
+ padding: 2px;
|
|
|
+ cursor: pointer;
|
|
|
+ color: #94a3b8;
|
|
|
+ border-radius: 4px;
|
|
|
+ transition: all 0.2s ease;
|
|
|
+ flex-shrink: 0;
|
|
|
+
|
|
|
+ &:hover {
|
|
|
+ background: #f1f5f9;
|
|
|
+ color: #64748b;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 尺寸变体
|
|
|
+ .gp-size-small {
|
|
|
+ &.gp-modal {
|
|
|
+ .gp-header { padding: 16px 20px 12px; }
|
|
|
+ .gp-content { padding: 16px 20px; }
|
|
|
+ .gp-actions { padding: 12px 20px 16px; }
|
|
|
+ .gp-title { font-size: 16px; }
|
|
|
+ .gp-message { font-size: 14px; }
|
|
|
+ }
|
|
|
+
|
|
|
+ &.gp-toast {
|
|
|
+ min-width: 250px;
|
|
|
+ .gp-toast-content { padding: 12px; }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .gp-size-medium {
|
|
|
+ // 默认尺寸,已在上面定义
|
|
|
+ }
|
|
|
+
|
|
|
+ .gp-size-large {
|
|
|
+ &.gp-modal {
|
|
|
+ .gp-header { padding: 24px 28px 20px; }
|
|
|
+ .gp-content { padding: 24px 28px; }
|
|
|
+ .gp-actions { padding: 20px 28px 24px; }
|
|
|
+ .gp-title { font-size: 20px; }
|
|
|
+ .gp-message { font-size: 18px; }
|
|
|
+ }
|
|
|
+
|
|
|
+ &.gp-toast {
|
|
|
+ min-width: 350px;
|
|
|
+ .gp-toast-content { padding: 20px; }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 位置变体
|
|
|
+ .gp-position-top-right {
|
|
|
+ top: 20px;
|
|
|
+ right: 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .gp-position-bottom-right {
|
|
|
+ bottom: 20px;
|
|
|
+ right: 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .gp-position-top-left {
|
|
|
+ top: 20px;
|
|
|
+ left: 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .gp-position-bottom-left {
|
|
|
+ bottom: 20px;
|
|
|
+ left: 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 响应式调整
|
|
|
+ @media (max-width: 640px) {
|
|
|
+ .gp-modal {
|
|
|
+ margin: 16px;
|
|
|
+ max-width: calc(100vw - 32px);
|
|
|
+
|
|
|
+ .gp-header, .gp-content, .gp-actions {
|
|
|
+ padding-left: 20px;
|
|
|
+ padding-right: 20px;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
-.gp-toast-inner {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- gap: 12px;
|
|
|
- background: #fff;
|
|
|
- border: 1px solid #e5e7eb;
|
|
|
- box-shadow: 0 8px 24px rgba(0,0,0,0.12);
|
|
|
- border-radius: 12px;
|
|
|
- padding: 12px 14px;
|
|
|
- min-width: 280px;
|
|
|
+ .gp-toast {
|
|
|
+ left: 16px !important;
|
|
|
+ right: 16px !important;
|
|
|
+ max-width: none;
|
|
|
+ min-width: 0;
|
|
|
+
|
|
|
+ &.gp-position-top-right,
|
|
|
+ &.gp-position-top-left {
|
|
|
+ top: 16px;
|
|
|
+ }
|
|
|
+
|
|
|
+ &.gp-position-bottom-right,
|
|
|
+ &.gp-position-bottom-left {
|
|
|
+ bottom: 16px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
-.gp-texts {
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- .gp-title { font-size: 14px; font-weight: 600; color: #111827; }
|
|
|
- .gp-content { font-size: 12px; color: #4b5563; padding: 0; }
|
|
|
+// 动画定义
|
|
|
+@keyframes modalSlideIn {
|
|
|
+ from {
|
|
|
+ opacity: 0;
|
|
|
+ transform: scale(0.95) translateY(-10px);
|
|
|
+ }
|
|
|
+ to {
|
|
|
+ opacity: 1;
|
|
|
+ transform: scale(1) translateY(0);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
-@media (max-width: $mobile) {
|
|
|
- .gp-toast-inner { min-width: 240px; }
|
|
|
+@keyframes toastSlideIn {
|
|
|
+ from {
|
|
|
+ opacity: 0;
|
|
|
+ transform: translateX(100%);
|
|
|
+ }
|
|
|
+ to {
|
|
|
+ opacity: 1;
|
|
|
+ transform: translateX(0);
|
|
|
+ }
|
|
|
}
|