remotes.js 1.1 KB

123456789101112131415161718192021222324252627282930
  1. /**
  2. * Touch-based remote controller for your presentation courtesy
  3. * of the folks at http://remotes.io
  4. */
  5. (function(window){
  6. /**
  7. * Detects if we are dealing with a touch enabled device (with some false positives)
  8. * Borrowed from modernizr: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/touch.js
  9. */
  10. var hasTouch = (function(){
  11. return ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch;
  12. })();
  13. if(!hasTouch){
  14. head.ready( 'remotes.ne.min.js', function() {
  15. new Remotes("preview")
  16. .on("swipe-left", function(e){ Reveal.right(); })
  17. .on("swipe-right", function(e){ Reveal.left(); })
  18. .on("swipe-up", function(e){ Reveal.down(); })
  19. .on("swipe-down", function(e){ Reveal.up(); })
  20. .on("tap", function(e){
  21. Reveal.toggleOverview();
  22. });
  23. } );
  24. head.js('https://raw.github.com/Remotes/Remotes/master/dist/remotes.ne.min.js');
  25. }
  26. })(window);