(args)
| 74 | } |
| 75 | |
| 76 | export function easeAnimate(args) { |
| 77 | const clicked = args.object as Button; |
| 78 | const page: Page = clicked.page; |
| 79 | const select = getViewById(page, 'select') as SegmentedBar; |
| 80 | const item: SegmentedBarItem = select.items[select.selectedIndex]; |
| 81 | const animsIn: AnimationDefinition[] = []; |
| 82 | const animsOut: AnimationDefinition[] = []; |
| 83 | for (let i = 0; i < 100; i++) { |
| 84 | const box = getViewById(page, 'el-' + i) as Label; |
| 85 | const prop = getBoxPropertyAnimationData(item.title, clicked.text, box, 32, 24); |
| 86 | animsIn.push({ |
| 87 | [prop.animateKey]: prop.animateValueTo, |
| 88 | delay: 15 * i, |
| 89 | target: box, |
| 90 | duration: prop.animateDuration, |
| 91 | curve: prop.animateEase, |
| 92 | }); |
| 93 | animsOut.push({ |
| 94 | [prop.animateKey]: prop.animateValueFrom, |
| 95 | target: box, |
| 96 | delay: prop.animateReturnDelay + 5 * Math.abs(i - 100), |
| 97 | duration: prop.animateDuration, |
| 98 | curve: prop.animateEase, |
| 99 | }); |
| 100 | } |
| 101 | new Animation(animsIn, false) |
| 102 | .play() |
| 103 | .then(() => new Animation(animsOut, false).play()) |
| 104 | .catch((e) => console.log(e)); |
| 105 | } |
nothing calls this directly
no test coverage detected