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

Slow down AnimatedContainer #228

Open
jrock2004 opened this issue Jul 11, 2020 · 2 comments
Open

Slow down AnimatedContainer #228

jrock2004 opened this issue Jul 11, 2020 · 2 comments

Comments

@jrock2004
Copy link

So I have a div that has some text and a button to expand. When I click expand the animated container starts to grow in height and the new content scrolls down from the top. But the issues is, I want to height of the box to start growing once the text hits the bottom of the div? Is this possible?

<AnimatedContainer>
  {{#animated-if showSelectTip use=this.transition}}
    <div>
       <h1> Cool Text</h1>
       <button>Show More</button>
    </div>
  {{else}}
    <div>
      .....
      .....
      .....
      .....
    </div>
  {{/animated-if}}
</AnimatedContainer>
*transition({ insertedSprites, removedSprites }) {
  removedSprites.forEach(sprite => {
    fadeOut(sprite, { duration: 100 });
  });

  for (let sprite of insertedSprites) {
    sprite.startAtPixel({ y: 0 });
    yield move(sprite, { easing: easeOut, duration: 750 });
  }
}

If you need to see a more working example I can put one up

@aalimovs
Copy link

aalimovs commented Aug 7, 2020

@jrock2004 I'm actually building something similar, which transition did you end up with?

Here's what I'm using:

function * ({ insertedSprites, removedSprites }) {
    insertedSprites.forEach(fadeIn);
    removedSprites.forEach(fadeOut);
}

@jrock2004
Copy link
Author

@aalimovs I ended up, just living with it. I started to play with the speed of the animation to minimize the look, but never came up with a good solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants