├── .gitignore ├── scss ├── _opr.scss └── main.scss ├── config.rb ├── index.html ├── readme.md ├── css └── main.css └── js ├── opr.js └── jquery.touchSwipe.min.js /.gitignore: -------------------------------------------------------------------------------- 1 | .sass-cache/ 2 | .idea 3 | -------------------------------------------------------------------------------- /scss/_opr.scss: -------------------------------------------------------------------------------- 1 | .opr-page{ 2 | position:fixed; 3 | height: 100%; 4 | width: 100%; 5 | } 6 | .opr-current{ 7 | z-index: 99; 8 | } 9 | .opr-animate{ 10 | z-index:100; 11 | } 12 | .opr-nav a[data-target], .opr-next, .opr-prev{ 13 | cursor: pointer; 14 | } -------------------------------------------------------------------------------- /config.rb: -------------------------------------------------------------------------------- 1 | require 'compass/import-once/activate' 2 | # Require any additional compass plugins here. 3 | 4 | # Set this to the root of your project when deployed: 5 | http_path = "/testing/" 6 | css_dir = "css" 7 | sass_dir = "scss" 8 | images_dir = "img" 9 | javascripts_dir = "js" 10 | 11 | # You can select your preferred output style here (can be overridden via the command line): 12 | # output_style = :expanded or :nested or :compact or :compressed 13 | 14 | # To enable relative paths to assets via compass helper functions. Uncomment: 15 | #relative_assets = true 16 | 17 | # To disable debugging comments that display the original location of your selectors. Uncomment: 18 | # line_comments = false 19 | 20 | 21 | # If you prefer the indented syntax, you might want to regenerate this 22 | # project again passing --syntax sass, or you can uncomment this: 23 | # preferred_syntax = :sass 24 | # and then run: 25 | # sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | OnePageR 5 | 6 | 7 | 8 | 9 | 17 | 18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |

 

