mirror of
https://github.com/System-End/github-readme-stats.git
synced 2026-04-19 21:05:16 +00:00
feat(wakatime card): add disable animations query option (#3496)
* feat(wakatime card): add disable animations query option * docs
This commit is contained in:
parent
afcb773b11
commit
a8663a8025
4 changed files with 9 additions and 0 deletions
|
|
@ -30,6 +30,7 @@ export default async (req, res) => {
|
|||
api_domain,
|
||||
border_radius,
|
||||
border_color,
|
||||
disable_animations,
|
||||
} = req.query;
|
||||
|
||||
res.setHeader("Content-Type", "image/svg+xml");
|
||||
|
|
@ -83,6 +84,7 @@ export default async (req, res) => {
|
|||
locale: locale ? locale.toLowerCase() : null,
|
||||
layout,
|
||||
langs_count,
|
||||
disable_animations: parseBoolean(disable_animations),
|
||||
}),
|
||||
);
|
||||
} catch (err) {
|
||||
|
|
|
|||
|
|
@ -421,6 +421,7 @@ If we don't support your language, please consider contributing! You can find mo
|
|||
* `layout` - Switches between two available layouts `default` & `compact`. Default `default`.
|
||||
* `langs_count` - Limits the number of languages on the card, defaults to all reported languages *(number)*.
|
||||
* `api_domain` - Sets a custom API domain for the card, e.g. to use services like [Hakatime](https://github.com/mujx/hakatime) or [Wakapi](https://github.com/muety/wakapi) *(string)*. Default `Waka API`.
|
||||
* `disable_animations` - Disables all animations in the card *(boolean)*. Default: `false`.
|
||||
|
||||
***
|
||||
|
||||
|
|
|
|||
1
src/cards/types.d.ts
vendored
1
src/cards/types.d.ts
vendored
|
|
@ -54,6 +54,7 @@ type WakaTimeOptions = CommonOptions & {
|
|||
custom_title: string;
|
||||
layout: "compact" | "normal";
|
||||
langs_count: number;
|
||||
disable_animations: boolean;
|
||||
};
|
||||
|
||||
export type GistCardOptions = CommonOptions & {
|
||||
|
|
|
|||
|
|
@ -218,6 +218,7 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => {
|
|||
langs_count = languages.length,
|
||||
border_radius,
|
||||
border_color,
|
||||
disable_animations,
|
||||
} = options;
|
||||
|
||||
const shouldHideLangs = Array.isArray(hide) && hide.length > 0;
|
||||
|
|
@ -382,6 +383,10 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => {
|
|||
},
|
||||
});
|
||||
|
||||
if (disable_animations) {
|
||||
card.disableAnimations();
|
||||
}
|
||||
|
||||
card.setHideBorder(hide_border);
|
||||
card.setHideTitle(hide_title);
|
||||
card.setCSS(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue