decord/source/modules/virtual_currency/shared/AnimationUtils.tsx

35 lines
1 KiB
TypeScript
Raw Normal View History

// Module ID: 11131
// Function ID: 11132
// Name: AnimationUtils
2026-07-23 10:11:24 +00:00
// Dependencies: [2]
2026-08-27 16:17:25 +00:00
// Exports: getOrbBalanceCounterAnimationConfigs
2026-07-20 16:05:17 +00:00
// Module 11131 (AnimationUtils)
import size from "module_2" /* 2 */;
2026-08-24 06:08:38 +00:00
const ORB_LOTTIE_COUNTER_ANIMATION_FACTORS = { EARN: 0.25, SPEND: 0.3 };
let result = size.fileFinishedImporting("modules/virtual_currency/shared/AnimationUtils.tsx");
2026-07-20 16:05:17 +00:00
export const EXPECTED_ORB_LOTTIE_ANIMATION_DURATION_MS = 3000;
export { ORB_LOTTIE_COUNTER_ANIMATION_FACTORS };
2026-08-27 16:17:25 +00:00
export const getOrbBalanceCounterAnimationConfigs = function getOrbBalanceCounterAnimationConfigs(diff, targetTime) {
targetTime = targetTime.targetTime;
if (targetTime.isRenderedWithoutLottieAnimation) {
const obj2 = { duration: targetTime, delay: 0 };
return obj2;
2026-08-27 16:17:25 +00:00
} else {
let str = "SPEND";
if (diff > 0) {
str = "EARN";
}
const result = targetTime * obj[str];
obj = { duration: result, delay: null };
2026-08-27 16:17:25 +00:00
let num2 = 0;
if (diff > 0) {
num2 = targetTime - result;
}
obj.delay = num2;
2026-08-27 16:17:25 +00:00
return obj;
2026-07-20 16:05:17 +00:00
}
};