Hey Guys,
I was doing a lot of search here in the forums regarding left/right swiping to load a new scene. I am aware about the “jump to scene” functions and the “regular” slide in/out page transitions triggered by this actions. My problem is – theyjust don’t feel “native”. Native swiping between views on mobile and also modern swiping frameworks like swiper.js will act WHILE you swipe on your screen – and not AFTER you finished your swipe. I am pretty sure that most of you are knowing what I mean…
I saw a few workarounds here (using the drag function and timelines) or by creating symbols from the pages, mounting those symbols one one master page and using js to swipe between the symbols etc. But these are workarounds an not really cool/usable if you will have to deal with a lot of content (pages) in Hype – let’s say for a digital magazine.
I did a LOT of experiments regarding this:
– trying to use swiper.js (which is one of the best solutions imho).Unfortunately this will definitely not work out of the box, because of the way how Hype is constructing the DIV structure
– cutting my projects in different “pages” and manually injecting the pages (in Angular.js) in a swiper/ionic structure. This is working, but it is really a LOT of work and a pain for larger projects
– the last thing I was playing with was dragend.js (https://github.com/Stereobit/dragend). This is looking for me somehow promissing, but I don’t have the js knowledge to try a serious implementation in Hype. According to the dragend.js documentation:
the structure:
<div id="demo">
<div class="dragend-page"></div>
<div class="dragend-page"></div>
</div>
Seems to be achievable with Hype:
<div id="index_hype_container">
<div class="HYPE_scene"></div>
<div class="HYPE_scene"></div>
<div class="HYPE_scene"></div>
...
</div>
calling dragend.js:
new Dragend(document.getElementById("demo"), options);
So this could be maybe something like:
new Dragend(hypeDocument.getElementById("your_hype_container"), options);
since dragend offers something like this for the options parameter: “pageClass: classname selector for all elments that should provide a page” – taking “HYPE_scene” as the classname could be working…?
Have to say that I was not able to put all this together But maybe one of you guys with some more talent for JS could give this a try? Here is what I did:
https://dl.dropboxusercontent.com/u/75478515/swipe_1.zip
I would really see a nice swiping behavior implemented natively in hype, but I am afraid that this could take a long time (if ever). But for the mean time – did one of you guys found a working solution for this?