Skip to content

Commit

Permalink
Merge pull request #48 from anuraghazra/fix-circl-rank-rim
Browse files Browse the repository at this point in the history
design: added a rim to circle rank's progress
  • Loading branch information
anuraghazra committed Jul 14, 2020
2 parents 014f710 + 6f79b49 commit cbd0e58
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/renderStatsCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const renderStatsCard = (stats = {}, options = { hide: [] }) => {
const statItems = Object.keys(STATS)
.filter((key) => !hide.includes(key))
.map((key, index) =>
// create the text nodes, and pass index so that we can calculate the line spacing
// create the text nodes, and pass index so that we can calculate the line spacing
createTextNode({ ...STATS[key], index, lineHeight: lheight })
);

Expand Down Expand Up @@ -113,6 +113,7 @@ const renderStatsCard = (stats = {}, options = { hide: [] }) => {
: `<g data-testid="rank-circle" transform="translate(400, ${
height / 1.85
})">
<circle class="rank-circle-rim" cx="-10" cy="8" r="40" />
<circle class="rank-circle" cx="-10" cy="8" r="40" />
<text
x="0"
Expand All @@ -139,6 +140,12 @@ const renderStatsCard = (stats = {}, options = { hide: [] }) => {
fill: ${iconColor};
display: ${!!show_icons ? "block" : "none"};
}
.rank-circle-rim {
stroke: ${titleColor};
fill: none;
stroke-width: 6;
opacity: 0.2;
}
.rank-circle {
stroke-dashoffset: 30;
stroke-dasharray: ${rankProgress};
Expand Down

0 comments on commit cbd0e58

Please sign in to comment.