Skip to content

Commit

Permalink
feat: Added border_radius option (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
FajarKim authored Oct 21, 2023
1 parent 56bb0c4 commit 81ee4d9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export type UiConfig = {
bgColor: string;
Locale: string;
borderWidth: number | string;
borderRadius: number | string;
};

export default async function readmeStats(req: any, res: any): Promise<any> {
Expand All @@ -32,6 +33,7 @@ export default async function readmeStats(req: any, res: any): Promise<any> {
bgColor: req.query.bg_color || selectTheme.bg_color || defaultTheme.bg_color,
Locale: req.query.locale || "en",
borderWidth: req.query.border_width || "1",
borderRadius: req.query.border_radius || "4.5",
};

if (!username) throw new Error("Username is required");
Expand Down
2 changes: 1 addition & 1 deletion src/card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default function cardStyle(data: GetData, uiConfig: UiConfig): string {
</style>
<title id="titleId">${selectLocale.titleCard.split("{name}").join(data.name) || defaultLocale.titleCard.split("{name}").join(data.name)}</title>
<rect x="0.5" y="0.5" rx="4.5" height="99%" width="534" fill="#${uiConfig.bgColor}" stroke="#${uiConfig.borderColor}" stroke-opacity="1" stroke-width="${uiConfig.borderWidth}"/>
<rect x="0.5" y="0.5" rx="${uiConfig.borderRadius}" height="99%" width="534" fill="#${uiConfig.bgColor}" stroke="#${uiConfig.borderColor}" stroke-opacity="1" stroke-width="${uiConfig.borderWidth}"/>
<g transform="translate(0, 25)">
<g class="div-animation">
<text x="${titleXAngle}" y="-10" class="text-title">${selectLocale.titleCard.split("{name}").join(data.name) || defaultLocale.titleCard.split("{name}").join(data.name)}</text>
Expand Down

0 comments on commit 81ee4d9

Please sign in to comment.