Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
16 lines
620 B
Plaintext
16 lines
620 B
Plaintext
function calcChildStagger(children, child, delayChildren, staggerChildren = 0, staggerDirection = 1) {
|
|
const index = Array.from(children)
|
|
.sort((a, b) => a.sortNodePosition(b))
|
|
.indexOf(child);
|
|
const numChildren = children.size;
|
|
const maxStaggerDuration = (numChildren - 1) * staggerChildren;
|
|
const delayIsFunction = typeof delayChildren === "function";
|
|
return delayIsFunction
|
|
? delayChildren(index, numChildren)
|
|
: staggerDirection === 1
|
|
? index * staggerChildren
|
|
: maxStaggerDuration - index * staggerChildren;
|
|
}
|
|
|
|
export { calcChildStagger };
|