badgen
Advanced tools
Comparing version 2.4.2 to 2.4.3
@@ -19,40 +19,36 @@ const calcWidth = require('./calc-text-width.js').Verdana110 | ||
if (style === 'flat') { | ||
return ` | ||
<svg width="${width / 10}" height="20" viewBox="0 0 ${width} 200" xmlns="http://www.w3.org/2000/svg"${xlink}> | ||
<g> | ||
<rect fill="#555" width="${sbRectWidth}" height="200"/> | ||
<rect fill="#${color}" x="${sbRectWidth}" width="${stRectWidth}" height="200"/> | ||
</g> | ||
<g fill="#fff" text-anchor="start" font-family="Verdana,DejaVu Sans,sans-serif" font-size="110"> | ||
<text x="${icon ? '220' : '50'}" y="148" textLength="${sbTextWidth}" fill="#000" opacity="0.1">${subject}</text> | ||
<text x="${icon ? '210' : '50'}" y="138" textLength="${sbTextWidth}">${subject}</text> | ||
<text x="${sbRectWidth + 55}" y="148" textLength="${stTextWidth}" fill="#000" opacity="0.1">${status}</text> | ||
<text x="${sbRectWidth + 45}" y="138" textLength="${stTextWidth}">${status}</text> | ||
</g> | ||
${icon ? `<image x="40" y="35" width="${iconWidth}" height="132" xlink:href="${icon}"/>` : ''} | ||
</svg> | ||
` | ||
return `<svg width="${width / 10}" height="20" viewBox="0 0 ${width} 200" xmlns="http://www.w3.org/2000/svg"${xlink}> | ||
<g> | ||
<rect fill="#555" width="${sbRectWidth}" height="200"/> | ||
<rect fill="#${color}" x="${sbRectWidth}" width="${stRectWidth}" height="200"/> | ||
</g> | ||
<g fill="#fff" text-anchor="start" font-family="Verdana,DejaVu Sans,sans-serif" font-size="110"> | ||
<text x="${icon ? '220' : '50'}" y="148" textLength="${sbTextWidth}" fill="#000" opacity="0.1">${subject}</text> | ||
<text x="${icon ? '210' : '50'}" y="138" textLength="${sbTextWidth}">${subject}</text> | ||
<text x="${sbRectWidth + 55}" y="148" textLength="${stTextWidth}" fill="#000" opacity="0.1">${status}</text> | ||
<text x="${sbRectWidth + 45}" y="138" textLength="${stTextWidth}">${status}</text> | ||
</g> | ||
${icon ? `<image x="40" y="35" width="${iconWidth}" height="132" xlink:href="${icon}"/>` : ''} | ||
</svg>` | ||
} | ||
return ` | ||
<svg width="${width / 10}" height="20" viewBox="0 0 ${width} 200" xmlns="http://www.w3.org/2000/svg"${xlink}> | ||
<linearGradient id="a" x2="0" y2="100%"> | ||
<stop offset="0" stop-opacity=".1" stop-color="#EEE"/> | ||
<stop offset="1" stop-opacity=".1"/> | ||
</linearGradient> | ||
<mask id="m"><rect width="${width}" height="200" rx="30" fill="#FFF"/></mask> | ||
<g mask="url(#m)"> | ||
<rect width="${sbRectWidth}" height="200" fill="#555"/> | ||
<rect width="${stRectWidth}" height="200" fill="#${color}" x="${sbRectWidth}"/> | ||
<rect width="${width}" height="200" fill="url(#a)"/> | ||
</g> | ||
<g fill="#fff" text-anchor="start" font-family="Verdana,DejaVu Sans,sans-serif" font-size="110"> | ||
<text x="${icon ? '220' : '60'}" y="148" textLength="${sbTextWidth}" fill="#000" opacity="0.25">${subject}</text> | ||
<text x="${icon ? '210' : '50'}" y="138" textLength="${sbTextWidth}">${subject}</text> | ||
<text x="${sbRectWidth + 55}" y="148" textLength="${stTextWidth}" fill="#000" opacity="0.25">${status}</text> | ||
<text x="${sbRectWidth + 45}" y="138" textLength="${stTextWidth}">${status}</text> | ||
</g> | ||
${icon ? `<image x="40" y="35" width="${iconWidth}" height="130" xlink:href="${icon}"/>` : ''} | ||
</svg> | ||
` | ||
return `<svg width="${width / 10}" height="20" viewBox="0 0 ${width} 200" xmlns="http://www.w3.org/2000/svg"${xlink}> | ||
<linearGradient id="a" x2="0" y2="100%"> | ||
<stop offset="0" stop-opacity=".1" stop-color="#EEE"/> | ||
<stop offset="1" stop-opacity=".1"/> | ||
</linearGradient> | ||
<mask id="m"><rect width="${width}" height="200" rx="30" fill="#FFF"/></mask> | ||
<g mask="url(#m)"> | ||
<rect width="${sbRectWidth}" height="200" fill="#555"/> | ||
<rect width="${stRectWidth}" height="200" fill="#${color}" x="${sbRectWidth}"/> | ||
<rect width="${width}" height="200" fill="url(#a)"/> | ||
</g> | ||
<g fill="#fff" text-anchor="start" font-family="Verdana,DejaVu Sans,sans-serif" font-size="110"> | ||
<text x="${icon ? '220' : '60'}" y="148" textLength="${sbTextWidth}" fill="#000" opacity="0.25">${subject}</text> | ||
<text x="${icon ? '210' : '50'}" y="138" textLength="${sbTextWidth}">${subject}</text> | ||
<text x="${sbRectWidth + 55}" y="148" textLength="${stTextWidth}" fill="#000" opacity="0.25">${status}</text> | ||
<text x="${sbRectWidth + 45}" y="138" textLength="${stTextWidth}">${status}</text> | ||
</g> | ||
${icon ? `<image x="40" y="35" width="${iconWidth}" height="130" xlink:href="${icon}"/>` : ''} | ||
</svg>` | ||
} | ||
@@ -59,0 +55,0 @@ |
{ | ||
"name": "badgen", | ||
"version": "2.4.2", | ||
"version": "2.4.3", | ||
"description": "Fast svg badge generator.", | ||
@@ -5,0 +5,0 @@ "repository": "amio/badgen", |
33403
183