-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added better swiping support for touch devices. #496
Conversation
It would be amazing if there was an algorithm to simulate exactly the changes a native do when swiping (like moving the step while you drag until a given threshold). |
@FagnerMartinsBrack I think that's possible to do having transition interpolations for mid-frames. The only question is performance. I will try to experiment with that :) |
@FagnerMartinsBrack I've added interpolation for frames to provide native-like dragging. The performance seems usable on mobile devices :) Check this demo out: Tested on Samsung Galaxy A5, Chrome browser. P. S. I also implemented a <div class="slide step" data-x="0.5w" data-y="2h"> ... </div> This means to use 0.5 * screen width for X and 2 * screen height for Y to build responsive presentations (to use current screen dimensions Instead of using explicit pixel-values) You can check out the demo presentation here: http://crowdsourcemyname.com |
Really awesome! I believe though, for the sake of usability, that it should swipe using the pointer as the reference instead of the actual slide edges. If you use the slide edges it will not transition when you start the swipe after the middle of the screen. |
@FagnerMartinsBrack Thanks :) However I'm not sure if I understand you correctly, can you describe the desired behavior? |
@FagnerMartinsBrack ah, I see now. Sure, I can just change threshold to some lower value (currently 1/2 screen width, probably need 1/4 or 1/5 or smth) Thanks for the demo! I'm gonna push update in few minutes. |
@FagnerMartinsBrack Done! Check out the demo site :) |
👍 |
Anyone with write access to the repo around? :) |
I am not sure if this is going to be merged soon, see #435. The reason I suggested some improvements was because I see a lot of value in something like this, even if it is not merged. I will probably cherry-pick some of the changes if you don't mind ;D |
@FagnerMartinsBrack use as you wish, it's open for everyone :) |
@and3rson I find this feature very useful. Just pinging to say that we haven't forgotten it. The problem is that without proper automated testing this can't be landed. We will keep this in the queue and come back later. To give a little bit of context, recently a decision was made in the project to make the development more active. If you want to keep track of what we are doing right now, please check #512. |
@FagnerMartinsBrack Awesome! Thanks for info. You guys are doing an awesome job. |
Relative positions can now be expressed as a multiple of screen width and height, using "w" and "h" respectively, appended to the end of the number value. First part of incorporating mobile and swipe support from impress#496 by Andrew Dunai (@and3rson)
Also: - Removes the code that allowed navigation by tapping left/right edge of screen. - Removes the code that disabled impress.js on mobile devices - Adds new API call impress().swipe() Refactored for the plugin api from this pull request by @and3rson: impress#496
Hi @and3rson Your code is really cool! I've merged this in the past 2 commits to my fork. You can try it with the official demo here. Note: To play with the swiping, you may want to stop the autoplay by clicking on the pause button to the bottom right. Testing with my 3 year old tablet, the official demo animates a swipe pretty smoothly on Chrome. Only the "tiny ideas" slide is tough, as it zooms (ie scales) so heavily. On Firefox for Android it was quite sluggish, but doing a quick swipe instead of trying to "enjoy it" will bring you to the next step no problem. Details:
|
Is there any news from here? 😉 |
@Pierstoval This depends on #575. We can't start implementing new features until we have a considerable amount of integration test coverage in the project. We don't want to break the presentations of who is using it :) |
Also: - Removes the code that allowed navigation by tapping left/right edge of screen. - Actually, this was already removed in this branch... - Removes the code that disabled impress.js on mobile devices - Adds new API call impress().swipe() Refactored for the plugin api from this pull request by @and3rson: impress#496 Manually "cherry picked" from c44fd0f
Also: - Removes the code that allowed navigation by tapping left/right edge of screen. - Actually, this was already removed in this branch... - Removes the code that disabled impress.js on mobile devices - Adds new API call impress().swipe() Refactored for the plugin api from this pull request by @and3rson: impress#496 Manually "cherry picked" from c44fd0f
Also: - Removes the code that allowed navigation by tapping left/right edge of screen. - Actually, this was already removed in this branch... - Removes the code that disabled impress.js on mobile devices - Adds new API call impress().swipe() Refactored for the plugin api from this pull request by @and3rson: impress#496 Manually "cherry picked" from c44fd0f
Also: - Removes the code that allowed navigation by tapping left/right edge of screen. - Actually, this was already removed in this branch... - Removes the code that disabled impress.js on mobile devices - Adds new API call impress().swipe() Refactored for the plugin api from this pull request by @and3rson: #496 Manually "cherry picked" from henrikingo@c44fd0f
This is now merged to master (with some refactoring to fit the new plugin based approach). Thanks @and3rson, I enjoyed your code! (Never did anything that swiped before.) |
@henrikingo Glad it helps! |
So, recently I've been doing some stuff for a presentation and noticed that it is not working on my Android.
A little examination has shown me that Android, iPhone and iPad are blacklisted for the swipe.
I think the time has come to disable the blacklist as most modern (and not-so-modern) devices nowadays work flawlessly with Impress.JS.
So, I've implemented a "swipe" left & right effect and removed "Android" User-Agent from the blacklist.
Check out the video below.
Hope this is useful to somebody :)