Skip to content

Commit

Permalink
Keyboard events
Browse files Browse the repository at this point in the history
  • Loading branch information
ghosh committed Nov 8, 2016
1 parent 8661601 commit 1d1031f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion build/assets/scripts/site.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build/gradients.json
Expand Up @@ -763,13 +763,13 @@
{
"name": "Mild",
"colors": ["#67B26F", "#4ca2cd"]
},
},
{
"name": "Emerald Water",
"colors": ["#348F50", "#56B4D3"]
},
{
"name": "Vice City",
"colors": [ "#3494E6", "#EC6EAD" ]
"colors": ["#3494E6", "#EC6EAD"]
}
]
4 changes: 2 additions & 2 deletions build/index.html
Expand Up @@ -18,7 +18,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">

<link rel="stylesheet" href="assets/styles/site.css?rel=1478620967835">
<link rel="stylesheet" href="assets/styles/site.css?rel=1478623124764">

<title>uiGradients - Beautiful colored gradients</title>
<meta name="description" content="A handpicked collection of beautiful color gradients for designers and developers">
Expand Down Expand Up @@ -274,7 +274,7 @@ <h6 class="popup__heading">

</footer>

<script type="text/javascript" src="assets/scripts/site.js?rel=1478620967833"></script>
<script type="text/javascript" src="assets/scripts/site.js?rel=1478623124762"></script>

</body>

Expand Down
13 changes: 6 additions & 7 deletions source/scripts/modules/Keys.js
Expand Up @@ -15,25 +15,24 @@ window.uiGradients = window.uiGradients || {};
switch(event.which) {

case 37: // left
if (pallete.hasClass('is-active')) {
return;
}
ga('send', 'event', 'keyboard navigation', 'left', 'next gradient');
if (pallete.hasClass('is-active')) return;
canvas.trigger('changeDown');
break;

case 39: // right
if (pallete.hasClass('is-active')) {
return;
}
ga('send', 'event', 'keyboard navigation', 'right', 'prev gradient');
if (pallete.hasClass('is-active')) return;
canvas.trigger('changeUp');
break;

case 16: // shift
ga('send', 'event', 'footer-buttons', 'keydown', 'show pallete');
ga('send', 'event', 'keyboard navigation', 'shift', 'show pallete');
pallete.trigger('toggle');
break;

case 27: // esc
ga('send', 'event', 'keyboard navigation', 'esc', 'hide pallete');
pallete.trigger('close');
break;

Expand Down

0 comments on commit 1d1031f

Please sign in to comment.