tag api update

This commit is contained in:
2025-07-11 14:07:21 +02:00
parent a00d273e29
commit 65d60a5c1b
+5 -4
View File
@@ -39,7 +39,7 @@ router.get('/tag', (req, res) => {
<g fill="#fff" text-anchor="start" font-family="${fontFamily}" text-rendering="geometricPrecision" font-size="${badgeFontSize}">
<text x="${tagTextX}" y="${badgeFontSize + textPadding}" fill="${color}">${tag.toLowerCase()}</text>
<text x="${labelTextX}" y="${badgeFontSize + textPadding}" fill="${color}" font-weight="${fontWeight}">${label.toUpperCase()}</text>
</g>`;
</g>`.trim();
const flat = `
@@ -60,12 +60,13 @@ router.get('/tag', (req, res) => {
<text x="165" y="140" transform="scale(.1)" fill="#fff" textLength="210">${tag}</text>
<text aria-hidden="true" x="455" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="210">${label}</text>
<text x="455" y="140" transform="scale(.1)" fill="#fff" textLength="210">${label}</text>
</g>`;
</g>`.trim();
const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="${badgeWidth}" height="${badgeSize}" role="img" aria-label="${tag}: ${label}">
const svg = `
<svg xmlns="http://www.w3.org/2000/svg" width="${badgeWidth}" height="${badgeSize}" role="img" aria-label="${tag}: ${label}">
<title>${tag}: ${label}</title>
${style === 'rect' ? rect : flat}
</svg>`;
</svg>`.trim();
res.setHeader('Content-Type', 'image/svg+xml');
res.send(svg);