Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export default async (req, res) => {
number_format,
border_color,
rank_icon,
badge_style,
show,
} = req.query;
res.setHeader("Content-Type", "image/svg+xml");
Expand Down Expand Up @@ -117,6 +118,7 @@ export default async (req, res) => {
locale: locale ? locale.toLowerCase() : null,
disable_animations: parseBoolean(disable_animations),
rank_icon,
badge_style,
show: showStats,
}),
);
Expand Down
3 changes: 2 additions & 1 deletion src/cards/stats-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ const renderStatsCard = (stats, options = {}) => {
locale,
disable_animations = false,
rank_icon = "default",
badge_style = "default",
show = [],
} = options;

Expand Down Expand Up @@ -507,7 +508,7 @@ const renderStatsCard = (stats, options = {}) => {
<circle class="rank-circle-rim" cx="-10" cy="8" r="40" />
<circle class="rank-circle" cx="-10" cy="8" r="40" />
<g class="rank-text">
${rankIcon(rank_icon, rank?.level, rank?.percentile)}
${rankIcon(rank_icon, rank?.level, rank?.percentile, badge_style)}
</g>
</g>`;

Expand Down
2 changes: 2 additions & 0 deletions src/cards/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
type ThemeNames = keyof typeof import("../../themes/index.js");
type RankIcon = "default" | "github" | "percentile";
type BadgeStyle = "default" | null;

export type CommonOptions = {
title_color: string;
Expand Down Expand Up @@ -27,6 +28,7 @@ export type StatCardOptions = CommonOptions & {
ring_color: string;
text_bold: boolean;
rank_icon: RankIcon;
badge_style: BadgeStyle;
show: string[];
};

Expand Down
6 changes: 5 additions & 1 deletion src/common/icons.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.