Update/improve landing loading time #491
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
Notes
TDLR: using a single asset for landing page images that include the images and maybe even animations may be better for performance
Previously, a state variable was used to track whether the images had loaded in or not. Each image was rendered one by one, and when they had all loaded, the images would unblur and expand into the landing section. The issue was that the way images were being rendered in, the landing page seemed very choppy.
Initially, using a useRef object as well as making all images hidden until they were loaded in made the transition a lot smoother. Another problem came up though-- there was a big gap between when the user would enter the page and when the images would load in. So I opted to make a progress bar.
The way I see it, there are two options: 1) add the progress bar and make them smooth 2) no progress bar, faster images on screen but a little less smooth. A third option that I think would work pretty good would be to make a single asset that contains every image in the landing page as well as any of the desired animations. This might be a little over-the-top right now but may be a good future consideration.