@@ -252,7 +252,7 @@ function generateCard(array $stats, array $params = null): string
252
252
$ longestStreakRange = splitLines ($ longestStreakRange , 28 , 0 );
253
253
254
254
return "<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'
255
- style='isolation:isolate' viewBox='0 0 495 195' width='495px' height='195px' direction=' {$ direction }'>
255
+ style='isolation: isolate' viewBox='0 0 495 195' width='495px' height='195px' direction=' {$ direction }'>
256
256
<style>
257
257
@keyframes currstreak {
258
258
0% { font-size: 3px; opacity: 0.2; }
@@ -274,86 +274,86 @@ function generateCard(array $stats, array $params = null): string
274
274
</mask>
275
275
</defs>
276
276
<g clip-path='url(#outer_rectangle)'>
277
- <g style='isolation:isolate'>
277
+ <g style='isolation: isolate'>
278
278
<rect stroke=' {$ theme ["border " ]}' fill=' {$ theme ["background " ]}' rx=' {$ borderRadius }' x='0.5' y='0.5' width='494' height='194'/>
279
279
</g>
280
- <g style='isolation:isolate'>
280
+ <g style='isolation: isolate'>
281
281
<line x1='330' y1='28' x2='330' y2='170' vector-effect='non-scaling-stroke' stroke-width='1' stroke=' {$ theme ["stroke " ]}' stroke-linejoin='miter' stroke-linecap='square' stroke-miterlimit='3'/>
282
282
<line x1='165' y1='28' x2='165' y2='170' vector-effect='non-scaling-stroke' stroke-width='1' stroke=' {$ theme ["stroke " ]}' stroke-linejoin='miter' stroke-linecap='square' stroke-miterlimit='3'/>
283
283
</g>
284
- <g style='isolation:isolate'>
284
+ <g style='isolation: isolate'>
285
285
<!-- Total Contributions Big Number -->
286
286
<g transform='translate(1,48)'>
287
- <text x='81.5' y='32' stroke-width='0' text-anchor='middle' style='font-family:Segoe UI, Ubuntu, sans-serif;font-weight:700;font-size:28px;font-style:normal;fill: { $ theme [ " sideNums " ]} ;stroke:none; opacity: 0; animation: fadein 0.5s linear forwards 0.6s; '>
287
+ <text x='81.5' y='32' stroke-width='0' text-anchor='middle' fill=' { $ theme [ " sideNums " ]} ' stroke='none' style='font-family: \" Segoe UI \" , Ubuntu, sans-serif; font-weight: 700; font-size: 28px; font-style: normal; opacity: 0; animation: fadein 0.5s linear forwards 0.6s'>
288
288
{$ totalContributions }
289
289
</text>
290
290
</g>
291
291
292
292
<!-- Total Contributions Label -->
293
293
<g transform='translate(1,84)'>
294
- <text x='81.5' y='32' stroke-width='0' text-anchor='middle' style='font-family:Segoe UI, Ubuntu, sans-serif;font-weight:400;font-size:14px;font-style:normal;fill: { $ theme [ " sideLabels " ]} ;stroke:none; opacity: 0; animation: fadein 0.5s linear forwards 0.7s; '>
294
+ <text x='81.5' y='32' stroke-width='0' text-anchor='middle' fill=' { $ theme [ " sideLabels " ]} ' stroke='none' style='font-family: \" Segoe UI \" , Ubuntu, sans-serif; font-weight: 400; font-size: 14px; font-style: normal; opacity: 0; animation: fadein 0.5s linear forwards 0.7s'>
295
295
{$ totalContributionsText }
296
296
</text>
297
297
</g>
298
298
299
299
<!-- total contributions range -->
300
300
<g transform='translate(1,114)'>
301
- <text x='81.5' y='32' stroke-width='0' text-anchor='middle' style='font-family:Segoe UI, Ubuntu, sans-serif;font-weight:400;font-size:12px;font-style:normal;fill: { $ theme [ " dates " ]} ;stroke:none; opacity: 0; animation: fadein 0.5s linear forwards 0.8s; '>
301
+ <text x='81.5' y='32' stroke-width='0' text-anchor='middle' fill=' { $ theme [ " dates " ]} ' stroke='none' style='font-family: \" Segoe UI \" , Ubuntu, sans-serif; font-weight: 400; font-size: 12px; font-style: normal; opacity: 0; animation: fadein 0.5s linear forwards 0.8s'>
302
302
{$ totalContributionsRange }
303
303
</text>
304
304
</g>
305
305
</g>
306
- <g style='isolation:isolate'>
306
+ <g style='isolation: isolate'>
307
307
<!-- Current Streak Big Number -->
308
308
<g transform='translate(166,48)'>
309
- <text x='81.5' y='32' stroke-width='0' text-anchor='middle' style='font-family:Segoe UI, Ubuntu, sans-serif;font-weight:700;font-size:28px;font-style:normal;fill: { $ theme [ " currStreakNum " ]} ;stroke:none; animation: currstreak 0.6s linear forwards; '>
309
+ <text x='81.5' y='32' stroke-width='0' text-anchor='middle' fill=' { $ theme [ " currStreakNum " ]} ' stroke='none' style='font-family: \" Segoe UI \" , Ubuntu, sans-serif; font-weight: 700; font-size: 28px; font-style: normal; animation: currstreak 0.6s linear forwards'>
310
310
{$ currentStreak }
311
311
</text>
312
312
</g>
313
313
314
314
<!-- Current Streak Label -->
315
315
<g transform='translate(166,108)'>
316
- <text x='81.5' y='32' stroke-width='0' text-anchor='middle' style='font-family:Segoe UI, Ubuntu, sans-serif;font-weight:700;font-size:14px;font-style:normal;fill: { $ theme [ " currStreakLabel " ]} ;stroke:none; opacity: 0; animation: fadein 0.5s linear forwards 0.9s; '>
316
+ <text x='81.5' y='32' stroke-width='0' text-anchor='middle' fill=' { $ theme [ " currStreakLabel " ]} ' stroke='none' style='font-family: \" Segoe UI \" , Ubuntu, sans-serif; font-weight: 700; font-size: 14px; font-style: normal; opacity: 0; animation: fadein 0.5s linear forwards 0.9s'>
317
317
{$ currentStreakText }
318
318
</text>
319
319
</g>
320
320
321
321
<!-- Current Streak Range -->
322
322
<g transform='translate(166,145)'>
323
- <text x='81.5' y='21' stroke-width='0' text-anchor='middle' style='font-family:Segoe UI, Ubuntu, sans-serif;font-weight:400;font-size:12px;font-style:normal;fill: { $ theme [ " dates " ]} ;stroke:none; opacity: 0; animation: fadein 0.5s linear forwards 0.9s; '>
323
+ <text x='81.5' y='21' stroke-width='0' text-anchor='middle' fill=' { $ theme [ " dates " ]} ' stroke='none' style='font-family: \" Segoe UI \" , Ubuntu, sans-serif; font-weight: 400; font-size: 12px; font-style: normal; opacity: 0; animation: fadein 0.5s linear forwards 0.9s'>
324
324
{$ currentStreakRange }
325
325
</text>
326
326
</g>
327
327
328
328
<!-- ring around number -->
329
329
<g mask='url(#mask_out_ring_behind_fire)'>
330
- <circle cx='247.5' cy='71' r='40' style='fill: none; stroke: {$ theme ["ring " ]}; stroke-width:5; opacity: 0; animation: fadein 0.5s linear forwards 0.4s; '></circle>
330
+ <circle cx='247.5' cy='71' r='40' fill=' none' stroke=' {$ theme ["ring " ]}' stroke-width='5' style=' opacity: 0; animation: fadein 0.5s linear forwards 0.4s'></circle>
331
331
</g>
332
332
<!-- fire icon -->
333
- <g style='opacity: 0; animation: fadein 0.5s linear forwards 0.6s; stroke-opacity: 0; '>
334
- <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' stroke-opacity='0' />
333
+ <g stroke-opacity='0' style='opacity: 0; animation: fadein 0.5s linear forwards 0.6s'>
334
+ <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'/>
335
335
<path d=' M 249 20.17 C 249 20.17 249.74 22.82 249.74 24.97 C 249.74 27.03 248.39 28.7 246.33 28.7 C 244.26 28.7 242.7 27.03 242.7 24.97 L 242.73 24.61 C 240.71 27.01 239.5 30.12 239.5 33.5 C 239.5 37.92 243.08 41.5 247.5 41.5 C 251.92 41.5 255.5 37.92 255.5 33.5 C 255.5 28.11 252.91 23.3 249 20.17 Z M 247.21 38.5 C 245.43 38.5 243.99 37.1 243.99 35.36 C 243.99 33.74 245.04 32.6 246.8 32.24 C 248.57 31.88 250.4 31.03 251.42 29.66 C 251.81 30.95 252.01 32.31 252.01 33.7 C 252.01 36.35 249.86 38.5 247.21 38.5 Z ' fill=' {$ theme ["fire " ]}' stroke-opacity='0'/>
336
336
</g>
337
337
338
338
</g>
339
- <g style='isolation:isolate'>
339
+ <g style='isolation: isolate'>
340
340
<!-- Longest Streak Big Number -->
341
341
<g transform='translate(331,48)'>
342
- <text x='81.5' y='32' stroke-width='0' text-anchor='middle' style='font-family:Segoe UI, Ubuntu, sans-serif;font-weight:700;font-size:28px;font-style:normal;fill: { $ theme [ " sideNums " ]} ;stroke:none; opacity: 0; animation: fadein 0.5s linear forwards 1.2s; '>
342
+ <text x='81.5' y='32' stroke-width='0' text-anchor='middle' fill=' { $ theme [ " sideNums " ]} ' stroke='none' style='font-family: \" Segoe UI \" , Ubuntu, sans-serif; font-weight: 700; font-size: 28px; font-style: normal; opacity: 0; animation: fadein 0.5s linear forwards 1.2s'>
343
343
{$ longestStreak }
344
344
</text>
345
345
</g>
346
346
347
347
<!-- Longest Streak Label -->
348
348
<g transform='translate(331,84)'>
349
- <text x='81.5' y='32' stroke-width='0' text-anchor='middle' style='font-family:Segoe UI, Ubuntu, sans-serif;font-weight:400;font-size:14px;font-style:normal;fill: { $ theme [ " sideLabels " ]} ;stroke:none; opacity: 0; animation: fadein 0.5s linear forwards 1.3s; '>
349
+ <text x='81.5' y='32' stroke-width='0' text-anchor='middle' fill=' { $ theme [ " sideLabels " ]} ' stroke='none' style='font-family: \" Segoe UI \" , Ubuntu, sans-serif; font-weight: 400; font-size: 14px; font-style: normal; opacity: 0; animation: fadein 0.5s linear forwards 1.3s'>
350
350
{$ longestStreakText }
351
351
</text>
352
352
</g>
353
353
354
354
<!-- Longest Streak Range -->
355
355
<g transform='translate(331,114)'>
356
- <text x='81.5' y='32' stroke-width='0' text-anchor='middle' style='font-family:Segoe UI, Ubuntu, sans-serif;font-weight:400;font-size:12px;font-style:normal;fill: { $ theme [ " dates " ]} ;stroke:none; opacity: 0; animation: fadein 0.5s linear forwards 1.4s; '>
356
+ <text x='81.5' y='32' stroke-width='0' text-anchor='middle' fill=' { $ theme [ " dates " ]} ' stroke='none' style='font-family: \" Segoe UI \" , Ubuntu, sans-serif; font-weight: 400; font-size: 12px; font-style: normal; opacity: 0; animation: fadein 0.5s linear forwards 1.4s'>
357
357
{$ longestStreakRange }
358
358
</text>
359
359
</g>
@@ -381,7 +381,7 @@ function generateErrorCard(string $message, array $params = null): string
381
381
// read border_radius parameter, default to 4.5 if not set
382
382
$ borderRadius = $ params ["border_radius " ] ?? "4.5 " ;
383
383
384
- return "<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' style='isolation:isolate' viewBox='0 0 495 195' width='495px' height='195px'>
384
+ return "<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' style='isolation: isolate' viewBox='0 0 495 195' width='495px' height='195px'>
385
385
<style>
386
386
a {
387
387
fill: {$ theme ["dates " ]};
@@ -393,13 +393,13 @@ function generateErrorCard(string $message, array $params = null): string
393
393
</clipPath>
394
394
</defs>
395
395
<g clip-path='url(#outer_rectangle)'>
396
- <g style='isolation:isolate'>
396
+ <g style='isolation: isolate'>
397
397
<rect stroke=' {$ theme ["border " ]}' fill=' {$ theme ["background " ]}' rx=' {$ borderRadius }' x='0.5' y='0.5' width='494' height='194'/>
398
398
</g>
399
- <g style='isolation:isolate'>
399
+ <g style='isolation: isolate'>
400
400
<!-- Error Label -->
401
401
<g transform='translate(166,108)'>
402
- <text x='81.5' y='50' dy='0.25em' stroke-width='0' text-anchor='middle' style='font-family:Segoe UI, Ubuntu, sans-serif;font-weight:400;font-size:14px;font-style:normal;fill: { $ theme [ " sideLabels " ]} ;stroke:none; '>
402
+ <text x='81.5' y='50' dy='0.25em' stroke-width='0' text-anchor='middle' fill=' { $ theme [ " sideLabels " ]} ' stroke='none' style='font-family: \" Segoe UI \" , Ubuntu, sans-serif; font-weight: 400; font-size: 14px; font-style: normal'>
403
403
{$ message }
404
404
</text>
405
405
</g>
@@ -413,10 +413,10 @@ function generateErrorCard(string $message, array $params = null): string
413
413
</defs>
414
414
<!-- Sad face -->
415
415
<g>
416
- <path style='fill: {$ theme ["fire " ]}; ' d='M248,35.8c-25.2,0-45.7,20.5-45.7,45.7s20.5,45.8,45.7,45.8s45.7-20.5,45.7-45.7S273.2,35.8,248,35.8z M248,122.3c-11.2,0-21.4-4.5-28.8-11.9c-2.9-2.9-5.4-6.3-7.4-10c-3-5.7-4.6-12.1-4.6-18.9c0-22.5,18.3-40.8,40.8-40.8 c10.7,0,20.4,4.1,27.7,10.9c3.8,3.5,6.9,7.7,9.1,12.4c2.6,5.3,4,11.3,4,17.6C288.8,104.1,270.5,122.3,248,122.3z'/>
417
- <path style='fill: {$ theme ["fire " ]}; ' d='M252.8,93.8c5.4,1.1,10.3,4.2,13.7,8.6l3.9-3c-4.1-5.3-10-9-16.6-10.4c-10.6-2.2-21.7,1.9-28.3,10.4l3.9,3 C234.9,95.3,244.1,91.9,252.8,93.8z'/>
418
- <circle style='fill: {$ theme ["fire " ]}; ' cx='232.8' cy='71.3' r='4.9'/>
419
- <circle style='fill: {$ theme ["fire " ]}; ' cx='263.4' cy='71.3' r='4.9'/>
416
+ <path fill=' {$ theme ["fire " ]}' d='M248,35.8c-25.2,0-45.7,20.5-45.7,45.7s20.5,45.8,45.7,45.8s45.7-20.5,45.7-45.7S273.2,35.8,248,35.8z M248,122.3c-11.2,0-21.4-4.5-28.8-11.9c-2.9-2.9-5.4-6.3-7.4-10c-3-5.7-4.6-12.1-4.6-18.9c0-22.5,18.3-40.8,40.8-40.8 c10.7,0,20.4,4.1,27.7,10.9c3.8,3.5,6.9,7.7,9.1,12.4c2.6,5.3,4,11.3,4,17.6C288.8,104.1,270.5,122.3,248,122.3z'/>
417
+ <path fill=' {$ theme ["fire " ]}' d='M252.8,93.8c5.4,1.1,10.3,4.2,13.7,8.6l3.9-3c-4.1-5.3-10-9-16.6-10.4c-10.6-2.2-21.7,1.9-28.3,10.4l3.9,3 C234.9,95.3,244.1,91.9,252.8,93.8z'/>
418
+ <circle fill=' {$ theme ["fire " ]}' cx='232.8' cy='71.3' r='4.9'/>
419
+ <circle fill=' {$ theme ["fire " ]}' cx='263.4' cy='71.3' r='4.9'/>
420
420
</g>
421
421
</g>
422
422
</g>
@@ -439,8 +439,8 @@ function convertSvgToPng(string $svg): string
439
439
// remove style and animations
440
440
$ svg = preg_replace ("/(<style>\X*?<\/style>)/m " , "" , $ svg );
441
441
$ svg = preg_replace ("/(opacity: 0;)/m " , "opacity: 1; " , $ svg );
442
- $ svg = preg_replace ("/(animation: fadein.*?; )/m " , "opacity: 1; " , $ svg );
443
- $ svg = preg_replace ("/(animation: currstreak.*?; )/m " , "font-size: 28px; " , $ svg );
442
+ $ svg = preg_replace ("/(animation: fadein[^;' \" ]+ )/m " , "opacity: 1; " , $ svg );
443
+ $ svg = preg_replace ("/(animation: currstreak[^;' \" ]+ )/m " , "font-size: 28px; " , $ svg );
444
444
$ svg = preg_replace ("/<a \X*?>(\X*?)<\/a>/m " , '\1 ' , $ svg );
445
445
446
446
// save svg to random file
0 commit comments