1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
initAnime: () => { proxy.$anime.set('.box', { translateY: function (el: any, i: number, l: any) { DATA.yTrans[i] = { y: i * 40 }; return i * 40; }, }); DATA.animation = proxy.$anime({ targets: DATA.yTrans, duration: ((DATA.overdueCompanyList.length * 40) / 20.8) * 1000, easing: 'linear', y: `-=${40 * DATA.overdueCompanyList.length}`, loop: true, update: function (anim: any) { proxy.$anime.set('.box', { translateY: function (el: any, i: number, l: any) { return DATA.yTrans[i]?.y % (40 * DATA.overdueCompanyList.length) > 0 ? DATA.yTrans[i]?.y % (40 * DATA.overdueCompanyList.length) : (DATA.yTrans[i]?.y % (40 * DATA.overdueCompanyList.length)) + 40 * DATA.overdueCompanyList.length; }, }); }, }); }, handlePlay: () => { DATA.animation && DATA.animation.play(); }, handlePause: () => { DATA.animation && DATA.animation.pause(); } onUnmounted(() => { DATA.animation && DATA.animation.remove(DATA.yTrans); });
|