-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
33 scorecard #130
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather avoid basing on external resources. Could we vendor these fonts? What are the licenses?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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