kopia lustrzana https://github.com/badgen/badgen
rodzic
84110cfdca
commit
0b067b22be
12
lib/index.js
12
lib/index.js
|
@ -4,8 +4,8 @@ const colorPresets = require('./color-presets.js')
|
|||
module.exports = function ({subject, status, color, style}) {
|
||||
color = colorPresets[color] || color || colorPresets['blue']
|
||||
|
||||
const sbRectWidth = calcWidth(subject) + 11
|
||||
const stRectWidth = calcWidth(status) + 11
|
||||
const sbRectWidth = calcWidth(subject) + 10
|
||||
const stRectWidth = calcWidth(status) + 10
|
||||
const width = sbRectWidth + stRectWidth
|
||||
|
||||
if (style === 'flat') {
|
||||
|
@ -16,8 +16,8 @@ module.exports = function ({subject, status, color, style}) {
|
|||
<rect x="${sbRectWidth}" width="${stRectWidth}" height="20" fill="#${color}"/>
|
||||
</g>
|
||||
<g fill="#fff" text-anchor="start" font-family="Verdana,DejaVu Sans,sans-serif" font-size="11">
|
||||
<text x="7" y="14.8" fill="#000" opacity="0.1">${subject}</text>
|
||||
<text x="6" y="13.8">${subject}</text>
|
||||
<text x="6.1" y="14.8" fill="#000" opacity="0.1">${subject}</text>
|
||||
<text x="5.1" y="13.8">${subject}</text>
|
||||
<text x="${sbRectWidth + 5.5}" y="14.8" fill="#000" opacity="0.1">${status}</text>
|
||||
<text x="${sbRectWidth + 4.5}" y="13.8">${status}</text>
|
||||
</g>
|
||||
|
@ -38,8 +38,8 @@ module.exports = function ({subject, status, color, style}) {
|
|||
<rect width="${width}" height="20" fill="url(#a)"/>
|
||||
</g>
|
||||
<g fill="#fff" text-anchor="start" font-family="Verdana,DejaVu Sans,sans-serif" font-size="11">
|
||||
<text x="7" y="14.8" fill="#000" opacity="0.25">${subject}</text>
|
||||
<text x="6" y="13.8">${subject}</text>
|
||||
<text x="6.4" y="14.8" fill="#000" opacity="0.25">${subject}</text>
|
||||
<text x="5.4" y="13.8">${subject}</text>
|
||||
<text x="${sbRectWidth + 5.5}" y="14.8" fill="#000" opacity="0.25">${status}</text>
|
||||
<text x="${sbRectWidth + 4.5}" y="13.8">${status}</text>
|
||||
</g>
|
||||
|
|
Ładowanie…
Reference in New Issue