Nainish-Rai / aesthetic-startpage

Aesthetic Startpage to boost your productivity and at the same time give your desktop a new aesthetic look
GNU General Public License v3.0
138 stars 71 forks source link

Refactor theme selection and preloading to avoid FOUC on theme change #92

Closed lewisdoesstuff closed 2 months ago

lewisdoesstuff commented 10 months ago

Hi!

I noticed that the demo page flickers unstyled content when changing the theme from the menu.

I've refactored the theme switching JS to preload all of the themes at page load instead of having the browser fetch them dynamically by switching the stylesheet ref.

Avoids the flash of unstyled HTML when clicking an option in the menu.

This may make first page load slightly slower, but shouldn't be an issue once the styles are cached.

netlify[bot] commented 10 months ago

Deploy Preview for nainish-startpage ready!

Name Link
Latest commit 0ce794e61e18485b9cf68f460aa243b61ee8b823
Latest deploy log https://app.netlify.com/sites/nainish-startpage/deploys/6595c4812cc29700082b154d
Deploy Preview https://deploy-preview-92--nainish-startpage.netlify.app/
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Nainish-Rai commented 10 months ago

@lewisdoesstuff Hey I am testing this and will merge if all works fine

lewisdoesstuff commented 4 months ago

Did this work okay @Nainish-Rai ?

Nainish-Rai commented 2 months ago

@lewisdoesstuff Yess, thanks for the PR