How to add a custom element?

I’m currently challenging Wix for my future website and one of the thing that I need in this website is some sections where, when scrolled, display an animation, frame-by-frame. I wrote a component in the form of a standalone JS script plus and HTML markup and a CSS stylesheet, but I can’t find a way to add it to my Wix site.

Additionnally, I’m unable to access the global window object from Velo and this is required to listen to the “scroll” event - I have an error “ReferenceError: window is not defined” when executing addEventListener on the global window object.

Can someone show me the right direction to add custom elements to my site?

Note that using a Custom Element creates an…iframe, which prevent me to access the parent window and listen to the scroll event.