Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Example) Remove something from the DOM with animation #50

Open
GrosSacASac opened this issue Apr 17, 2019 · 0 comments
Open

(Example) Remove something from the DOM with animation #50

GrosSacASac opened this issue Apr 17, 2019 · 0 comments

Comments

@GrosSacASac
Copy link
Owner

GrosSacASac commented Apr 17, 2019

One way would be to be able to provide a custom removeNode function

const removeNode = (node) => {
    if (node.nodeType === 1) {
    node.animate([
        // keyframes
        { transform: 'translateY(0px)' },
        { transform: 'translateY(-300px)' }
      ], {
        // timing options
        duration: 20000,
        iterations: 1
      }).finished.then(function () {
          node.remove();
      });
    } else {
        node.remove()
    }
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant