BigW Consortium Gitlab

badge.svg.erb 1.25 KB
Newer Older
1
<svg xmlns="http://www.w3.org/2000/svg" width="<%= badge.width %>" height="20">
2 3 4 5 6 7
  <linearGradient id="b" x2="0" y2="100%">
    <stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
    <stop offset="1" stop-opacity=".1"/>
  </linearGradient>

  <mask id="a">
8
    <rect width="<%= badge.width %>" height="20" rx="3" fill="#fff"/>
9 10 11
  </mask>

  <g mask="url(#a)">
12 13 14
    <path fill="<%= badge.key_color %>"
          d="M0 0 h<%= badge.key_width %> v20 H0 z"/>
    <path fill="<%= badge.value_color %>"
15
          d="M<%= badge.key_width %> 0 h<%= badge.value_width %> v20 H<%= badge.key_width %> z"/>
16 17
    <path fill="url(#b)"
          d="M0 0 h<%= badge.width %> v20 H0 z"/>
18 19 20 21
  </g>

  <g fill="#fff" text-anchor="middle">
    <g font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
22 23 24 25 26 27 28 29 30 31 32 33
      <text x="<%= badge.key_text_anchor %>" y="15" fill="#010101" fill-opacity=".3">
        <%= badge.key_text %>
      </text>
      <text x="<%= badge.key_text_anchor %>" y="14">
        <%= badge.key_text %>
      </text>
      <text x="<%= badge.value_text_anchor %>" y="15" fill="#010101" fill-opacity=".3">
        <%= badge.value_text %>
      </text>
      <text x="<%= badge.value_text_anchor %>" y="14">
        <%= badge.value_text %>
      </text>
34 35 36
    </g>
  </g>
</svg>