diff --git a/src/oj/achievement/index.vue b/src/oj/achievement/index.vue index 6e4b1be..8d7a1ce 100644 --- a/src/oj/achievement/index.vue +++ b/src/oj/achievement/index.vue @@ -18,6 +18,14 @@ interface UserBadge { const route = useRoute() const name = computed(() => (route.query.name as string) || undefined) +// 和 AchievementCard 的边框配色保持一致 +const RARITY_COLOR: Record = { + bronze: "#b87333", + silver: "#9fa6b2", + gold: "#e0a300", + platinum: "#7dd3fc", +} + const achievements = ref([]) const summary = ref(null) const badges = ref([]) @@ -59,19 +67,44 @@ watch(name, load)
-
{{ summary.percent }}%
+ +
+
{{ summary.percent }}%
+
+
- {{ summary.unlocked }} / {{ summary.total }} 已获得 + 已获得 {{ summary.unlocked }} / {{ summary.total }}
+
-
{{ r.label }}
-
{{ r.unlocked }} / {{ r.total }}
+ + {{ r.label }} + + + + + + {{ r.unlocked }} / {{ r.total }} +
@@ -114,34 +147,70 @@ watch(name, load) .overview-row { display: flex; align-items: center; - justify-content: space-between; - gap: 24px; + gap: 32px; flex-wrap: wrap; } -.big { - font-size: 40px; +.percent { + flex: none; + width: 110px; + text-align: center; +} +.percent :deep(.n-progress) { + width: 110px; +} +.ring-percent { + font-size: 22px; font-weight: 700; line-height: 1; } .sub { - margin-top: 6px; - font-size: 13px; - opacity: 0.7; + margin-top: 8px; + font-size: 12px; + opacity: 0.65; + white-space: nowrap; } .rarity { - display: flex; - gap: 20px; + flex: 1; + min-width: 240px; + display: grid; + grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); + gap: 10px 28px; } .rarity-item { - text-align: center; + display: flex; + align-items: center; + gap: 10px; } .rarity-label { - font-size: 12px; - opacity: 0.7; + flex: none; + width: 30px; + font-size: 13px; + font-weight: 600; +} +.rarity-bar { + flex: 1; + height: 6px; + min-width: 40px; + border-radius: 3px; + overflow: hidden; + background: rgba(128, 128, 128, 0.2); /* 灰底在明暗两套主题下都成立 */ +} +.rarity-fill { + display: block; + height: 100%; + border-radius: 3px; + transition: width 0.4s ease; } .rarity-count { - font-weight: 600; - margin-top: 2px; + flex: none; + font-size: 12px; + opacity: 0.7; + white-space: nowrap; + font-variant-numeric: tabular-nums; +} +.rarity-count b { + font-size: 13px; + opacity: 0.9; } .tabs { margin: 16px 0;