Skip to content

Commit 63a91b9

Browse files
committed
feat: Changed background of fire icon to dynamic
1 parent ce7ed13 commit 63a91b9

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/card.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,19 +106,24 @@ function generateCard($stats): string
106106
Current Streak
107107
</text>
108108
</g>
109-
109+
110110
<!-- Current Streak Range -->
111111
<g transform='translate(166,145)'>
112112
<rect width='163' height='26' stroke='none' fill='none'></rect>
113113
<text x='81.5' y='13' dominant-baseline='middle' stroke-width='0' text-anchor='middle' style='font-family:&quot;Open Sans&quot;, Roboto, system-ui, sans-serif;font-weight:400;font-size:12px;font-style:normal;fill:{$theme["subtitleText"]};stroke:none;'>
114114
{$currentStreakRange}
115115
</text>
116116
</g>
117-
117+
118+
<!-- mask for background behind fire -->
119+
<defs>
120+
<mask id='cut-off-area'>
121+
<rect x='0' y='0' width='500' height='500' fill='white' />
122+
<ellipse cx='247.5' cy='31' rx='13' ry='18'/>
123+
</mask>
124+
</defs>
118125
<!-- ring around number -->
119-
<circle cx='247.5' cy='71' r='40' style='fill:none;stroke:{$theme["highlight"]};stroke-width:5;'></circle>
120-
<!-- background behind fire -->
121-
<ellipse vector-effect='non-scaling-stroke' cx='247.5' cy='31' rx='13' ry='18' fill='{$theme["background"]}'/>
126+
<circle cx='247.5' cy='71' r='40' mask='url(#cut-off-area)' style='fill:none;stroke:{$theme["highlight"]};stroke-width:5;'></circle>
122127
<!-- fire icon -->
123128
<g>
124129
<path d=' M 235.5 19.5 L 259.5 19.5 L 259.5 43.5 L 235.5 43.5 L 235.5 19.5 Z ' fill='none'/>

0 commit comments

Comments
 (0)