I’ve improved this even further thanks to the new data() short code that comes with Blocs 6.1.
I have the experiment project available here and it now only uses 2 interactions to get this effect on unlimited number of pages.
You need Blocs for Mac 6.1 for this to work.