diff --git a/sahli.coffee b/sahli.coffee index 9ba693a..d153554 100644 --- a/sahli.coffee +++ b/sahli.coffee @@ -133,6 +133,7 @@ class @Sahli $('body').stop() $('body').scrollTop(0) @scroll_direction = 1 + @scroll_speed = 5 i = @currentpic filedata = @filedata filedata[i].pic = $('
' + filedata[i].file + '
') @@ -194,6 +195,17 @@ class @Sahli console.log "#{@scroll_speed} | #{steps}" scrollbox.animate { scrollTop: scrollto }, @scroll_speed * steps, 'linear' + @changespeed = (speed) -> + @scroll_speed = speed + $('body').stop() + @scroll_direction = - @scroll_direction + @setscroll() + + @changescrolldirection = (direction) -> + @scroll_direction = direction + $('body').stop() + @setscroll() + @loadkeys = -> $(document).on('keydown', (ev) => switch ev.which @@ -205,8 +217,26 @@ class @Sahli @setscroll() when @keycode('t') $('body').scrollTop(0) - when 8 # backspace + when @keycode('a') $('body').stop() + @scroll_direction = - @scroll_direction + when @keycode('w') + @changescrolldirection -1 + when @keycode('x') + @changescrolldirection 1 + when @keycode('1') + @changespeed 1 + when @keycode('2') + @changespeed 2 + @scroll_speed = 2 + when @keycode('3') + @changespeed 3 + @scroll_speed = 3 + when @keycode('4') + @changespeed 4 + @scroll_speed = 4 + when @keycode('5') + @changespeed 5 else console.log ev.which - ) \ No newline at end of file + ) diff --git a/sahli.css b/sahli.css index cb54e3b..238b309 100644 --- a/sahli.css +++ b/sahli.css @@ -3,6 +3,7 @@ body { margin: 0px; padding: 0px; overflow: hidden; + border: none; } h1#top { @@ -15,7 +16,6 @@ h1#top { } div#sahliviewer { - border: 1px inset grey; color: green; padding: 0px; margin: 0px;