diff --git a/README.md b/README.md index d77b7d77..a3d827c6 100644 --- a/README.md +++ b/README.md @@ -43,26 +43,27 @@ The `user` field is the only required option. All other fields are optional. If the `theme` parameter is specified, any color customizations specified will be applied on top of the theme, overriding the theme's values. -| Parameter | Details | Example | -| :---------------: | :---------------------------------------------: | :-----------------------------------------------------------------------: | -| `user` | GitHub username to show stats for | `DenverCoder1` | -| `theme` | The theme to apply (Default: `default`) | `dark`, `radical`, etc. [🎨➜](./docs/themes.md) | -| `hide_border` | Make the border transparent (Default: `false`) | `true` or `false` | -| `border_radius` | Set the roundness of the edges (Default: `4.5`) | Number `0` (sharp corners) to `248` (ellipse) | -| `background` | Background color | **hex code** without `#` or **css color** | -| `border` | Border color | **hex code** without `#` or **css color** | -| `stroke` | Stroke line color between sections | **hex code** without `#` or **css color** | -| `ring` | Color of the ring around the current streak | **hex code** without `#` or **css color** | -| `fire` | Color of the fire in the ring | **hex code** without `#` or **css color** | -| `currStreakNum` | Current streak number | **hex code** without `#` or **css color** | -| `sideNums` | Total and longest streak numbers | **hex code** without `#` or **css color** | -| `currStreakLabel` | Current streak label | **hex code** without `#` or **css color** | -| `sideLabels` | Total and longest streak labels | **hex code** without `#` or **css color** | -| `dates` | Date range text color | **hex code** without `#` or **css color** | -| `date_format` | Date format pattern or empty for locale format | See note below on [📅 Date Formats](#-date-formats) | -| `locale` | Locale for labels and numbers (Default: `en`) | ISO 639-1 code - See [🗪 Locales](#-locales) | -| `type` | Output format (Default: `svg`) | Current options: `svg`, `png` or `json` | -| `mode` | Streak mode (Default: `daily`) | `daily` (contribute daily) or `weekly` (contribute once per Sun-Sat week) | +| Parameter | Details | Example | +| :------------------: | :---------------------------------------------: | :-----------------------------------------------------------------------: | +| `user` | GitHub username to show stats for | `DenverCoder1` | +| `theme` | The theme to apply (Default: `default`) | `dark`, `radical`, etc. [🎨➜](./docs/themes.md) | +| `hide_border` | Make the border transparent (Default: `false`) | `true` or `false` | +| `border_radius` | Set the roundness of the edges (Default: `4.5`) | Number `0` (sharp corners) to `248` (ellipse) | +| `background` | Background color | **hex code** without `#` or **css color** | +| `border` | Border color | **hex code** without `#` or **css color** | +| `stroke` | Stroke line color between sections | **hex code** without `#` or **css color** | +| `ring` | Color of the ring around the current streak | **hex code** without `#` or **css color** | +| `fire` | Color of the fire in the ring | **hex code** without `#` or **css color** | +| `currStreakNum` | Current streak number | **hex code** without `#` or **css color** | +| `sideNums` | Total and longest streak numbers | **hex code** without `#` or **css color** | +| `currStreakLabel` | Current streak label | **hex code** without `#` or **css color** | +| `sideLabels` | Total and longest streak labels | **hex code** without `#` or **css color** | +| `dates` | Date range text color | **hex code** without `#` or **css color** | +| `date_format` | Date format pattern or empty for locale format | See note below on [📅 Date Formats](#-date-formats) | +| `locale` | Locale for labels and numbers (Default: `en`) | ISO 639-1 code - See [🗪 Locales](#-locales) | +| `type` | Output format (Default: `svg`) | Current options: `svg`, `png` or `json` | +| `mode` | Streak mode (Default: `daily`) | `daily` (contribute daily) or `weekly` (contribute once per Sun-Sat week) | +| `disable_animations` | Disable SVG animations (Default: `false`) | `true` or `false` | ### 🖌 Themes diff --git a/src/card.php b/src/card.php index 3235c002..6729805f 100644 --- a/src/card.php +++ b/src/card.php @@ -476,6 +476,22 @@ function generateErrorCard(string $message, array $params = null): string "; } +/** + * Remove animations from SVG + * + * @param string $svg The SVG for the card as a string + * @return string The SVG without animations + */ +function removeAnimations(string $svg): string +{ + $svg = preg_replace("/(