Skip to content

33 scorecard#130

Open
Snaki009 wants to merge 7 commits into
florczakraf:masterfrom
Snaki009:22-scorecard
Open

33 scorecard#130
Snaki009 wants to merge 7 commits into
florczakraf:masterfrom
Snaki009:22-scorecard

Conversation

@Snaki009

@Snaki009 Snaki009 commented Aug 17, 2023

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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