How do I make this animation?
-
Good afternoon, you need to find a solution to one of the animation tasks https://obe.ru/anima/ (3, 4 or 5)
There is a hint:
Find cursor position inside svg
let svg = document.getElementById ("svg");
let mouse = {x: 0, y: 0};
document.addEventListener ("mousemove", function (ev) {
mouse.x = ev.pageX - svg.getBoundingClientRect (). left;
mouse.y = ev.pageY - svg.getBoundingClientRect (). top;
});JavaScript Victoria Bruce, Apr 4, 2019 -
It's easier to do this on canvas, in each frame you draw lines from the desired places to a white rectangleAnonymous
1 Answers
Your Answer
To place the code, please use CodePen or similar tool. Thanks you!