33 scorecard#130
Conversation
| context.fillText('{{ score.ex_score|div:100|stringformat:".2f" }}', 350, 570) | ||
|
|
||
| context.font = '15px miso' | ||
| context.fillText('boogiestats.andr.host', 200, 590) |
There was a problem hiding this comment.
we should take it from the user's request, the domain can change any time + this codebase is open -- anyone can take it and host for themselves. See how it's done on the user manual page for filling configuration snippets.
| <link href="https://fonts.cdnfonts.com/css/miso" rel="stylesheet" /> | ||
| <link href="https://fonts.cdnfonts.com/css/wendy" rel="stylesheet" /> |
There was a problem hiding this comment.
I'd rather avoid basing on external resources. Could we vendor these fonts? What are the licenses?
There was a problem hiding this comment.
Miso license, source:fontsquirell
L I C E N S E I N F O R M A T I O N
———————————————————-
You can use MISO for free.
You can share MISO with your friends
as long as you include this text file.
You are NOT permitted to sell MISO.
As for wendy: could by unlicensed as most pages skip that part but one page mentions:
EN: Only available for testing the font. Non-commercial and reproduction prohibited. Please contact the author for official purchase of use.
Could be boilerplate, needs doublecheck
There was a problem hiding this comment.
this is a real issue because the fonts don't load reliably as described on PDGC. When browser cache is disabled they never display properly.
|
|
||
| const canvas = document.getElementById('statcard') | ||
| const context = canvas.getContext('2d') | ||
| const nodec = '{{ score.comment }}'.includes('No Dec/WO') |
There was a problem hiding this comment.
this is unreliable. We could just display 0s for them (it's saved as 0 in the DB in that case anyway). BTW, there's also option to disable just WO ;)
There was a problem hiding this comment.
Left this on purpose as this comment is not that uncommon to gray it out. On every other outcome it's just 0 and working properly
| context.font = '40px Wendy' | ||
| context.textAlign = 'right' | ||
| context.fillText('EX', 355, 540) | ||
| context.textAlign = 'center' | ||
| context.fillText('{{ score.ex_score|div:100|stringformat:".2f" }}', 350, 570) |
| if('{{ score.song.chart_info.steps_type}}'.includes('double')) context.fillText('DOUBLE', 81, 123) | ||
|
|
||
| context.font = '50px miso' | ||
| context.fillText('BoogieStats', 200, 45) |
There was a problem hiding this comment.
I think we could get rid of the big branding at the top, there's a smaller one in the footer that's also a full address which might be more useful for getting new people on
|
|
||
| context.fillStyle = '#ffffff' | ||
| context.fillText('FANTASTIC', 190, 280) | ||
| context.fillText('EXCELENT', 190, 320) |
There was a problem hiding this comment.
| context.fillText('EXCELENT', 190, 320) | |
| context.fillText('EXCELLENT', 190, 320) |
| const sum = parseInt('{{ score.total_steps }}') | ||
| const p = parseInt('{{ score.fantastics_plus }}') / sum * barWidth; | ||
| const f = parseInt('{{ score.fantastics }}') / sum * barWidth; | ||
| const e = parseInt('{{ score.excelents }}') / sum * barWidth; |



resolves #33
Generation is done fully client-side via canvas
Added 2 fonts
Details:

View for charts not in db + page position (this image contains not included fantastics split)
Long name charts
