UNPKG

vue-document-components

Version:

A collection of Vue.js components for document preview, file management, and media handling

285 lines (247 loc) 6.09 kB
/* Vue Document Components - 现代化主题样式 */ /* CSS 变量定义 */ :root { /* 主色调 */ --primary-color: #409eff; --secondary-color: #67c23a; --accent-color: #e6a23c; --danger-color: #f56c6c; /* 渐变色 */ --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%); --success-gradient: linear-gradient(135deg, #409EFF, #67C23A); --glass-gradient: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%); /* 背景色 */ --bg-primary: #ffffff; --bg-secondary: #f8f9fa; --bg-tertiary: #e9ecef; --bg-dark: #1a1a1a; /* 文字颜色 */ --text-primary: #303133; --text-secondary: #606266; --text-tertiary: #909399; --text-light: #c0c4cc; /* 阴影效果 */ --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.1); --shadow-medium: 0 8px 24px rgba(0, 0, 0, 0.15); --shadow-heavy: 0 16px 48px rgba(0, 0, 0, 0.2); --shadow-color: 0 8px 32px rgba(64, 158, 255, 0.15); /* 圆角 */ --radius-small: 6px; --radius-medium: 12px; --radius-large: 16px; --radius-xl: 24px; /* 间距 */ --spacing-xs: 4px; --spacing-sm: 8px; --spacing-md: 16px; --spacing-lg: 24px; --spacing-xl: 32px; --spacing-2xl: 48px; /* 动画时长 */ --duration-fast: 0.2s; --duration-normal: 0.3s; --duration-slow: 0.5s; /* 缓动函数 */ --ease-out-back: cubic-bezier(0.175, 0.885, 0.32, 1.275); --ease-out-circ: cubic-bezier(0.25, 0.46, 0.45, 0.94); --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1); } /* 全局动画类 */ .fade-enter-active, .fade-leave-active { transition: all var(--duration-normal) var(--ease-out-circ); } .fade-enter-from, .fade-leave-to { opacity: 0; transform: scale(0.95); } .slide-up-enter-active, .slide-up-leave-active { transition: all var(--duration-slow) var(--ease-out-back); } .slide-up-enter-from, .slide-up-leave-to { opacity: 0; transform: translateY(30px); } .scale-enter-active, .scale-leave-active { transition: all var(--duration-normal) var(--ease-out-back); } .scale-enter-from, .scale-leave-to { opacity: 0; transform: scale(0.8); } /* 通用动画效果 */ @keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } } @keyframes slideInUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } } @keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } } @keyframes float { 0%, 100% { transform: translateY(0px); } 50% { transform: translateY(-10px); } } @keyframes shimmer { 0% { background-position: -1000px 0; } 100% { background-position: 1000px 0; } } @keyframes ripple { to { transform: scale(4); opacity: 0; } } /* 毛玻璃效果 */ .glass-effect { background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(20px); border: 1px solid rgba(255, 255, 255, 0.2); } /* 高级按钮样式 */ .modern-button { position: relative; padding: var(--spacing-md) var(--spacing-lg); border-radius: var(--radius-medium); font-weight: 600; font-size: 14px; border: none; cursor: pointer; overflow: hidden; transition: all var(--duration-normal) var(--ease-out-back); background: var(--success-gradient); color: white; box-shadow: var(--shadow-color); } .modern-button::before { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent); transition: left 0.6s; } .modern-button:hover::before { left: 100%; } .modern-button:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 15px 35px rgba(64, 158, 255, 0.4); } .modern-button:active { transform: translateY(-1px) scale(1.01); } /* 卡片样式 */ .modern-card { background: var(--bg-primary); border-radius: var(--radius-large); box-shadow: var(--shadow-medium); padding: var(--spacing-xl); transition: all var(--duration-normal) var(--ease-out-circ); border: 1px solid rgba(255, 255, 255, 0.1); } .modern-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-heavy); } /* 输入框样式 */ .modern-input { width: 100%; padding: var(--spacing-md); border: 2px solid transparent; border-radius: var(--radius-medium); background: var(--bg-secondary); transition: all var(--duration-normal) var(--ease-out-circ); font-size: 14px; } .modern-input:focus { outline: none; border-color: var(--primary-color); background: var(--bg-primary); box-shadow: 0 0 0 4px rgba(64, 158, 255, 0.1); } /* 加载动画 */ .loading-spinner { width: 40px; height: 40px; border: 4px solid rgba(64, 158, 255, 0.2); border-left-color: var(--primary-color); border-radius: 50%; animation: spin 1s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } } /* 响应式工具类 */ @media (max-width: 768px) { :root { --spacing-md: 12px; --spacing-lg: 16px; --spacing-xl: 24px; --spacing-2xl: 32px; } .modern-button { padding: var(--spacing-sm) var(--spacing-md); font-size: 13px; } .modern-card { padding: var(--spacing-lg); border-radius: var(--radius-medium); } } /* 暗色主题支持 */ @media (prefers-color-scheme: dark) { :root { --bg-primary: #1a1a1a; --bg-secondary: #2d2d2d; --bg-tertiary: #404040; --text-primary: #ffffff; --text-secondary: #e0e0e0; --text-tertiary: #b0b0b0; } } /* 减少动画偏好支持 */ @media (prefers-reduced-motion: reduce) { * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; } }