├── .gitignore ├── CNAME ├── LICENSE ├── README.md ├── close.html ├── css ├── css.css ├── fonts.css └── less │ ├── css.less │ ├── fontello.less │ ├── for.less │ └── medias.less ├── font ├── fontello.eot ├── fontello.svg ├── fontello.ttf └── fontello.woff ├── gulpfile.js ├── img ├── favicon.png ├── load.gif ├── logo-128.png ├── logo-16.png ├── logo.png └── tut │ ├── common.png │ ├── double.png │ ├── pressed.png │ ├── previous.png │ └── reverse.png ├── index.html ├── js ├── assets │ ├── common.js │ ├── dash.min.js │ └── libs.min.js ├── dash │ ├── dash-gui.js │ ├── dash-level.js │ ├── dash-utils.js │ └── dash.js ├── libs │ ├── fb.js │ ├── fb.min.js │ ├── hammer.min.js │ ├── hammer.min.map │ ├── jquery-1.11.0.min.js │ ├── jquery.animate-enhanced.min.js │ ├── jquery.cookie.js │ ├── keypress-2.1.0.min.js │ └── require.js └── script.min.js ├── package.json ├── policy.html └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | 4 | -------------------------------------------------------------------------------- /CNAME: -------------------------------------------------------------------------------- 1 | dash.kraiom.com 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 Kraiom Studio 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dash 2 | 3 | A web browser casual game. The rule is simple: send the panel to the correct direction, if you can! In DASH you must press the arrow accordingly to what is being shown within the remaining time and the number of lives. 4 | 5 | # Collaborations 6 | A project like this could not be possibly polished and tested without a little a help of some people! Special thanks to [Thiago Wittmann](http://thiagowittmann.github.io/), [Mateus Craveiro](http://mccraveiro.github.io/), [Alexandre Almeida](http://alexandrealmeida.io/) and [Rafael Tomazela](https://twitter.com/sohakes). 7 | 8 | # License 9 | MIT 10 | -------------------------------------------------------------------------------- /close.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /css/css.css: -------------------------------------------------------------------------------- 1 | *,body,html{margin:0;padding:0}.centering,section i,table td{text-align:center}.menu,.score>div,h1{float:left}.info b,h1{font-weight:400}.google_ads{width:500px}.show{display:block!important}.centering{width:100%}body,html{width:100%;height:100%}body{background:#E7E737;font-family:'Noto Sans',sans-serif;font-size:1.1em;overflow:hidden}.message,body.automatic{overflow:auto}section{width:100%;height:100%;position:absolute;top:-100%;left:-100%;z-index:1;overflow:hidden}.wrapper,section i{position:absolute;left:0;bottom:0;right:0;top:0}section i{display:block;font-size:20em;line-height:2em;width:100%;height:100%;margin:auto}section i.correct,section i.pressed{color:#fff}table{width:100%;margin:0 auto}table td{padding:.3em}table td:nt-child(1){text-align:left}table tr:nth-child(odd){background:#f6f6bd}table img{border-radius:100%;border:none!important}ul li{list-style-position:inside}.wrapper{width:36em;height:19.5em;margin:auto}.wrapper.full{position:relative;width:65%;font-size:15px;text-align:justify}.wrapper.full>div{margin-bottom:.5em}.wrapper.full a{width:auto;display:inline;padding:0;text-align:left;font-size:1em;letter-spacing:0;border:none;color:#111;text-decoration:underline}.copyright,.menu div{text-align:center;font-size:.8em;letter-spacing:.2em}.timer,.timer>div{border-radius:.5em}.wrapper.full a:hover{background:0 0}.clear{clear:both}.copyright{margin-top:4em;margin-right:0!important}.copyright a{width:auto;min-width:10em;padding:.6em 1em}.menu{display:inline-block;padding:0 2.5em;margin-top:-1.6em;width:15em;height:3em}.menu b{display:block;height:1.2em}.menu div{display:block;padding:.6em;color:#111;margin-bottom:1.5em}.score,h1{color:#fff}.menu div span{background:#111;color:#fff;letter-spacing:0;display:inline-block;min-width:2em;min-height:2em;line-height:2em}.score,.timer{display:none;left:0;z-index:2002}.timer{position:absolute;box-shadow:0 1px 2px #333;background:rgba(255,255,255,.5);right:0;bottom:1em;width:80%;margin:auto;height:1.5em;box-sizing:border-box}.timer>div{background:#fff;width:50%;height:100%;box-shadow:0 1px 4px #333}.score{width:2.5em;height:2em;font-size:4em;font-family:'Josefin Sans',sans-serif;position:fixed;top:0;text-shadow:0 1px 1px #111}.score .counter,.score.msg i{width:100%;line-height:2em;text-align:center}h2,h4{text-transform:uppercase;position:relative;font-family:'Josefin Sans',sans-serif}.score.msg{left:auto;right:.5em}.score.msg i{display:block;height:100%}.score .counter{text-shadow:0 1px 1px #111}h2.tal,h4{text-align:left}.score .lives{height:.5em;width:2.5em;margin-top:-2.3em;margin-left:.1em;display:none}h1,h1.title{display:inline-block}.score .lives div{float:left;width:.7em;height:.2em;background:#fff}.score .lives div.middle{margin:0 .1em}h1.title,h2{margin-bottom:1em}.score .lives div.lost{background:#333}h1{text-align:center;width:3.2em;height:3.2em;line-height:3.4em;background:#111;font-family:'Josefin Sans',sans-serif;font-size:5em}h1.title{float:none}h2{text-align:center;font-size:3em}.message,a{text-align:center}h2 small{font-size:.3em;position:absolute;left:0;bottom:-1.5em;color:#555}h4{font-size:1.5em;margin:1.5em 0 .5em}.info,.message{display:none;position:absolute;left:0;right:0;margin:auto;border:1px solid #111;background:#E7E737}.message{width:80%;bottom:7%;padding:1em;line-height:1em;z-index:2002}.info{padding:5%;width:70%;height:70%;top:0;bottom:0;z-index:200;overflow-y:scroll;overflow-x:hidden}.info b,a,a.fb,a.gp,a.tw{display:inline-block}.info .dismiss{position:fixed;margin-top:-4%;margin-left:-4%;z-index:1000}.info .dismiss a{background:#E7E737}.info .dismiss a:hover{background:#111}.info::-webkit-scrollbar{width:8px;border-radius:10px}.info img,a{border:1px solid #111}.info::-webkit-scrollbar-track{background-color:#E7E737}.info::-webkit-scrollbar-thumb{background-color:#494909}.info::-webkit-scrollbar-thumb:hover{background-color:#494909}.info b,a:hover{background:#111;color:#fff}.info>div{margin-bottom:2em}.info a{width:auto}.info .centering>div{margin-bottom:1em}.info .centering>div.buttons{margin-top:3em}.info .centering>div a{margin-bottom:0;min-width:15em}.info .centering>div a i{display:inline-block;width:10%;float:left}.info b{font-family:'Josefin Sans',sans-serif;min-width:2em;min-height:2em;line-height:2em}.info h2{margin-top:1em}.info h3{margin-bottom:1em}.info .block div{padding-top:5%}.info img{max-height:15em;max-width:50%}.info img.r{float:right;margin-left:4%}.info img.l{float:left;margin-right:4%}a{width:16.5em;padding:.6em;font-size:.8em;letter-spacing:.2em;color:#111;text-decoration:none;transition:all .2s lisnear;-webkit-transition:all .2s linear;-moz-transition:.2s linear;cursor:pointer;margin-bottom:1.8em}a.fb,a.gp,a.tw{width:4em}a.tw{margin:0 .6em}a.disabled{color:#77770e!important;border-color:#77770e!important;cursor:default!important}a.disabled:hover{color:#77770e!important;background:0 0!important}.font-0{color:#1c6415!important}.bg-0{background:#1c6415!important}.preset-0{background:#34b827;color:#1c6415}.reverse-0{background:linear-gradient(135deg,#34b827 25%,transparent 5%) -50px 0,linear-gradient(225deg,#34b827 25%,transparent 5%) -50px 0,linear-gradient(315deg,#34b827 25%,transparent 5%),linear-gradient(45deg,#34b827 25%,transparent 5%);background-size:20px 20px;background-color:#42d434;color:#1c6415}.font-1{color:#b13f07!important}.bg-1{background:#b13f07!important}.preset-1{background:#F76C27;color:#b13f07}.reverse-1{background:linear-gradient(135deg,#F76C27 25%,transparent 5%) -50px 0,linear-gradient(225deg,#F76C27 25%,transparent 5%) -50px 0,linear-gradient(315deg,#F76C27 25%,transparent 5%),linear-gradient(45deg,#F76C27 25%,transparent 5%);background-size:20px 20px;background-color:#f8874e;color:#b13f07}.font-2{color:#346aa4!important}.bg-2{background:#346aa4!important}.preset-2{background:#6D9DD1;color:#346aa4}.reverse-2{background:linear-gradient(135deg,#6D9DD1 25%,transparent 5%) -50px 0,linear-gradient(225deg,#6D9DD1 25%,transparent 5%) -50px 0,linear-gradient(315deg,#6D9DD1 25%,transparent 5%),linear-gradient(45deg,#6D9DD1 25%,transparent 5%);background-size:20px 20px;background-color:#8cb2db;color:#346aa4}.font-3{color:#c61e5e!important}.bg-3{background:#c61e5e!important}.preset-3{background:#e76395;color:#c61e5e}.reverse-3{background:linear-gradient(135deg,#e76395 25%,transparent 5%) -50px 0,linear-gradient(225deg,#e76395 25%,transparent 5%) -50px 0,linear-gradient(315deg,#e76395 25%,transparent 5%),linear-gradient(45deg,#e76395 25%,transparent 5%);background-size:20px 20px;background-color:#ec86ad;color:#c61e5e}.font-4{color:#707c04!important}.bg-4{background:#707c04!important}.preset-4{background:#cade08;color:#707c04}.reverse-4{background:linear-gradient(135deg,#cade08 25%,transparent 5%) -50px 0,linear-gradient(225deg,#cade08 25%,transparent 5%) -50px 0,linear-gradient(315deg,#cade08 25%,transparent 5%),linear-gradient(45deg,#cade08 25%,transparent 5%);background-size:20px 20px;background-color:#e2f718;color:#707c04}.font-5{color:#126067!important}.bg-5{background:#126067!important}.preset-5{background:#22b1bd;color:#126067}.reverse-5{background:linear-gradient(135deg,#22b1bd 25%,transparent 5%) -50px 0,linear-gradient(225deg,#22b1bd 25%,transparent 5%) -50px 0,linear-gradient(315deg,#22b1bd 25%,transparent 5%),linear-gradient(45deg,#22b1bd 25%,transparent 5%);background-size:20px 20px;background-color:#2eccd9;color:#126067}.font-6{color:#4e2290!important}.bg-6{background:#4e2290!important}.preset-6{background:#7E45D3;color:#4e2290}.reverse-6{background:linear-gradient(135deg,#7E45D3 25%,transparent 5%) -50px 0,linear-gradient(225deg,#7E45D3 25%,transparent 5%) -50px 0,linear-gradient(315deg,#7E45D3 25%,transparent 5%),linear-gradient(45deg,#7E45D3 25%,transparent 5%);background-size:20px 20px;background-color:#9566db;color:#4e2290}.font-7{color:#ab1515!important}.bg-7{background:#ab1515!important}.preset-7{background:#E73F3F;color:#ab1515}.reverse-7{background:linear-gradient(135deg,#E73F3F 25%,transparent 5%) -50px 0,linear-gradient(225deg,#E73F3F 25%,transparent 5%) -50px 0,linear-gradient(315deg,#E73F3F 25%,transparent 5%),linear-gradient(45deg,#E73F3F 25%,transparent 5%);background-size:20px 20px;background-color:#ec6363;color:#ab1515} 2 | @font-face{font-family:fontello;src:url(../font/fontello.eot?57116985);src:url(../font/fontello.eot?57116985#iefix) format('embedded-opentype'),url(../font/fontello.woff?57116985) format('woff'),url(../font/fontello.ttf?57116985) format('truetype'),url(../font/fontello.svg?57116985#fontello) format('svg');font-weight:400;font-style:normal}[class*=" icon-"]:before,[class^=icon-]:before{font-family:fontello;font-style:normal;font-weight:400;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em}.icon-angle-down:before{content:'\e800'}.icon-angle-double-down:before{content:'\e801'}.icon-angle-left:before{content:'\e802'}.icon-angle-right:before{content:'\e803'}.icon-angle-up:before{content:'\e804'}.icon-angle-double-left:before{content:'\e805'}.icon-angle-double-right:before{content:'\e806'}.icon-angle-double-up:before{content:'\e807'}.icon-cancel:before{content:'\e808'}.icon-gplus:before{content:'\e809'}.icon-facebook:before{content:'\e80a'}.icon-twitter:before{content:'\e80b'}.icon-tumblr:before{content:'\e80c'}.icon-cw:before{content:'\e80d'}.icon-joystick:before{content:'\e80e'}.icon-trophy:before{content:'\e817'}.icon-award:before{content:'\e818'}.icon-down-open-big:before{content:'\e81a'}.icon-left-open-big:before{content:'\e81b'}.icon-right-open-big:before{content:'\e81c'}.icon-up-open-big:before{content:'\e81d'} 3 | 4 | @media (max-width:650px) and (min-height:480px){.menu a:hover,.menu div span{background:#111;color:#fff}body{font-size:15px}.copyright{display:none}.menu,h1{display:block;float:none;text-align:center}.info{width:87%;height:90%}section i{font-size:18em}h2{margin-top:1em;margin-bottom:1em!important;font-size:2.5em!important}.wrapper{width:90%;height:30em}h1{margin:0 auto .3em;width:3em;height:3em;line-height:3.2em;font-size:2.5em}.menu{width:100%;margin-top:-.5em;height:65%;padding:0}.menu div{padding:.6em;font-size:.9em;margin-bottom:.5em}.menu div span{letter-spacing:0;display:inline-block;min-width:2em;min-height:2em;line-height:2em}.menu a{height:3em;font-size:.9em;line-height:3em}.menu a.fb,.menu a.gp,.menu a.tw{display:none}.menu a.main_btn{margin-bottom:.6em;width:auto;display:block}}@media (max-height:479px){.copyright,.menu a.fb,.menu a.gp,.menu a.tw{display:none}body{font-size:15px}.copyright{margin-top:.5em}.wrapper{width:31em;height:19em}.info{width:85%;height:75%}section i{font-size:15em;line-height:1.2em}#btn_leader{margin-bottom:0!important}.menu{padding:0 1em;margin-top:-.5em;width:14em}.menu div{font-size:.9em;width:100%}.menu a{height:1.5em;font-size:.9em;line-height:1.5em;margin-bottom:1.3em}.menu a:hover{background:#111;color:#fff}h1{width:3em;height:3em;line-height:3.2em;font-size:4.5em;margin-top:1.1em}} -------------------------------------------------------------------------------- /css/fonts.css: -------------------------------------------------------------------------------- 1 | /* latin-ext */ 2 | @font-face { 3 | font-family: 'Josefin Sans'; 4 | font-style: normal; 5 | font-weight: 100; 6 | src: local('Josefin Sans Thin'), local('JosefinSans-Thin'), url(http://fonts.gstatic.com/s/josefinsans/v9/q9w3H4aeBxj0hZ8Osfi3d_ZLGUYxk5QQ1Un914Iccq4.woff2) format('woff2'); 7 | unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; 8 | } 9 | /* latin */ 10 | @font-face { 11 | font-family: 'Josefin Sans'; 12 | font-style: normal; 13 | font-weight: 100; 14 | src: local('Josefin Sans Thin'), local('JosefinSans-Thin'), url(http://fonts.gstatic.com/s/josefinsans/v9/q9w3H4aeBxj0hZ8Osfi3dzUBvlJYYQI_sDPKrlKoP9Q.woff2) format('woff2'); 15 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; 16 | } 17 | /* latin-ext */ 18 | @font-face { 19 | font-family: 'Josefin Sans'; 20 | font-style: normal; 21 | font-weight: 400; 22 | src: local('Josefin Sans'), local('JosefinSans'), url(http://fonts.gstatic.com/s/josefinsans/v9/xgzbb53t8j-Mo-vYa23n5ojoYw3YTyktCCer_ilOlhE.woff2) format('woff2'); 23 | unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; 24 | } 25 | /* latin */ 26 | @font-face { 27 | font-family: 'Josefin Sans'; 28 | font-style: normal; 29 | font-weight: 400; 30 | src: local('Josefin Sans'), local('JosefinSans'), url(http://fonts.gstatic.com/s/josefinsans/v9/xgzbb53t8j-Mo-vYa23n5hampu5_7CjHW5spxoeN3Vs.woff2) format('woff2'); 31 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; 32 | } 33 | /* cyrillic-ext */ 34 | @font-face { 35 | font-family: 'Noto Sans'; 36 | font-style: normal; 37 | font-weight: 400; 38 | src: local('Noto Sans'), local('NotoSans'), url(http://fonts.gstatic.com/s/notosans/v6/C7bP6N8yXZ-PGLzbFLtQKYX0hVgzZQUfRDuZrPvH3D8.woff2) format('woff2'); 39 | unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; 40 | } 41 | /* cyrillic */ 42 | @font-face { 43 | font-family: 'Noto Sans'; 44 | font-style: normal; 45 | font-weight: 400; 46 | src: local('Noto Sans'), local('NotoSans'), url(http://fonts.gstatic.com/s/notosans/v6/iLJc6PpCnnbQjYc1Jq4v04X0hVgzZQUfRDuZrPvH3D8.woff2) format('woff2'); 47 | unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; 48 | } 49 | /* devanagari */ 50 | @font-face { 51 | font-family: 'Noto Sans'; 52 | font-style: normal; 53 | font-weight: 400; 54 | src: local('Noto Sans'), local('NotoSans'), url(http://fonts.gstatic.com/s/notosans/v6/5pCv5Yz4eMu9gmvX8nNhfYX0hVgzZQUfRDuZrPvH3D8.woff2) format('woff2'); 55 | unicode-range: U+02BC, U+0900-097F, U+1CD0-1CF6, U+1CF8-1CF9, U+200B-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FB; 56 | } 57 | /* greek-ext */ 58 | @font-face { 59 | font-family: 'Noto Sans'; 60 | font-style: normal; 61 | font-weight: 400; 62 | src: local('Noto Sans'), local('NotoSans'), url(http://fonts.gstatic.com/s/notosans/v6/gEkd0pn-sMtQ_P4HUpi6WIX0hVgzZQUfRDuZrPvH3D8.woff2) format('woff2'); 63 | unicode-range: U+1F00-1FFF; 64 | } 65 | /* greek */ 66 | @font-face { 67 | font-family: 'Noto Sans'; 68 | font-style: normal; 69 | font-weight: 400; 70 | src: local('Noto Sans'), local('NotoSans'), url(http://fonts.gstatic.com/s/notosans/v6/iPF-u8L1qkTPHaKjvXERn4X0hVgzZQUfRDuZrPvH3D8.woff2) format('woff2'); 71 | unicode-range: U+0370-03FF; 72 | } 73 | /* vietnamese */ 74 | @font-face { 75 | font-family: 'Noto Sans'; 76 | font-style: normal; 77 | font-weight: 400; 78 | src: local('Noto Sans'), local('NotoSans'), url(http://fonts.gstatic.com/s/notosans/v6/mTzVK0-EJOCaJiOPeaz-h4X0hVgzZQUfRDuZrPvH3D8.woff2) format('woff2'); 79 | unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB; 80 | } 81 | /* latin-ext */ 82 | @font-face { 83 | font-family: 'Noto Sans'; 84 | font-style: normal; 85 | font-weight: 400; 86 | src: local('Noto Sans'), local('NotoSans'), url(http://fonts.gstatic.com/s/notosans/v6/erE3KsIWUumgD1j_Ca-V-4X0hVgzZQUfRDuZrPvH3D8.woff2) format('woff2'); 87 | unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; 88 | } 89 | /* latin */ 90 | @font-face { 91 | font-family: 'Noto Sans'; 92 | font-style: normal; 93 | font-weight: 400; 94 | src: local('Noto Sans'), local('NotoSans'), url(http://fonts.gstatic.com/s/notosans/v6/LeFlHvsZjXu2c3ZRgBq9nJBw1xU1rKptJj_0jans920.woff2) format('woff2'); 95 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; 96 | } 97 | /* cyrillic-ext */ 98 | @font-face { 99 | font-family: 'Noto Sans'; 100 | font-style: normal; 101 | font-weight: 700; 102 | src: local('Noto Sans Bold'), local('NotoSans-Bold'), url(http://fonts.gstatic.com/s/notosans/v6/PIbvSEyHEdL91QLOQRnZ1w7aC6SjiAOpAWOKfJDfVRY.woff2) format('woff2'); 103 | unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; 104 | } 105 | /* cyrillic */ 106 | @font-face { 107 | font-family: 'Noto Sans'; 108 | font-style: normal; 109 | font-weight: 700; 110 | src: local('Noto Sans Bold'), local('NotoSans-Bold'), url(http://fonts.gstatic.com/s/notosans/v6/PIbvSEyHEdL91QLOQRnZ1xdwxCXfZpKo5kWAx_74bHs.woff2) format('woff2'); 111 | unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; 112 | } 113 | /* devanagari */ 114 | @font-face { 115 | font-family: 'Noto Sans'; 116 | font-style: normal; 117 | font-weight: 700; 118 | src: local('Noto Sans Bold'), local('NotoSans-Bold'), url(http://fonts.gstatic.com/s/notosans/v6/PIbvSEyHEdL91QLOQRnZ1yGUML8f7tzeB6gGvgki0bE.woff2) format('woff2'); 119 | unicode-range: U+02BC, U+0900-097F, U+1CD0-1CF6, U+1CF8-1CF9, U+200B-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FB; 120 | } 121 | /* greek-ext */ 122 | @font-face { 123 | font-family: 'Noto Sans'; 124 | font-style: normal; 125 | font-weight: 700; 126 | src: local('Noto Sans Bold'), local('NotoSans-Bold'), url(http://fonts.gstatic.com/s/notosans/v6/PIbvSEyHEdL91QLOQRnZ156vnaPZw6nYDxM4SVEMFKg.woff2) format('woff2'); 127 | unicode-range: U+1F00-1FFF; 128 | } 129 | /* greek */ 130 | @font-face { 131 | font-family: 'Noto Sans'; 132 | font-style: normal; 133 | font-weight: 700; 134 | src: local('Noto Sans Bold'), local('NotoSans-Bold'), url(http://fonts.gstatic.com/s/notosans/v6/PIbvSEyHEdL91QLOQRnZ1_y1_HTwRwgtl1cPga3Fy3Y.woff2) format('woff2'); 135 | unicode-range: U+0370-03FF; 136 | } 137 | /* vietnamese */ 138 | @font-face { 139 | font-family: 'Noto Sans'; 140 | font-style: normal; 141 | font-weight: 700; 142 | src: local('Noto Sans Bold'), local('NotoSans-Bold'), url(http://fonts.gstatic.com/s/notosans/v6/PIbvSEyHEdL91QLOQRnZ1_grLsWo7Jk1KvZser0olKY.woff2) format('woff2'); 143 | unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB; 144 | } 145 | /* latin-ext */ 146 | @font-face { 147 | font-family: 'Noto Sans'; 148 | font-style: normal; 149 | font-weight: 700; 150 | src: local('Noto Sans Bold'), local('NotoSans-Bold'), url(http://fonts.gstatic.com/s/notosans/v6/PIbvSEyHEdL91QLOQRnZ14joYw3YTyktCCer_ilOlhE.woff2) format('woff2'); 151 | unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; 152 | } 153 | /* latin */ 154 | @font-face { 155 | font-family: 'Noto Sans'; 156 | font-style: normal; 157 | font-weight: 700; 158 | src: local('Noto Sans Bold'), local('NotoSans-Bold'), url(http://fonts.gstatic.com/s/notosans/v6/PIbvSEyHEdL91QLOQRnZ1xampu5_7CjHW5spxoeN3Vs.woff2) format('woff2'); 159 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; 160 | } 161 | -------------------------------------------------------------------------------- /css/less/css.less: -------------------------------------------------------------------------------- 1 | @import "for"; 2 | 3 | @color-0: #34b827; 4 | @color-1: #F76C27; 5 | @color-2: #6D9DD1; 6 | @color-3: #e76395; 7 | @color-4: #cade08; 8 | @color-5: #22b1bd; 9 | @color-6: #7E45D3; 10 | @color-7: #E73F3F; 11 | 12 | @yellow: #E7E737; 13 | 14 | @colors: 'color-0', 'color-1', 'color-2', 'color-3', 'color-4', 'color-5', 'color-6', 'color-7'; 15 | 16 | * { 17 | margin: 0; 18 | padding: 0; 19 | } 20 | 21 | .google_ads { 22 | width: 500px; 23 | } 24 | 25 | .show { 26 | display: block !important; 27 | } 28 | 29 | .centering { 30 | text-align: center; 31 | width: 100%; 32 | } 33 | 34 | body, html { 35 | width: 100%; 36 | height: 100%; 37 | margin: 0; 38 | padding: 0; 39 | } 40 | 41 | body { 42 | background: @yellow; 43 | font-family: 'Noto Sans', sans-serif; 44 | font-size: 1.1em; 45 | overflow: hidden; 46 | 47 | &.automatic { 48 | overflow: auto; 49 | } 50 | } 51 | 52 | section { 53 | width: 100%; 54 | height: 100%; 55 | position: absolute; 56 | top: -100%; 57 | left: -100%; 58 | z-index: 1; 59 | overflow: hidden; 60 | 61 | i { 62 | display: block; 63 | font-size: 20em; 64 | line-height: 2em; 65 | width: 100%; 66 | height: 100%; 67 | position: absolute; 68 | left: 0; 69 | right: 0; 70 | bottom: 0; 71 | top: 0; 72 | margin: auto; 73 | text-align: center; 74 | 75 | &.correct, &.pressed { 76 | color: #ffffff; 77 | } 78 | } 79 | } 80 | 81 | table { 82 | width: 100%; 83 | margin: 0 auto; 84 | 85 | td { 86 | padding: 0.3em; 87 | text-align: center; 88 | } 89 | 90 | td:nt-child(1) { 91 | text-align: left; 92 | } 93 | 94 | tr:nth-child(odd) { 95 | background: lighten(#e3e337, 30%); 96 | } 97 | 98 | img { 99 | border-radius: 100%; 100 | border: none !important; 101 | } 102 | } 103 | 104 | ul { 105 | li { 106 | list-style-position: inside; 107 | } 108 | } 109 | 110 | .wrapper { 111 | width: 36em; 112 | height: 19.5em; 113 | position: absolute; 114 | top: 0; 115 | left: 0; 116 | right: 0; 117 | bottom: 0; 118 | margin: auto; 119 | 120 | &.full { 121 | position: relative; 122 | width: 65%; 123 | font-size: 15px; 124 | text-align: justify; 125 | 126 | & > div { 127 | margin-bottom: 0.5em; 128 | } 129 | 130 | a { 131 | width: auto; 132 | display: inline; 133 | padding: 0; 134 | text-align: left; 135 | font-size: 1em; 136 | letter-spacing: 0; 137 | border: none; 138 | color: #111; 139 | text-decoration: underline; 140 | 141 | &:hover { 142 | background: none; 143 | } 144 | } 145 | } 146 | } 147 | 148 | .clear { 149 | clear: both; 150 | } 151 | 152 | .copyright { 153 | font-size: 0.8em; 154 | letter-spacing: 0.2em; 155 | margin-top: 4em; 156 | text-align: center; 157 | margin-right: 0 !important; 158 | 159 | a { 160 | width: auto; 161 | min-width: 10em; 162 | padding: 0.6em 1em; 163 | } 164 | } 165 | 166 | .menu { 167 | float: left; 168 | display: inline-block; 169 | padding: 0 2.5em; 170 | margin-top: -1.6em; 171 | width: 15em; 172 | height: 3em; 173 | 174 | b { 175 | display: block; 176 | height: 1.2em; 177 | } 178 | 179 | div { 180 | display: block; 181 | padding: 0.6em; 182 | text-align: center; 183 | font-size: 0.8em; 184 | letter-spacing: 0.2em; 185 | color: #111; 186 | margin-bottom: 1.5em; 187 | 188 | span { 189 | background: #111; 190 | color: #fff; 191 | letter-spacing: 0; 192 | display: inline-block; 193 | min-width: 2em; 194 | min-height: 2em; 195 | line-height: 2em; 196 | } 197 | } 198 | } 199 | 200 | .timer { 201 | position: absolute; 202 | z-index: 2002; 203 | display: none; 204 | 205 | box-shadow: 0 1px 2px #333; 206 | 207 | background: rgba(255, 255, 255, 0.5); 208 | 209 | left: 0; 210 | right: 0; 211 | bottom: 1em; 212 | width: 80%; 213 | margin: auto; 214 | 215 | height: 1.5em; 216 | box-sizing: border-box; 217 | border-radius: 0.5em; 218 | 219 | & > div { 220 | background: #fff; 221 | width: 50%; 222 | height: 100%; 223 | border-radius: 0.5em; 224 | box-shadow: 0 1px 4px #333; 225 | } 226 | } 227 | 228 | .score { 229 | z-index: 2002; 230 | display: none; 231 | width: 2.5em; 232 | height: 2em; 233 | font-size: 4em; 234 | color: #fff; 235 | font-family: 'Josefin Sans', sans-serif; 236 | // background: #111; 237 | position: fixed; 238 | left: 0; 239 | top: 0; 240 | // box-shadow: 0 1px 2px #333; 241 | text-shadow: 0px 1px 1px #111; 242 | 243 | &.msg { 244 | left: auto; 245 | right: 0.5em; 246 | 247 | i { 248 | display: block; 249 | width: 100%; 250 | height: 100%; 251 | line-height: 2em; 252 | text-align: center; 253 | } 254 | } 255 | 256 | & > div { 257 | float: left; 258 | } 259 | 260 | .counter { 261 | width: 100%; 262 | text-align: center; 263 | line-height: 2em; 264 | text-shadow: 0px 1px 1px #111; 265 | } 266 | 267 | .lives { 268 | height: 0.5em; 269 | width: 2.5em; 270 | margin-top: -2.3em; 271 | margin-left: 0.1em; 272 | display: none; 273 | 274 | div { 275 | float: left; 276 | width: 0.7em; 277 | height: 0.2em; 278 | background: #fff; 279 | 280 | &.middle { 281 | margin: 0 0.1em; 282 | } 283 | 284 | &.lost { 285 | background: #333; 286 | } 287 | } 288 | } 289 | } 290 | 291 | h1 { 292 | float: left; 293 | text-align: center; 294 | width: 3.2em; 295 | height: 3.2em; 296 | line-height: 3.4em; 297 | background: #111; 298 | color: #fff; 299 | font-family: 'Josefin Sans', sans-serif; 300 | font-weight: 400; 301 | font-size: 5em; 302 | display: inline-block; 303 | 304 | &.title { 305 | float: none; 306 | display: inline-block; 307 | margin-bottom: 1em; 308 | } 309 | } 310 | 311 | h2 { 312 | text-transform: uppercase; 313 | font-family: 'Josefin Sans', sans-serif; 314 | text-align: center; 315 | font-size: 3em; 316 | margin-bottom: 1.5em; 317 | position: relative; 318 | margin-bottom: 1em; 319 | 320 | &.tal { 321 | text-align: left; 322 | } 323 | 324 | small { 325 | font-size: 0.3em; 326 | position: absolute; 327 | left: 0; 328 | bottom: -1.5em; 329 | color: #555; 330 | } 331 | } 332 | 333 | h4 { 334 | text-transform: uppercase; 335 | font-family: 'Josefin Sans', sans-serif; 336 | text-align: left; 337 | font-size: 1.5em; 338 | position: relative; 339 | margin: 1.5em 0 0.5em 0; 340 | } 341 | 342 | 343 | 344 | .message { 345 | display: none; 346 | position: absolute; 347 | padding: 5%; 348 | width: 80%; 349 | padding: 0.1em; 350 | left: 0; 351 | right: 0; 352 | bottom: 7%; 353 | margin: auto; 354 | border: solid 1px #111; 355 | z-index: 200; 356 | background: @yellow; 357 | overflow: auto; 358 | padding: 1em; 359 | line-height: 1em; 360 | text-align: center; 361 | z-index: 2002; 362 | } 363 | 364 | .info { 365 | display: none; 366 | position: absolute; 367 | padding: 5%; 368 | width: 70%; 369 | height: 70%; 370 | left: 0; 371 | top: 0; 372 | right: 0; 373 | bottom: 0; 374 | margin: auto; 375 | border: solid 1px #111; 376 | z-index: 200; 377 | background: @yellow; 378 | overflow-y: scroll; 379 | overflow-x: hidden; 380 | 381 | .dismiss { 382 | position: fixed; 383 | margin-top: -4%; 384 | margin-left: -4%; 385 | z-index: 1000; 386 | 387 | a { 388 | background: @yellow; 389 | 390 | &:hover { 391 | background: #111; 392 | } 393 | } 394 | } 395 | 396 | &::-webkit-scrollbar { 397 | width: 8px; 398 | border-radius: 10px; 399 | } 400 | 401 | &::-webkit-scrollbar-track { 402 | background-color: @yellow; 403 | } 404 | 405 | &::-webkit-scrollbar-thumb { 406 | background-color: darken(@yellow, 40%); 407 | } 408 | 409 | &::-webkit-scrollbar-thumb:hover { 410 | background-color: darken(@yellow, 40%); 411 | } 412 | 413 | & > div { 414 | margin-bottom: 2em; 415 | } 416 | 417 | a { 418 | width: auto; 419 | } 420 | 421 | .centering > div { 422 | margin-bottom: 1em; 423 | 424 | &.buttons { 425 | margin-top: 3em; 426 | } 427 | 428 | a { 429 | margin-bottom: 0; 430 | min-width: 15em; 431 | 432 | i { 433 | display: inline-block; 434 | width: 10%; 435 | float: left; 436 | } 437 | } 438 | } 439 | 440 | b { 441 | font-family: 'Josefin Sans', sans-serif; 442 | font-weight: 400; 443 | background: #111; 444 | color: #fff; 445 | display: inline-block; 446 | min-width: 2em; 447 | min-height: 2em; 448 | line-height: 2em; 449 | } 450 | 451 | h2 { 452 | margin-top: 1em; 453 | } 454 | 455 | h3 { 456 | margin-bottom: 1em; 457 | } 458 | 459 | .block div { 460 | padding-top: 5%; 461 | } 462 | 463 | img { 464 | border: solid 1px #111; 465 | 466 | max-height: 15em; 467 | max-width: 50%; 468 | 469 | &.r { 470 | float: right; 471 | margin-left: 4%; 472 | } 473 | 474 | &.l { 475 | float: left; 476 | margin-right: 4%; 477 | } 478 | } 479 | } 480 | 481 | a { 482 | width: 16.5em; 483 | display: inline-block; 484 | padding: 0.6em; 485 | text-align: center; 486 | font-size: 0.8em; 487 | letter-spacing: 0.2em; 488 | border: solid 1px #111; 489 | color: #111; 490 | text-decoration: none; 491 | transition: all .2s lisnear; 492 | -webkit-transition: all .2s linear; 493 | -moz-transition: .2s linear; 494 | cursor: pointer; 495 | margin-bottom: 1.8em; 496 | 497 | &:hover { 498 | background: #111; 499 | color: #fff; 500 | } 501 | 502 | &.fb, &.tw, &.gp { 503 | width: 4em; 504 | display: inline-block; 505 | } 506 | 507 | &.tw { 508 | margin: 0 0.6em; 509 | } 510 | 511 | &.disabled { 512 | color: darken(@yellow, 30%) !important; 513 | border-color: darken(@yellow, 30%) !important; 514 | cursor: default !important; 515 | 516 | &:hover { 517 | color: darken(@yellow, 30%) !important; 518 | background: none !important; 519 | } 520 | } 521 | } 522 | 523 | .for(@colors); .-each(@color) { 524 | @number: replace(@color, '[^\d]+', ''); 525 | 526 | @color_only: e('font-@{number}'); 527 | @bg_only: e('bg-@{number}'); 528 | @preset: e('preset-@{number}'); 529 | @reverse: e('reverse-@{number}'); 530 | 531 | .@{color_only} { 532 | color: darken(@@color, 20%) !important; 533 | } 534 | 535 | .@{bg_only} { 536 | background: darken(@@color, 20%) !important; 537 | } 538 | 539 | .@{preset} { 540 | background: @@color; 541 | color: darken(@@color, 20%); 542 | } 543 | 544 | .@{reverse} { 545 | background: 546 | linear-gradient(135deg, @@color 25%, transparent 5%) -50px 0, 547 | linear-gradient(225deg, @@color 25%, transparent 5%) -50px 0, 548 | linear-gradient(315deg, @@color 25%, transparent 5%), 549 | linear-gradient(45deg, @@color 25%, transparent 5%); 550 | 551 | background-size: 20px 20px; 552 | 553 | background-color: lighten(@@color, 8%); 554 | color: darken(@@color, 20%); 555 | } 556 | } 557 | 558 | //@import "medias.less"; 559 | -------------------------------------------------------------------------------- /css/less/fontello.less: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'fontello'; 3 | src: url('../font/fontello.eot?57116985'); 4 | src: url('../font/fontello.eot?57116985#iefix') format('embedded-opentype'), 5 | url('../font/fontello.woff?57116985') format('woff'), 6 | url('../font/fontello.ttf?57116985') format('truetype'), 7 | url('../font/fontello.svg?57116985#fontello') format('svg'); 8 | font-weight: normal; 9 | font-style: normal; 10 | } 11 | /* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */ 12 | /* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */ 13 | /* 14 | @media screen and (-webkit-min-device-pixel-ratio:0) { 15 | @font-face { 16 | font-family: 'fontello'; 17 | src: url('../font/fontello.svg?57116985#fontello') format('svg'); 18 | } 19 | } 20 | */ 21 | 22 | [class^="icon-"]:before, [class*=" icon-"]:before { 23 | font-family: "fontello"; 24 | font-style: normal; 25 | font-weight: normal; 26 | speak: none; 27 | 28 | display: inline-block; 29 | text-decoration: inherit; 30 | width: 1em; 31 | margin-right: .2em; 32 | text-align: center; 33 | /* opacity: .8; */ 34 | 35 | /* For safety - reset parent styles, that can break glyph codes*/ 36 | font-variant: normal; 37 | text-transform: none; 38 | 39 | /* fix buttons height, for twitter bootstrap */ 40 | line-height: 1em; 41 | 42 | /* Animation center compensation - margins should be symmetric */ 43 | /* remove if not needed */ 44 | margin-left: .2em; 45 | 46 | /* you can be more comfortable with increased icons size */ 47 | /* font-size: 120%; */ 48 | 49 | /* Uncomment for 3D effect */ 50 | /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */ 51 | } 52 | 53 | .icon-angle-down:before { content: '\e800'; } /* '' */ 54 | .icon-angle-double-down:before { content: '\e801'; } /* '' */ 55 | .icon-angle-left:before { content: '\e802'; } /* '' */ 56 | .icon-angle-right:before { content: '\e803'; } /* '' */ 57 | .icon-angle-up:before { content: '\e804'; } /* '' */ 58 | .icon-angle-double-left:before { content: '\e805'; } /* '' */ 59 | .icon-angle-double-right:before { content: '\e806'; } /* '' */ 60 | .icon-angle-double-up:before { content: '\e807'; } /* '' */ 61 | .icon-cancel:before { content: '\e808'; } /* '' */ 62 | .icon-gplus:before { content: '\e809'; } /* '' */ 63 | .icon-facebook:before { content: '\e80a'; } /* '' */ 64 | .icon-twitter:before { content: '\e80b'; } /* '' */ 65 | .icon-tumblr:before { content: '\e80c'; } /* '' */ 66 | .icon-cw:before { content: '\e80d'; } /* '' */ 67 | .icon-joystick:before { content: '\e80e'; } /* '' */ 68 | .icon-trophy:before { content: '\e817'; } /* '' */ 69 | .icon-award:before { content: '\e818'; } /* '' */ 70 | .icon-down-open-big:before { content: '\e81a'; } /* '' */ 71 | .icon-left-open-big:before { content: '\e81b'; } /* '' */ 72 | .icon-right-open-big:before { content: '\e81c'; } /* '' */ 73 | .icon-up-open-big:before { content: '\e81d'; } /* '' */ 74 | -------------------------------------------------------------------------------- /css/less/for.less: -------------------------------------------------------------------------------- 1 | 2 | // ............................................................ 3 | // .for 4 | 5 | .for(@i, @n) {.-each(@i)} 6 | .for(@n) when (isnumber(@n)) {.for(1, @n)} 7 | .for(@i, @n) when not (@i = @n) { 8 | .for((@i + (@n - @i) / abs(@n - @i)), @n); 9 | } 10 | 11 | // ............................................................ 12 | // .for-each 13 | 14 | .for(@array) when (default()) {.for-impl_(length(@array))} 15 | .for-impl_(@i) when (@i > 1) {.for-impl_((@i - 1))} 16 | .for-impl_(@i) when (@i > 0) {.-each(extract(@array, @i))} -------------------------------------------------------------------------------- /css/less/medias.less: -------------------------------------------------------------------------------- 1 | // @media (max-width: 450px) { 2 | // #small_ad { 3 | // display: block; 4 | // } 5 | // 6 | // #big_ad { 7 | // display: none; 8 | // } 9 | // } 10 | 11 | @media (max-width: 650px) and (min-height: 480px) { 12 | body { 13 | font-size: 15px; 14 | } 15 | 16 | .copyright { 17 | display: none; 18 | } 19 | 20 | .info { 21 | width: 87%; 22 | height: 90%; 23 | } 24 | 25 | section i { 26 | font-size: 18em; 27 | } 28 | 29 | h2 { 30 | margin-top: 1em; 31 | margin-bottom: 1em !important; 32 | font-size: 2.5em !important; 33 | } 34 | 35 | .wrapper { 36 | width: 90%; 37 | height: 30em; 38 | } 39 | 40 | h1 { 41 | display: block; 42 | margin: 0 auto 0.3em auto; 43 | float: none; 44 | text-align: center; 45 | width: 3em; 46 | height: 3em; 47 | line-height: 3.2em; 48 | font-size: 2.5em; 49 | display: block; 50 | } 51 | 52 | .menu { 53 | width: 100%; 54 | margin-top: -0.5em; 55 | display: block; 56 | float: none; 57 | height: 65%; 58 | padding: 0; 59 | text-align: center; 60 | 61 | div { 62 | padding: 0.6em; 63 | font-size: 0.9em; 64 | margin-bottom: 0.5em; 65 | 66 | span { 67 | background: #111; 68 | color: #fff; 69 | letter-spacing: 0; 70 | display: inline-block; 71 | min-width: 2em; 72 | min-height: 2em; 73 | line-height: 2em; 74 | } 75 | } 76 | 77 | a { 78 | height: 3em; 79 | font-size: 0.9em; 80 | line-height: 3em; 81 | 82 | &:hover { 83 | background: #111; 84 | color: #fff; 85 | } 86 | 87 | &.fb, &.tw, &.gp { 88 | display: none; 89 | } 90 | } 91 | 92 | a.main_btn { 93 | margin-bottom: 0.6em; 94 | width: auto; 95 | display: block; 96 | } 97 | } 98 | } 99 | 100 | @media (max-height: 479px) { 101 | body { 102 | font-size: 15px; 103 | } 104 | 105 | .copyright { 106 | display: none; 107 | } 108 | 109 | .wrapper { 110 | width: 31em; 111 | height: 19em; 112 | } 113 | 114 | .copyright { 115 | margin-top: 0.5em; 116 | } 117 | 118 | .info { 119 | width: 85%; 120 | height: 75%; 121 | } 122 | 123 | section i { 124 | font-size: 15em; 125 | line-height: 1.2em; 126 | } 127 | 128 | #btn_leader { 129 | margin-bottom: 0 !important; 130 | } 131 | 132 | .menu { 133 | padding: 0 1em; 134 | margin-top: -0.5em; 135 | width: 14em; 136 | 137 | div { 138 | font-size: 0.9em; 139 | width: 100%; 140 | } 141 | 142 | a { 143 | height: 1.5em; 144 | font-size: 0.9em; 145 | line-height: 1.5em; 146 | margin-bottom: 1.3em; 147 | 148 | &:hover { 149 | background: #111; 150 | color: #fff; 151 | } 152 | 153 | &.fb, &.tw, &.gp { 154 | display: none; 155 | } 156 | } 157 | } 158 | 159 | h1 { 160 | width: 3em; 161 | height: 3em; 162 | line-height: 3.2em; 163 | font-size: 4.5em; 164 | margin-top: 1.1em; 165 | } 166 | } 167 | -------------------------------------------------------------------------------- /font/fontello.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kraiom/dash/8a8cd0aeda75db79fae6279f7cac195f89b17487/font/fontello.eot -------------------------------------------------------------------------------- /font/fontello.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Copyright (C) 2015 by original authors @ fontello.com 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /font/fontello.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kraiom/dash/8a8cd0aeda75db79fae6279f7cac195f89b17487/font/fontello.ttf -------------------------------------------------------------------------------- /font/fontello.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kraiom/dash/8a8cd0aeda75db79fae6279f7cac195f89b17487/font/fontello.woff -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const $ = require('gulp-load-plugins')() 4 | const gulp = require('gulp') 5 | 6 | gulp.task ('styles', () => gulp 7 | .src('css/less/*.less') 8 | .pipe($.less()) 9 | .pipe($.minifyCss()) 10 | .pipe($.concat('css.css')) 11 | .pipe(gulp.dest('css/')) 12 | ) 13 | 14 | gulp.task ('dash', () => gulp 15 | .src('js/dash/*.js') 16 | .pipe($.order([ 17 | 'js/dash/dash-utils.js', 18 | 'js/dash/*.js' 19 | ])) 20 | .pipe($.uglify()) 21 | .pipe($.concat('dash.min.js')) 22 | .pipe(gulp.dest('js/assets/')) 23 | ) 24 | 25 | gulp.task ('fb', () => gulp 26 | .src('js/libs/fb.js') 27 | .pipe($.uglify()) 28 | .pipe($.concat('fb.min.js')) 29 | .pipe(gulp.dest('js/libs/')) 30 | ) 31 | 32 | gulp.task ('libs', () => gulp 33 | .src([ 34 | 'js/libs/jquery*', 35 | 'js/libs/keypress*', 36 | 'js/libs/hammer.min.js' 37 | ]) 38 | .pipe($.uglify()) 39 | .pipe($.concat('libs.min.js')) 40 | .pipe(gulp.dest('js/assets/')) 41 | ) 42 | 43 | gulp.task ('scripts', ['dash', 'libs'], () => gulp 44 | .src('js/assets/*.js') 45 | .pipe($.uglify()) 46 | .pipe($.order([ 47 | 'libs.min.js', 48 | 'dash.min.js', 49 | 'common.js' 50 | ]), { base: './js/assets' }) 51 | .pipe($.concat('script.min.js')) 52 | .pipe(gulp.dest('js/')) 53 | ) 54 | 55 | gulp.task ('default', ['styles', 'fb', 'scripts']) 56 | -------------------------------------------------------------------------------- /img/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kraiom/dash/8a8cd0aeda75db79fae6279f7cac195f89b17487/img/favicon.png -------------------------------------------------------------------------------- /img/load.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kraiom/dash/8a8cd0aeda75db79fae6279f7cac195f89b17487/img/load.gif -------------------------------------------------------------------------------- /img/logo-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kraiom/dash/8a8cd0aeda75db79fae6279f7cac195f89b17487/img/logo-128.png -------------------------------------------------------------------------------- /img/logo-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kraiom/dash/8a8cd0aeda75db79fae6279f7cac195f89b17487/img/logo-16.png -------------------------------------------------------------------------------- /img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kraiom/dash/8a8cd0aeda75db79fae6279f7cac195f89b17487/img/logo.png -------------------------------------------------------------------------------- /img/tut/common.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kraiom/dash/8a8cd0aeda75db79fae6279f7cac195f89b17487/img/tut/common.png -------------------------------------------------------------------------------- /img/tut/double.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kraiom/dash/8a8cd0aeda75db79fae6279f7cac195f89b17487/img/tut/double.png -------------------------------------------------------------------------------- /img/tut/pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kraiom/dash/8a8cd0aeda75db79fae6279f7cac195f89b17487/img/tut/pressed.png -------------------------------------------------------------------------------- /img/tut/previous.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kraiom/dash/8a8cd0aeda75db79fae6279f7cac195f89b17487/img/tut/previous.png -------------------------------------------------------------------------------- /img/tut/reverse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kraiom/dash/8a8cd0aeda75db79fae6279f7cac195f89b17487/img/tut/reverse.png -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | Dash 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
32 |

