googlefonts / diffenator2

A font comparison tool that will not stop until your fonts are exhaustively compared.
Apache License 2.0
45 stars 6 forks source link

Adding autoSwitch for diff browsers proofer #129

Open juandelperal opened 9 months ago

juandelperal commented 9 months ago

This enables the automatic switching of fonts (new vs old) every 1.25 secs. This helps to compare the versions without clicking all the time.

If the user clicks the old/new button, then the switching stops.

Demo: ScreenRecording2024-01-30at11 39 00-ezgif com-video-to-gif-converter

PS. I couldn't test it compiles the HTML properly, just added the snippets in the template

m4rc1e commented 8 months ago

Sorry for not looking at this sooner.

m4rc1e commented 8 months ago

Love It! Once ci passes, I'll merge.

m4rc1e commented 8 months ago

Seems the toggle has been broken for the other pages. I get the following traceback if I open up a page other than proofer.html

Uncaught ReferenceError: autoSwitch is not defined
    at HTMLDivElement.switchFonts (Black-Bold-ExtraBold-Medium-diffbrowsers_waterfall.html:638:25)

Since I like the feature, I don't mind fixing this but it may take me a while to get round to it.

juandelperal commented 8 months ago

Nice! I can help with it. How do I build or run tests locally?

juandelperal commented 8 months ago

I (blindly) added a possible fix, but I cant generate the HTMLs properly I tried using python src/diffenator2/__main__.py diff -fb ...

but it seems that I'm getting a cached version, as the generated htmls don't show the changes I am trying