Solution Review: Falling Circle
We'll cover the following...
We'll cover the following...
Solution
Explanation
See the following explanation to better understand the above code.
- From line 2 to line 7, we have created an SVG canvas of size (500x500) with a red border.
- In line 9 to line 13, we have created a circle of radius (r=50), and the center of the circle at (250,50) relative to the origin.
- In line 16, we have moved the circle to the bottom of the canvas using
translate. Thetransitionfunction with a duration of3000msis used in line 14 and line 15 to make the translation of the circle smooth. - After moving the circle to the bottom of the SVG canvas, we have to change the
colorof the circle using theattrfunction. Thetransitionfunction with the duration of3000msis used to make the change of the color smooth.