已给版本

This commit is contained in:
梁泽军 2025-03-04 17:06:09 +08:00
parent e3f8651643
commit 2e5cde7d62

View File

@ -85,7 +85,7 @@ console.log('isLegacyiOS', isLegacyiOS);
// 线
const progressArr = [0, 38, 48, 67, 100,]
const progressArr = [0, 25, 45, 85, 100,]
const playerRef = ref(null)
const imageFramePlayer = ref(null)
@ -157,8 +157,8 @@ const playFn = (index) => {
}
if (locationId.value !== index) {
//
//
const setpNum = Math.abs(index - locationId.value)
const direction = index - locationId.value > 0 ? 1 : -1
console.log('setpNum', setpNum);
locationId.value = index;
@ -171,7 +171,7 @@ const playFn = (index) => {
}
]
};
handleMove(progressArr[index - 1], setpNum)
handleMove(progressArr[index - 1], setpNum, direction)
} else {
locationId.value = index
playerRef.value.source = {
@ -237,14 +237,21 @@ const initSvgAnimation = () => {
path: "#motionPath",
align: "#motionPath",
autoRotate: false,
type: "uniform", //
curviness: 0,
//
from: convertCoordinates({ x: 0, y: 0 }),
to: convertCoordinates({ x: 1, y: 1 }),
usePathData: true
},
snap: {
x: 1, //
y: 1
},
paused: true,
duration: 1,
ease: "power2.inOut"
ease: "none",
force3D: true // GPU
})
//
@ -257,7 +264,7 @@ const initSvgAnimation = () => {
}
//
const handleMove = (percent, setpNum) => {
const handleMove = (percent, setpNum,) => {
const target = percent
//
@ -268,6 +275,7 @@ const handleMove = (percent, setpNum) => {
gsap.to(currentProgress, {
value: clampedTarget,
duration: 1 * setpNum,
ease: "power2.inOut", //
onUpdate: () => {
animation.progress(currentProgress.value / 100)
},
@ -290,8 +298,6 @@ const handleMove = (percent, setpNum) => {
//
const animationFn = () => {
const tl = gsap.timeline({
onComplete: () => {
gsap.to(".title-flower", {
@ -659,15 +665,21 @@ const animationFn = () => {
.xfl-icon {
pointer-events: none;
position: absolute;
// position: absolute;
width: 163px;
height: 153px;
// 1.5
will-change: transform;
transform: translate(-50%, -50%) scale(1.5);
transform: translateZ(0) translate(-50%, -50%) scale(1.5);
visibility: hidden;
/* 旧iOS需要绝对像素值 */
@media screen and (-webkit-min-device-pixel-ratio:0) {
will-change: transform;
transform: translateZ(0) translate(-50%, -50%) scale(1.5);
}
#frameBox {
width: 100%;
height: 100%;