+
+ {isDefined(turnsState) &&
+
{turnsText}
}
+
+ {isDefined(level) &&
+
+ Lv
+ {level}
+
}
+ {isDefined(name) &&
+
{name}
}
+
+ {isDefined(hpText) &&
+
}
+ {isDefined(mpText) &&
+
}
+ {isDefined(ipText) &&
+
}
+ {isDefined(spText) &&
+
+
+ {spText}
+ }
+
+}
diff --git a/src/SpringyValueHook.ts b/src/SpringyValueHook.ts
new file mode 100644
index 0000000..12b91f4
--- /dev/null
+++ b/src/SpringyValueHook.ts
@@ -0,0 +1,131 @@
+import {useCallback, useMemo, useState} from "react";
+import {Interpolation, SpringConfig, SpringValue, to, useSpring, useTrail} from "@react-spring/web";
+
+export interface UseSpringyValueProps {
+ current?: number
+ max?: number
+ flash?: boolean
+ springDelays?: readonly [number, number, number]
+ springConfigs?: readonly [SpringConfig, SpringConfig, SpringConfig]
+ flashConfig?: SpringConfig
+}
+
+export interface UseSpringyValueOutput {
+ springs: {v: SpringValue}[]
+ flashSpring: {v: SpringValue}
+ interpolate: SpringyValueInterpolate
+}
+
+export interface SpringyValues {
+ currentValue?: number // The true current value of the resource, after the recent delta.
+ displayedValue: number // The displayed current value of the resource, after the recent delta.
+ newValue: number // The displayed value of the resource as of ~2 seconds ago.
+ recentValue: number // The end of the delta that's being applied.
+ maxValue?: number // The maximum value of the resource.
+ previousValue?: number // The original value before the most recent delta.
+ flashValue: number // The position in the oscillation of the flashing resource.
+ flashing?: boolean // Whether the resource is actively flashing.
+}
+
+const literalSymbol: unique symbol = Symbol("SpringyValueLiteralSymbol")
+export type SpringyValueLiteral