mouseover on clicks will show client data
mouseover on clicks will show client data

--- a/src/js/a.js
+++ b/src/js/a.js
@@ -54,6 +54,17 @@
 
     var clicks = [];
     var moves = [];
+    var cursorX, cursorY;
+    document.onmousemove = function(e){
+        cursorX = - viewportwidth/2 + e.pageX;
+        cursorY = e.pageY;
+    }
+
+    document.onclick = function(e){
+        var _cursorX = - viewportwidth/2 + e.pageX;
+        var _cursorY = e.pageY;
+        console.log (_cursorX + " " + _cursorY);
+    }
 
     var step = function () {
         render();
@@ -70,11 +81,16 @@
             }
             ctx.globalAlpha = 0.5;
             ctx.beginPath();
-            ctx.fillStyle = click.color;
+            if (cursorX >= click.x - 4 && cursorX <= click.x + 4 && cursorY >= click.y - 4 && cursorY <= click.y + 4) {
+                ctx.strokeStyle = '#EBC167';
+                ctx.fillStyle = '#EB1C8A';
+            } else {
+                ctx.strokeStyle = '#003300';
+                ctx.fillStyle = click.color;
+            }
             ctx.arc(x, click.y, 4, 0, 2 * Math.PI, true);
             ctx.fill();
             ctx.lineWidth = 0.5;
-            ctx.strokeStyle = '#003300';
             ctx.stroke();
         }
         for(key in moves) {
@@ -83,6 +99,7 @@
                 moves.splice(key, 1);
             }
             ctx.beginPath();
+            ctx.strokeStyle = '#000000';
             x0 = viewportwidth/2 + move[0].x;
             x1 = viewportwidth/2 + move[1].x;
             ctx.moveTo(x0, move[0].y);
@@ -96,7 +113,7 @@
     var aSocket = io();
     aSocket.emit('t:connect', {w:window.width, h:window.height, admin:1234});
     aSocket.on('t:click', function(click){
-        click.time = Date.now() + 1500000;
+        click.time = Date.now() + 150000;
         clicks.push(click);
     });
     var xx = 1;

--- a/src/js/c.js
+++ b/src/js/c.js
@@ -51,7 +51,7 @@
     document.onclick = function(e){
         if (connected && clickAction.enabled) {
             var x = - viewportwidth/2 + e.pageX;
-            cSocket.emit('t:click', {x:x, y:e.pageY});
+            cSocket.emit('t:click', {x:x, y:e.pageY, url:window.location.href});
         }
     }
     var cSocket = io(host);
@@ -82,7 +82,7 @@
     setInterval(function(){
         if (connected && mouseAction.enabled) {
             var x = - viewportwidth/2 + cursorX;
-            cSocket.emit('t:mousemove', {x:x, y:cursorY});
+            cSocket.emit('t:mousemove', {x:x, y:cursorY, url:window.location.href});
         }
     }, mouseAction.interval);
 }

comments