Longtime I didn’t contribute much but I thought I’d share some code I wipped up as a example for a project I am working on. It’s much like waypoints but works across multiple Hype-Instances on a page. The example only uses only one Hype-Animations but is intended for mixed HTML/CMS-content and multiple Hype-Animations across the page.
The example forwards the events to the Hype-Animation and those then can be used inside the animation as needed. Check out the init-Function (on sceneload) to see the setup. One gets enter, exit and progress updates. This example just initially pauses the timeline and then plays it in either direction on enter and exit event but obviously one can do much more.
Check out the Scrollama-Project this is based on:
Furthermore the example has the debug-mode and progress enabled (example.html):
Long time indeed Nice implementation but I’m not sure about the support / lack of in some browsers. Doesn’t work in Safari or iOS or IE but nothing works in IE I, personally would probably stick to waypoints for the moment but I am 1 in a sea of many.
This looks GREAT Many thanks @MaxZieb for putting it up!
Just out of curiosity, does anyone happen to know if the same principle could be used entirely within Hype? Like, for example, if an entire site is made using a single Hype document which uses enter and exit viewport triggers to drive the content (I’ve attached a very simple hype plus a vid of it being used to help illustrate).
It would be brilliantly cool if content could be triggered at that ‘middle of the window’ line whilst remaining fixed in place within the browser window instead of scrolling. I’m probably not explaining myself very well but hopefully someone might be able to understand my ramblings
Hey Frannie, I put the doc link up as I thought it is useful in these type of threads to have a link to the object of discussion. It was not really in reply to you… But hope it helps…
For anybody that wants to use this with the WordPress-Plugin use the following in your functions.php or use a plugin like “snippets” (search under install plugins) to add the code.
Is would this be working inside a Banner format inject deep in a website?
Would like a solution for this, so that we can start using these entering Viewport functions.
Well, it is external JS, you need to include it in your banner file directly or in the package. It also is based in Intersection Observer and has the Polyfill in the source. I saw one could update the dependencies after all this time. Seem like Scrollama was updated meanwhile. I made a bundle from this called ScrollKit. You can also use Hype Action Events and add the polyfill there if you need to support older Browsers, I also just put some scrolling samples out that only work with on scroll, as well. Either way, using an Intersection Observer is more modern than doing some plain old scroll math.
As you know. If I create a Banner 300x250 and this gets loaded into an iframe on a website I don't habe to option for the banner to be scrolled into view. There is no scrolling in the banner itself. But on the website it is placed on.
But sandboxing will probably prevent it from working like @h_classen said …
Update:just tested it loading across two domains and it works! Only thing there is a slight undefined bug (for my custom isAbove attribute) in Hype Action Events at the moment when using it in an iframe. I will fix it tonight.