add card_width to wakatime card

This commit is contained in:
martin-mfg
2025-09-12 16:54:40 +02:00
parent 99d410298f
commit c607c2466e
2 changed files with 5 additions and 4 deletions
+2
View File
@@ -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,
+3 -4
View File
@@ -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: {