DASH

33 | 34 | 43 | 44 |
45 | 46 | 52 |
53 | 54 | 55 |
56 |
57 | 58 |
59 |
10
60 | 63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 | 71 |
72 |
73 |
74 | 75 |
76 | 77 |
78 | 79 |
80 | Close window 81 | 82 |

Game over!

83 | 84 |
85 |
86 | Your final score is 888 in 10 seconds! 87 |
88 | 89 |
90 | Play again 91 |
92 | 93 |
94 |
Share on Facebook
95 |
96 |
97 | 98 |
99 | Share on Twitter 100 |
101 |
102 |
103 |
104 | 105 |
106 | Close window 107 | 108 |

How to play

109 | 110 |
111 | Enable in-game tutorial 112 | 113 |
114 | 115 |
The rule is simple: send the panel to the correct direction, if you can! In Dash you must press the arrow accordingly to what is being shown within the remaining time and each round is faster than the last!
116 | 117 |
Too easy? There are also some things you must pay attention to in order to dash!
118 | 119 |
120 | common arrow 121 |
122 |

Simple arrow

123 | The simple arrow is the most basic and classic thing! Just press the right key in time and you're good. 124 |
125 |
126 |
127 | 128 |
129 | common arrow 130 |
131 |

Reverse

132 | It's a trap! If the background is striped, then you must take the opposite action that is being shown. For instance, if the image shows a right arrow, press the left key; If it shows up, then press down, and so on and so forth. 133 |
134 |
135 |
136 | 137 |
138 | common arrow 139 |
140 |

