Greenheart / swipeforfuture.com

Solving the climate crisis, one swipe at a time 🌍🔥
https://swipeforfuture.com
GNU General Public License v3.0
6 stars 1 forks source link

Fix position for cards swiped to the left #179

Closed Greenheart closed 3 years ago

Greenheart commented 3 years ago

Due to how the cards get positioned when they are supposed to be swiped outside of the screen, they get further on the right side than on the left side, causing the animation to seem slower to the left than to the right.

This could be fixed by adding an offset like card.cliendWidth to the calculated position, for example by using bind:this={card} to get the size of the card with card.clientWidth.

Greenheart commented 3 years ago

Fixed with https://github.com/Greenheart/swipeforfuture.com/commit/0c94397854eec9aaeec3be65baedc44c929e25b3