30 |
31 |
32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /scss/main.scss: -------------------------------------------------------------------------------- 1 | @import "compass/reset"; 2 | @import url(http://fonts.googleapis.com/css?family=Roboto+Slab:400,300,100,700); 3 | @import "opr"; 4 | 5 | $brand1: #11CC88; 6 | $brand2: #FFB242; 7 | $brand3: #418AD0; 8 | $brand4: #FF6342; 9 | $dark: #333; 10 | $light: #ddd; 11 | $transition: .3s ease-in-out; 12 | 13 | body{ 14 | background-color: $light; 15 | font-family: 'Roboto Slab', serif; 16 | color: $dark; 17 | } 18 | a{ 19 | text-decoration: none; 20 | color: $dark; 21 | display:block; 22 | } 23 | 24 | a:after{ 25 | content: ''; 26 | position:relative; 27 | display: block; 28 | width: 8px; 29 | border-bottom: 2px solid $dark; 30 | transition: $transition; 31 | } 32 | a:hover:after{ 33 | width: 100%; 34 | } 35 | #nav-main{ 36 | position: fixed; 37 | right: 0; 38 | z-index: 999; 39 | padding: 20px; 40 | margin: 20px; 41 | border: 4px solid $dark; 42 | } 43 | #nav-main li{ 44 | float:left; 45 | } 46 | #nav-main li+li{ 47 | margin-left:20px; 48 | } 49 | .first{ 50 | background-color: $brand1; 51 | } 52 | .second{ 53 | background-color: $brand2; 54 | } 55 | .third{ 56 | background-color: $brand3; 57 | } 58 | .fourth{ 59 | background-color: $brand4; 60 | } 61 | 62 | .opr-next{ 63 | width:30px; 64 | height:30px; 65 | position: fixed; 66 | left: 50%; 67 | bottom: 40px; 68 | box-shadow: 4px 4px 0 $dark; 69 | transform: translate(-50%, 0) rotate(45deg); 70 | cursor: pointer; 71 | } -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # OnePageR 2 | 3 | A minimalistic single page slides template based on jQuery 4 | 5 | [view the demo](http://schliflo.github.io/OnePageR/) 6 | 7 | 8 | ## Features 9 | 10 | * Minimal code 11 | * Maximum flexibility 12 | * Fullscreen slides 13 | * Three navigation methods: 14 | * Click navigation 15 | * Arrow-key navigation 16 | * Menu navigation 17 | * Minimum requirements: 18 | * jQuery 19 | 20 | ## Usage 21 | 22 | * include jQuery 23 | * include opr.js file 24 | * include opr stylesheet (scss @import "opr") 25 | * wrap your slides in ".opr-container" 26 | * add ".opr-page" to each slide 27 | * you're good to go 28 | 29 | optional: 30 | 31 | * add menu- or click navigation according to example file. 32 | * make sure to use data targets with menu nav 33 | 34 | ## License 35 | 36 | This is free and unencumbered software released into the public domain. 37 | 38 | Anyone is free to copy, modify, publish, use, compile, sell, or 39 | distribute this software, either in source code form or as a compiled 40 | binary, for any purpose, commercial or non-commercial, and by any 41 | means. 42 | 43 | In jurisdictions that recognize copyright laws, the author or authors 44 | of this software dedicate any and all copyright interest in the 45 | software to the public domain. We make this dedication for the benefit 46 | of the public at large and to the detriment of our heirs and 47 | successors. We intend this dedication to be an overt act of 48 | relinquishment in perpetuity of all present and future rights to this 49 | software under copyright law. 50 | 51 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 52 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 53 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 54 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 55 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 56 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 57 | OTHER DEALINGS IN THE SOFTWARE. 58 | 59 | For more information, please refer to -------------------------------------------------------------------------------- /css/main.css: -------------------------------------------------------------------------------- 1 | @import url(http://fonts.googleapis.com/css?family=Roboto+Slab:400,300,100,700); 2 | /* line 5, ../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.1/stylesheets/compass/reset/_utilities.scss */ 3 | html, body, div, span, applet, object, iframe, 4 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 5 | a, abbr, acronym, address, big, cite, code, 6 | del, dfn, em, img, ins, kbd, q, s, samp, 7 | small, strike, strong, sub, sup, tt, var, 8 | b, u, i, center, 9 | dl, dt, dd, ol, ul, li, 10 | fieldset, form, label, legend, 11 | table, caption, tbody, tfoot, thead, tr, th, td, 12 | article, aside, canvas, details, embed, 13 | figure, figcaption, footer, header, hgroup, 14 | menu, nav, output, ruby, section, summary, 15 | time, mark, audio, video { 16 | margin: 0; 17 | padding: 0; 18 | border: 0; 19 | font: inherit; 20 | font-size: 100%; 21 | vertical-align: baseline; 22 | } 23 | 24 | /* line 22, ../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.1/stylesheets/compass/reset/_utilities.scss */ 25 | html { 26 | line-height: 1; 27 | } 28 | 29 | /* line 24, ../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.1/stylesheets/compass/reset/_utilities.scss */ 30 | ol, ul { 31 | list-style: none; 32 | } 33 | 34 | /* line 26, ../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.1/stylesheets/compass/reset/_utilities.scss */ 35 | table { 36 | border-collapse: collapse; 37 | border-spacing: 0; 38 | } 39 | 40 | /* line 28, ../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.1/stylesheets/compass/reset/_utilities.scss */ 41 | caption, th, td { 42 | text-align: left; 43 | font-weight: normal; 44 | vertical-align: middle; 45 | } 46 | 47 | /* line 30, ../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.1/stylesheets/compass/reset/_utilities.scss */ 48 | q, blockquote { 49 | quotes: none; 50 | } 51 | /* line 103, ../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.1/stylesheets/compass/reset/_utilities.scss */ 52 | q:before, q:after, blockquote:before, blockquote:after { 53 | content: ""; 54 | content: none; 55 | } 56 | 57 | /* line 32, ../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.1/stylesheets/compass/reset/_utilities.scss */ 58 | a img { 59 | border: none; 60 | } 61 | 62 | /* line 116, ../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.1/stylesheets/compass/reset/_utilities.scss */ 63 | article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, nav, section, summary { 64 | display: block; 65 | } 66 | 67 | /* line 1, ../scss/_opr.scss */ 68 | .opr-page { 69 | position: fixed; 70 | height: 100%; 71 | width: 100%; 72 | } 73 | 74 | /* line 6, ../scss/_opr.scss */ 75 | .opr-current { 76 | z-index: 99; 77 | } 78 | 79 | /* line 9, ../scss/_opr.scss */ 80 | .opr-animate { 81 | z-index: 100; 82 | } 83 | 84 | /* line 12, ../scss/_opr.scss */ 85 | .opr-nav a[data-target], .opr-next, .opr-prev { 86 | cursor: pointer; 87 | } 88 | 89 | /* line 13, ../scss/main.scss */ 90 | body { 91 | background-color: #ddd; 92 | font-family: 'Roboto Slab', serif; 93 | color: #333; 94 | } 95 | 96 | /* line 18, ../scss/main.scss */ 97 | a { 98 | text-decoration: none; 99 | color: #333; 100 | display: block; 101 | } 102 | 103 | /* line 24, ../scss/main.scss */ 104 | a:after { 105 | content: ''; 106 | position: relative; 107 | display: block; 108 | width: 8px; 109 | border-bottom: 2px solid #333; 110 | transition: 0.3s ease-in-out; 111 | } 112 | 113 | /* line 32, ../scss/main.scss */ 114 | a:hover:after { 115 | width: 100%; 116 | } 117 | 118 | /* line 35, ../scss/main.scss */ 119 | #nav-main { 120 | position: fixed; 121 | right: 0; 122 | z-index: 999; 123 | padding: 20px; 124 | margin: 20px; 125 | border: 4px solid #333; 126 | } 127 | 128 | /* line 43, ../scss/main.scss */ 129 | #nav-main li { 130 | float: left; 131 | } 132 | 133 | /* line 46, ../scss/main.scss */ 134 | #nav-main li + li { 135 | margin-left: 20px; 136 | } 137 | 138 | /* line 49, ../scss/main.scss */ 139 | .first { 140 | background-color: #11CC88; 141 | } 142 | 143 | /* line 52, ../scss/main.scss */ 144 | .second { 145 | background-color: #FFB242; 146 | } 147 | 148 | /* line 55, ../scss/main.scss */ 149 | .third { 150 | background-color: #418AD0; 151 | } 152 | 153 | /* line 58, ../scss/main.scss */ 154 | .fourth { 155 | background-color: #FF6342; 156 | } 157 | 158 | /* line 62, ../scss/main.scss */ 159 | .opr-next { 160 | width: 30px; 161 | height: 30px; 162 | position: fixed; 163 | left: 50%; 164 | bottom: 40px; 165 | box-shadow: 4px 4px 0 #333; 166 | transform: translate(-50%, 0) rotate(45deg); 167 | cursor: pointer; 168 | } 169 | -------------------------------------------------------------------------------- /js/opr.js: -------------------------------------------------------------------------------- 1 | (function ($) { 2 | 3 | var oprCur = $('.opr-current'); // always stores the current active slide 4 | var animationRunning = false; 5 | 6 | function oprHasNext(slide) { // check if slide has valid next 7 | if (slide.next().is('.opr-page')) { 8 | return true; 9 | } 10 | return false; 11 | } 12 | 13 | function oprHasPrev(slide) { // check if slide has valid prev 14 | if (slide.prev().is('.opr-page')) { 15 | return true; 16 | } 17 | return false; 18 | } 19 | 20 | function oprIDExists(pageID) { // check if pageID exists 21 | if ($('.opr-page[data-target="' + pageID + '"]').length > 0) { 22 | return true; 23 | } 24 | return false; 25 | } 26 | 27 | function oprNext() { 28 | if (!animationRunning) { // check if animation is running 29 | var slide = oprCur; 30 | if (oprHasNext(slide)) { 31 | animationRunning = true; 32 | var next = slide.next('.opr-page'); 33 | slide.addClass('opr-animate'); // put slide in front (z-index :100) 34 | slide.removeClass('opr-current'); // remove current status from old slide 35 | next.addClass('opr-current'); // add current status to new slide 36 | slide.slideUp(function () { 37 | slide.removeClass('opr-animate'); 38 | slide.show(); // make old slide visible again, as slideUp() adds display:none 39 | animationRunning = false; 40 | }); 41 | oprCur = next; // set current slide 42 | } 43 | } 44 | } 45 | 46 | function oprPrev() { 47 | if (!animationRunning) { // check if animation is running 48 | var slide = oprCur; 49 | if (oprHasPrev(slide)) { 50 | animationRunning = true; 51 | var prev = slide.prev('.opr-page'); 52 | prev.hide(); // hide prev slide before slideDown() 53 | prev.addClass('opr-animate'); // put slide in front (z-index :100) 54 | prev.slideDown(function () { 55 | slide.removeClass('opr-current'); // remove current status from old slide 56 | prev.removeClass('opr-animate'); 57 | prev.addClass('opr-current'); // add current status to new slide 58 | animationRunning = false; 59 | }); 60 | oprCur = prev; // set current slide 61 | } 62 | } 63 | } 64 | 65 | function oprID(pageID) { 66 | if (!animationRunning) { // check if animation is running 67 | var slide = oprCur; 68 | if (slide.data('target') != pageID && oprIDExists(pageID)) { 69 | animationRunning = true; 70 | var page = $('.opr-page[data-target="' + pageID + '"]'); 71 | page.hide(); // hide new slide before slideDown() 72 | page.addClass('opr-animate'); // put slide in front (z-index :100) 73 | page.slideDown(function () { 74 | slide.removeClass('opr-current'); // remove current status from old slide 75 | page.removeClass('opr-animate'); 76 | page.addClass('opr-current'); // add current status to new slide 77 | animationRunning = false; 78 | }); 79 | oprCur = page; // set current slide 80 | } 81 | } 82 | } 83 | 84 | //****************************// 85 | // click events // 86 | //****************************// 87 | $('.opr-next').on('click', function () { // handles next button 88 | oprNext(); 89 | }); 90 | $('.opr-prev').on('click', function () { // handles prev button 91 | oprPrev(); 92 | }); 93 | $('.opr-nav').on('click', 'a', function () { // handles menu navigation 94 | var pageID = $(this).data('target'); 95 | oprID(pageID); 96 | }); 97 | 98 | //****************************// 99 | // key events // 100 | //****************************// 101 | $(document).keydown(function (e) { 102 | switch (e.which) { 103 | case 38: // up 104 | oprPrev(); 105 | break; 106 | case 40: // down 107 | oprNext(); 108 | break; 109 | 110 | default: 111 | return; // exit this handler for other keys 112 | } 113 | e.preventDefault(); // prevent the default action (scroll / move caret) 114 | }); 115 | 116 | //****************************// 117 | // scroll events // 118 | //****************************// 119 | var minScrollWidth = 25; 120 | $(window).bind('mousewheel DOMMouseScroll MozMousePixelScroll', function (event) { // handle scroll event 121 | var delta = parseInt(event.originalEvent.wheelDelta || -event.originalEvent.detail); 122 | if (delta >= minScrollWidth) { // determine scroll direction 123 | oprPrev(); 124 | } 125 | if (delta <= -minScrollWidth) { 126 | oprNext(); 127 | } 128 | }); 129 | 130 | $(window).swipe({ 131 | //Generic swipe handler for all directions 132 | swipeUp: function () { // swipe up 133 | oprNext(); 134 | }, 135 | swipeDown: function () { // swipe down 136 | oprPrev(); 137 | } 138 | }); 139 | 140 | })(jQuery); 141 | -------------------------------------------------------------------------------- /js/jquery.touchSwipe.min.js: -------------------------------------------------------------------------------- 1 | (function(a){if(typeof define==="function"&&define.amd&&define.amd.jQuery){define(["jquery"],a)}else{a(jQuery)}}(function(f){var p="left",o="right",e="up",x="down",c="in",z="out",m="none",s="auto",l="swipe",t="pinch",A="tap",j="doubletap",b="longtap",y="hold",D="horizontal",u="vertical",i="all",r=10,g="start",k="move",h="end",q="cancel",a="ontouchstart" in window,v=window.navigator.msPointerEnabled&&!window.navigator.pointerEnabled,d=window.navigator.pointerEnabled||window.navigator.msPointerEnabled,B="TouchSwipe";var n={fingers:1,threshold:75,cancelThreshold:null,pinchThreshold:20,maxTimeThreshold:null,fingerReleaseThreshold:250,longTapThreshold:500,doubleTapThreshold:200,swipe:null,swipeLeft:null,swipeRight:null,swipeUp:null,swipeDown:null,swipeStatus:null,pinchIn:null,pinchOut:null,pinchStatus:null,click:null,tap:null,doubleTap:null,longTap:null,hold:null,triggerOnTouchEnd:true,triggerOnTouchLeave:false,allowPageScroll:"auto",fallbackToMouseEvents:true,excludedElements:"label, button, input, select, textarea, a, .noSwipe"};f.fn.swipe=function(G){var F=f(this),E=F.data(B);if(E&&typeof G==="string"){if(E[G]){return E[G].apply(this,Array.prototype.slice.call(arguments,1))}else{f.error("Method "+G+" does not exist on jQuery.swipe")}}else{if(!E&&(typeof G==="object"||!G)){return w.apply(this,arguments)}}return F};f.fn.swipe.defaults=n;f.fn.swipe.phases={PHASE_START:g,PHASE_MOVE:k,PHASE_END:h,PHASE_CANCEL:q};f.fn.swipe.directions={LEFT:p,RIGHT:o,UP:e,DOWN:x,IN:c,OUT:z};f.fn.swipe.pageScroll={NONE:m,HORIZONTAL:D,VERTICAL:u,AUTO:s};f.fn.swipe.fingers={ONE:1,TWO:2,THREE:3,ALL:i};function w(E){if(E&&(E.allowPageScroll===undefined&&(E.swipe!==undefined||E.swipeStatus!==undefined))){E.allowPageScroll=m}if(E.click!==undefined&&E.tap===undefined){E.tap=E.click}if(!E){E={}}E=f.extend({},f.fn.swipe.defaults,E);return this.each(function(){var G=f(this);var F=G.data(B);if(!F){F=new C(this,E);G.data(B,F)}})}function C(a4,av){var az=(a||d||!av.fallbackToMouseEvents),J=az?(d?(v?"MSPointerDown":"pointerdown"):"touchstart"):"mousedown",ay=az?(d?(v?"MSPointerMove":"pointermove"):"touchmove"):"mousemove",U=az?(d?(v?"MSPointerUp":"pointerup"):"touchend"):"mouseup",S=az?null:"mouseleave",aD=(d?(v?"MSPointerCancel":"pointercancel"):"touchcancel");var ag=0,aP=null,ab=0,a1=0,aZ=0,G=1,aq=0,aJ=0,M=null;var aR=f(a4);var Z="start";var W=0;var aQ=null;var T=0,a2=0,a5=0,ad=0,N=0;var aW=null,af=null;try{aR.bind(J,aN);aR.bind(aD,a9)}catch(ak){f.error("events not supported "+J+","+aD+" on jQuery.swipe")}this.enable=function(){aR.bind(J,aN);aR.bind(aD,a9);return aR};this.disable=function(){aK();return aR};this.destroy=function(){aK();aR.data(B,null);return aR};this.option=function(bc,bb){if(av[bc]!==undefined){if(bb===undefined){return av[bc]}else{av[bc]=bb}}else{f.error("Option "+bc+" does not exist on jQuery.swipe.options")}return null};function aN(bd){if(aB()){return}if(f(bd.target).closest(av.excludedElements,aR).length>0){return}var be=bd.originalEvent?bd.originalEvent:bd;var bc,bb=a?be.touches[0]:be;Z=g;if(a){W=be.touches.length}else{bd.preventDefault()}ag=0;aP=null;aJ=null;ab=0;a1=0;aZ=0;G=1;aq=0;aQ=aj();M=aa();R();if(!a||(W===av.fingers||av.fingers===i)||aX()){ai(0,bb);T=at();if(W==2){ai(1,be.touches[1]);a1=aZ=au(aQ[0].start,aQ[1].start)}if(av.swipeStatus||av.pinchStatus){bc=O(be,Z)}}else{bc=false}if(bc===false){Z=q;O(be,Z);return bc}else{if(av.hold){af=setTimeout(f.proxy(function(){aR.trigger("hold",[be.target]);if(av.hold){bc=av.hold.call(aR,be,be.target)}},this),av.longTapThreshold)}ao(true)}return null}function a3(be){var bh=be.originalEvent?be.originalEvent:be;if(Z===h||Z===q||am()){return}var bd,bc=a?bh.touches[0]:bh;var bf=aH(bc);a2=at();if(a){W=bh.touches.length}if(av.hold){clearTimeout(af)}Z=k;if(W==2){if(a1==0){ai(1,bh.touches[1]);a1=aZ=au(aQ[0].start,aQ[1].start)}else{aH(bh.touches[1]);aZ=au(aQ[0].end,aQ[1].end);aJ=ar(aQ[0].end,aQ[1].end)}G=a7(a1,aZ);aq=Math.abs(a1-aZ)}if((W===av.fingers||av.fingers===i)||!a||aX()){aP=aL(bf.start,bf.end);al(be,aP);ag=aS(bf.start,bf.end);ab=aM();aI(aP,ag);if(av.swipeStatus||av.pinchStatus){bd=O(bh,Z)}if(!av.triggerOnTouchEnd||av.triggerOnTouchLeave){var bb=true;if(av.triggerOnTouchLeave){var bg=aY(this);bb=E(bf.end,bg)}if(!av.triggerOnTouchEnd&&bb){Z=aC(k)}else{if(av.triggerOnTouchLeave&&!bb){Z=aC(h)}}if(Z==q||Z==h){O(bh,Z)}}}else{Z=q;O(bh,Z)}if(bd===false){Z=q;O(bh,Z)}}function L(bb){var bc=bb.originalEvent;if(a){if(bc.touches.length>0){F();return true}}if(am()){W=ad}a2=at();ab=aM();if(ba()||!an()){Z=q;O(bc,Z)}else{if(av.triggerOnTouchEnd||(av.triggerOnTouchEnd==false&&Z===k)){bb.preventDefault();Z=h;O(bc,Z)}else{if(!av.triggerOnTouchEnd&&a6()){Z=h;aF(bc,Z,A)}else{if(Z===k){Z=q;O(bc,Z)}}}}ao(false);return null}function a9(){W=0;a2=0;T=0;a1=0;aZ=0;G=1;R();ao(false)}function K(bb){var bc=bb.originalEvent;if(av.triggerOnTouchLeave){Z=aC(h);O(bc,Z)}}function aK(){aR.unbind(J,aN);aR.unbind(aD,a9);aR.unbind(ay,a3);aR.unbind(U,L);if(S){aR.unbind(S,K)}ao(false)}function aC(bf){var be=bf;var bd=aA();var bc=an();var bb=ba();if(!bd||bb){be=q}else{if(bc&&bf==k&&(!av.triggerOnTouchEnd||av.triggerOnTouchLeave)){be=h}else{if(!bc&&bf==h&&av.triggerOnTouchLeave){be=q}}}return be}function O(bd,bb){var bc=undefined;if(I()||V()){bc=aF(bd,bb,l)}else{if((P()||aX())&&bc!==false){bc=aF(bd,bb,t)}}if(aG()&&bc!==false){bc=aF(bd,bb,j)}else{if(ap()&&bc!==false){bc=aF(bd,bb,b)}else{if(ah()&&bc!==false){bc=aF(bd,bb,A)}}}if(bb===q){a9(bd)}if(bb===h){if(a){if(bd.touches.length==0){a9(bd)}}else{a9(bd)}}return bc}function aF(be,bb,bd){var bc=undefined;if(bd==l){aR.trigger("swipeStatus",[bb,aP||null,ag||0,ab||0,W,aQ]);if(av.swipeStatus){bc=av.swipeStatus.call(aR,be,bb,aP||null,ag||0,ab||0,W,aQ);if(bc===false){return false}}if(bb==h&&aV()){aR.trigger("swipe",[aP,ag,ab,W,aQ]);if(av.swipe){bc=av.swipe.call(aR,be,aP,ag,ab,W,aQ);if(bc===false){return false}}switch(aP){case p:aR.trigger("swipeLeft",[aP,ag,ab,W,aQ]);if(av.swipeLeft){bc=av.swipeLeft.call(aR,be,aP,ag,ab,W,aQ)}break;case o:aR.trigger("swipeRight",[aP,ag,ab,W,aQ]);if(av.swipeRight){bc=av.swipeRight.call(aR,be,aP,ag,ab,W,aQ)}break;case e:aR.trigger("swipeUp",[aP,ag,ab,W,aQ]);if(av.swipeUp){bc=av.swipeUp.call(aR,be,aP,ag,ab,W,aQ)}break;case x:aR.trigger("swipeDown",[aP,ag,ab,W,aQ]);if(av.swipeDown){bc=av.swipeDown.call(aR,be,aP,ag,ab,W,aQ)}break}}}if(bd==t){aR.trigger("pinchStatus",[bb,aJ||null,aq||0,ab||0,W,G,aQ]);if(av.pinchStatus){bc=av.pinchStatus.call(aR,be,bb,aJ||null,aq||0,ab||0,W,G,aQ);if(bc===false){return false}}if(bb==h&&a8()){switch(aJ){case c:aR.trigger("pinchIn",[aJ||null,aq||0,ab||0,W,G,aQ]);if(av.pinchIn){bc=av.pinchIn.call(aR,be,aJ||null,aq||0,ab||0,W,G,aQ)}break;case z:aR.trigger("pinchOut",[aJ||null,aq||0,ab||0,W,G,aQ]);if(av.pinchOut){bc=av.pinchOut.call(aR,be,aJ||null,aq||0,ab||0,W,G,aQ)}break}}}if(bd==A){if(bb===q||bb===h){clearTimeout(aW);clearTimeout(af);if(Y()&&!H()){N=at();aW=setTimeout(f.proxy(function(){N=null;aR.trigger("tap",[be.target]);if(av.tap){bc=av.tap.call(aR,be,be.target)}},this),av.doubleTapThreshold)}else{N=null;aR.trigger("tap",[be.target]);if(av.tap){bc=av.tap.call(aR,be,be.target)}}}}else{if(bd==j){if(bb===q||bb===h){clearTimeout(aW);N=null;aR.trigger("doubletap",[be.target]);if(av.doubleTap){bc=av.doubleTap.call(aR,be,be.target)}}}else{if(bd==b){if(bb===q||bb===h){clearTimeout(aW);N=null;aR.trigger("longtap",[be.target]);if(av.longTap){bc=av.longTap.call(aR,be,be.target)}}}}}return bc}function an(){var bb=true;if(av.threshold!==null){bb=ag>=av.threshold}return bb}function ba(){var bb=false;if(av.cancelThreshold!==null&&aP!==null){bb=(aT(aP)-ag)>=av.cancelThreshold}return bb}function ae(){if(av.pinchThreshold!==null){return aq>=av.pinchThreshold}return true}function aA(){var bb;if(av.maxTimeThreshold){if(ab>=av.maxTimeThreshold){bb=false}else{bb=true}}else{bb=true}return bb}function al(bb,bc){if(av.allowPageScroll===m||aX()){bb.preventDefault()}else{var bd=av.allowPageScroll===s;switch(bc){case p:if((av.swipeLeft&&bd)||(!bd&&av.allowPageScroll!=D)){bb.preventDefault()}break;case o:if((av.swipeRight&&bd)||(!bd&&av.allowPageScroll!=D)){bb.preventDefault()}break;case e:if((av.swipeUp&&bd)||(!bd&&av.allowPageScroll!=u)){bb.preventDefault()}break;case x:if((av.swipeDown&&bd)||(!bd&&av.allowPageScroll!=u)){bb.preventDefault()}break}}}function a8(){var bc=aO();var bb=X();var bd=ae();return bc&&bb&&bd}function aX(){return !!(av.pinchStatus||av.pinchIn||av.pinchOut)}function P(){return !!(a8()&&aX())}function aV(){var be=aA();var bg=an();var bd=aO();var bb=X();var bc=ba();var bf=!bc&&bb&&bd&&bg&&be;return bf}function V(){return !!(av.swipe||av.swipeStatus||av.swipeLeft||av.swipeRight||av.swipeUp||av.swipeDown)}function I(){return !!(aV()&&V())}function aO(){return((W===av.fingers||av.fingers===i)||!a)}function X(){return aQ[0].end.x!==0}function a6(){return !!(av.tap)}function Y(){return !!(av.doubleTap)}function aU(){return !!(av.longTap)}function Q(){if(N==null){return false}var bb=at();return(Y()&&((bb-N)<=av.doubleTapThreshold))}function H(){return Q()}function ax(){return((W===1||!a)&&(isNaN(ag)||agav.longTapThreshold)&&(ag=0)){return p}else{if((bd<=360)&&(bd>=315)){return p}else{if((bd>=135)&&(bd<=225)){return o}else{if((bd>45)&&(bd<135)){return x}else{return e}}}}}function at(){var bb=new Date();return bb.getTime()}function aY(bb){bb=f(bb);var bd=bb.offset();var bc={left:bd.left,right:bd.left+bb.outerWidth(),top:bd.top,bottom:bd.top+bb.outerHeight()};return bc}function E(bb,bc){return(bb.x>bc.left&&bb.xbc.top&&bb.y