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

JavaScript runs once, CSS handles a 24 hour animation #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Zegnat
Copy link

@Zegnat Zegnat commented Oct 11, 2022

Somewhere between an interesting experiment and something I wanted to do. No hard feelings if you do not deem it mergable, I will just continue on my fork. There is probably more clean-up that can be done.

This change gets rid of the 4 second JavaScript interval. Instead it generates 24 hour CSS animations once and lets the browser handle it. In the browser profiler this gets rid of rendering and painting steps.

Currently all the elements are added by JavaScript and the animations generated on the fly. Though for even better performance it could have been added straight to the HTML. The only thing JavaScript will always be needed for is to set the animation start time.

This also simplifies the blue hover styling. No more weird blinking in and out of existence for the final coloured rectangle.

Would love to get your opinion on some of these techniques!

@netlify
Copy link

netlify bot commented Oct 11, 2022

Deploy Preview for melodious-otter-07ba46 ready!

Name Link
🔨 Latest commit f074227
🔍 Latest deploy log https://app.netlify.com/sites/melodious-otter-07ba46/deploys/634556278d76100008608768
😎 Deploy Preview https://deploy-preview-4--melodious-otter-07ba46.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 settings.

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.

None yet

1 participant