Friday 2 June 2017

Beautiful animation of circle with html tags and inline css

In this animation i all the circle are increasing and becomes largest size at the center of SVG (scalable vector graphics) . The blue circle becomes red and red becomes blue and some other effect you can observe when you look at the animation, like change in position and much more. All this effect are created by html and inline css.



what should you have?
● Basic knowledge of html and css.
● Any text editor better if you use any code editor.

Method to create this animation.
step first: For creating a circle on any html page we have to define an svg (scalable vector graphics) first and define its height and width. For this animation i have set the value of height equal 600 and width equal to 600.
second step: Create circle by using circle tag and define there position on x-axis and y-axis by cx and cy respectively. The circle will appear on top other circle or any other elements which are coded first. For example

In this code the red circle code is written before the blue circle but when you run this code on browser the blue circle cover the red circle. So be careful while you write your code.
Step third: Create an animate tag between the opening and closing tag of circle and define the following property in opening tag of animate.
# attributeName - This is used to choose which attributes of circle you want to change . There are four attributes of circle which can be changed , which are "cx" , "cy" , "r" and "fill" (fill used for color ).
# from - define the initial value of cx , cy , r and fill .
# to - define final value of value of cx , cy , r and fill .
# dur - define time interval of animation in which it get completed.
#repeatCount - define Number of times the animation occurred.
Use this property for animate tag as used in below code.

This code will define only the circle which is at top-left of animation. Similarly define all other circle by changing there attributes value and save the file in html format.
This is the original html code of above animation



Download this animation html file
Check my blog for more animation and subscribe to get in touch.

No comments:

Post a Comment