Double arrow

141 | To dismiss a panel like this, you must double press the required key in the same amount of time. As easy as pie! 142 |
143 |
144 |
145 | 146 |
147 | common arrow 148 |
149 |

Previous action

150 | This one may seem tricky. DASH is not only about being fast, but also being attentive! If you ever see a symbol like this, then it is a previous arrow! It means you must repeat your last action! 151 |
152 |
153 |
154 | 155 |
156 | common arrow 157 |
158 |

Pressed arrow

159 | Have you paid close attention to what happens when you press the correct key? Yes, the arrow turns into white. However, what should you do if the panel came with a white arrow? Simple: do not press anything. At all. Seriously. 160 |
161 |
162 |
163 |
164 | 165 |
166 | Close window 167 | 168 |

Leaderboard

169 | 170 | 173 | 174 |
175 | Ranking not available yet! 176 |
177 | 178 |
179 | 180 |
181 | 182 | 185 | 186 | 187 |
188 |
189 | 190 |
191 | 192 | 193 | 194 | 195 | 208 | 209 | 210 | -------------------------------------------------------------------------------- /js/assets/common.js: -------------------------------------------------------------------------------- 1 | // Default values 2 | var W, H; 3 | var SITE = escape('http://dash.kraiom.com/'); 4 | var listener = new window.keypress.Listener(); 5 | var msg = null, msg_icon = null; 6 | var game = null; 7 | var end_game_view = null; 8 | var last_score = null; 9 | var last_time = null; 10 | var konami = false; 11 | var best = 0, BEST_SCORE = 0; 12 | var tic = 0; 13 | var shares = {fb: null, tw: null}; 14 | var ROUNDS_TO_HIDE = -1; 15 | var tutorial = 1, message = null; 16 | var tutorial_btn = {on: null, off: null}; 17 | 18 | var taught = []; 19 | 20 | var challenges = [ 21 | { 22 | alias: 'simple', 23 | 24 | morph: function (tentative, last) { 25 | return { 26 | expected: [tentative.expected[0]] 27 | }; 28 | }, 29 | 30 | text: 'Press the key/swipe to the direction of the arrow' 31 | }, 32 | 33 | { 34 | alias: 'reverse', 35 | constraints: ['pressed', 'previous'], 36 | rounds: 15, 37 | 38 | morph: function (tentative, last) { 39 | var length = tentative.expected.length; 40 | var values = {expected: []}; 41 | 42 | for (var i = 0; i < length; i++) 43 | values.expected.push(mod(tentative.expected[i] + 2, 4)); 44 | 45 | return values; 46 | }, 47 | 48 | text: 'Press the key/swipe to the opposite direction of the arrow' 49 | }, 50 | 51 | { 52 | alias: 'double', 53 | constraints: ['pressed', 'previous'], 54 | rounds: 10, 55 | 56 | morph: function (tentative, last) { 57 | return { 58 | expected: [tentative.expected[0], tentative.expected[0]] 59 | }; 60 | }, 61 | 62 | text: 'Press the key/swipe twice to the direction of the arrow' 63 | }, 64 | 65 | { 66 | alias: 'previous', 67 | first_turn: false, 68 | constraints: ['reverse', 'double', 'pressed'], 69 | rounds: 25, 70 | 71 | morph: function (tentative, last) { 72 | return { 73 | expected: last.expected, 74 | missable: last.missable, 75 | direction: last.direction 76 | }; 77 | }, 78 | 79 | text: 'Repeat your previous action' 80 | }, 81 | 82 | { 83 | alias: 'pressed', 84 | constraints: ['reverse', 'double', 'pressed'], 85 | rounds: 30, 86 | 87 | morph: function (tentative, last) { 88 | return { 89 | expected: [], 90 | missable: false 91 | }; 92 | }, 93 | 94 | text: 'Do not do anything!' 95 | } 96 | ]; 97 | 98 | listener.sequence_combo('up up down down left right left right b a enter', function() { 99 | konami ^= true; 100 | msg_icon.removeClass().addClass('icon-joystick'); 101 | msg.fadeIn(); 102 | setTimeout(function () { msg.fadeOut(); }, 1500); 103 | }); 104 | 105 | 106 | listener.sequence_combo('esc', function() { 107 | if (game.is_playing()) { 108 | game.end(); 109 | message.fadeOut('fast'); 110 | } 111 | }); 112 | 113 | // Toggles fullscreen 114 | function toggleFullScreen () { 115 | if (!document.fullscreenElement && // alternative standard method 116 | !document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement ) { // current working methods 117 | if (document.documentElement.requestFullscreen) { 118 | document.documentElement.requestFullscreen(); 119 | } else if (document.documentElement.msRequestFullscreen) { 120 | document.documentElement.msRequestFullscreen(); 121 | } else if (document.documentElement.mozRequestFullScreen) { 122 | document.documentElement.mozRequestFullScreen(); 123 | } else if (document.documentElement.webkitRequestFullscreen) { 124 | document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT); 125 | } 126 | } else { 127 | if (document.exitFullscreen) { 128 | document.exitFullscreen(); 129 | } else if (document.msExitFullscreen) { 130 | document.msExitFullscreen(); 131 | } else if (document.mozCancelFullScreen) { 132 | document.mozCancelFullScreen(); 133 | } else if (document.webkitExitFullscreen) { 134 | document.webkitExitFullscreen(); 135 | } 136 | } 137 | } 138 | 139 | // Fetches object 140 | function fetch (name, result) { 141 | var cookie = $.cookie(name); 142 | var local = window.localStorage.getItem(name); 143 | 144 | if (!cookie && !local) 145 | return null; 146 | 147 | return cookie || local; 148 | } 149 | 150 | 151 | // Stores object 152 | function store (name, value) { 153 | $.cookie(name, value, { expires: 365 }); 154 | window.localStorage.setItem(name, value); 155 | } 156 | 157 | 158 | // Achievement popup 159 | function achievement () { 160 | msg_icon.removeClass().addClass('icon-trophy'); 161 | msg.fadeIn(); 162 | setTimeout(function () { msg.fadeOut(); }, 1500); 163 | } 164 | 165 | // A function called to begin dash 166 | function goDash () { 167 | var hiding = ROUNDS_TO_HIDE; 168 | 169 | hiding += ~~(Math.random() * 20); 170 | 171 | game.prepare(challenges, konami ? 42 : 1, 172 | BEST_SCORE, -1); 173 | tic = (new Date()).getTime(); 174 | game.start(); 175 | } 176 | 177 | $(document).ready(function() { 178 | 179 | $('#btn_howto').click(function() { $('#info').fadeIn('slow', function () { 180 | $(this).css('overflow', 'auto'); 181 | }); }); 182 | 183 | $('#btn_full').click(toggleFullScreen); 184 | 185 | $('#btn_leader').click(function() { 186 | fb_update_leaderboard(); 187 | 188 | $('#leaderboards').fadeIn('slow', function () { 189 | $(this).css('overflow', 'auto'); 190 | }); 191 | }); 192 | 193 | $('#btn_login').click(function() { fb_login(); }); 194 | 195 | $('.dismiss').click(function() { $(this).parent().fadeOut(); }); 196 | 197 | W = $(window).width(); 198 | H = $(window).height(); 199 | 200 | msg = $('#msg'); 201 | msg_icon = $('#msg_icon'); 202 | 203 | end_game_view = $('#end_game_view'); 204 | 205 | best = $('#best'); 206 | last_score = $('#last_score'); 207 | last_time = $('#last_time'); 208 | 209 | shares.fb = $('#fb_share_score'); 210 | shares.tw = $('#tw_share_score'); 211 | 212 | message = $('#tutorial'); 213 | 214 | tutorial_btn = { 215 | on: $('#tutorial_on'), 216 | off: $('#tutorial_off') 217 | } 218 | 219 | // $('.gp').click(function () { 220 | // var left = ~~((W - 600) / 2); 221 | // var top = ~~((H - 600) / 2); 222 | 223 | // window.open('https://plus.google.com/share?url=' + SITE, 'Dash', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600,left=' + left + ',top=' + top); 224 | // }); 225 | 226 | if (fetch ('best') === null) 227 | store ('best', 0); 228 | 229 | if (fetch ('tutorial') === null) 230 | store ('tutorial', challenges.length); 231 | 232 | BEST_SCORE = fetch ('best'); 233 | tutorial = parseInt(fetch('tutorial')); 234 | 235 | if (tutorial !== 0) { 236 | tutorial_btn.on.toggle(); 237 | tutorial_btn.off.toggle(); 238 | } 239 | 240 | best.html(BEST_SCORE); 241 | 242 | tutorial_btn.on.click(function () { 243 | tutorial = challenges.length; 244 | store('tutorial', tutorial); 245 | tutorial_btn.on.toggle(); 246 | tutorial_btn.off.toggle(); 247 | }); 248 | 249 | tutorial_btn.off.click(function () { 250 | tutorial = 0; 251 | store('tutorial', tutorial); 252 | tutorial_btn.on.toggle(); 253 | tutorial_btn.off.toggle(); 254 | }); 255 | 256 | Interface = new DashGUI( 257 | { 258 | panels: ['#panel-0', '#panel-1'], 259 | icons: ['#panel-0 i', '#panel-1 i'], 260 | score: {main: '#score', timer: '#gauge', 261 | lives: '.lives div', points: '#counter'} 262 | }, 263 | { 264 | base_index: 1000, 265 | presets: 8, 266 | panel: 'preset-*', 267 | icon: 'icon-angle-.', 268 | wrong_icon: 'icon-cancel', 269 | life_lost: '+lost', 270 | correct_icon: '+correct', 271 | replace_array: ['left', 'up', 'right', 'down'], 272 | timer_color: 'bg-*' 273 | }, 274 | { 275 | 1 : { 276 | panel: 'reverse-*' 277 | }, 278 | 279 | 2 : { 280 | icon: 'icon-angle-double-.' 281 | }, 282 | 283 | 3 : { 284 | icon: 'icon-cw' 285 | }, 286 | 287 | 4 : { 288 | icon: '+pressed' 289 | } 290 | } 291 | ); 292 | 293 | var handlers = { 294 | on_panel_retrieve : function (raw, modifiers, expected) { 295 | var challenge = modifiers[0]; 296 | 297 | if (tutorial === 0 || taught.has(challenge)) 298 | return; 299 | 300 | game.pause(); 301 | 302 | message.html(challenges[challenge].text); 303 | message.fadeIn('fast'); 304 | 305 | if (expected.length === 0) { 306 | setTimeout(function () { 307 | message.fadeOut('fast'); 308 | game.resume(); 309 | game.correct(); 310 | }, 2000); 311 | } 312 | 313 | if (taught.push(challenge) === challenges.length) { 314 | store('tutorial', 0); 315 | tutorial_btn.on.toggle(); 316 | tutorial_btn.off.toggle(); 317 | } 318 | }, 319 | 320 | after_game : function (score) { 321 | var toc = (new Date()).getTime(); 322 | var elapsed = ~~((toc - tic) / 1000); 323 | 324 | last_time.html(elapsed); 325 | last_score.html(score); 326 | 327 | var text = 'I\'ve made ' + score + ' points in Dash! Can you dash faster? #Dash'; 328 | text = escape(text); 329 | 330 | shares.tw.attr('href', 'https://twitter.com/intent/tweet?text=' + text + '&url=' + SITE); 331 | 332 | _gaq.push(['_setCustomVar', 333 | 1, // This custom var is set to slot #1. Required parameter. 334 | 'Section', // The top-level name for your online content categories. Required parameter. 335 | 'Score', // Sets the value of "Section" to "Life & Style" for this particular aricle. Required parameter. 336 | score // Sets the scope to page-level. Optional parameter. 337 | ]); 338 | 339 | _gaq.push(['_setCustomVar', 340 | 2, // This custom var is set to slot #1. Required parameter. 341 | 'Section', // The top-level name for your online content categories. Required parameter. 342 | 'Time', // Sets the value of "Section" to "Life & Style" for this particular aricle. Required parameter. 343 | elapsed // Sets the scope to page-level. Optional parameter. 344 | ]); 345 | 346 | if (window.FB_LOGGED !== true) 347 | shares.fb.removeClass('disabled').addClass('disabled'); 348 | 349 | shares.fb.click(function () { 350 | if (shares.fb.hasClass('disabled')) 351 | return; 352 | 353 | shares.fb.addClass('disabled'); 354 | $('#share_text').html ('Sharing...'); 355 | 356 | FB.api('/me/feed', 'post', { 357 | description: unescape(text), 358 | caption: 'How fast can you dash?', 359 | link: 'https://apps.facebook.com/the-dash-game/', 360 | picture: 'https://dash.kraiom.com/img/logo.png', 361 | name: 'DASH', 362 | status_type: 'app_created_story', 363 | type: 'link' 364 | }, function(response) { 365 | if (!response || response.error) { 366 | console.log('Error occured'); 367 | } else { 368 | $('#share_text').html ('Shared!'); 369 | 370 | setTimeout(function(){ 371 | $('#share_text').html ('Share'); 372 | shares.fb.removeClass('disabled'); 373 | }, 2000); 374 | } 375 | }); 376 | }); 377 | 378 | end_game_view.fadeIn('slow', function () { 379 | $(this).css('overflow', 'auto'); 380 | }); 381 | 382 | if (score > BEST_SCORE) { 383 | store('best', score); 384 | fb_update_score(score); 385 | BEST_SCORE = score; 386 | best.html(BEST_SCORE); 387 | } 388 | }, 389 | 390 | best_score : function () { 391 | achievement(); 392 | }, 393 | 394 | lost_life : function () {}, 395 | 396 | got_point : function () {}, 397 | 398 | key_pressed : function (key) { 399 | if (tutorial === 0 || !game.is_paused()) 400 | return; 401 | 402 | if (game.test(key)) { 403 | tutorial--; 404 | game.resume(); 405 | setTimeout(function () { 406 | message.fadeOut('slow'); 407 | }, 1000); 408 | game.correct(); 409 | } 410 | } 411 | }; 412 | 413 | game = new Dash(Interface, handlers, { 414 | press_time: 1800, 415 | step: 6 416 | }).init(); 417 | 418 | $('#btn_play').click(function(){ 419 | goDash(); 420 | }); 421 | 422 | $('#btn_again').click(function(){ 423 | goDash(); 424 | end_game_view.fadeOut(); 425 | }); 426 | }); 427 | -------------------------------------------------------------------------------- /js/assets/dash.min.js: -------------------------------------------------------------------------------- 1 | var DIRECTIONS=4;!function(e){"use strict";e.DashGUI=function(e,s,n){var r=this;r.DROP_TIME=700,r.MIN_DROP_TIME=300;var a=r.DROP_TIME,i=[],t=1,o=e.panels.length;r.direction=null;var c=0,l=-1;void 0!==s.base_index&&(c=s.base_index);for(var d,p=0;p=s.presets/2&&i.shift(),e};r.getPanels=function(){return e.panels};var v=function(e,n){var r={addClass:!1,class_name:e};return"+"===e.charAt(0)&&(r.addClass=!0,e=e.substr(1)),void 0!==n&&(e=e.replace(/\*/g,n),void 0!==s.replace_array[n]&&(e=e.replace(/\./g,s.replace_array[n]))),r.class_name=e,r},m=function(e,s,n){s?e.addClass(n):e.removeClass().addClass(n)},u=function(e,s,n){var r=v(s,n);m(e,r.addClass,r.class_name)};r.retrieve=function(i,p,v){r.direction=i;var m=f(),h=p.length,_=e.panels,x=mod(t+1,o);_[x].css("z-index",c),_[t].css("z-index",c+1);var g=e.icons[x];u(_[x],s.panel,m),u(g,s.icon,i);for(var w=0;wn?(y.shift(),y):t===n?y:t=37&&e<=40?e-37:void 0!==t[e]?t[e]:-1}function c(){e.dismiss(),e.toc(),clearTimeout(_),h=!1,t.after_game(f)}function u(e){for(var t=["left","up","right","down"],n=0;n<4&&!(e.indexOf(t[n])>=0);n++);s(n+37)}function s(e){if(h)return t.key_pressed(e,l.expected.clone(),l.challenges.clone()),!(g||!w)&&void(a.test(e)===!0?a.correct():a.test(e)===!1&&a.wrong())}if(!e)return!1;var a=this,l=null,f=0,d=3,p=0,m=-1,v=!1,_=null,g=!1,h=!1,w=!1,y=[];a.wrong=function(){return l.toc(),t.lost_life(d-1),e.toc(),e.fails(d),clearTimeout(_),0===--d?c():void a.start()},a.correct=function(){l.toc(),f++,t.got_point(f),e.toc(),e.scores(f),f>p&&!v&&(t.best_score(f),v=!0),f===m&&e.hide_timer(),clearTimeout(_),a.start()},a.end=function(){c()},a.is_paused=function(){return g},a.test=function(e){if(e=i(e),e===-1)return null;var t=r(e);return null===t?null:!!t.compare(l.expected)},a.pause=function(){g=!0,clearTimeout(_),e.toc()},a.resume=function(){g=!1},a.start=function(){if(h&&!g){l.new_round(),r(),w=!1,t.before_game(l.direction,l.challenges);var n=e.get_drop_time();n=l.apply_ratio(n,.9999,e.MIN_DROP_TIME),n+=2+4*(1-l.get_ratio()),e.set_drop_time(Math.round(n)),e.retrieve(l.direction,l.challenges,function(){e.tic(l.press_time),w=!0,l.tic(),clearTimeout(_),_=setTimeout(function(){return l.toc(),l.missable?a.wrong():void(y.compare(l.expected)?a.correct():a.wrong())},l.press_time),setTimeout(function(){t.on_panel_retrieve(l.direction,l.challenges.clone(),l.expected.clone())},5)})}},a.prepare=function(t,r,i,c){void 0===r&&(r=3),void 0===i&&(i=0),void 0===c&&(c=-1),p=i,m=c,l=new DashLevel(t,n,o),e.prepare(),d=r,f=0,h=!0,v=!1},a.init=function(){var n=["before_game","after_game","best_score","lost_life","got_point","key_pressed"],o=n.length;void 0===t&&(t={});for(var r=0;r=37&&t<=40&&(e.preventDefault(),e.stopPropagation()),s(t)});var c=e.getPanels();o=c.length;for(var r=0;r= (defaults.presets / 2)) 136 | queue.shift(); 137 | 138 | return preset; 139 | } 140 | 141 | // Function that returns the panels that are going 142 | // to be considered 143 | _.getPanels = function () { 144 | return elements.panels; 145 | } 146 | 147 | // A helper function that interprets a class name given a number 148 | // returns an object with the following attributes: 149 | // - addClass: boolean, represent whether or not the class must be added 150 | // instead of replaced. 151 | // - class_name: string, represents the class name to be used 152 | var interpret = function (class_name, index) { 153 | var values = {addClass: false, class_name: class_name}; 154 | 155 | if (class_name.charAt(0) === '+') { 156 | values.addClass = true; 157 | class_name = class_name.substr(1); 158 | } 159 | 160 | if (index !== undefined) { 161 | class_name = class_name.replace(/\*/g, index); 162 | 163 | if (defaults.replace_array[index] !== undefined) 164 | class_name = class_name.replace(/\./g, defaults.replace_array[index]); 165 | } 166 | 167 | values.class_name = class_name; 168 | return values; 169 | } 170 | 171 | // Helper function that toggle classes in a object 172 | var toggle_class = function (object, addClass, class_name) { 173 | if (addClass) 174 | object.addClass(class_name); 175 | else 176 | object.removeClass().addClass(class_name); 177 | } 178 | 179 | // Minifier/helper function that calls interpret/toggle_class 180 | // for the object given the class_name to be interpreted and 181 | // the integer index to be considered. 182 | var shape = function (object, class_name, index) { 183 | var class_data = interpret(class_name, index); 184 | toggle_class(object, class_data.addClass, class_data.class_name); 185 | } 186 | 187 | // The function that displays a panel when requested. It takes 188 | // three parameters. @direction is the raw arrow direction that 189 | // should be displayed. @modifier is an array of indexes for a 190 | // specific style that must be applied. @callback is the function 191 | // called once the panel is fully displayed. 192 | _.retrieve = function (direction, modifier, callback) { 193 | _.direction = direction; 194 | 195 | var preset = get_preset(); 196 | var length = modifier.length; 197 | var panel = elements.panels; 198 | var next = mod(current + 1, N_PANELS); 199 | 200 | panel[next].css('z-index', zIndex); 201 | panel[current].css('z-index', zIndex + 1); 202 | 203 | var arrow = elements.icons[next]; 204 | 205 | shape(panel[next], defaults.panel, preset); 206 | shape(arrow, defaults.icon, direction); 207 | 208 | for (var i = 0; i < length; i++) { 209 | if (modifier[i] in specifics) { 210 | var style = specifics[modifier[i]]; 211 | 212 | if (style.panel) 213 | shape(panel[next], style.panel, preset); 214 | 215 | if (style.icon) 216 | shape(arrow, style.icon, direction); 217 | } 218 | } 219 | 220 | shape(elements.score.timer, defaults.timer_color, preset); 221 | 222 | if (last_raw === -1) { 223 | var die = ~~(Math.random() * DIRECTIONS); 224 | var pos = positions[die]; 225 | panel[next].css({left: pos.x, top: pos.y}); 226 | panel[next].animate({left: 0, top: 0}, drop_time, callback); 227 | } else { 228 | var pos = positions[last_raw]; 229 | panel[next].css({left: 0, top: 0}); 230 | panel[current].animate({left: pos.x, top: pos.y}, drop_time, callback); 231 | } 232 | 233 | last_raw = direction; 234 | current = next; 235 | } 236 | 237 | // The function that resets all data to start over 238 | _.prepare = function () { 239 | var W = $(window).width() + 10; 240 | var H = $(window).height() + 10; 241 | 242 | positions = [ 243 | {x: '-' + W + 'px', y: '0'}, 244 | {x: '0', y: '-' + H + 'px'}, 245 | {x: W + 'px', y: '0'}, 246 | {x: '0', y: H + 'px'} 247 | ]; 248 | 249 | last_raw = -1; 250 | 251 | elements.score.main.css('z-index', 2 * (zIndex + 1)); 252 | elements.score.timer.css('z-index', 2 * (zIndex + 1)); 253 | 254 | elements.score.timer.parent().fadeIn(); 255 | elements.score.points.html(0); 256 | elements.score.main.fadeIn(); 257 | 258 | for (var i = 0; i < elements.panels.length; i++) 259 | elements.panels[i].css({ 260 | top: '-100%', 261 | left: '-100%', 262 | display: 'block' 263 | }); 264 | 265 | elements.score.timer.css('width', 0); 266 | 267 | var class_data = interpret(defaults.life_lost); 268 | elements.score.lives.removeClass(class_data.class_name); 269 | } 270 | 271 | // The function that dismiss all panels 272 | _.dismiss = function () { 273 | for (var i = 0; i < elements.panels.length; i++) 274 | elements.panels[i].fadeOut(); 275 | 276 | elements.score.main.fadeOut(); 277 | elements.score.timer.parent().fadeOut(); 278 | } 279 | 280 | // Changes panel when the user gets wrong 281 | _.fails = function (remaining) { 282 | remaining--; 283 | 284 | shape(elements.icons[current], defaults.wrong_icon, _.direction); 285 | 286 | if (elements.score.lives.eq(remaining) !== undefined) 287 | shape(elements.score.lives.eq(remaining), defaults.life_lost); 288 | } 289 | 290 | // Changes panel when the user gets correct 291 | _.scores = function (points) { 292 | elements.score.points.html(points); 293 | 294 | shape(elements.icons[current], defaults.correct_icon, _.direction); 295 | } 296 | 297 | // Starts the timer 298 | _.tic = function (time) { 299 | if (elements.score.timer.parent().css('display') === 'block') 300 | elements.score.timer.animate({width: '100%'}, time); 301 | } 302 | 303 | // Stops the timer 304 | _.toc = function () { 305 | elements.score.timer.stop().css('width', 0); 306 | } 307 | 308 | // Hides the timer from gameplay 309 | _.hide_timer = function () { 310 | _.toc(); 311 | elements.score.timer.parent().fadeOut(); 312 | } 313 | 314 | // Return drop_time 315 | _.get_drop_time = function () { 316 | return drop_time; 317 | } 318 | 319 | // Sets drop_time 320 | _.set_drop_time = function (time) { 321 | drop_time = time; 322 | } 323 | } 324 | 325 | }) (window); 326 | -------------------------------------------------------------------------------- /js/dash/dash-level.js: -------------------------------------------------------------------------------- 1 | /* 2 | Dash v 0.4 | (c) 2017 Kraiom Studio - kraiom.com | Licensed under CC-NC-ND 3 | 4 | The DashLevel object handles a state 5 | of the game. I.e. it handles what is 6 | being shown in the current panel and 7 | its related data. 8 | 9 | FYI, The order of the directions is: 10 | 0 - left; 11 | 1 - up; 12 | 2 - right; 13 | 3 - down. 14 | 15 | It takes three values as input: 16 | 17 | @challenges: The attribute that defines 18 | the challenges to be faced. It is an array 19 | of objects. Notice that the order IS important 20 | because they are going to be indexed in the 21 | given order. This object must comprise three 22 | attributes: 23 | - first_turn: a boolean that defines whether 24 | or not the challenge can occur in the very 25 | first turn. (default true). 26 | 27 | - constraints: an array of numbers/aliases defining 28 | which other challenges cannot overlap this 29 | one. Note that if @overlaid_challenges is 1, then this 30 | attribute has no effect, since no challenge will 31 | ever be overlapped. (default []). 32 | 33 | - rounds: The minimum number of rounds (inclusive) 34 | that this challenge can occur. It will not occur 35 | prior this specified number of rounds. (default 0). 36 | 37 | - morph: a function that must return an object 38 | that is a modification of the input one. This 39 | function is explained below. 40 | 41 | - alias: a nickname for the challenge, used if 42 | you want to provide nicknames for the "constraints" 43 | instead of indexes. 44 | 45 | @times: A object with the following attributes: 46 | press_time: The time the player has to press 47 | (default 2 seconds) 48 | step: The amount of seconds that the next 49 | turn will have less than the current 50 | (default 40 ms) 51 | 52 | @overlaid_challenges: The number of allowed 53 | overlays in a challenge (default 1) 54 | 55 | The "morph" function is the most important 56 | function when defining a challenge. And has 57 | the following flavour: 58 | 59 | function morph (tentative, last) {}; 60 | 61 | @tentative is a object that has three attributes. 62 | Namely: 63 | - missable: a boolean that defines whether 64 | or not the challenge is not satisfied if the 65 | player runs out of time. 66 | 67 | - challenges: an array of indexes of challenges 68 | being currently applied. 69 | 70 | - expected: an array defining the expected sequence 71 | of keys in [0, 3]. 72 | 73 | - direction: the raw direction that the class generated. 74 | 75 | @last is an object with the following attributes: 76 | - expected: the last array defining the expected 77 | sequence of keys in [0, 3]. 78 | 79 | - missable: the last boolean that defines whether 80 | or not the challenge is not satisfied if the 81 | player runs out of time. 82 | 83 | - direction: the last raw direction that the 84 | class generated. 85 | 86 | Both @tentative and @last are read-only objects. DO 87 | NOT change ANY of their contents, it will make the 88 | game to explode into pieces! 89 | 90 | After the logic of the challenge, the user must 91 | return object containing a missable and a expected 92 | parameter based on the logic for the challenge. The 93 | missable parameter is still optional. 94 | */ 95 | 96 | ;(function (w) { 97 | 'use strict'; 98 | 99 | w.DashLevel = function (challenges, times, overlaid_challenges) { 100 | // Mandatory argument 101 | if (!challenges) 102 | return false; 103 | 104 | // The number of configurations 105 | var CONFIGURATIONS = challenges.length; 106 | 107 | // The number of directions 108 | var DIRECTIONS = 4; 109 | 110 | // The time the player has to press 111 | var PRESS_TIME = sec2ms(2); 112 | 113 | // The amount of seconds that the next 114 | // turn will have less than the current 115 | var STEP = sec2ms(0.04); 116 | 117 | // The minimum velocity that the player 118 | // will ever have to dismiss a panel 119 | var MINIMUM_VELOCITY = sec2ms(0.5); 120 | 121 | // The time the user used to press the key 122 | var timer = 0; 123 | 124 | // Applying defaults for challenges 125 | for (var i = 0; i < CONFIGURATIONS; i++) { 126 | var current = challenges[i]; 127 | 128 | if (current.morph === undefined) { 129 | challenges[i] = null; 130 | continue; 131 | } 132 | 133 | if (current.missable === undefined) 134 | current.missable = true; 135 | 136 | if (current.first_turn === undefined) 137 | current.first_turn = true; 138 | 139 | if (current.rounds === undefined) 140 | current.rounds = 0; 141 | 142 | if (current.constraints === undefined) 143 | current.constraints = []; 144 | } 145 | 146 | // Initializing the timeline array 147 | var challenges_timeline = []; 148 | 149 | for (var i = 0; i < CONFIGURATIONS; i++) { 150 | var current = challenges[i]; 151 | 152 | if (current === null) 153 | continue; 154 | 155 | var timeline = { 156 | index: i, 157 | rounds: current.rounds 158 | }; 159 | 160 | challenges_timeline.push(timeline); 161 | } 162 | 163 | // Initializing aliases object 164 | var aliases = {}; 165 | 166 | for (var i = 0; i < CONFIGURATIONS; i++) { 167 | var current = challenges[i]; 168 | var name = i; 169 | 170 | if (current.alias !== undefined) 171 | name = current.alias; 172 | 173 | aliases[name] = i; 174 | } 175 | 176 | // Checks whether there are still valid 177 | // challenges in order to continue; 178 | if (challenges_timeline.length === 0) 179 | return false; 180 | 181 | // Sorts by earlier rounds 182 | challenges_timeline.sort(function (a, b) { 183 | return a.rounds - b.rounds; 184 | }); 185 | 186 | // The minimum number of overlaid challenges is 1 187 | if (overlaid_challenges === undefined) 188 | overlaid_challenges = 1; 189 | 190 | // Define the times if not set 191 | if (times === undefined) 192 | times = {}; 193 | 194 | if (times.press_time === undefined) 195 | times.press_time = PRESS_TIME; 196 | 197 | if (times.step === undefined) 198 | times.step = STEP; 199 | 200 | if (times.minimun_velocity === undefined) 201 | times.minimun_velocity = MINIMUM_VELOCITY; 202 | 203 | // The self handler 204 | var _ = this; 205 | 206 | // The expected direction array 207 | _.expected = null; 208 | 209 | // The last expected action 210 | var last = {expected: null, missable: null, direction: null}; 211 | 212 | // The combination of challenges computed 213 | _.challenges = null; 214 | 215 | // The raw direction computed 216 | _.direction = null; 217 | 218 | // The press time 219 | _.press_time = times.press_time; 220 | 221 | // Determines whether or not the current 222 | // challenge is missable. I.e. the player 223 | // will get a wrong after the time finishes 224 | _.missable = true; 225 | 226 | // The number of rounds elapsed 227 | var rounds = -1; 228 | 229 | // The ratio of difficulty based on user's speed 230 | var ratio = 0.5; 231 | 232 | // The challenged that can currently be applied 233 | _.allowed = []; 234 | 235 | // A function that generates a random number 236 | var rand = function (n) { 237 | return ~~(Math.random() * n); 238 | } 239 | 240 | // The function that feeds _.allowed by adding 241 | // new allowed challenged 242 | var update_allowed_challenges = function () { 243 | if (challenges_timeline.length === 0) 244 | return; 245 | 246 | var first = challenges_timeline[0]; 247 | 248 | if (first.rounds === rounds) { 249 | _.allowed.push(first.index); 250 | challenges_timeline.shift(); 251 | update_allowed_challenges(); 252 | } 253 | } 254 | 255 | // The function that generates a configuration 256 | // for the panel (direction and difficulty) and 257 | // the solution for the puzzle 258 | var compute_expected = function () { 259 | var direction = rand (DIRECTIONS); 260 | 261 | var tentative = { 262 | expected: [direction], 263 | challenges: [], 264 | missable: true, 265 | direction: direction 266 | } 267 | 268 | for (var i = 0; i < overlaid_challenges; i++) 269 | tentative = salt (tentative); 270 | 271 | _.expected = tentative.expected; 272 | _.challenges = tentative.challenges; 273 | _.missable = tentative.missable; 274 | 275 | last = { 276 | expected: _.expected, 277 | missable: _.missable, 278 | direction: tentative.direction 279 | }; 280 | 281 | _.direction = tentative.direction; 282 | } 283 | 284 | // Add a challenge to the computed expected array 285 | var salt = function (tentative) { 286 | var expected = tentative.expected; 287 | 288 | var length = tentative.challenges.length; 289 | var reload = false; 290 | var current, index; 291 | 292 | var computed = null; 293 | 294 | while (true) { 295 | index = rand(CONFIGURATIONS); 296 | current = challenges[index]; 297 | 298 | // This is the very first turn and the challenge 299 | // cannot happen in the first turn 300 | if (rounds === 0 && !current.first_turn) 301 | continue; 302 | 303 | // If the challenge is not allowed, then do it again 304 | if (!_.allowed.has(index)) 305 | continue; 306 | 307 | // Check for constraint violations for adding a new 308 | // configuration to the previous one 309 | for (var i = 0; i < length; i++) { 310 | var applied = tentative.challenges[i]; 311 | 312 | if (applied.constraints.has(aliases[index])) 313 | continue; 314 | } 315 | 316 | // Gets the next computed challenge 317 | computed = current.morph(tentative, last); 318 | 319 | // Does not allow repetition of non-missables 320 | if (last.missable === false && computed.missable === false) 321 | continue; 322 | 323 | break; 324 | } 325 | 326 | tentative.challenges.push(index); 327 | 328 | if (computed.missable === undefined) 329 | computed.missable = true; 330 | 331 | if (computed.direction === undefined) 332 | computed.direction = tentative.direction; 333 | 334 | return { 335 | expected: computed.expected, 336 | challenges: tentative.challenges, 337 | missable: computed.missable, 338 | direction: computed.direction 339 | }; 340 | } 341 | 342 | // The function that increments a new round 343 | // and make all the logic necessary for a new 344 | // level 345 | _.new_round = function () { 346 | rounds++; 347 | update_allowed_challenges(); 348 | 349 | compute_expected(); 350 | _.press_time = _.apply_ratio(_.press_time, 1, 351 | times.minimun_velocity); 352 | } 353 | 354 | // Returns _.rounds 355 | _.get_rounds = function () { 356 | return rounds; 357 | } 358 | 359 | // Starts counter 360 | _.tic = function () { 361 | timer = (new Date()).getTime(); 362 | } 363 | 364 | // Stops counter and update ratio 365 | _.toc = function () { 366 | var toc = (new Date()).getTime(); 367 | var difference = toc - timer; 368 | ratio = (_.press_time - difference) / _.press_time; 369 | } 370 | 371 | // Gets the difficulty ration 372 | _.get_ratio = function () { 373 | return ratio; 374 | } 375 | 376 | // Returns the difficulty ratio to a given variable 377 | // in a given threshold 378 | _.apply_ratio = function (value, threshold, minimum) { 379 | value -= times.step * ratio; 380 | value -= times.step * 0.5; 381 | value = Math.max(value, minimum); 382 | return Math.round(value / threshold); 383 | } 384 | } 385 | 386 | }) (window); -------------------------------------------------------------------------------- /js/dash/dash-utils.js: -------------------------------------------------------------------------------- 1 | /* 2 | Dash v 0.4 | (c) 2017 Kraiom Studio - kraiom.com | Licensed under CC-NC-ND 3 | */ 4 | 5 | // Function that converts sec to ms 6 | function sec2ms (sec) { 7 | return sec * 1000; 8 | } 9 | 10 | // Function that calculates the interger modulus 11 | function mod (n, m) { 12 | return ((n % m) + m) % m; 13 | } 14 | 15 | // A prototype that evaluates whether or not an 16 | // item is in the array. 17 | Array.prototype.has = (function (item) { 18 | var length_a = this.length; 19 | 20 | for (var i = 0; i < length_a; i++) 21 | if (this[i] === item) 22 | return true; 23 | 24 | return false; 25 | }); 26 | 27 | // A prototype that copies all elements 28 | // of target to the main array. Returns 29 | // the new arrray. 30 | Array.prototype.push_array = (function (target) { 31 | var length_a = target.length; 32 | 33 | for (var i = 0; i < length_a; i++) 34 | this.push(target[i]); 35 | 36 | return this; 37 | }); 38 | 39 | // Check if two arrays are equal. 40 | Array.prototype.compare = (function (target) { 41 | var length_a = this.length; 42 | 43 | if (length_a !== target.length) 44 | return false; 45 | 46 | for (var i = 0; i < length_a; i++) 47 | if (this[i] !== target[i]) 48 | return false; 49 | 50 | return true; 51 | }); 52 | 53 | 54 | // Creates a clone of the array 55 | Array.prototype.clone = (function () { 56 | var length_a = this.length; 57 | var target = []; 58 | 59 | for (var i = 0; i < length_a; i++) 60 | target.push(this[i]); 61 | 62 | return target; 63 | }); 64 | -------------------------------------------------------------------------------- /js/dash/dash.js: -------------------------------------------------------------------------------- 1 | /* 2 | Dash v 0.4 | (c) 2017 Kraiom Studio - kraiom.com | Licensed under CC-NC-ND 3 | 4 | The Dash object handles the game logic, assigning 5 | the proper listeners and taking care of calling the correct 6 | interface-related objects, as well as handling life points 7 | and how the player press the correct key. 8 | 9 | To begin a game, the user must call .init() first and only once. 10 | After that, before every gameplay, the user must call 11 | .prepare() followed by .start(). Using the desired attributes 12 | for the "prepare" method. 13 | 14 | To instantiate Dash, there are two attributes that must 15 | be given: 16 | @Interface: A properly initialized Dash-GUI object 17 | 18 | @handlers: An object that can have the following attributes 19 | (all are callback functions): 20 | - before_game: Triggered right before each new panel 21 | being called. Has two input parameters: @direction that is 22 | the raw arrow direction that should be displayed. @modifier 23 | is an array of indexes for a specific style that must be applied. 24 | 25 | - after_game: Triggered when the game ends. Has one 26 | input parameter that is the final score. 27 | 28 | - best_score: Achieved at maximum once in a run. Triggered 29 | when the player beats his/her best score. Has one input 30 | parameter that is the current score. 31 | 32 | - lost_life: Triggered when the player loses a life. Has 33 | one input parameter that is current life points. 34 | 35 | - got_point: Triggered when the player gets a point. Has 36 | one input parameter that is current score. 37 | 38 | - key_pressed: Triggered right after a valid key is computed. 39 | Has three input parameters: the key pressed (Number), the expected 40 | sequence to be performed (Array) and the challenged in the 41 | current panel (Array). 42 | 43 | - on_panel_retrieve: Triggered right after a panel is fully 44 | retrieved. Has three input parameters: The raw arrow direction that 45 | should be displayed; An array of indexes for the challenge being applied; 46 | And what the expected value of key pressing is. 47 | 48 | And two optional attributes related to DashLevel: 49 | 50 | @times: A object with the following attributes: 51 | press_time: The time the player has to press 52 | (default 2 seconds) 53 | step: The amount of seconds that the next 54 | turn will have less than the current 55 | (default 40 ms) 56 | 57 | @overlaid_challenges: The number of allowed 58 | overlays in a challenge (default 1). 59 | 60 | The function prepare takes three arguments: 61 | @n_lives: The number of lives for this run. (default 3). 62 | 63 | @best_score: The current best score. Used to trigger handlers. 64 | best_score. (default 0). 65 | 66 | @challenges: Mandatory argument. This is an object that defines 67 | the challenges to be beaten, as explained in DashLevel definition. 68 | */ 69 | 70 | 71 | ;(function (w) { 72 | 'use strict'; 73 | 74 | 75 | w.Dash = function (Interface, handlers, times, overlaid_challenges) { 76 | // A valid Dash-GUI object is mandatory 77 | if (!Interface) 78 | return false; 79 | 80 | // The this handler 81 | var _ = this; 82 | 83 | // The level handler 84 | var Level = null; 85 | 86 | // The number of right pressed panels 87 | var right = 0; 88 | 89 | // The number of remaining lives 90 | var lives = 3; 91 | 92 | // The player's best score 93 | var BEST_SCORE = 0; 94 | 95 | // The number of panels that must be dismissed 96 | // in order to call Interface.hide_timer 97 | var HIDE_TIMER = -1; 98 | 99 | // Whether or not this run has a new best 100 | var new_best = false; 101 | 102 | // The timer handler 103 | var timer = null; 104 | 105 | // Whether or not the player paused the game 106 | var paused = false; 107 | 108 | // Whether or not the game is active 109 | var playing = false; 110 | 111 | // Whether or not the player can press the key 112 | var allowed = false; 113 | 114 | // The pressed sequence 115 | var sequence = []; 116 | 117 | // The function that manages the sequence 118 | // pressed by the user. It adds key to 119 | // the sequence and return an array containing 120 | // what the test array should be, regarding 121 | // Level.expected length. If the expected length 122 | // has not been achieved, it returns null. 123 | // If key is undefined, then sequence is set 124 | // to an empty array. 125 | function stack_key (key) { 126 | if (key === undefined) { 127 | sequence = []; 128 | return null; 129 | } 130 | 131 | sequence.push(key); 132 | 133 | var sequence_length = sequence.length; 134 | var expected_length = Level.expected.length; 135 | 136 | if (expected_length === 0) 137 | return sequence; 138 | 139 | if (sequence_length > expected_length) { 140 | sequence.shift(); 141 | return sequence; 142 | } 143 | 144 | if (sequence_length === expected_length) 145 | return sequence; 146 | 147 | if (sequence_length < expected_length) 148 | return null; 149 | } 150 | 151 | // Helper function that converts a keycode 152 | // to a code in [0, 3], also allowing awsd 153 | function adjust_key (key) { 154 | var awsd = { 155 | 65 : 0, 156 | 87 : 1, 157 | 68 : 2, 158 | 83 : 3 159 | }; 160 | 161 | if (key >= 37 && key <= 40) 162 | return key - 37; 163 | 164 | if (awsd[key] !== undefined) 165 | return awsd[key]; 166 | 167 | return -1; 168 | } 169 | 170 | // The function that deals with losing lives 171 | _.wrong = function () { 172 | Level.toc(); 173 | 174 | handlers.lost_life(lives - 1); 175 | 176 | Interface.toc(); 177 | Interface.fails(lives); 178 | 179 | clearTimeout(timer); 180 | 181 | if (--lives === 0) 182 | return game_over(); 183 | 184 | _.start(); 185 | } 186 | 187 | // The function that deals with getting points 188 | _.correct = function () { 189 | Level.toc(); 190 | 191 | right++; 192 | 193 | handlers.got_point(right); 194 | 195 | Interface.toc(); 196 | Interface.scores(right); 197 | 198 | if (right > BEST_SCORE && !new_best) { 199 | handlers.best_score(right); 200 | new_best = true; 201 | } 202 | 203 | if (right === HIDE_TIMER) 204 | Interface.hide_timer(); 205 | 206 | clearTimeout(timer); 207 | _.start(); 208 | } 209 | 210 | // The game over handler 211 | function game_over () { 212 | Interface.dismiss(); 213 | Interface.toc(); 214 | clearTimeout(timer); 215 | playing = false; 216 | 217 | handlers.after_game(right); 218 | } 219 | 220 | // Calls game over 221 | _.end = function () { 222 | game_over(); 223 | } 224 | 225 | // Evaluate the keycode related to the pan 226 | function evaluate_pan (type) { 227 | var names = ['left', 'up', 'right', 'down']; 228 | 229 | for (var i = 0; i < 4; i++) 230 | if (type.indexOf(names[i]) >= 0) 231 | break; 232 | 233 | evaluate(i + 37); 234 | } 235 | 236 | // The unstack function which evaluates a key pressed. 237 | function evaluate (key) { 238 | if (!playing) 239 | return; 240 | 241 | handlers.key_pressed(key, Level.expected.clone(), 242 | Level.challenges.clone()); 243 | 244 | if (paused || !allowed) 245 | return false; 246 | 247 | if (_.test(key) === true) 248 | _.correct(); 249 | 250 | else if (_.test(key) === false) 251 | _.wrong(); 252 | } 253 | 254 | // Checks whether or not the game is paused 255 | _.is_paused = function () { 256 | return paused; 257 | } 258 | 259 | // An interface so that the user can emulate the interaction 260 | // with the system by inputing a key (that will be normally) 261 | // computed and compared to the expected value. 262 | _.test = function (key) { 263 | key = adjust_key(key); 264 | 265 | if (key === -1) 266 | return null; 267 | 268 | var answer = stack_key(key); 269 | 270 | if (answer === null) 271 | return null; 272 | 273 | if (answer.compare(Level.expected)) 274 | return true; 275 | 276 | else 277 | return false; 278 | } 279 | 280 | // A function that pauses the whole game 281 | _.pause = function () { 282 | paused = true; 283 | clearTimeout(timer); 284 | Interface.toc(); 285 | } 286 | 287 | // A function that resumes the whole game 288 | _.resume = function () { 289 | paused = false; 290 | } 291 | 292 | // The game function which places the tiles and is recursively called 293 | _.start = function () { 294 | if (!playing || paused) 295 | return; 296 | 297 | Level.new_round(); 298 | stack_key(); 299 | 300 | allowed = false; 301 | 302 | handlers.before_game(Level.direction, Level.challenges); 303 | 304 | var drop_time = Interface.get_drop_time(); 305 | drop_time = Level.apply_ratio(drop_time, 0.9999, Interface.MIN_DROP_TIME); 306 | drop_time += 2 + (1 - Level.get_ratio()) * 4; 307 | 308 | Interface.set_drop_time(Math.round(drop_time)); 309 | 310 | Interface.retrieve(Level.direction, Level.challenges, function () { 311 | Interface.tic(Level.press_time); 312 | 313 | allowed = true; 314 | 315 | Level.tic(); 316 | 317 | clearTimeout(timer); 318 | timer = setTimeout(function () { 319 | Level.toc(); 320 | 321 | if (Level.missable) 322 | return _.wrong(); 323 | 324 | if (sequence.compare(Level.expected)) 325 | _.correct(); 326 | else 327 | _.wrong(); 328 | 329 | }, Level.press_time); 330 | 331 | setTimeout(function () { 332 | handlers.on_panel_retrieve(Level.direction, 333 | Level.challenges.clone(), Level.expected.clone()); 334 | }, 5); 335 | }); 336 | } 337 | 338 | // Function used for reseting the game's values 339 | _.prepare = function (challenges, n_lives, best_score, no_timer_turns) { 340 | if (n_lives === undefined) 341 | n_lives = 3; 342 | 343 | if (best_score === undefined) 344 | best_score = 0; 345 | 346 | if (no_timer_turns === undefined) 347 | no_timer_turns = -1; 348 | 349 | BEST_SCORE = best_score; 350 | HIDE_TIMER = no_timer_turns; 351 | 352 | Level = new DashLevel(challenges, times, overlaid_challenges); 353 | 354 | Interface.prepare(); 355 | 356 | lives = n_lives; 357 | right = 0; 358 | 359 | playing = true; 360 | new_best = false; 361 | } 362 | 363 | // Prepare interface and set listeners 364 | _.init = function () { 365 | 366 | var handler_names = ['before_game', 'after_game', 367 | 'best_score', 'lost_life', 'got_point', 'key_pressed']; 368 | 369 | var length = handler_names.length; 370 | 371 | if (handlers === undefined) 372 | handlers = {}; 373 | 374 | for (var i = 0; i < length; i++) { 375 | var name = handler_names[i]; 376 | 377 | if (handlers[name] === undefined) 378 | handlers[name] = function () {}; 379 | } 380 | 381 | window.addEventListener('focus', function () { 382 | _.resume(); 383 | _.start(); 384 | var text = $('title').html(); 385 | $('title').html(text.replace(' - Paused', '')); 386 | }); 387 | 388 | window.addEventListener('blur', function () { 389 | _.pause(); 390 | var text = $('title').html(); 391 | $('title').html(text + ' - Paused'); 392 | }); 393 | 394 | $('body').keydown(function (e) { 395 | var key = e.keyCode; 396 | 397 | if (key >= 37 && key <= 40) { 398 | e.preventDefault(); 399 | e.stopPropagation(); 400 | } 401 | 402 | evaluate(key); 403 | }); 404 | 405 | var panels = Interface.getPanels(); 406 | length = panels.length; 407 | 408 | for (var i = 0; i < length; i++) { 409 | Hammer(panels[i].get(0), { 410 | recognizers: [ 411 | [ Hammer.Swipe, 412 | { 413 | direction: Hammer.DIRECTION_ALL, 414 | velocity: 0.2, 415 | threshold: 10 416 | } 417 | ] 418 | ] 419 | }).on('swipeleft', function (event) { 420 | evaluate_pan(event.type); 421 | }).on('swipeup', function (event) { 422 | evaluate_pan(event.type); 423 | }).on('swiperight', function (event) { 424 | evaluate_pan(event.type); 425 | }).on('swipedown', function (event) { 426 | evaluate_pan(event.type); 427 | }); 428 | } 429 | 430 | return _; 431 | } 432 | 433 | // Returns playing 434 | _.is_playing = function () { 435 | return playing; 436 | } 437 | } 438 | }) (window); -------------------------------------------------------------------------------- /js/libs/fb.js: -------------------------------------------------------------------------------- 1 | window.fbAsyncInit = function() { 2 | FB.init({ 3 | appId : '903632352992329', 4 | xfbml : true, 5 | version : 'v2.2', 6 | cookie : true 7 | }); 8 | 9 | window.fb_update_score = function (score) { 10 | if (window.FB_LOGGED !== true) 11 | return; 12 | 13 | FB.api( 14 | "/me/scores", 15 | "POST", 16 | { 17 | "score": score 18 | }, 19 | function (response) { 20 | if (response.error) 21 | console.log(response); 22 | } 23 | ); 24 | } 25 | 26 | window.fb_update_leaderboard = function () { 27 | if (window.FB_LOGGED !== true) 28 | return; 29 | 30 | $('#loading').toggle(true); 31 | $('#no_leaderboard').toggle(false); 32 | 33 | var ranking = $('#ranking').empty().empty(); 34 | 35 | FB.api( 36 | "/app/scores?fields=score,user.limit(40)", 37 | function (response) { 38 | $('#loading').toggle(false); 39 | 40 | if (response && !response.error) { 41 | response = response.data; 42 | var length = response.length; 43 | 44 | if (length === 0) 45 | $('#error_msg').toggle(true); 46 | 47 | if (length === 1) 48 | $('#app_permissions_alert').toggle(true); 49 | 50 | $('#error_msg').toggle(false); 51 | $('#app_permissions_alert').toggle(false); 52 | 53 | for (var i = 0; i < length; i++) { 54 | ranking.append( 55 | '' + 56 | '' + (i + 1) + '.' + 57 | '' + response[i].user.name + '' + 59 | '' + response[i].user.name + '' + 60 | '' + response[i].score + '' + 61 | ''); 62 | } 63 | } else 64 | $('#no_leaderboard').toggle(true); 65 | } 66 | ); 67 | } 68 | 69 | function onLogin(response) { 70 | if (response.status == 'connected') { 71 | FB.api('/me?fields=first_name,picture', function(data) { 72 | var welcomeBlock = document.getElementById('user_name'); 73 | welcomeBlock.innerHTML = data.first_name + ', '; 74 | }); 75 | 76 | FB.api( 77 | "/me/scores", 78 | function (response) { 79 | if (response && !response.error) { 80 | var fb_score = 0; 81 | 82 | if (response.data !== undefined && 83 | response.data[0] !== undefined && 84 | response.data[0].score !== undefined) 85 | fb_score = response.data[0].score; 86 | 87 | BEST_SCORE = fb_score; 88 | best.html(BEST_SCORE); 89 | store('best', BEST_SCORE); 90 | 91 | fb_update_score (BEST_SCORE); 92 | } 93 | } 94 | ); 95 | } 96 | } 97 | 98 | window.fb_login = function () { 99 | FB.login(function(response) { 100 | window.FB_LOGGED = true; 101 | onLogin(response); 102 | fb_update_leaderboard(); 103 | $('#btn_login').toggle(false); 104 | }, {scope: 'user_friends, email, publish_actions'}); 105 | } 106 | 107 | FB.getLoginStatus(function(response) { 108 | // Check login status on load, and if the user is 109 | // already logged in, go directly to the welcome message. 110 | $('#error_msg').toggle(false); 111 | 112 | if (response.status == 'connected') { 113 | window.FB_LOGGED = true; 114 | onLogin(response); 115 | } else 116 | $('#btn_login').toggle(true); 117 | }); 118 | }; 119 | 120 | (function(d, s, id){ 121 | var js, fjs = d.getElementsByTagName(s)[0]; 122 | if (d.getElementById(id)) {return;} 123 | js = d.createElement(s); js.id = id; 124 | js.src = "//connect.facebook.net/en_US/sdk.js"; 125 | fjs.parentNode.insertBefore(js, fjs); 126 | }(document, 'script', 'facebook-jssdk')); 127 | -------------------------------------------------------------------------------- /js/libs/fb.min.js: -------------------------------------------------------------------------------- 1 | window.fbAsyncInit=function(){function e(e){"connected"==e.status&&(FB.api("/me?fields=first_name,picture",function(e){var t=document.getElementById("user_name");t.innerHTML=e.first_name+", "}),FB.api("/me/scores",function(e){if(e&&!e.error){var t=0;void 0!==e.data&&void 0!==e.data[0]&&void 0!==e.data[0].score&&(t=e.data[0].score),BEST_SCORE=t,best.html(BEST_SCORE),store("best",BEST_SCORE),fb_update_score(BEST_SCORE)}}))}FB.init({appId:"903632352992329",xfbml:!0,version:"v2.2",cookie:!0}),window.fb_update_score=function(e){window.FB_LOGGED===!0&&FB.api("/me/scores","POST",{score:e},function(e){e.error&&console.log(e)})},window.fb_update_leaderboard=function(){if(window.FB_LOGGED===!0){$("#loading").toggle(!0),$("#no_leaderboard").toggle(!1);var e=$("#ranking").empty().empty();FB.api("/app/scores?fields=score,user.limit(40)",function(t){if($("#loading").toggle(!1),t&&!t.error){t=t.data;var o=t.length;0===o&&$("#error_msg").toggle(!0),1===o&&$("#app_permissions_alert").toggle(!0),$("#error_msg").toggle(!1),$("#app_permissions_alert").toggle(!1);for(var n=0;n"+(n+1)+'.'+t[n].user.name+''+t[n].user.name+''+t[n].score+"")}else $("#no_leaderboard").toggle(!0)})}},window.fb_login=function(){FB.login(function(t){window.FB_LOGGED=!0,e(t),fb_update_leaderboard(),$("#btn_login").toggle(!1)},{scope:"user_friends, email, publish_actions"})},FB.getLoginStatus(function(t){$("#error_msg").toggle(!1),"connected"==t.status?(window.FB_LOGGED=!0,e(t)):$("#btn_login").toggle(!0)})},function(e,t,o){var n,r=e.getElementsByTagName(t)[0];e.getElementById(o)||(n=e.createElement(t),n.id=o,n.src="//connect.facebook.net/en_US/sdk.js",r.parentNode.insertBefore(n,r))}(document,"script","facebook-jssdk"); -------------------------------------------------------------------------------- /js/libs/hammer.min.js: -------------------------------------------------------------------------------- 1 | /*! Hammer.JS - v2.0.4 - 2014-09-28 2 | * http://hammerjs.github.io/ 3 | * 4 | * Copyright (c) 2014 Jorik Tangelder; 5 | * Licensed under the MIT license */ 6 | !function(a,b,c,d){"use strict";function e(a,b,c){return setTimeout(k(a,c),b)}function f(a,b,c){return Array.isArray(a)?(g(a,c[b],c),!0):!1}function g(a,b,c){var e;if(a)if(a.forEach)a.forEach(b,c);else if(a.length!==d)for(e=0;e-1}function r(a){return a.trim().split(/\s+/g)}function s(a,b,c){if(a.indexOf&&!c)return a.indexOf(b);for(var d=0;dc[b]}):d.sort()),d}function v(a,b){for(var c,e,f=b[0].toUpperCase()+b.slice(1),g=0;g1&&!c.firstMultiple?c.firstMultiple=E(b):1===e&&(c.firstMultiple=!1);var f=c.firstInput,g=c.firstMultiple,h=g?g.center:f.center,i=b.center=F(d);b.timeStamp=nb(),b.deltaTime=b.timeStamp-f.timeStamp,b.angle=J(h,i),b.distance=I(h,i),C(c,b),b.offsetDirection=H(b.deltaX,b.deltaY),b.scale=g?L(g.pointers,d):1,b.rotation=g?K(g.pointers,d):0,D(c,b);var j=a.element;p(b.srcEvent.target,j)&&(j=b.srcEvent.target),b.target=j}function C(a,b){var c=b.center,d=a.offsetDelta||{},e=a.prevDelta||{},f=a.prevInput||{};(b.eventType===yb||f.eventType===Ab)&&(e=a.prevDelta={x:f.deltaX||0,y:f.deltaY||0},d=a.offsetDelta={x:c.x,y:c.y}),b.deltaX=e.x+(c.x-d.x),b.deltaY=e.y+(c.y-d.y)}function D(a,b){var c,e,f,g,h=a.lastInterval||b,i=b.timeStamp-h.timeStamp;if(b.eventType!=Bb&&(i>xb||h.velocity===d)){var j=h.deltaX-b.deltaX,k=h.deltaY-b.deltaY,l=G(i,j,k);e=l.x,f=l.y,c=mb(l.x)>mb(l.y)?l.x:l.y,g=H(j,k),a.lastInterval=b}else c=h.velocity,e=h.velocityX,f=h.velocityY,g=h.direction;b.velocity=c,b.velocityX=e,b.velocityY=f,b.direction=g}function E(a){for(var b=[],c=0;ce;)c+=a[e].clientX,d+=a[e].clientY,e++;return{x:lb(c/b),y:lb(d/b)}}function G(a,b,c){return{x:b/a||0,y:c/a||0}}function H(a,b){return a===b?Cb:mb(a)>=mb(b)?a>0?Db:Eb:b>0?Fb:Gb}function I(a,b,c){c||(c=Kb);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return Math.sqrt(d*d+e*e)}function J(a,b,c){c||(c=Kb);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return 180*Math.atan2(e,d)/Math.PI}function K(a,b){return J(b[1],b[0],Lb)-J(a[1],a[0],Lb)}function L(a,b){return I(b[0],b[1],Lb)/I(a[0],a[1],Lb)}function M(){this.evEl=Nb,this.evWin=Ob,this.allow=!0,this.pressed=!1,y.apply(this,arguments)}function N(){this.evEl=Rb,this.evWin=Sb,y.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function O(){this.evTarget=Ub,this.evWin=Vb,this.started=!1,y.apply(this,arguments)}function P(a,b){var c=t(a.touches),d=t(a.changedTouches);return b&(Ab|Bb)&&(c=u(c.concat(d),"identifier",!0)),[c,d]}function Q(){this.evTarget=Xb,this.targetIds={},y.apply(this,arguments)}function R(a,b){var c=t(a.touches),d=this.targetIds;if(b&(yb|zb)&&1===c.length)return d[c[0].identifier]=!0,[c,c];var e,f,g=t(a.changedTouches),h=[],i=this.target;if(f=c.filter(function(a){return p(a.target,i)}),b===yb)for(e=0;eh&&(b.push(a),h=b.length-1):e&(Ab|Bb)&&(c=!0),0>h||(b[h]=a,this.callback(this.manager,e,{pointers:b,changedPointers:[a],pointerType:f,srcEvent:a}),c&&b.splice(h,1))}});var Tb={touchstart:yb,touchmove:zb,touchend:Ab,touchcancel:Bb},Ub="touchstart",Vb="touchstart touchmove touchend touchcancel";j(O,y,{handler:function(a){var b=Tb[a.type];if(b===yb&&(this.started=!0),this.started){var c=P.call(this,a,b);b&(Ab|Bb)&&c[0].length-c[1].length===0&&(this.started=!1),this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:tb,srcEvent:a})}}});var Wb={touchstart:yb,touchmove:zb,touchend:Ab,touchcancel:Bb},Xb="touchstart touchmove touchend touchcancel";j(Q,y,{handler:function(a){var b=Wb[a.type],c=R.call(this,a,b);c&&this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:tb,srcEvent:a})}}),j(S,y,{handler:function(a,b,c){var d=c.pointerType==tb,e=c.pointerType==vb;if(d)this.mouse.allow=!1;else if(e&&!this.mouse.allow)return;b&(Ab|Bb)&&(this.mouse.allow=!0),this.callback(a,b,c)},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var Yb=v(jb.style,"touchAction"),Zb=Yb!==d,$b="compute",_b="auto",ac="manipulation",bc="none",cc="pan-x",dc="pan-y";T.prototype={set:function(a){a==$b&&(a=this.compute()),Zb&&(this.manager.element.style[Yb]=a),this.actions=a.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var a=[];return g(this.manager.recognizers,function(b){l(b.options.enable,[b])&&(a=a.concat(b.getTouchAction()))}),U(a.join(" "))},preventDefaults:function(a){if(!Zb){var b=a.srcEvent,c=a.offsetDirection;if(this.manager.session.prevented)return void b.preventDefault();var d=this.actions,e=q(d,bc),f=q(d,dc),g=q(d,cc);return e||f&&c&Hb||g&&c&Ib?this.preventSrc(b):void 0}},preventSrc:function(a){this.manager.session.prevented=!0,a.preventDefault()}};var ec=1,fc=2,gc=4,hc=8,ic=hc,jc=16,kc=32;V.prototype={defaults:{},set:function(a){return h(this.options,a),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(a){if(f(a,"recognizeWith",this))return this;var b=this.simultaneous;return a=Y(a,this),b[a.id]||(b[a.id]=a,a.recognizeWith(this)),this},dropRecognizeWith:function(a){return f(a,"dropRecognizeWith",this)?this:(a=Y(a,this),delete this.simultaneous[a.id],this)},requireFailure:function(a){if(f(a,"requireFailure",this))return this;var b=this.requireFail;return a=Y(a,this),-1===s(b,a)&&(b.push(a),a.requireFailure(this)),this},dropRequireFailure:function(a){if(f(a,"dropRequireFailure",this))return this;a=Y(a,this);var b=s(this.requireFail,a);return b>-1&&this.requireFail.splice(b,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(a){return!!this.simultaneous[a.id]},emit:function(a){function b(b){c.manager.emit(c.options.event+(b?W(d):""),a)}var c=this,d=this.state;hc>d&&b(!0),b(),d>=hc&&b(!0)},tryEmit:function(a){return this.canEmit()?this.emit(a):void(this.state=kc)},canEmit:function(){for(var a=0;af?Db:Eb,c=f!=this.pX,d=Math.abs(a.deltaX)):(e=0===g?Cb:0>g?Fb:Gb,c=g!=this.pY,d=Math.abs(a.deltaY))),a.direction=e,c&&d>b.threshold&&e&b.direction},attrTest:function(a){return Z.prototype.attrTest.call(this,a)&&(this.state&fc||!(this.state&fc)&&this.directionTest(a))},emit:function(a){this.pX=a.deltaX,this.pY=a.deltaY;var b=X(a.direction);b&&this.manager.emit(this.options.event+b,a),this._super.emit.call(this,a)}}),j(_,Z,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[bc]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.scale-1)>this.options.threshold||this.state&fc)},emit:function(a){if(this._super.emit.call(this,a),1!==a.scale){var b=a.scale<1?"in":"out";this.manager.emit(this.options.event+b,a)}}}),j(ab,V,{defaults:{event:"press",pointers:1,time:500,threshold:5},getTouchAction:function(){return[_b]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distanceb.time;if(this._input=a,!d||!c||a.eventType&(Ab|Bb)&&!f)this.reset();else if(a.eventType&yb)this.reset(),this._timer=e(function(){this.state=ic,this.tryEmit()},b.time,this);else if(a.eventType&Ab)return ic;return kc},reset:function(){clearTimeout(this._timer)},emit:function(a){this.state===ic&&(a&&a.eventType&Ab?this.manager.emit(this.options.event+"up",a):(this._input.timeStamp=nb(),this.manager.emit(this.options.event,this._input)))}}),j(bb,Z,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[bc]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.rotation)>this.options.threshold||this.state&fc)}}),j(cb,Z,{defaults:{event:"swipe",threshold:10,velocity:.65,direction:Hb|Ib,pointers:1},getTouchAction:function(){return $.prototype.getTouchAction.call(this)},attrTest:function(a){var b,c=this.options.direction;return c&(Hb|Ib)?b=a.velocity:c&Hb?b=a.velocityX:c&Ib&&(b=a.velocityY),this._super.attrTest.call(this,a)&&c&a.direction&&a.distance>this.options.threshold&&mb(b)>this.options.velocity&&a.eventType&Ab},emit:function(a){var b=X(a.direction);b&&this.manager.emit(this.options.event+b,a),this.manager.emit(this.options.event,a)}}),j(db,V,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:2,posThreshold:10},getTouchAction:function(){return[ac]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance=e.duration||e.step?G.apply(this,arguments):this[!0===e.queue?"queue":"each"](function(){var b=d(this),c=d.extend({},e),k=function(c){var e=b.data(r)||{original:{}},g={};if(2==c.eventPhase){if(!0!==a.leaveTransforms){for(c=l.length-1;0<=c;c--)g[l[c]+"transform"]="";if(f&&"undefined"!== 17 | typeof e.meta){c=0;for(var h;h=B[c];++c){var k=e.meta[h+"_o"];"undefined"!==typeof k&&(g[h]=k+"px",d(this).css(h,g[h]))}}}b.unbind("webkitTransitionEnd oTransitionEnd transitionend").css(e.original).css(g).data(r,null);"hide"===a.opacity&&(elem=b[0],elem.style&&(display=d.css(elem,"display"),"none"===display||d._data(elem,"olddisplay")||d._data(elem,"olddisplay",display),elem.style.display="none"),b.css("opacity",""));n.call(this)}},p={bounce:"cubic-bezier(0.0, 0.35, .5, 1.3)",linear:"linear",swing:"ease-in-out", 18 | easeInQuad:"cubic-bezier(0.550, 0.085, 0.680, 0.530)",easeInCubic:"cubic-bezier(0.550, 0.055, 0.675, 0.190)",easeInQuart:"cubic-bezier(0.895, 0.030, 0.685, 0.220)",easeInQuint:"cubic-bezier(0.755, 0.050, 0.855, 0.060)",easeInSine:"cubic-bezier(0.470, 0.000, 0.745, 0.715)",easeInExpo:"cubic-bezier(0.950, 0.050, 0.795, 0.035)",easeInCirc:"cubic-bezier(0.600, 0.040, 0.980, 0.335)",easeInBack:"cubic-bezier(0.600, -0.280, 0.735, 0.045)",easeOutQuad:"cubic-bezier(0.250, 0.460, 0.450, 0.940)",easeOutCubic:"cubic-bezier(0.215, 0.610, 0.355, 1.000)", 19 | easeOutQuart:"cubic-bezier(0.165, 0.840, 0.440, 1.000)",easeOutQuint:"cubic-bezier(0.230, 1.000, 0.320, 1.000)",easeOutSine:"cubic-bezier(0.390, 0.575, 0.565, 1.000)",easeOutExpo:"cubic-bezier(0.190, 1.000, 0.220, 1.000)",easeOutCirc:"cubic-bezier(0.075, 0.820, 0.165, 1.000)",easeOutBack:"cubic-bezier(0.175, 0.885, 0.320, 1.275)",easeInOutQuad:"cubic-bezier(0.455, 0.030, 0.515, 0.955)",easeInOutCubic:"cubic-bezier(0.645, 0.045, 0.355, 1.000)",easeInOutQuart:"cubic-bezier(0.770, 0.000, 0.175, 1.000)", 20 | easeInOutQuint:"cubic-bezier(0.860, 0.000, 0.070, 1.000)",easeInOutSine:"cubic-bezier(0.445, 0.050, 0.550, 0.950)",easeInOutExpo:"cubic-bezier(1.000, 0.000, 0.000, 1.000)",easeInOutCirc:"cubic-bezier(0.785, 0.135, 0.150, 0.860)",easeInOutBack:"cubic-bezier(0.680, -0.550, 0.265, 1.550)"},t={},p=p[c.easing||"swing"]?p[c.easing||"swing"]:c.easing||"swing",h;for(h in a)if(-1===d.inArray(h,T)){var u=-1 1 && !$.isFunction(value)) { 60 | options = $.extend({}, config.defaults, options); 61 | 62 | if (typeof options.expires === 'number') { 63 | var days = options.expires, t = options.expires = new Date(); 64 | t.setTime(+t + days * 864e+5); 65 | } 66 | 67 | return (document.cookie = [ 68 | encode(key), '=', stringifyCookieValue(value), 69 | options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE 70 | options.path ? '; path=' + options.path : '', 71 | options.domain ? '; domain=' + options.domain : '', 72 | options.secure ? '; secure' : '' 73 | ].join('')); 74 | } 75 | 76 | // Read 77 | 78 | var result = key ? undefined : {}; 79 | 80 | // To prevent the for loop in the first place assign an empty array 81 | // in case there are no cookies at all. Also prevents odd result when 82 | // calling $.cookie(). 83 | var cookies = document.cookie ? document.cookie.split('; ') : []; 84 | 85 | for (var i = 0, l = cookies.length; i < l; i++) { 86 | var parts = cookies[i].split('='); 87 | var name = decode(parts.shift()); 88 | var cookie = parts.join('='); 89 | 90 | if (key && key === name) { 91 | // If second argument (value) is a function it's a converter... 92 | result = read(cookie, value); 93 | break; 94 | } 95 | 96 | // Prevent storing a cookie that we couldn't decode. 97 | if (!key && (cookie = read(cookie)) !== undefined) { 98 | result[name] = cookie; 99 | } 100 | } 101 | 102 | return result; 103 | }; 104 | 105 | config.defaults = {}; 106 | 107 | $.removeCookie = function (key, options) { 108 | if ($.cookie(key) === undefined) { 109 | return false; 110 | } 111 | 112 | // Must not alter options, thus extending a fresh object... 113 | $.cookie(key, '', $.extend({}, options, { expires: -1 })); 114 | return !$.cookie(key); 115 | }; 116 | 117 | })); 118 | -------------------------------------------------------------------------------- /js/libs/keypress-2.1.0.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | Keypress version 2.1.0 (c) 2014 David Mauro. 3 | Licensed under the Apache License, Version 2.0 4 | http://www.apache.org/licenses/LICENSE-2.0 5 | */ 6 | (function(){var m,v,y,z,A,r,w,B,F,C,G,H,p,s,q,o,t,D,I,E={}.hasOwnProperty,j=[].indexOf||function(a){for(var c=0,b=this.length;cj.call(a,"cmd")?!1:!0};g.prototype._prevent_default=function(a,c){if((c||this.should_suppress_event_defaults)&&!this.should_force_event_defaults)if(a.preventDefault?a.preventDefault():a.returnValue=!1,a.stopPropagation)return a.stopPropagation()};g.prototype._get_active_combos=function(a){var c,b;c=[];b=w(this._keys_down,function(b){return b!==a});b.push(a);this._match_combo_arrays(b, 11 | function(a){return function(b){if(a._cmd_bug_check(b.keys))return c.push(b)}}(this));this._fuzzy_match_combo_arrays(b,function(a){return function(b){if(!(0<=j.call(c,b))&&!b.is_solitary&&a._cmd_bug_check(b.keys))return c.push(b)}}(this));return c};g.prototype._get_potential_combos=function(a){var c,b,d,e,f;b=[];f=this._registered_combos;d=0;for(e=f.length;dk;e=0<=k?++i:--i)if((c=this._active_combos[e])&&c.is_exclusive&&a.is_exclusive){c=c.keys;if(!h){g=0;for(n=c.length;gj.call(a.keys,b)){h=!1;break}}if(f&&!h){l=a.keys;g=0;for(n=l.length;gj.call(c,b)){f=!0;break}}h&&(d?(c=this._active_combos.splice(e,1)[0],null!=c&&c.reset()):(c=this._active_combos.splice(e, 13 | 1,a)[0],null!=c&&c.reset(),d=!0),f=!1)}}f&&this._active_combos.unshift(a);return h||f};g.prototype._remove_from_active_combos=function(a){var c,b,d,e;b=d=0;for(e=this._active_combos.length;0<=e?de;b=0<=e?++d:--d)if(c=this._active_combos[b],c===a){a=this._active_combos.splice(b,1)[0];a.reset();break}};g.prototype._get_possible_sequences=function(){var a,c,b,d,e,f,h,i,g,n,k,l;d=[];n=this._registered_combos;f=0;for(g=n.length;f=k;c=1<= 14 | k?++h:--h)if(e=this._sequence.slice(-c),a.is_sequence){if(0>j.call(a.keys,"shift")&&(e=w(e,function(a){return"shift"!==a}),!e.length))continue;c=i=0;for(l=e.length;0<=l?il;c=0<=l?++i:--i)if(a.keys[c]===e[c])b=!0;else{b=!1;break}b&&d.push(a)}}return d};g.prototype._add_key_to_sequence=function(a,c){var b,d,e,f;this._sequence.push(a);d=this._get_possible_sequences();if(d.length){e=0;for(f=d.length;e=l;b=1<=l?++i:--i)if(f=w(this._sequence,function(a){return 0<=j.call(c.keys,"shift")?!0:"shift"!==a}).slice(-b),c.keys.length===f.length){b=g=0;for(u=f.length;0<=u?gu;b= 16 | 0<=u?++g:--g)if(e=f[b],!(0>j.call(c.keys,"shift")&&"shift"===e)&&!("shift"===a&&0>j.call(c.keys,"shift")))if(c.keys[b]===e)d=!0;else{d=!1;break}}if(d)return c}return!1};g.prototype._receive_input=function(a,c){var b;if(this._prevent_capture)this._keys_down.length&&(this._keys_down=[]);else if(b=z(a.keyCode),(c||this._keys_down.length||!("alt"===b||b===o))&&b)return c?this._key_down(b,a):this._key_up(b,a)};g.prototype._fire=function(a,c,b,d){"function"===typeof c["on_"+a]&&this._prevent_default(b, 17 | !0!==c["on_"+a].call(c["this"],b,c.count,d));"release"===a&&(c.count=0);if("keyup"===a)return c.keyup_fired=!0};g.prototype._match_combo_arrays=function(a,c){var b,d,e,f;f=this._registered_combos;d=0;for(e=f.length;df;b=0<= 19 | f?++d:--d)this._keys_down[b]===e&&this._keys_down.splice(b,1)}d=this._get_active_combos(a);e=this._get_potential_combos(a);f=0;for(h=d.length;fj.call(this._keys_down,a)&&this._keys_down.push(a)};g.prototype._handle_combo_down=function(a,c,b,d){var e,f,h,g,m;if(0>j.call(a.keys,b))return!1;this._prevent_default(d,a&&a.prevent_default);e=!1;if(0<=j.call(this._keys_down, 20 | b)&&(e=!0,!a.allows_key_repeat()))return!1;h=this._add_to_active_combos(a,b);b=a.keyup_fired=!1;if(a.is_exclusive){g=0;for(m=c.length;ga.keys.length){b=!0;break}}if(!b&&(a.is_counting&&"function"===typeof a.on_keydown&&(a.count+=1),h))return this._fire("keydown",a,d,e)};g.prototype._key_up=function(a,c){var b,d,e,f,h,g;b=a;(e=A(a,c))&&(a=e);e=s[b];c.shiftKey?e&&0<=j.call(this._keys_down,e)||(a=b):b&&0<=j.call(this._keys_down,b)||(a=e);(f=this._get_sequence(a))&& 21 | this._fire("keyup",f,c);if(0>j.call(this._keys_down,a))return!1;f=h=0;for(g=this._keys_down.length;0<=g?hg;f=0<=g?++h:--h)if((d=this._keys_down[f])===a||d===e||d===b){this._keys_down.splice(f,1);break}d=this._active_combos.length;e=[];g=this._active_combos;f=0;for(h=g.length;fd;b=0<=d?++c:--c)if(a===i._registered_combos[b]){i._registered_combos.splice(b,1);break}else e.push(void 0);return e};if(a instanceof x)return b(a);"string"===typeof a&&(a=a.split(" "));f=this._registered_combos;g=[];d=0;for(e=f.length;d< 25 | e;d++)c=f[d],null!=c&&(c.is_unordered&&v(a,c.keys)||!c.is_unordered&&y(a,c.keys)?g.push(b(c)):g.push(void 0));return g};g.prototype.unregister_many=function(a){var c,b,d,e;e=[];b=0;for(d=a.length;be;b=0<=e?++d:--d)if(a[b]!==c[b])return!1;return!0};F=function(a, 27 | c){var b,d,e;d=0;for(e=a.length;dj.call(c,b))return!1;return!0};B=Array.prototype.indexOf||function(a,c){var b,d,e;b=d=0;for(e=a.length;0<=e?d<=e:d>=e;b=0<=e?++d:--d)if(a[b]===c)return b;return-1};C=function(a,c){var b,d,e,f;e=d=0;for(f=a.length;e=d)d=b;else return!1;return!0};q=function(){if(m.debug)return console.log.apply(console,arguments)};G=function(a){var c,b,d;c=!1;for(d in p)if(b=p[d],a===b){c=!0;break}if(!c)for(d in s)if(b=s[d],a===b){c= 28 | !0;break}return c};I=function(a){var c,b,d,e,f,g,i;f=!0;a.keys.length||q("You're trying to bind a combo with no keys:",a);b=g=0;for(i=a.keys.length;0<=i?gi;b=0<=i?++g:--g)d=a.keys[b],(c=H[d])&&(d=a.keys[b]=c),"meta"===d&&a.keys.splice(b,1,o),"cmd"===d&&q('Warning: use the "meta" key rather than "cmd" for Windows compatibility');i=a.keys;c=0;for(g=i.length;c",",":"<","'":'"',";":":","[":"{","]":"}","\\":"|","`":"~","=":"+","-":"_",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(","0":")"};p={"0":"\\",8:"backspace",9:"tab",12:"num",13:"enter",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"caps",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",44:"print",45:"insert", 31 | 46:"delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",91:"cmd",92:"cmd",93:"cmd",96:"num_0",97:"num_1",98:"num_2",99:"num_3",100:"num_4",101:"num_5",102:"num_6",103:"num_7",104:"num_8",105:"num_9",106:"num_multiply",107:"num_add",108:"num_enter",109:"num_subtract",110:"num_decimal",111:"num_divide", 32 | 112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",124:"print",144:"num",145:"scroll",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",223:"`",224:"cmd",225:"alt",57392:"ctrl",63289:"num",59:";",61:"-",173:"="};m._keycode_dictionary=p;m._is_array_in_array_sorted=C;-1!==navigator.userAgent.indexOf("Mac OS X")&&(o="cmd");-1!==navigator.userAgent.indexOf("Opera")&&(p["17"]="cmd");"function"===typeof define&& 33 | define.amd?define([],function(){return m}):"undefined"!==typeof exports&&null!==exports?exports.keypress=m:window.keypress=m}).call(this); 34 | -------------------------------------------------------------------------------- /js/libs/require.js: -------------------------------------------------------------------------------- 1 | /* 2 | RequireJS 2.1.16 Copyright (c) 2010-2015, The Dojo Foundation All Rights Reserved. 3 | Available via the MIT or new BSD license. 4 | see: http://github.com/jrburke/requirejs for details 5 | */ 6 | var requirejs,require,define; 7 | (function(ba){function G(b){return"[object Function]"===K.call(b)}function H(b){return"[object Array]"===K.call(b)}function v(b,c){if(b){var d;for(d=0;dthis.depCount&&!this.defined){if(G(l)){if(this.events.error&&this.map.isDefine||g.onError!==ca)try{f=i.execCb(c,l,b,f)}catch(d){a=d}else f=i.execCb(c,l,b,f);this.map.isDefine&&void 0===f&&((b=this.module)?f=b.exports:this.usingExports&& 19 | (f=this.exports));if(a)return a.requireMap=this.map,a.requireModules=this.map.isDefine?[this.map.id]:null,a.requireType=this.map.isDefine?"define":"require",w(this.error=a)}else f=l;this.exports=f;if(this.map.isDefine&&!this.ignore&&(r[c]=f,g.onResourceLoad))g.onResourceLoad(i,this.map,this.depMaps);y(c);this.defined=!0}this.defining=!1;this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else this.fetch()}},callPlugin:function(){var a= 20 | this.map,b=a.id,d=p(a.prefix);this.depMaps.push(d);q(d,"defined",u(this,function(f){var l,d;d=m(aa,this.map.id);var e=this.map.name,P=this.map.parentMap?this.map.parentMap.name:null,n=i.makeRequire(a.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){if(f.normalize&&(e=f.normalize(e,function(a){return c(a,P,!0)})||""),f=p(a.prefix+"!"+e,this.map.parentMap),q(f,"defined",u(this,function(a){this.init([],function(){return a},null,{enabled:!0,ignore:!0})})),d=m(h,f.id)){this.depMaps.push(f); 21 | if(this.events.error)d.on("error",u(this,function(a){this.emit("error",a)}));d.enable()}}else d?(this.map.url=i.nameToUrl(d),this.load()):(l=u(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),l.error=u(this,function(a){this.inited=!0;this.error=a;a.requireModules=[b];B(h,function(a){0===a.map.id.indexOf(b+"_unnormalized")&&y(a.map.id)});w(a)}),l.fromText=u(this,function(f,c){var d=a.name,e=p(d),P=M;c&&(f=c);P&&(M=!1);s(e);t(j.config,b)&&(j.config[d]=j.config[b]);try{g.exec(f)}catch(h){return w(C("fromtexteval", 22 | "fromText eval for "+b+" failed: "+h,h,[b]))}P&&(M=!0);this.depMaps.push(e);i.completeLoad(d);n([d],l)}),f.load(a.name,n,l,j))}));i.enable(d,this);this.pluginMaps[d.id]=d},enable:function(){V[this.map.id]=this;this.enabling=this.enabled=!0;v(this.depMaps,u(this,function(a,b){var c,f;if("string"===typeof a){a=p(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap);this.depMaps[b]=a;if(c=m(L,a.id)){this.depExports[b]=c(this);return}this.depCount+=1;q(a,"defined",u(this,function(a){this.defineDep(b, 23 | a);this.check()}));this.errback?q(a,"error",u(this,this.errback)):this.events.error&&q(a,"error",u(this,function(a){this.emit("error",a)}))}c=a.id;f=h[c];!t(L,c)&&(f&&!f.enabled)&&i.enable(a,this)}));B(this.pluginMaps,u(this,function(a){var b=m(h,a.id);b&&!b.enabled&&i.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){v(this.events[a],function(a){a(b)});"error"===a&&delete this.events[a]}};i={config:j,contextName:b, 24 | registry:h,defined:r,urlFetched:S,defQueue:A,Module:Z,makeModuleMap:p,nextTick:g.nextTick,onError:w,configure:function(a){a.baseUrl&&"/"!==a.baseUrl.charAt(a.baseUrl.length-1)&&(a.baseUrl+="/");var b=j.shim,c={paths:!0,bundles:!0,config:!0,map:!0};B(a,function(a,b){c[b]?(j[b]||(j[b]={}),U(j[b],a,!0,!0)):j[b]=a});a.bundles&&B(a.bundles,function(a,b){v(a,function(a){a!==b&&(aa[a]=b)})});a.shim&&(B(a.shim,function(a,c){H(a)&&(a={deps:a});if((a.exports||a.init)&&!a.exportsFn)a.exportsFn=i.makeShimExports(a); 25 | b[c]=a}),j.shim=b);a.packages&&v(a.packages,function(a){var b,a="string"===typeof a?{name:a}:a;b=a.name;a.location&&(j.paths[b]=a.location);j.pkgs[b]=a.name+"/"+(a.main||"main").replace(ia,"").replace(Q,"")});B(h,function(a,b){!a.inited&&!a.map.unnormalized&&(a.map=p(b))});if(a.deps||a.callback)i.require(a.deps||[],a.callback)},makeShimExports:function(a){return function(){var b;a.init&&(b=a.init.apply(ba,arguments));return b||a.exports&&da(a.exports)}},makeRequire:function(a,e){function j(c,d,m){var n, 26 | q;e.enableBuildCallback&&(d&&G(d))&&(d.__requireJsBuild=!0);if("string"===typeof c){if(G(d))return w(C("requireargs","Invalid require call"),m);if(a&&t(L,c))return L[c](h[a.id]);if(g.get)return g.get(i,c,a,j);n=p(c,a,!1,!0);n=n.id;return!t(r,n)?w(C("notloaded",'Module name "'+n+'" has not been loaded yet for context: '+b+(a?"":". Use require([])"))):r[n]}J();i.nextTick(function(){J();q=s(p(null,a));q.skipMap=e.skipMap;q.init(c,d,m,{enabled:!0});D()});return j}e=e||{};U(j,{isBrowser:z,toUrl:function(b){var d, 27 | e=b.lastIndexOf("."),k=b.split("/")[0];if(-1!==e&&(!("."===k||".."===k)||1e.attachEvent.toString().indexOf("[native code"))&& 34 | !Y?(M=!0,e.attachEvent("onreadystatechange",b.onScriptLoad)):(e.addEventListener("load",b.onScriptLoad,!1),e.addEventListener("error",b.onScriptError,!1)),e.src=d,J=e,D?y.insertBefore(e,D):y.appendChild(e),J=null,e;if(ea)try{importScripts(d),b.completeLoad(c)}catch(m){b.onError(C("importscripts","importScripts failed for "+c+" at "+d,m,[c]))}};z&&!q.skipDataMain&&T(document.getElementsByTagName("script"),function(b){y||(y=b.parentNode);if(I=b.getAttribute("data-main"))return s=I,q.baseUrl||(E=s.split("/"), 35 | s=E.pop(),O=E.length?E.join("/")+"/":"./",q.baseUrl=O),s=s.replace(Q,""),g.jsExtRegExp.test(s)&&(s=I),q.deps=q.deps?q.deps.concat(s):[s],!0});define=function(b,c,d){var e,g;"string"!==typeof b&&(d=c,c=b,b=null);H(c)||(d=c,c=null);!c&&G(d)&&(c=[],d.length&&(d.toString().replace(ka,"").replace(la,function(b,d){c.push(d)}),c=(1===d.length?["require"]:["require","exports","module"]).concat(c)));if(M){if(!(e=J))N&&"interactive"===N.readyState||T(document.getElementsByTagName("script"),function(b){if("interactive"=== 36 | b.readyState)return N=b}),e=N;e&&(b||(b=e.getAttribute("data-requiremodule")),g=F[e.getAttribute("data-requirecontext")])}(g?g.defQueue:R).push([b,c,d])};define.amd={jQuery:!0};g.exec=function(b){return eval(b)};g(q)}})(this); 37 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dash", 3 | "version": "1.0.0", 4 | "description": "A web browser casual game. The rule is simple: send the panel to the correct direction, if you can! In DASH you must press the arrow accordingly to what is being shown within the remaining time and the number of lives.", 5 | "main": "gulpfile.js", 6 | "dependencies": { 7 | "gulp": "^3.9.1", 8 | "gulp-load-plugins": "^1.5.0" 9 | }, 10 | "devDependencies": { 11 | "gulp": "^3.9.1", 12 | "gulp-concat": "^2.6.0", 13 | "gulp-less": "^3.1.0", 14 | "gulp-minify-css": "^1.2.4", 15 | "gulp-order": "^1.1.1", 16 | "gulp-rename": "^1.2.2", 17 | "gulp-uglify": "^1.5.3" 18 | }, 19 | "scripts": { 20 | "test": "echo \"Error: no test specified\" && exit 1", 21 | "build": "gulp" 22 | }, 23 | "repository": { 24 | "type": "git", 25 | "url": "https://github.com/kraiom/dash.git" 26 | }, 27 | "author": "Kraiom Studio (https://kraiom.com/)", 28 | "license": "MIT", 29 | "bugs": { 30 | "url": "https://github.com/kraiom/dash/issues" 31 | }, 32 | "homepage": "https://github.com/kraiom/dash" 33 | } 34 | -------------------------------------------------------------------------------- /policy.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | Dash - Privacy Policy 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |

