diff --git a/api/index.js b/api/index.js index 2075005..2315ddd 100644 --- a/api/index.js +++ b/api/index.js @@ -26,6 +26,7 @@ module.exports = async (req, res) => { title_color, icon_color, text_color, + text_bold, bg_color, theme, cache_seconds, @@ -75,6 +76,7 @@ module.exports = async (req, res) => { title_color, icon_color, text_color, + text_bold: parseBoolean(text_bold), bg_color, theme, custom_title, diff --git a/readme.md b/readme.md index a4034ee..3ef4072 100644 --- a/readme.md +++ b/readme.md @@ -195,6 +195,7 @@ You can provide multiple comma-separated values in the bg_color option to render - `line_height` - Sets the line-height between text _(number)_ - `exclude_repo` - Exclude stars from specified repositories _(Comma-separated values)_ - `custom_title` - Sets a custom title for the card +- `text_bold` - Use bold text _(boolean)_ - `disable_animations` - Disables all animations in the card _(boolean)_ #### Repo Card Exclusive Options: @@ -453,3 +454,4 @@ Thanks! :heart: Contributions are welcome! <3 Made with :heart: and JavaScript. + diff --git a/src/cards/stats-card.js b/src/cards/stats-card.js index bbc48cf..30056b8 100644 --- a/src/cards/stats-card.js +++ b/src/cards/stats-card.js @@ -20,6 +20,7 @@ const createTextNode = ({ index, showIcons, shiftValuePos, + bold, }) => { const kValue = kFormatter(value); const staggerDelay = (index + 3) * 150; @@ -35,9 +36,11 @@ const createTextNode = ({ return ` ${iconSvg} - ${label}: + ${label}: { title_color, icon_color, text_color, + text_bold = true, bg_color, theme = "default", custom_title, @@ -165,6 +169,7 @@ const renderStatsCard = (stats = {}, options = { hide: [] }) => { showIcons: show_icons, shiftValuePos: (!include_all_commits ? 50 : 35) + (isLongLocale ? 50 : 0), + bold: text_bold, }), ); diff --git a/src/getStyles.js b/src/getStyles.js index e5013e5..e76b51f 100644 --- a/src/getStyles.js +++ b/src/getStyles.js @@ -85,6 +85,7 @@ const getStyles = ({ animation: scaleInAnimation 0.3s ease-in-out forwards; } + .not_bold { font-weight: 400 } .bold { font-weight: 700 } .icon { fill: ${iconColor}; diff --git a/tests/__snapshots__/renderWakatimeCard.test.js.snap b/tests/__snapshots__/renderWakatimeCard.test.js.snap index aa5641a..bd62580 100644 --- a/tests/__snapshots__/renderWakatimeCard.test.js.snap +++ b/tests/__snapshots__/renderWakatimeCard.test.js.snap @@ -41,6 +41,7 @@ exports[`Test Render Wakatime Card should render correctly 1`] = ` animation: scaleInAnimation 0.3s ease-in-out forwards; } + .not_bold { font-weight: 400 } .bold { font-weight: 700 } .icon { fill: #4c71f2; @@ -202,6 +203,7 @@ exports[`Test Render Wakatime Card should render correctly with compact layout 1 animation: scaleInAnimation 0.3s ease-in-out forwards; } + .not_bold { font-weight: 400 } .bold { font-weight: 700 } .icon { fill: #4c71f2;