In: Computer Science
Using the examples found in the readings for this week, create a simple, yet unique graphic using SVG.
The graphic should incorporate shape transformation methods and animation.
Share both the code and screen capture of the graphic.
`Hey,
Note: Brother if you have any queries related the answer please do comment. I would be very happy to resolve all your queries.
The required code for the svg is as follows....Hope you like the graphics it's not unique but worth of appreciation.
ShapeTransformation.html
<html>
<head>
<title>Shape Transformation</title>
</head>
<body>
<svg width="640" height="480"
xmlns="http://www.w3.org/2000/svg">
<g>
<title>Layer 1</title>
<rect fill="#fff" id="cb" height="402" width="582" y="-1"
x="-1"/>
<g display="none" overflow="visible" y="0" x="0" height="100%"
width="100%" id="cg">
<rect fill="url(#gridptttn)" stroke-width="0" y="0" x="0"
height="100%" width="100%"/>
</g>
</g>
<g>
<title>Layer 2</title>
<ellipse id="shapet1" stroke="#000" ry="119.5" rx="123.5"
id="sha1" cy="193.5" cx="298" fill-opacity="null"
stroke-opacity="null" stroke-width="3" fill="#fff"/>
<ellipse id="shapet1" stroke="#000" ry="87" rx="93.00001"
id="sha2" cy="197" cx="300.5" fill-opacity="null"
stroke-opacity="null" stroke-width="3" fill="none"/>
<ellipse id="shapet2" stroke="#000" ry="63" rx="64.5" id="sha3"
cy="197" cx="302" fill-opacity="null" stroke-opacity="null"
stroke-width="3" fill="none"/>
<ellipse id="shapet2" stroke="#000" ry="38" rx="37" id="sha4"
cy="198" cx="302.5" fill-opacity="null" stroke-opacity="null"
stroke-width="3" fill="none"/>
</g>
</svg>
<style>
#shapet1 {
animation-name: shapet1;
animation-duration: 3s;
animation-timing-function: ease-in-out;
animation-iteration-count: infinite;
}
#shapet2 {
animation-name: shapet2;
animation-duration: 3s;
animation-timing-function: ease-in-out;
animation-iteration-count: infinite;
}
@keyframes shapet1 {
from {
cy: 0%;
fill: none;
stroke: grey;
}
to {
cy: 50%;
fill: #9284D9;
stroke: white;
}
}
@keyframes shapet2 {
from {
cx: 100%;
fill: none;
stroke: grey;
}
to {
cx: 52%;
fill: #9284D9;
stroke: white;
}
}
</style>
</body>
</html>
Output:
Kindly revert for any queries
Thanks.