MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / easeAnimate

Function easeAnimate

apps/ui/src/animation/animation-army-100-page.ts:76–105  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

74}
75
76export 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}

Callers

nothing calls this directly

Calls 5

getViewByIdFunction · 0.90
playMethod · 0.65
pushMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected