Swipeable Cards Using View Model Properties

Hi everyone,

I’m feeling quite frustrated because I can’t figure out how to create simple swipeable cards. It seems like it should be an easy task, but I’m stuck.

My goal is to display a company history across about 20 cards that users can swipe through (see basic layout). The year should update accordingly, and the card content should change with each swipe.

However, I’m struggling with the basics and haven’t found any posts or tutorials that clearly explain how to handle this using view model properties.

To understand the logic, I tried building a simple prototype using grey rectangles.

My idea was to use two listeners (pointer down and pointer up) to detect the start and end of a swipe. The difference between the start and end positions would determine the swipe direction and how the cards should move.

Does anyone have a simple and intuitive approach for setting this up?

Cheers,
Christoph
/