velocity.js

velocity-react - animating scrollTop after component update

試著忘記壹切 提交于 2021-02-07 12:13:57
问题 I'm writing a simple "console" that shows messages in a chat-like manner. With messages appearing from the bottom, and moving up. I have the working code, but I'd like to animate the appearing messages by scrolling the container to the bottom each time a new "li" is added. Current code: import React from 'react'; import { render, findDOMNode } from 'react-dom'; export default React.createClass({ componentDidUpdate : function(){ var node = findDOMNode(this); node.scrollTop = node.scrollHeight;

How to animate translate properties with Velocity.js?

旧巷老猫 提交于 2021-02-05 03:49:58
问题 I have a simple block that is suppose to move left 200px with translateX. It will move left with position left. I can't seem to move the block with translateX or translateY. CSS values for Transform translate will work. Reason to use translate is the performance compared to position. I commented out the position left with Velocity to give you an idea what I'm trying to achieve. var button = document.getElementById('button'); var adiv = document.getElementById('panel'); button.addEventListener

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",

Velocity.js/Blast.js starting opacity at 0

天涯浪子 提交于 2020-02-08 02:46:26
问题 I am using Velocity.js and Blast.js to create a simple load in each word as an animation... one of the basic setups. I am also using this alongside Cycle2. I have a few issues with what I am trying to achieve that I cannot work out from the documentation. A 'Velocity/Blast function' can exist on many slides throughout in a cycle2 slider so it needs to re-run each time. This is what I am trying to achieve: The Velocity animation needs to begin at opacity:0 each time... so when you cycle to a

Why is animation jittery/choppy at long duration?

非 Y 不嫁゛ 提交于 2020-01-06 02:54:07
问题 When I animate a box just 90px to left and 90px down in 15 seconds using velocity.js, the animation is a bit jittery. How can I fix this problem, or should I just use another animation library for JS? $(function() { $("#box").velocity({ top: 90, left: 90 }, { duration: 15000, easing: 'ease-in-out' }); }); #box { color: white; background-color: black; width: 50px; height: 50px; text-align: center; line-height: 50px; position: absolute; } <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1

Why is animation jittery/choppy at long duration?

…衆ロ難τιáo~ 提交于 2020-01-06 02:54:05
问题 When I animate a box just 90px to left and 90px down in 15 seconds using velocity.js, the animation is a bit jittery. How can I fix this problem, or should I just use another animation library for JS? $(function() { $("#box").velocity({ top: 90, left: 90 }, { duration: 15000, easing: 'ease-in-out' }); }); #box { color: white; background-color: black; width: 50px; height: 50px; text-align: center; line-height: 50px; position: absolute; } <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1

Use velocity.js with webpack

为君一笑 提交于 2020-01-02 07:06:23
问题 I'm trying to use some parts of materialize-css , js , some of these parts depend on velocity and some other chunks of code that I have depend on jQuery . I'm using webpack to build it all. requiring velocity is not working for me, I still get a .velocity is not a function . I use ProvidePlugin to inject jQuery (installed with npm) where $ or jQuery are used, and this is working nice. plugins: [ new webpack.ProvidePlugin({ $: "jquery", jQuery: "jquery", }) ] However looks like velocity is not

Use velocity.js with webpack

情到浓时终转凉″ 提交于 2020-01-02 07:06:12
问题 I'm trying to use some parts of materialize-css , js , some of these parts depend on velocity and some other chunks of code that I have depend on jQuery . I'm using webpack to build it all. requiring velocity is not working for me, I still get a .velocity is not a function . I use ProvidePlugin to inject jQuery (installed with npm) where $ or jQuery are used, and this is working nice. plugins: [ new webpack.ProvidePlugin({ $: "jquery", jQuery: "jquery", }) ] However looks like velocity is not

Animate React component when unmount/leave

纵然是瞬间 提交于 2019-12-24 10:09:36
问题 I want to use Velocity to fade out a component when the component leaves . I'm calling the callback but there is no animation. What is wrong with the code below? export class Foo extends Component { componentWillEnter(cb) { cb(); } componentWillLeave(cb) { const node = findDOMNode(el); Velocity(node, { opacity: 0 }, { duration:200 }); cb(); } } 回答1: Found it on a GSAP post. The callback needs to be passed to Velocity as the complete function. export class Foo extends Component {

Animate draggable element using velocity.js

独自空忆成欢 提交于 2019-12-24 04:26:23
问题 I am using velocity.js to animate a draggable SVG element as it is dragged by the user. However, velocity.js queues the previous mousemove co-ordinates & animates through all the subsequent mousemove co-ordinates. What I want is velocity.js not to queue the co-ordinates but animate to the latest co-ordinates as passed on by the function. Check this jsFiddle document.addEventListener("mousedown",mouseDown); document.addEventListener("mouseup",endMove); var click=false; var clickX, clickY; var