From 121da420e853e082bd65fb57c61a3005ce034ffd Mon Sep 17 00:00:00 2001 From: George Michael Brower Date: Wed, 2 Feb 2011 19:45:12 -0500 Subject: [PATCH] Starting navigation --- controllers/scrubber.js | 5 +++++ controllers/slider.js | 1 + index.html | 18 ++++++++---------- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/controllers/scrubber.js b/controllers/scrubber.js index 9522aff..87fac67 100644 --- a/controllers/scrubber.js +++ b/controllers/scrubber.js @@ -158,6 +158,11 @@ GUI.Scrubber = function(controller, timer) { _this.timer.hoverPoint = cur; } } + if (_this.timer.hoverPoint == null) { + document.body.style.cursor = "pointer"; + } else { + document.body.style.cursor = "auto"; + } _this.render(); }); diff --git a/controllers/slider.js b/controllers/slider.js index c3a254e..88ef9c4 100644 --- a/controllers/slider.js +++ b/controllers/slider.js @@ -25,6 +25,7 @@ GUI.Slider = function(numberController, min, max, step, initValue) { var onDrag = function(e) { if (!clicked) return; var pos = GUI.getOffset(_this.domElement); + console.log(pos.left + " " + pos.top); var val = GUI.map(e.pageX, pos.left, pos.top + _this.domElement.offsetWidth, min, max); val = Math.round(val/step)*step; numberController.setValue(val); diff --git a/index.html b/index.html index a28e560..ea050e5 100644 --- a/index.html +++ b/index.html @@ -44,25 +44,23 @@ // Text field gui.add(fizzyText, "message") + .at(-1000, "gui-dat") .at(1000, "is") - .at(2000, "the") - .at(3000, "shit"); + .at(2000, "getting") + .at(3000, "pretty") + .at(4000, "tight"); // Sliders with min and max gui.add(fizzyText, "maxSize", 0.5, 7); gui.add(fizzyText, "growthSpeed", 0.01, 1); + gui.add(fizzyText, "speed", 0.1, 2); // Sliders with min, max and increment. - gui.add(fizzyText, "noiseStrength", 10, 100, 5). - at(1000, 30). - at(4500, 20). - at(7000, 100); - + gui.add(fizzyText, "noiseStrength", 10, 100, 5); + // Boolean checkbox - gui.add(fizzyText, "displayOutline") - .at(250, true) - .at(450, false); + gui.add(fizzyText, "displayOutline"); // Fires a function called "explode" gui.add(fizzyText, "explode")