29 | 30 |
31 |
32 |

DASH

33 |
34 | 35 |

Privacy Policy Last updated on 8th March, 2015

36 | 37 |

1. About Dash's privacy approach

38 | 39 |
The Dash's producer cares about your information and tries effortless to achieve the best global practices regarding privacy.
40 | 41 |
This privacy policy sets out how your information is held. By using our game you consent to the practices set out in this policy.
42 | 43 |
Note that not all of the items in this policy are applicable for different versions of the game. Most of them are only applicable for the Facebook app of the game.
44 | 45 |

2. Note for parents and children

46 | 47 |
If you are a child, remember to play safe online. Never give someone any information, photo, name, home address, telephone, etc. without first asking your parent/guardian if that is all right.
48 | 49 |
For the parents, know that we are committed to the safety and privacy of the children who use our game. We encourage you to monitor your children's activities.
50 | 51 |

3. What information do we gather?

52 | These are the informations we get when you login into our game: 53 | 54 |
    55 |
  • Your full name
  • 56 |
  • Your profile picture
  • 57 |
  • Your e-mail
  • 58 |
  • Your friends list
  • 59 |
60 | 61 |

4. About data sent to third-parties

62 | 63 |
None of the information gathered is ever given in any way to third-party companies. Nor we store it outside Facebook for any purposes.
64 | 65 |

