no message

cyl/master-0804
jscyl13849007907 4 months ago
parent 6afdf71935
commit 8aee8da1c3

@ -356,11 +356,26 @@ export default {
onTouchEnd() {
let that = this;
that.isTouching = false;
setTimeout(() => {
//
const animationDuration = 300; // (ms)
const frameDuration = 16; // (60fps)
const totalFrames = Math.ceil(animationDuration / frameDuration);
let currentFrame = 0;
const startScale = that.backgroundScale;
const startScroll = that.mtScroll;
const animate = () => {
currentFrame++;
const progress = Math.min(currentFrame / totalFrames, 1);
const easeOutQuart = 1 - Math.pow(1 - progress, 4);
that.backgroundScale = startScale * (1 - easeOutQuart);
that.mtScroll = startScroll * (1 - easeOutQuart);
if (progress < 1) {
setTimeout(animate, frameDuration);
} else {
that.backgroundScale = 0;
that.mtScroll = 0
}, 100);
that.mtScroll = 0;
}
};
animate();
},
goHome() {

Loading…
Cancel
Save