diff --git a/api-renamed/wakatime.js b/api-renamed/wakatime.js index 87f31ced..e619fecb 100644 --- a/api-renamed/wakatime.js +++ b/api-renamed/wakatime.js @@ -16,6 +16,7 @@ export default async (req, res) => { title_color, icon_color, hide_border, + card_width, line_height, text_color, bg_color, @@ -74,6 +75,7 @@ export default async (req, res) => { custom_title, hide_title: parseBoolean(hide_title), hide_border: parseBoolean(hide_border), + card_width: parseInt(card_width, 10), hide: parseArray(hide), line_height, title_color, diff --git a/src/cards/wakatime.js b/src/cards/wakatime.js index 65e1d54d..50e5e23b 100644 --- a/src/cards/wakatime.js +++ b/src/cards/wakatime.js @@ -223,6 +223,7 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => { const { hide_title = false, hide_border = false, + card_width, hide, line_height = 25, title_color, @@ -289,11 +290,9 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => { let finalLayout = ""; - let width = 440; - // RENDER COMPACT LAYOUT if (layout === "compact") { - width = width + 50; + let width = (card_width || 495) - 5; height = 90 + Math.round(filteredLanguages.length / 2) * 25; // progressOffset holds the previous language's width and used to offset the next language @@ -392,7 +391,7 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => { const card = new Card({ customTitle: custom_title, defaultTitle: titleText, - width: 495, + width: card_width || 495, height, border_radius, colors: {