summaryrefslogtreecommitdiff
path: root/public/assets/test/wheel.html
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2016-10-28 18:06:46 -0400
committerJules Laplace <jules@okfoc.us>2016-10-28 18:06:46 -0400
commit9e7bacd46c1e5d0e1c24433690d421ab3f3a11f2 (patch)
tree4d0cefa2780dfa4382f1ed2ea481b6aafbdbb15e /public/assets/test/wheel.html
parent50da9e3e677f121f15e501bf062da6c45db255ad (diff)
parentcce1dea756717f1308c6b72f762b5ea5f5b43958 (diff)
merge
Diffstat (limited to 'public/assets/test/wheel.html')
-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