15 ms·
Here is how they are calculating the actual axis refinement [0] const scoreWidth = (Astro.props.score - 33) * (100 / (100 - 33)) [0] https://github.com/wi
by bbbbbenji 3y ago
Here is how they are calculating the actual axis refinement [0]
const scoreWidth = (Astro.props.score - 33) * (100 / (100 - 33))
[0] https://github.com/withastro/astro.build/blob/main/src/pages/_components/CoreWebVitalsGraphItem.astro#L7C20-L7C65 https://github.com/withastro/astro.build/blob/main/src/pages...
> (Astro.props.score - 33) * (100 / (100 - 33))
- dmix 3y agoThe benefits of OSS marketing sites. You can make a PR/issue and point directly at their sneaky code.
- derkoe 3y agoSeems like someone has already done that: https://github.com/withastro/astro.build/pull/730 https://github.com/withastro/astro.build/pull/730
- wallmountedtv 3y agoAnd its been merged now haha. You can see the change too on https://astro.build/ https://astro.build/ It's awesome just how quickly this got addressed.
- endigma 3y agoHappy to help
- ricardobeat 3y agoHave you checked it on mobile? Now it’s skewed the other way due to the space reserved for the label.
- endigma 3y agoI'm aware, this was actually an issue prior to my PR as well, but less obvious. I think this would need some more defensive CSS to maybe shift the label around to the inside of the bar? Or perhaps the labels are unnecessary (it is a p90 of an average of a ton of lighthouse scores after all, not like the number quantifies to much) Edit: https://github.com/withastro/astro.build/pull/731 https://github.com/withastro/astro.build/pull/731
- lyjackal 3y agoSeems like now, predators due to some padding with the number text, the bar chart is still not proportional (but in the other direction. 98 should be further out)
- rwaksmunski 3y agoThis page barely scrolls on my i7 MBP and Firefox.
- jer0me 3y agohttps://github.com/withastro/astro.build/blob/7e4bc761570184b473cfbe14887c00a092d00560/src/pages/_components/CoreWebVitalsGraphItem.astro#L7 https://github.com/withastro/astro.build/blob/7e4bc761570184...