2017-12-07 14:00:06 +01:00
|
|
|
$(document).ready(function() {
|
|
|
|
console.log("ready");
|
|
|
|
$(document).on('keydown', function(e){
|
|
|
|
if(e.which == 37){
|
|
|
|
$("#char-container").css({
|
|
|
|
'left': '-=2rem',
|
|
|
|
})
|
2017-12-12 15:28:23 +01:00
|
|
|
$("#char-pants-left").css({
|
|
|
|
'animation-name': 'animation-move-left',
|
|
|
|
'animation-duration': '0.2s',
|
|
|
|
'animation-name': '',
|
|
|
|
'animation-duration': '',
|
2017-12-12 15:13:52 +01:00
|
|
|
})
|
2017-12-12 15:28:23 +01:00
|
|
|
}
|
2017-12-07 14:00:06 +01:00
|
|
|
if(e.which == 38){
|
|
|
|
$("#char-container").css({
|
|
|
|
'top': '-=2rem',
|
|
|
|
})
|
|
|
|
}
|
|
|
|
if(e.which == 39){
|
|
|
|
$("#char-container").css({
|
|
|
|
'left': '+=2rem',
|
|
|
|
})
|
2017-12-12 15:13:52 +01:00
|
|
|
$("#char-pants-right").css({
|
|
|
|
})
|
2017-12-07 14:00:06 +01:00
|
|
|
}
|
|
|
|
if(e.which == 40){
|
|
|
|
$("#char-container").css({
|
|
|
|
'top': '+=2rem',
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
|
|
|
});
|