Major overhaul to the theme and now functioning.
This commit is contained in:
+42
@@ -0,0 +1,42 @@
|
||||
import {
|
||||
SUPPORTS_INTERSECTION
|
||||
} from "./chunk-LZ5T2ERG.js";
|
||||
import {
|
||||
onScopeDispose,
|
||||
ref,
|
||||
shallowRef,
|
||||
watch
|
||||
} from "./chunk-2MKFL3BX.js";
|
||||
|
||||
// node_modules/vuetify/lib/composables/intersectionObserver.js
|
||||
function useIntersectionObserver(callback, options) {
|
||||
const intersectionRef = ref();
|
||||
const isIntersecting = shallowRef(false);
|
||||
if (SUPPORTS_INTERSECTION) {
|
||||
const observer = new IntersectionObserver((entries) => {
|
||||
callback?.(entries, observer);
|
||||
isIntersecting.value = !!entries.find((entry) => entry.isIntersecting);
|
||||
}, options);
|
||||
onScopeDispose(() => {
|
||||
observer.disconnect();
|
||||
});
|
||||
watch(intersectionRef, (newValue, oldValue) => {
|
||||
if (oldValue) {
|
||||
observer.unobserve(oldValue);
|
||||
isIntersecting.value = false;
|
||||
}
|
||||
if (newValue) observer.observe(newValue);
|
||||
}, {
|
||||
flush: "post"
|
||||
});
|
||||
}
|
||||
return {
|
||||
intersectionRef,
|
||||
isIntersecting
|
||||
};
|
||||
}
|
||||
|
||||
export {
|
||||
useIntersectionObserver
|
||||
};
|
||||
//# sourceMappingURL=chunk-AJ7MUB7M.js.map
|
||||
Reference in New Issue
Block a user