2022-06-29 16:15:58 +08:00
|
|
|
import type { CommonMapToken, SeedToken } from '../../interface';
|
2022-09-01 20:09:32 +08:00
|
|
|
import genRadius from './genRadius';
|
2022-06-29 16:15:58 +08:00
|
|
|
|
|
|
|
export default function genCommonMapToken(token: SeedToken): CommonMapToken {
|
2022-12-09 17:52:34 +08:00
|
|
|
const { motionUnit, motionBase, borderRadius, lineWidth } = token;
|
2022-06-29 16:15:58 +08:00
|
|
|
|
|
|
|
return {
|
|
|
|
// motion
|
2022-10-25 17:04:36 +08:00
|
|
|
motionDurationFast: `${(motionBase + motionUnit).toFixed(1)}s`,
|
2022-06-29 16:15:58 +08:00
|
|
|
motionDurationMid: `${(motionBase + motionUnit * 2).toFixed(1)}s`,
|
|
|
|
motionDurationSlow: `${(motionBase + motionUnit * 3).toFixed(1)}s`,
|
|
|
|
|
|
|
|
// line
|
|
|
|
lineWidthBold: lineWidth + 1,
|
|
|
|
|
|
|
|
// radius
|
2022-11-01 15:06:38 +08:00
|
|
|
...genRadius(borderRadius),
|
2022-06-29 16:15:58 +08:00
|
|
|
};
|
|
|
|
}
|