5. About automatic data collection

66 | 67 |
Our game implements Google Analytics. Therefore, you usage information such as time spent playing, locale, browser and operating system is collected for statics and improvements only. We also collect your final scores and time you played each try, for improvements purposes only.
68 | 69 |

6. How do we use your information?

70 | 71 |
Your profile data is exclusively used for personalization purposes. You must login so that we can keep track of your score and build a leaderboard. The automatic data gathered is used only for improvement purposes.
72 | 73 |

7. Facebook integration

74 | 75 | 76 |
The Facebook login is used to save your high score and reading your friend's highscore only. Note that Facebook itself is going to publish some activities on your timeline when you, for instance, beat your own high score. This can be avoided by not allowing the app to post on your timeline. However, if you do so, you are not going to be able to be seen in your friend's scores on leaderboard section. If you accidentally chose not to publish, or want to change its permission, simply go to your apps settings tab, search for Dash, and change "App visibility" to "Friends".
77 |

8. Marketing

78 | 79 |
We reserver the right to use your information to send you news about our game and/or show advertisements in game screen. If we ever send you an e-mail, you will be able to unsubscribe and do not receive them anymore.
80 | 81 |

9. Security storage

82 | 83 |
Your data is only accessed by our game through requests; We do not hold databases. Therefore all your data is stored in Facebook and Google servers and the communications are made through secure channel.
84 | 85 |

10. Contact

86 | 87 |
Should you have any concerns, suggestions or complaints, contact the Dash's producer.
88 | 89 | 90 |
91 | 92 | 93 | 94 | 107 | 108 | 109 | --------------------------------------------------------------------------------