diff --git a/pages/src/config.ts b/pages/src/config.ts index e618006..36191b2 100644 --- a/pages/src/config.ts +++ b/pages/src/config.ts @@ -45,8 +45,9 @@ export const RANK_LIST: { hideInTab?: boolean; color?: string; weight: number; + description?: string; }[] = [ - { status: "all", text: "总榜", tabText: "总榜", color: "bg-yellow-500", weight: 0}, + { status: "all", text: "总榜", tabText: "总榜", color: "bg-yellow-500", weight: 0, description: "排序公式:选题数目*0.5 + 翻译数目*1.0+校对数目*1.0+发布数目*0.8" }, { status: "translator", text: "翻译", tabText: "翻译王者", color: "bg-green-500", weight: 1 }, { status: "proofreader", text: "校验", tabText: "校验大佬", color: "bg-purple-500" , weight: 1}, { status: "collector", text: "选题", tabText: "用心选题", color: "bg-red-500" , weight: 0.5}, diff --git a/pages/src/layouts/RankLayout.astro b/pages/src/layouts/RankLayout.astro index 292450a..467b513 100644 --- a/pages/src/layouts/RankLayout.astro +++ b/pages/src/layouts/RankLayout.astro @@ -154,6 +154,28 @@ async function getAllAvatar() { flex-grow: 1; max-width: 100%; } + + .icon-container { + position: relative; + display: inline-block; + } + + .description { + display: none; + position: absolute; + top: 25px; + left: 0; + background-color: #333; + color: #fff; + padding: 5px; + border-radius: 3px; + white-space: nowrap; + } + + .icon-container:hover .description, + .icon-container.active .description { + display: block; + }
- {RANK_LIST.map(({ status, tabText }) => ( + {RANK_LIST.map(({ status, tabText, description }) => (
-

{tabText}

+

{tabText}{ + description ? ( + // icon for description (?) + // - {description} + // Add icon, show the description when the icon is hovered +
+   + + +
{description}
+
+ ) : null + }

    {status != "all" ? ( rankResult.get(status).map(([name, feature]: [string, { avatar: string, count: number }], index: number) => (