|
|
|
|
@ -96,18 +96,18 @@
|
|
|
|
|
|
|
|
|
|
let shiftKeyIsDown = $state(false);
|
|
|
|
|
let lastAssetMouseEvent: TimelineAsset | null = $state(null);
|
|
|
|
|
let slidingWindow = $state({ top: 0, bottom: 0 });
|
|
|
|
|
|
|
|
|
|
const updateSlidingWindow = () => {
|
|
|
|
|
const v = $state.snapshot(viewport);
|
|
|
|
|
const top = (document.scrollingElement?.scrollTop || 0) - slidingWindowOffset;
|
|
|
|
|
const bottom = top + v.height;
|
|
|
|
|
const w = {
|
|
|
|
|
let scrollTop = $state(0);
|
|
|
|
|
let slidingWindow = $derived.by(() => {
|
|
|
|
|
const top = (scrollTop || 0) - slidingWindowOffset;
|
|
|
|
|
const bottom = top + viewport.height;
|
|
|
|
|
return {
|
|
|
|
|
top,
|
|
|
|
|
bottom,
|
|
|
|
|
};
|
|
|
|
|
slidingWindow = w;
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const updateSlidingWindow = () => (scrollTop = document.scrollingElement?.scrollTop ?? 0);
|
|
|
|
|
|
|
|
|
|
const debouncedOnIntersected = debounce(() => onIntersected?.(), 750, { maxWait: 100, leading: true });
|
|
|
|
|
|
|
|
|
|
let lastIntersectedHeight = 0;
|
|
|
|
|
|