nns-dapp icon indicating copy to clipboard operation
nns-dapp copied to clipboard

TBD Proposal cards animation

Open mstrasinskis opened this issue 8 months ago • 0 comments

Motivation

This PR adds animation to the /proposals page cards, making it clearer for users to understand that the universe were switched. The animation will also keep users engaged and improve the overall user experience.

Changes

  • Added constants for card animation.
  • Added utility function isHtmlElementInViewport.
  • Provided card index to the ProposalCard component, allowing each card to determine its animation start time (with a default value, since it's not a critical feature).
  • Implemented a sequential fly animation in the ProposalCard component:
    • |global modificator was applied to make the animation work between pages. Only in transition was used. No navigation issues detected.
    • Only visible cards will be animated (due to animation duration, checking card visibility only at creation suffices).
    • Only the first 18 cards (maximum visible count on large screens) are animated with the sequential effect.
    • Other cards appear using a simultaneous animation to maintain a smooth experience for lazy-loaded proposals.
  • Added logic to UniverseWithActionableProposals to prevent animation of the first headline and initiate animation of the next headline after the standard animation duration.
  • Added fade animation for the proposals page loaders and banners.

Tests

  • Tested manually in multiple browsers: chrome, ff, safari, iOS.
  • Demo link: https://qsgjb-riaaa-aaaaa-aaaga-cai.mstr-ingress.devenv.dfinity.network/proposals/?u=qsgjb-riaaa-aaaaa-aaaga-cai

Todos

  • [x] Add entry to changelog (if necessary).

mstrasinskis avatar Jun 04 '24 12:06 mstrasinskis