okami.mom/strata

git clone https://git.nkp.pet/okami.mom/strata

Niko1221merge f-split-ui5 e9a2ca44a (round-7 UI, time-skip fixes, mode switch mid-goal, /plan, queued messages, uninstaller icon; includes agent6 eecb29593) into f-split-int743a6b3c6

main
521 B8 linesraw
1/** Numbers that move: the pure parts of a short count-up / count-down between two readings. */
2export const easeOutCubic = (t: number) => 1 - Math.pow(1 - Math.min(1, Math.max(0, t)), 3);
3
4/** The value between `from` and `to` after `elapsed` of `duration` milliseconds. */
5export function tweenValue(from: number, to: number, elapsed: number, duration: number): number {
6  if (!Number.isFinite(from) || !Number.isFinite(to) || duration <= 0) return to;
7  return from + (to - from) * easeOutCubic(elapsed / duration);
8}