summaryrefslogtreecommitdiff
path: root/public/assets/test
diff options
context:
space:
mode:
authorJulie Lala <jules@okfoc.us>2014-10-14 12:27:48 -0400
committerJulie Lala <jules@okfoc.us>2014-10-14 12:27:48 -0400
commit39bd4b9dca66403783e5b0fab48e3cdbf4882269 (patch)
tree53aebeb0f45fa252164bdca347c130c8e66aa202 /public/assets/test
parent3cb1983858c1314661592fa78c814eed44acb1b7 (diff)
wheel tests; scroll up-down to move forward/back
Diffstat (limited to 'public/assets/test')
-rw-r--r--public/assets/test/wheel.html29
1 files changed, 29 insertions, 0 deletions
diff --git a/public/assets/test/wheel.html b/public/assets/test/wheel.html
new file mode 100644
index 0000000..054945e
--- /dev/null
+++ b/public/assets/test/wheel.html
@@ -0,0 +1,29 @@
+<style>
+#cursor {
+ position:absolute;margin-top:-5px;margin-left:-5px;
+ width:10px;height:10px;border-radius:50%;
+ background:red;
+}
+</style>
+<div id="cursor"></div>
+<script src="/assets/javascripts/util.js"></script>
+<script src="/assets/javascripts/rectangles/util/wheel.js"></script>
+
+<script>
+x = window.innerWidth/2
+y = window.innerHeight/2
+function draw(){
+ cursor.style.top = y + 'px'
+ cursor.style.left = x + 'px'
+}
+new wheel({
+ el: document,
+ propagate: false,
+ update: function(e,dy,dx){
+ y = mod(y + dy, window.innerHeight)
+ x = mod(x + dx, window.innerWidth)
+ draw()
+ },
+})
+draw()
+</script> \ No newline at end of file