问题
Does the newest Velocity.js Version - V2 - work with the provided UI-Pack, and if yes how? (I downloaded the files from the Github Repo and included the min versions of velocity and velocity.ui)
I am trying to use some effects or make my own sequences but most of the time it doesn't work properly or not at all. Especially if there is a transform: "translate3d(..)"
in the animation it does not work at all not even making my own Animations without the UI pack.
Velocity("registerSequence", "mySequence", {
"duration": 1000,
"0,100%": {
transformOrigin: "center bottom"
},
"0%,20%,53%,80%,100%": {
transform: ["translate3d(0,0px,0)", "easeOutCubic"]
},
"40%,43%": {
transform: ["translate3d(0,-30px,0)", "easeInQuint"]
},
"70%": {
transform: ["translate3d(0,-15px,0)", "easeInQuint"]
},
"90%": {
transform: "translate3d(0,-4px,0)"
}
});
Velocity(element, 'mySequence');
In general I dont really know how to do transform animations correctly especially if I want to chain them, e.g. if I want to move the element to the right and then rotate it. It moves to the right but then for the rotation it jumps back to where it started out. I tried to move the transform origin etc. nothing worked.
element.velocity({
transform: ["translateX(200%)", "translateX(0px)"]
}, {duration: 1000, easing: 'ease-out'}).velocity({
transform: ["scale(0)", "scale(1)"]
}, {duration: 1000, easing: 'ease-out'});
来源:https://stackoverflow.com/questions/60460816/velocity-js-v2-and-ui-pack