Skip to content
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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

33 scorecard #130

wants to merge 7 commits into from

Conversation

Snaki009
Copy link
Contributor

@Snaki009 Snaki009 commented Aug 17, 2023

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)
image

image

Long name charts
image

context.fillText('{{ score.ex_score|div:100|stringformat:".2f" }}', 350, 570)

context.font = '15px miso'
context.fillText('boogiestats.andr.host', 200, 590)
Copy link
Owner

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.

Comment on lines +12 to +13
<link href="https://fonts.cdnfonts.com/css/miso" rel="stylesheet" />
<link href="https://fonts.cdnfonts.com/css/wendy" rel="stylesheet" />
Copy link
Owner

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?

Copy link
Contributor Author

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

Copy link
Owner

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')
Copy link
Owner

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 ;)

Copy link
Contributor Author

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

Comment on lines 164 to 168
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)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the alignment for the EX Score seems to be a bit off:

image

if('{{ score.song.chart_info.steps_type}}'.includes('double')) context.fillText('DOUBLE', 81, 123)

context.font = '50px miso'
context.fillText('BoogieStats', 200, 45)
Copy link
Owner

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)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const e = parseInt('{{ score.excelents }}') / sum * barWidth;
const e = parseInt('{{ score.excellents }}') / sum * barWidth;

image

@florczakraf
Copy link
Owner

I'm not sure where it happens so I'll just leave a generic PR comment for it. There's some broken special character escaping:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scorecards
2 participants