I̶ ̶d̶o̶n̶’̶t̶ ̶h̶a̶v̶e̶ ̶a̶ ̶t̶u̶t̶o̶r̶i̶a̶l̶ ̶f̶o̶r̶ ̶i̶t̶ ̶y̶e̶t̶ ̶-̶ ̶b̶u̶t̶ ̶i̶t̶’̶s̶ ̶p̶r̶e̶t̶t̶y̶ ̶s̶i̶m̶p̶l̶e̶.̶ Have the first card blank, make more cards and drop a Patternshop widget onto it. Arrow keys to flip through the layers. The checkbox enables composition.
To incorporate it into yours I think would be pretty simple. I might have to update it for your use case, because I didn’t read your code closely. So, a few things might be need to be refactored. But, overall, I think it mostly works how you have this set up, it would just need a few tweaks.
EDIT: There’s a demo HTML on my Patternshop page, now.