Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Couple lines of CSS cut page loading and resize times by 100 times (on my machine). Description of what content-visibility is: https://web.dev/articles/content-visibility Basically browser now doesn't render/layout invisible sections. As a downside it makes scrollbar jump around slightly when you scroll the page, as browser recalculates the layout. Section size was calculated using the following JS code: const getAverage = (arr) => arr.reduce((p, c) => p + c, 0) / arr.length getAverage(Array.from(document.querySelectorAll(".sect1").entries().map(([idx, el]) => el.getBoundingClientRect().height ))) getAverage(Array.from(document.querySelectorAll(".sect2").entries().map(([idx, el]) => el.getBoundingClientRect().height )))
- Loading branch information