I added the JS code in the before “/body>” tag, sandwiched between <script & /script>, and then added the HTML Code in an embed elements in the designer.
I published the page, but I was not able to see the animation.
Can you share the published link? Alternatively, in your browser, open the developer tools to see what the error is - This will help provide direction re finding a solution.
My first guess is that you forgot to include the dependencies (ex. <script src=“[LIBRARY URL]”></script>). The pen you referenced has 3 that will need to be included above the JS code you pasted. You can see a pens dependencies by clicking the ‘gear’ icon to the right of the JS code section title.