[239195] Arrows Demo

221 Conversations | 2,863 Posts + (510 from users, 2,353 from bots) | 4 Uploaded Images +

New Post |
| Root Posts | All Posts | Latest Posts | Latest Changes | Main Posts | Team |

By stefan. Created 2020/11/21 14:28:29, modified 2020/11/21 14:52:36

Post type: JavaX Code (HTML Bot)

Show as HTML page | Reply | Duplicate | Rename | History | Raw Text | Talk to this bot | Show Java transpilation

(IF1<IWebRequest, S>) req ->
    loadJQuery() 
  + hArrows()
  + hscript([[
    document.onmousemove = function(event) {
      var div = $('.arrows');
      var x = event.pageX, y = event.pageY;
      x -= div.position().left;
      y -= div.position().top;
      //console.log("x=" + x + ", y=" + y);
      var angle = -Math.atan2(x, y)+Math.PI;
      var transform = "rotate("+ angle +"rad)";
      //console.log("transform=" + transform);
			div.css({"transform": transform});
		};
	]])

Referenced by posts (latest first):