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

Add image optimisation #5

Open
KleeUT opened this issue Feb 1, 2023 · 1 comment
Open

Add image optimisation #5

KleeUT opened this issue Feb 1, 2023 · 1 comment

Comments

@KleeUT
Copy link
Contributor

KleeUT commented Feb 1, 2023

We're currently serving oversized images, let's add something to help us generate images that are a better size
Possible options include:

@Calinator444
Copy link
Contributor

I haven't really found a method of resizing images before sending them out, but I might have a method of reducing load times. Essentially it involves using the Intersection Observer API to check whether the image has entered the view port. Before the image is loaded, the dominant color of the image is used as a placeholder (the dominant color is determined using this tool). When the image enters the viewport, the background url is set to the appropriate image.

I created a mockup using standard html and CSS. A few of these things can be tweaked of course, such as when images pop in, how long they take to fade in or whether there's a transition animation.

Image_optimization-min

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

No branches or pull requests

2 participants