mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-02 02:28:11 +08:00
Modernize and fix website build tooling deps and utilize JS type checking (#3348)
* Modernize and fix website build tooling deps and utilize JS type checking * Upgrade to the latest Node.js
This commit is contained in:
@@ -7,16 +7,18 @@ window.addEventListener("DOMContentLoaded", () => {
|
||||
|
||||
let loaded = false;
|
||||
|
||||
new IntersectionObserver((entries) => {
|
||||
entries.forEach((entry) => {
|
||||
if (!loaded && entry.intersectionRatio > VISIBILITY_COVERAGE_FRACTION) {
|
||||
player.removeAttribute("preload");
|
||||
player.setAttribute("autoplay", "");
|
||||
new IntersectionObserver(
|
||||
(entries) => {
|
||||
entries.forEach((entry) => {
|
||||
if (!loaded && entry.intersectionRatio > VISIBILITY_COVERAGE_FRACTION) {
|
||||
player.removeAttribute("preload");
|
||||
player.setAttribute("autoplay", "");
|
||||
|
||||
loaded = true;
|
||||
};
|
||||
});
|
||||
}, { threshold: VISIBILITY_COVERAGE_FRACTION })
|
||||
.observe(player);
|
||||
loaded = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
{ threshold: VISIBILITY_COVERAGE_FRACTION },
|
||||
).observe(player);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user