question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

how to call the new ui-pack animations in v2?

See original GitHub issue

Hey there, so I’m sorry if I am not reading this properly but I’m just really confused.

I’ve read in many places that the UI-Pack functionalities don’t work for V2 yet… but I’m super confused because on the main readme.md you have this

https://cdnjs.cloudflare.com/ajax/libs/velocity/2.0.2/velocity.ui.min.js

This is a 2.0.2 version of the UI-Pack… is this being auto-generated in error or something? I just figure if you are making available a v2 version of the UI-Pack here then maybe that means it’s working now?

But I can’t figure out how to call it.

previously I was simply doing $('.v--modal').velocity('transition.swoopIn');

And this worked with version 1.5.1

now I’m using Velocity with Vuejs so it seems I have to call it differently.

so I’m doing it like this

import velocity from 'velocity-animate';

and then in my code

this works

velocity($('.v--modal'), { opacity: 1 }, { duration: 300 });

this doesn’t work anymore, since I’m not including the js file directly and importing in vue instead

$('.v--modal').velocity('transition.swoopIn');

and this also doesn’t work

velocity($('.v--modal'), 'transition.swoopIn');

I also tried rebuilding the swoopIn animation with the new syntax

      velocity(
        $('.v--modal'),
        {
          opacity: [1, 0],
          transform: "translateX(25px) scale(1.2)",
          transformOriginX: ['100%', '50%'],
          transformOriginY: ['100%', '100%'],
          scaleX: [1, 0],
          scaleY: [1, 0],
          translateX: [0, -700],
          translateZ: 0,
        },
        { duration: 850 },
      );

but this also doesn’t work.

BTW I am importing the velocity-animate (which I installed with NPM @beta)

But I am manually including the https://cdnjs.cloudflare.com/ajax/libs/velocity/2.0.2/velocity.ui.min.js because there doesn’t seem to be a npm package for that

I basically just really want to use the old animations in V2… specifically the swoopIn animation… and I don’t mind rewriting it but would really love an example of how to write it using the new syntax because I’m just lost with trying to port over the old way of doing things to the new way

And like I mentioned, just really confused about whether the UI animations are working or not yet… because I can see from your commit messages that you did very recently pull them in… but I can’t find any example of how to actually make calls to them… despite the V2 of the UI package being available on your readme

apologies for the annoyance… really like your package and looking forward to using V2 without issues

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:21

github_iconTop GitHub Comments

2reactions
Rycochetcommented, May 11, 2018

Leaving open as this question needs answering until the documentation catches up 😉

1reaction
brunoamaralcommented, Jun 6, 2018

@Rycochet thank you, that was it. I am using the new version and didn’t know I had to attach import 'velocity-animate/velocity.ui.min.js'; to have the UI pack. Thank you 🙂

Read more comments on GitHub >

github_iconTop Results From Across the Web

modifyAnimations(withRepeatCount:autoreverses:animations:)
The animations to perform. Discussion. You must call this method from within an enclosing animation block. The inverse nesting, calling animate(withDuration ...
Read more >
Advances in UIKit Animations and Transitions - WWDC NOTES
If we pass false , the animation is not completed and it is expected to call finishAnimation(at:) in the future to complete the...
Read more >
UIKit Animation Part 3 (ViewController Custom Transition — 2)
First, the navigation controller calls transitionDuration () to find out how long the transition will last; it then calls animateTransition (), ...
Read more >
UIView Hide/Show with animation - ios - Stack Overflow
2 ) Use the following code to animate the fade instead: ... variable (BOOL) called "finished" that is set to *YES* when animation...
Read more >
UIView Animations Tutorial: Practical Recipes
UIKit has some really powerful built-in UIView animations, ... Next, you call move(to:duration:options) , which is in the UIView extension ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found