Skip to content

Commit

Permalink
better JS controls, anchor styling
Browse files Browse the repository at this point in the history
  • Loading branch information
jdan committed Oct 7, 2012
1 parent 8fc2ebf commit 337dfa1
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions templates/layout.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@
font-size: 30px;
}
section.slide.author h3 a {
a {
text-decoration: none;
color: #44a4dd;
}
section.slide.author h3 a:hover {
a:hover {
color: #66b5ff;
}
Expand Down Expand Up @@ -115,10 +115,22 @@
$(document).on('keydown', function(e) {
var curr = $('section.active');
if (!curr.next().length) {
$('section:first').show().addClass('active');
var kc = e.keyCode;
// left, down, H, J, backspace
if (kc == 37 || kc == 40 || kc == 8 || kc == 72 || kc == 74) {
if (!curr.prev().length) {
$('section:last').show().addClass('active');
} else {
curr.prev().show().addClass('active');
}
} else {
curr.next().show().addClass('active');
// everything else
if (!curr.next().length) {
$('section:first').show().addClass('active');
} else {
curr.next().show().addClass('active');
}
}
curr.hide().removeClass('active');
Expand Down

0 comments on commit 337dfa1

Please sign in to comment.