This is a straightforward WikText for TiddlyWiki 5.3.0+ that creates a flexible grid of flip cards. You can adjust the dimensions in the included stylesheet. Remember to use backticks for the substituted attribute values.
\procedure stateTiddler() $:/temp/flipper-demo
\procedure card-actions()
<$action-listops $tiddler=<<stateTiddler>> $index=<<idx>> $subfilter="+[toggle[clicked]]" />
\end
\procedure flip-card(front, back, idx)
<$button actions=<<card-actions>> tag=div class={{{ flip-container [<stateTiddler>getindex<idx>match[clicked]] :and[join[ ]] }}} >
<div class="flipper">
<div class="front"><$transclude $variable=front $mode=block /></div>
<div class="back"><$transclude $variable=back $mode=block /></div>
</div>
</$button>
\end
Example a
<div class="grid">
<<flip-card "Card A" "Back A" idxA>>
<<flip-card "Card B" "Back B" idxB>>
</div>
Example b: Create an array of flip cards
<div class="grid">
<$list filter="A B C D E F G H" variable=n>
<$transclude $variable=flip-card front=`Card $(n)$ Front` back=`Back $(n)$` idx=`idx-$(n)$` />
</$list>
</div>
Demo and Code
-
To give a try, download flip-card.json (2.0 KB)
-
Drag and drop into https://tiddlywiki.com
-
Open the āflipper-ii/demoā tiddler
-
Click on any card you like
You can use different tiddlers to store card data for each side.
Screenshot
Special kudos to @saqimtiaz for his amazing work on substituted attribute values and the filter operation.