Skip to content

Slow down AnimatedContainer #228

@jrock2004

Description

@jrock2004

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions