summaryrefslogtreecommitdiff
path: root/shader-picker.html
diff options
context:
space:
mode:
Diffstat (limited to 'shader-picker.html')
-rw-r--r--shader-picker.html20
1 files changed, 12 insertions, 8 deletions
diff --git a/shader-picker.html b/shader-picker.html
index cfd880d..02ad0f6 100644
--- a/shader-picker.html
+++ b/shader-picker.html
@@ -8,7 +8,7 @@ html,body { margin: 0; padding: 0; }
#width,#height,#framecount,#framedelay,#frameinterval,#background { width: 30px; }
#shader { width: 100%; height: 247px; font-family: fixed; }
#controls { width: 450px; }
-#frames { width: 435px; min-height: 100px; border: 1px solid #ddd; line-height: 0; }
+#frames { width: 435px; min-height: 100px; max-height: 150px; overflow: auto; border: 1px solid #ddd; line-height: 0; }
#frames div { margin: 1px; padding: 0; position: relative; border: 1px solid #eee; cursor: -webkit-grab; }
.dragging { cursor: -webkit-grabbing !important; }
.ui-sortable-helper { cursor: -webkit-grabbing !important; }
@@ -36,7 +36,6 @@ a { color: #00f; }
</style>
</head>
<body>
-
<div id="gallery">
<div id="gallery-form">
<form id="gallery-search">
@@ -176,15 +175,14 @@ function init(){
$("#instructions").disableSelection();
load()
- $(window).on("scroll", function(){ scrolling = true })
+ $(window).on("scroll DOMMouseScroll mousewheel", function(){ scrolling = true })
gallery.choose = choose
gallery.init()
- console.log("gallery init")
user.init()
if (user.username.length) {
- console.log("signed in as ", user.username)
+ console.log("signed in as", user.username)
}
$(user.shaders.buttons["colorcycle"]).trigger("click")
@@ -238,7 +236,7 @@ function step_forward(){
pause(true)
}
var timeout, raf_id, start_t = 0, old_t = 0, pause_t = 0
-var paused = false, dragging = false, rendering = false, scrolling = false;
+var paused = false, dragging = false, rendering = false, scrolling = false, deferring = false, scrollTimeout = null;
var fps = 30;
function animate(t){
raf_id = requestAnimationFrame(animate);
@@ -246,9 +244,15 @@ function animate(t){
var step_t = t - old_t
old_t = t
- if (paused || dragging || rendering || scrolling) {
+ if (paused || dragging || rendering || scrolling || deferring) {
pause_t += step_t
- scrolling = false
+ if (scrolling) {
+ scrolling = false
+ deferring = true
+ }
+ else {
+ deferring = false
+ }
return
}