diff --git a/src/assets/styles/variables.css b/src/assets/styles/variables.css index f69a660..0e26050 100644 --- a/src/assets/styles/variables.css +++ b/src/assets/styles/variables.css @@ -102,6 +102,37 @@ --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15); --glass-blur: blur(10px); + /* 透明度级别 */ + --opacity-lighter: 0.02; + --opacity-light: 0.05; + --opacity-medium: 0.1; + --opacity-heavy: 0.2; + --opacity-strong: 0.3; + + /* 主题色透明度变体 */ + --primary-alpha-lighter: rgba(30, 58, 138, var(--opacity-lighter)); + --primary-alpha-light: rgba(30, 58, 138, var(--opacity-light)); + --primary-alpha-medium: rgba(30, 58, 138, var(--opacity-medium)); + --primary-alpha-heavy: rgba(30, 58, 138, var(--opacity-heavy)); + --primary-alpha-strong: rgba(30, 58, 138, var(--opacity-strong)); + + --success-alpha-light: rgba(16, 185, 129, var(--opacity-light)); + --success-alpha-medium: rgba(16, 185, 129, var(--opacity-medium)); + --success-alpha-heavy: rgba(16, 185, 129, var(--opacity-heavy)); + + --danger-alpha-light: rgba(239, 68, 68, var(--opacity-light)); + --danger-alpha-heavy: rgba(239, 68, 68, var(--opacity-heavy)); + + --secondary-alpha-heavy: rgba(6, 182, 212, var(--opacity-heavy)); + + --white-alpha-high: rgba(255, 255, 255, 0.98); + --white-alpha-medium: rgba(255, 255, 255, 0.9); + --white-alpha-light: rgba(255, 255, 255, 0.6); + --white-alpha-lighter: rgba(255, 255, 255, 0.1); + + --black-alpha-light: rgba(0, 0, 0, 0.08); + --black-alpha-medium: rgba(0, 0, 0, 0.15); + /* 动画 */ --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); --transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); diff --git a/src/components/AbilityRadarChart.vue b/src/components/AbilityRadarChart.vue index c7e0a31..0056047 100644 --- a/src/components/AbilityRadarChart.vue +++ b/src/components/AbilityRadarChart.vue @@ -107,11 +107,11 @@ export default { splitArea: { areaStyle: { color: [ - 'rgba(59, 130, 246, 0.02)', - 'rgba(59, 130, 246, 0.04)', - 'rgba(59, 130, 246, 0.06)', - 'rgba(59, 130, 246, 0.08)', - 'rgba(59, 130, 246, 0.1)' + getCSSVariable('--primary-alpha-lighter'), + getCSSVariable('--primary-alpha-lighter'), + getCSSVariable('--primary-alpha-light'), + getCSSVariable('--primary-alpha-light'), + getCSSVariable('--primary-alpha-medium') ] } }, @@ -135,7 +135,7 @@ export default { symbol: 'circle', symbolSize: CHART_CONFIG.symbolSize, areaStyle: { - color: 'rgba(59, 130, 246, 0.1)' + color: getCSSVariable('--primary-alpha-medium') }, lineStyle: { color: getCSSVariable('--primary'), diff --git a/src/components/BaseButton.vue b/src/components/BaseButton.vue index 9d8c8ac..76d604a 100644 --- a/src/components/BaseButton.vue +++ b/src/components/BaseButton.vue @@ -62,7 +62,7 @@ export default { .btn-gradient { background: var(--gradient-primary); border: none; - color: white; + color: var(--text-inverse); } .btn-gradient:hover { @@ -78,6 +78,6 @@ export default { .btn-outline:hover { background: var(--primary-color); - color: white; + color: var(--text-inverse); } \ No newline at end of file diff --git a/src/components/EvaluationDialog.vue b/src/components/EvaluationDialog.vue index db1b767..18d0655 100644 --- a/src/components/EvaluationDialog.vue +++ b/src/components/EvaluationDialog.vue @@ -225,6 +225,11 @@ import { ref, reactive, computed, watch } from 'vue' import { ElMessage } from 'element-plus' import FileUpload from './FileUpload.vue' +// 常量配置 +const ANIMATION_DELAY = { + MEDIUM: 1000 +} + export default { name: 'EvaluationDialog', components: { @@ -356,7 +361,7 @@ export default { submitting.value = true // 模拟提交延迟 - await new Promise(resolve => setTimeout(resolve, 1000)) + await new Promise(resolve => setTimeout(resolve, ANIMATION_DELAY.MEDIUM)) // 构造提交数据 const submitData = { diff --git a/src/components/FileUpload.vue b/src/components/FileUpload.vue index 373c267..87d9f9c 100644 --- a/src/components/FileUpload.vue +++ b/src/components/FileUpload.vue @@ -471,7 +471,7 @@ export default { &.file-error { border-color: var(--danger); - background: rgba(239, 68, 68, 0.05); + background: var(--danger-alpha-light); } } diff --git a/src/components/GradeDistributionChart.vue b/src/components/GradeDistributionChart.vue index 530be5d..c0a38c0 100644 --- a/src/components/GradeDistributionChart.vue +++ b/src/components/GradeDistributionChart.vue @@ -353,7 +353,7 @@ export default { } .summary-item:hover { - background: rgba(59, 130, 246, 0.05); + background: var(--primary-alpha-light); transform: translateY(-2px); } @@ -390,17 +390,17 @@ export default { } .grade-a-minus { - background: rgba(16, 185, 129, 0.2); + background: var(--success-alpha-heavy); color: var(--success); } .grade-b-plus { - background: rgba(59, 130, 246, 0.2); + background: var(--primary-alpha-heavy); color: var(--primary); } .grade-b { - background: rgba(6, 182, 212, 0.2); + background: var(--secondary-alpha-heavy); color: var(--secondary); } @@ -411,7 +411,7 @@ export default { .grade-c-plus, .grade-c { - background: rgba(239, 68, 68, 0.2); + background: var(--danger-alpha-heavy); color: var(--danger); } diff --git a/src/components/SubmissionDialog.vue b/src/components/SubmissionDialog.vue index 4002523..bcd9f7d 100644 --- a/src/components/SubmissionDialog.vue +++ b/src/components/SubmissionDialog.vue @@ -101,7 +101,7 @@