mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-30 15:28:12 +08:00
Add the auto-generated node catalog to the website's user manual (#3662)
* Generate the MVP node catalog in the manual (with some placeholders) * Implement nearly the rest of everything * Move to the tools directory and make it generate nicer default values * Add category descriptions * Organize file structure and improve type naming * Improve book table of contents code * Add collapsing chapter navigation to the book template * Add to build workflow * Clean up site structure
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
const VISIBILITY_COVERAGE_FRACTION = 0.25;
|
||||
|
||||
window.addEventListener("DOMContentLoaded", () => {
|
||||
const players = document.querySelectorAll("[data-auto-play]");
|
||||
players.forEach((player) => {
|
||||
if (!(player instanceof HTMLVideoElement)) return;
|
||||
|
||||
let loaded = false;
|
||||
|
||||
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);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user