diff --git a/apps/web/src/oj/achievement/components/GroupCard.vue b/apps/web/src/oj/achievement/components/GroupCard.vue index 5004c73..08a4716 100644 --- a/apps/web/src/oj/achievement/components/GroupCard.vue +++ b/apps/web/src/oj/achievement/components/GroupCard.vue @@ -35,7 +35,7 @@ const showBadges = computed(() => props.group.name === "题单和比赛" && !!pr :to="{ name: 'problemset', params: { problemSetId: b.problemSet.id } }" class="badge" > - + {{ b.badge.name }} @@ -89,24 +89,19 @@ h3 small { gap: 8px; } +/* 奖章名最长 9 个字(「有趣和无趣的观察者」),竖排在格子里放不下,横排写全 */ .badge { - width: 72px; - display: flex; - flex-direction: column; + display: inline-flex; align-items: center; - gap: 4px; - font-size: 12px; - line-height: 15px; - text-align: center; - color: v-bind("theme.textColor1"); - text-decoration: none; -} - -.badge span { - max-width: 100%; - overflow: hidden; - text-overflow: ellipsis; + gap: 6px; + height: 34px; + padding: 0 10px 0 6px; + border-radius: 6px; + font-size: var(--oj-fs-sec); white-space: nowrap; + color: v-bind("theme.textColor1"); + background: v-bind("theme.actionColor"); + text-decoration: none; } .compact { diff --git a/apps/web/src/oj/achievement/components/NearCard.vue b/apps/web/src/oj/achievement/components/NearCard.vue index 0260ed7..50da422 100644 --- a/apps/web/src/oj/achievement/components/NearCard.vue +++ b/apps/web/src/oj/achievement/components/NearCard.vue @@ -5,8 +5,11 @@ import { useRarityColor } from "shared/composables/rarity" import type { Near } from "../series" import Medal from "./Medal.vue" -/** 「快拿到了」:每个只说还差什么,进度条底下是现在几 / 要几、本班几人有 */ -defineProps<{ items: Near[]; compact?: boolean }>() +/** + * 「快拿到了」:每个只说还差什么,进度条底下是现在几 / 要几、本班几人有。 + * `wide`:旁边没有「本班」(没有班级的号)时三个横着排,占满整宽 + */ +defineProps<{ items: Near[]; compact?: boolean; wide?: boolean }>() const theme = useThemeVars() const rarityText = useRarityColor() @@ -22,38 +25,40 @@ const percent = (item: Near) => Math.round((item.series.value / item.achievement