Velocity.js V2 and UI Pack

一曲冷凌霜 提交于 2021-01-29 17:34:00

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!