How can I shuffle the cards? Change the order of the images?

Hello,

I have this tarot cards repeating group and a shuffle button, and I want to change the order of the cards everytime the shuffle button is pressed, how can I do this?

I tried everything, I tried using states and scroll to , the option scroll to a random tarot card only works if you don’t have a fixed set number of rows and columns. I need to have them fixed. Is there any way or any plugin to do this?

I didn’t find any tutorials that have got something to do with this.

Bubbles random operators caches and annoyingly returns same result when you sort it. If you want to keep it all front end (which id recommend) I’d have the deck as a static list each card has an “order” then create a custom state that is a list of numbers.

On button click use a chance.js random number generator to generate the list of numbers that then sets the custom states

Then in the repeating group I’d have the card display using “do search for card with order number = state number:item number current cell index number.

So it would look like this:

you’d click button to shuffle it generates the list of numbers (6,23,9)

Then the repeating group would show card 6, 23,9

You could do this without list as well and just be 3 states if you’re going to only always pull 3 tarot cards

Hello,

Thank you for your reply!

How can I make the cards into an order?

And where is the chance.js random number generator? I’m new to bublle…

I already have a state for the repeating group called start and it’s a number.
and I created two buttons on each sides of the deck and added states to them so that the left button everytime is clicked on will scroll x amount of cards to the left and the same happens with the right button but on the opposite direction. And in the repeating group as data source I have: Search for tarot cards:items from #RepeatingGroup tarot card’s start.

Can I still do it without having to writte something else in the data source? I don’t want to mess the workflows for the other buttons.

This topic was automatically closed after 70 days. New replies are no longer allowed.