Forum Discussion
Flashcard Animation in Storyline
The old version on my profile page still used jQuery and externally loaded GSAP. As that is not needed anymore i removed that from the Storyline file and reworked it so it only uses Vanilla Javascript.
Basically it works like this...
On start of the timeline all is set to its initial state. With queryselector getting all the needed elements, then hiding whats needed...lastly hiding the blocker. Showing that in this screenshot... blocker moved on purpose so you see the texts...
Then all cards and backcards have Javascript triggers.
Basically all the cards do the same more or less. With gsap.set some values are set directly so you donot see any change on screen. Then with gsap.to the animation is triggered... basically a simple perspective rotation 'rotationY' with some eases. To ensure all is properly visible i exchange the z-order of the different elements. For that i added a changeMan element ( the small block on top ) for each card. Its invisible, but used to control the z-order of the elements. So when the card is turned indeed the backside is showing on top in Storyline.
Do copy the code to a code-editor like Sublime Text with color coding, else you go bananas trying to get this right straight in Storyline. As seen below.
I add the working Storyline as a NewYears present ;-) ..if you need help...shout...
Happy coding in 2021
Math just one thing if I use the Modern player and scale the browser the objects move and resize when animating is there any fix for this?