UNPKG

@serendie/ui

Version:

Adaptive UI component library as part of Serendie Design System by Mitsubishi Electric

20 lines (19 loc) 410 B
import { describeArc as a } from "./util.js"; const i = (n) => (n % 1 + 1) % 1, h = ({ progress: n, radius: o, width: r }) => { const t = i(n), e = t * Math.PI * 2, s = 180 + 40 * Math.sin(-e) + 40, c = 90 * Math.sin(e) + 90; return { d: a( o + r, o + r, o, t * 360 + c, t * 360 + s ), rotationDeg: t * 360 }; }; export { h as getAnimatedArcProps, i as normalizeProgress };