Major overhaul to the theme and now functioning.

This commit is contained in:
2026-01-05 16:07:30 -05:00
parent 5823ca3c39
commit a475dfeab6
5218 changed files with 1643729 additions and 13229 deletions
@@ -0,0 +1,33 @@
// Utilities
import { defer, propsFactory } from "../util/index.js"; // Types
// Composables
export const makeDelayProps = propsFactory({
closeDelay: [Number, String],
openDelay: [Number, String]
}, 'delay');
export function useDelay(props, cb) {
let clearDelay = () => {};
function runDelay(isOpening, options) {
clearDelay?.();
const delay = isOpening ? props.openDelay : props.closeDelay;
const normalizedDelay = Math.max(options?.minDelay ?? 0, Number(delay ?? 0));
return new Promise(resolve => {
clearDelay = defer(normalizedDelay, () => {
cb?.(isOpening);
resolve(isOpening);
});
});
}
function runOpenDelay() {
return runDelay(true);
}
function runCloseDelay(options) {
return runDelay(false, options);
}
return {
clearDelay,
runOpenDelay,
runCloseDelay
};
}
//# sourceMappingURL=delay.js.map