How can I prevent hard coding the CSS animation below? - html
I'm using #keyframes to animate this svg :
.candles {
width: -webkit-fill-available;
transition: all 0.5s;
}
.candles line, path{
stroke: #5ABCF3;
animation-name: candle;
animation-duration: 4s;
animation-iteration-count: infinite;
animation-play-state: running;
animation-direction: alternate;
}
#keyframes candle {
from { stroke: #5ABCF3 }
to { stroke: blue; transform: translateY(-128px);}
}
<svg class="candles" width="1782" height="472" viewBox="0 0 1782 472" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="frame">
<line id="line-1" x1="6.5" y1="219.652" x2="6.5" y2="270.117" stroke="#5ABCF3" stroke-width="13"/>
<line id="line-2" x1="35.2988" y1="259.74" x2="35.2988" y2="274.583" stroke="#5ABCF3" stroke-width="13"/>
<line id="line-3" x1="62.5488" y1="258.266" x2="62.5488" y2="290.919" stroke="#5ABCF3" stroke-width="13"/>
<path id="line-4" d="M96.2578 273.045V323.509" stroke="#5ABCF3" stroke-width="13"/>
<path id="line-5" d="M123.475 305.76V322.086" stroke="#5ABCF3" stroke-width="13"/>
<path id="line-6" d="M153.799 255.301V328.029" stroke="#5ABCF3" stroke-width="13"/>
</g>
</svg>
in this have few elements and it's okay to hard code it, but when candles ( elements ) are more ... hard coding is not efficient
I want to be able to declare specific translateY() for each <line> or <path> element.
How can i do that?
In this example I use a combination of the pseudo selectors :nth-child(). Other selectors Pseudo-classes could also be used. I'm not saying that my example is perfect, but if you combine more of them with different CSS property values I think you can get something that looks more of less random.
Aside: You can see that I also experimented with attr(). At the moment this function can only be used in combination with the content property, but as you can read from the link more options will be available in the future. Like setting a type s for seconds.
.candles line,
.candles path {
stroke: #5ABCF3;
transition: all 0.5s;
animation-name: candle;
animation-duration: 4s;
animation-iteration-count: infinite;
animation-play-state: running;
animation-direction: alternate;
animation-delay: attr(data-delay s);
}
.candles *:first-child {
animation-delay: 1ms;
}
.candles *:first-child {
animation-delay: 1s;
animation-duration: 4.5s;
}
.candles *:nth-child(odd):nth-child(n+3) {
animation-delay: 2s;
animation-duration: 5.5s;
}
.candles *:nth-child(odd):nth-child(n+5) {
animation-delay: 2s;
}
.candles *:nth-child(even):nth-child(n+5) {
animation-delay: 3s;
animation-duration: 1.5s;
}
#keyframes candle {
from {
stroke: #5ABCF3
}
to {
stroke: blue;
transform: translateY(-128px);
}
}
<svg class="candles" width="1782" height="472" viewBox="0 0 1782 472" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="frame">
<line data-delay="10" x1="6.5" y1="219.652" x2="6.5" y2="270.117" stroke="#5ABCF3" stroke-width="13"/>
<line data-delay="0" x1="35.2988" y1="259.74" x2="35.2988" y2="274.583" stroke="#5ABCF3" stroke-width="13"/>
<line data-delay="2" x1="62.5488" y1="258.266" x2="62.5488" y2="290.919" stroke="#5ABCF3" stroke-width="13"/>
<path data-delay="5" d="M96.2578 273.045V323.509" stroke="#5ABCF3" stroke-width="13"/>
<path data-delay="3" d="M123.475 305.76V322.086" stroke="#5ABCF3" stroke-width="13"/>
<path data-delay="1" d="M153.799 255.301V328.029" stroke="#5ABCF3" stroke-width="13"/>
</g>
</svg>
Related
How to animate fill in a linear-gradient for svg?
How can I animate the fill for gradient colors in SVG? I want the fill to operate from opacity 0 to opacity of 1. .header-anim { min-height: 100vh; display: flex; align-items: center; justify-content: center; } #logo-anim path:nth-child(1) { stroke-dasharray: 1032; stroke-dashoffset: 1032; animation: line-anim 2s ease forwards, fill-black 0.5s ease forwards 2s; } #logo-anim path:nth-child(2) { stroke-dasharray: 1056; stroke-dashoffset: 1056; animation: line-anim 2s ease forwards, fill-gradient 0.5s ease forwards 2s; } #keyframes line-anim { to { stroke-dashoffset: 0; } } #keyframes fill-black { from { fill: transparent; } to { fill: black; } } #keyframes fill-gradient { from { fill: transparent; } to { fill: url(#paint0_linear_0_1); } } <div class="header-anim"> <svg id="logo-anim" width="234" height="233" viewBox="0 0 234 233" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M75.4995 83.1013L104.5 52.7419V149.908C103.841 155.213 101.512 163.152 96.6892 169.739C91.8749 176.315 84.6232 181.5 73.9995 181.5H22.7751C7.00798 158.997 -14.2991 102.251 23.2132 49.8815C28.6996 42.432 39.475 31.0305 53.8821 21.2016C68.2922 11.3708 86.2418 3.17637 106.088 1.99737C153.179 -0.800073 186.647 23.6983 201.465 38.5H185.579C179.439 32.991 168.434 25.3772 154.676 19.7975C140.599 14.0886 123.543 10.47 105.813 13.5101C86.2158 15.0713 42.0989 30.215 20.6414 78.3625C13.4533 92.9381 5.42859 131.796 29.7138 172.272L30.9052 174.257L32.2302 172.358L46.7825 151.5H61.9399C64.1719 151.674 67.4856 151.286 70.3053 149.49C73.2521 147.614 75.4995 144.295 75.4995 139V83.1013Z" stroke="black" stroke-width="3" /> <path d="M73.0043 222.051C57.832 216.175 42.4098 206.947 31.499 193H47.399C57.5515 202.587 82.9475 219.5 114 219.5C134.223 219.5 176.537 213.946 203.746 173.335L203.755 173.322L203.763 173.309C216.107 154.033 233.106 104.05 202.245 58.1629L201.228 56.6509L199.939 57.9393L177.879 80H162.148C159.838 79.5594 156.458 79.7889 153.599 81.9385C150.614 84.1823 148.5 88.2825 148.5 95V149.392L119.5 179.298V83.5C119.5 77.8938 121.122 69.4609 125.935 62.4762C130.694 55.5707 138.617 50 151.5 50H210.265C225.204 69.4906 246.888 120.188 217.2 171.752C187.163 223.922 135.874 232.968 114.135 231.006L114.094 231.002L114.052 231.001C104.628 230.673 89.0193 228.254 73.0043 222.051Z" stroke="url(#paint0_linear_0_1)" stroke-width="3" /> <defs> <linearGradient id="paint0_linear_0_1" x1="131.003" y1="48.5" x2="131.003" y2="232.748" gradientUnits="userSpaceOnUse"> <stop stop-color="#A77027" /> <stop offset="0.53125" stop-color="#F1E189" /> <stop offset="1" stop-color="#A77027" /> </linearGradient> </defs> </svg> </div> codepen link for reproduced error. Currently the gradient fill just snap into existence instead of slowly fading in like black fill. How can I achieve this animation? Thank you
You can't animate in "paint" fills, such as gradients, like you can with colours. What you can do instead is animate the fill-opacity. And in fact it actually simplifies the SVG. Because use can use the same fill animation for both paths. .header-anim { min-height: 100vh; display: flex; align-items: center; justify-content: center; } #logo-anim path:nth-child(1) { stroke-dasharray: 1032; stroke-dashoffset: 1032; fill: black; fill-opacity: 0; animation: line-anim 2s ease forwards, fill-anim 0.5s ease forwards 2s; } #logo-anim path:nth-child(2) { stroke-dasharray: 1056; stroke-dashoffset: 1056; fill: url(#paint0_linear_0_1); fill-opacity: 0; animation: line-anim 2s ease forwards, fill-anim 0.5s ease forwards 2s; } #keyframes line-anim { to { stroke-dashoffset: 0; } } #keyframes fill-anim { from { fill-opacity: 0; } to { fill-opacity: 1; } } <div class="header-anim"> <svg id="logo-anim" width="234" height="233" viewBox="0 0 234 233" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M75.4995 83.1013L104.5 52.7419V149.908C103.841 155.213 101.512 163.152 96.6892 169.739C91.8749 176.315 84.6232 181.5 73.9995 181.5H22.7751C7.00798 158.997 -14.2991 102.251 23.2132 49.8815C28.6996 42.432 39.475 31.0305 53.8821 21.2016C68.2922 11.3708 86.2418 3.17637 106.088 1.99737C153.179 -0.800073 186.647 23.6983 201.465 38.5H185.579C179.439 32.991 168.434 25.3772 154.676 19.7975C140.599 14.0886 123.543 10.47 105.813 13.5101C86.2158 15.0713 42.0989 30.215 20.6414 78.3625C13.4533 92.9381 5.42859 131.796 29.7138 172.272L30.9052 174.257L32.2302 172.358L46.7825 151.5H61.9399C64.1719 151.674 67.4856 151.286 70.3053 149.49C73.2521 147.614 75.4995 144.295 75.4995 139V83.1013Z" stroke="black" stroke-width="3" /> <path id="path-with-grad" d="M73.0043 222.051C57.832 216.175 42.4098 206.947 31.499 193H47.399C57.5515 202.587 82.9475 219.5 114 219.5C134.223 219.5 176.537 213.946 203.746 173.335L203.755 173.322L203.763 173.309C216.107 154.033 233.106 104.05 202.245 58.1629L201.228 56.6509L199.939 57.9393L177.879 80H162.148C159.838 79.5594 156.458 79.7889 153.599 81.9385C150.614 84.1823 148.5 88.2825 148.5 95V149.392L119.5 179.298V83.5C119.5 77.8938 121.122 69.4609 125.935 62.4762C130.694 55.5707 138.617 50 151.5 50H210.265C225.204 69.4906 246.888 120.188 217.2 171.752C187.163 223.922 135.874 232.968 114.135 231.006L114.094 231.002L114.052 231.001C104.628 230.673 89.0193 228.254 73.0043 222.051Z" stroke="url(#paint0_linear_0_1)" stroke-width="3" /> <defs> <linearGradient id="paint0_linear_0_1" x1="131.003" y1="48.5" x2="131.003" y2="232.748" gradientUnits="userSpaceOnUse"> <stop stop-color="#A77027" /> <stop offset="0.53125" stop-color="#F1E189" /> <stop offset="1" stop-color="#A77027" /> </linearGradient> </defs> </svg> </div>
SVG fill animation returns to initial state [duplicate]
This question already has answers here: Maintaining the final state at end of a CSS animation (5 answers) Closed 2 years ago. I'm using keyframes to change SVG path fill from visible to none-visible. It working, but when animation ends the path return to his initial color (black), and I want it to remain white. #secondletter { animation-name: col; animation-duration: 2s; animation-timing-function: ease-in; } #thirdletter { animation-name: col; animation-duration: 2s; animation-timing-function: ease-in-out; } #fourthletter { animation-name: col; animation-duration: 2s; animation-timing-function: ease-in-out; } #keyframes col { 0% {fill:black} 100% {fill:#fff} } <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 1366 768" style="enable-background:new 0 0 1366 768;" xml:space="preserve"> <g> <path d="M297,293l18.2,68.6c4.2,14.8,7.3,29.4,10.1,43.4h0.8c2.8-14,7.3-28.6,12-43.1l22.4-68.9H381l21,67.8 c4.8,15.7,9,30.2,12,44.2h0.8c2.2-14,5.9-28.3,10.4-44.2l19.3-67.8h24.4l-44,135.2h-22.4l-20.4-64.7c-4.8-15.1-8.7-28.6-12-44.5 h-0.6c-3.4,16.2-7.6,30.5-12.3,44.8l-21.8,64.4H313L272.1,293H297z"/> <path id="secondletter" d="M507.3,365c0.6,33.3,21.6,47,46.5,47c17.6,0,28.6-3.1,37.5-7l4.2,17.6c-8.4,3.9-23.5,8.7-45.1,8.7 c-41.7,0-66.6-27.7-66.6-68.3c0-41.2,24.1-73.1,63.8-73.1c44,0,55.7,38.6,55.7,63.6c0,5-0.6,9-1.1,11.5H507.3z M579.5,347.3 c0.3-15.4-6.4-39.8-34.2-39.8c-24.9,0-35.8,22.7-37.8,39.8H579.5z"/> <path d="M643.4,293l18.2,68.6c4.2,14.8,7.3,29.4,10.1,43.4h0.8c2.8-14,7.3-28.6,12-43.1l22.4-68.9h20.4l21,67.8 c4.8,15.7,9,30.2,12,44.2h0.8c2.2-14,5.9-28.3,10.4-44.2l19.3-67.8h24.4l-44,135.2h-22.4l-20.4-64.7c-4.8-15.1-8.7-28.6-12-44.5 h-0.6c-3.4,16.2-7.6,30.5-12.3,44.8l-21.8,64.4h-22.4L618.5,293H643.4z"/> <path id="thirdletter" d="M853.7,365c0.6,33.3,21.6,47,46.5,47c17.6,0,28.6-3.1,37.5-7l4.2,17.6c-8.4,3.9-23.5,8.7-45.1,8.7 c-41.7,0-66.6-27.7-66.6-68.3c0-41.2,24.1-73.1,63.8-73.1c44,0,55.7,38.6,55.7,63.6c0,5-0.6,9-1.1,11.5H853.7z M925.9,347.3 c0.3-15.4-6.4-39.8-34.2-39.8c-24.9,0-35.8,22.7-37.8,39.8H925.9z"/> <path id="fourthletter" d="M980.2,229.5h24.4v85.1h0.6c8.7-15.1,24.4-24.6,46.2-24.6c33.6,0,57.4,28,57.4,68.9c0,48.4-31.1,72.5-61,72.5 c-19.6,0-35.3-7.6-45.6-25.2h-0.6l-1.1,22.1h-21.3c0.6-9.2,1.1-23,1.1-34.7V229.5z M1004.6,373.9c0,3.1,0.3,6.2,1.1,9 c4.8,17.4,19.3,28.8,37,28.8c26,0,41.2-21,41.2-52.1c0-27.2-14-50.4-40.6-50.4c-16.5,0-32.2,11.5-37.2,30.2 c-0.6,3.1-1.4,6.2-1.4,10.1V373.9z"/> </g> </svg> How can I keep the animation color even when it ends?
I think you just want animation-fill-mode: forwards; According to MDN forwards indicates that The target will retain the computed values set by the last keyframe encountered during execution. Like so... #secondletter { animation-name: col; animation-duration: 2s; animation-timing-function: ease-in; animation-fill-mode: forwards; } #thirdletter { animation-name: col; animation-duration: 2s; animation-timing-function: ease-in-out; animation-fill-mode: forwards; } #fourthletter { animation-name: col; animation-duration: 2s; animation-timing-function: ease-in-out; animation-fill-mode: forwards; } #keyframes col { 0% {fill:black} 100% {fill:#fff} } <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 1366 768" style="enable-background:new 0 0 1366 768;" xml:space="preserve"> <g> <path d="M297,293l18.2,68.6c4.2,14.8,7.3,29.4,10.1,43.4h0.8c2.8-14,7.3-28.6,12-43.1l22.4-68.9H381l21,67.8 c4.8,15.7,9,30.2,12,44.2h0.8c2.2-14,5.9-28.3,10.4-44.2l19.3-67.8h24.4l-44,135.2h-22.4l-20.4-64.7c-4.8-15.1-8.7-28.6-12-44.5 h-0.6c-3.4,16.2-7.6,30.5-12.3,44.8l-21.8,64.4H313L272.1,293H297z"/> <path id="secondletter" d="M507.3,365c0.6,33.3,21.6,47,46.5,47c17.6,0,28.6-3.1,37.5-7l4.2,17.6c-8.4,3.9-23.5,8.7-45.1,8.7 c-41.7,0-66.6-27.7-66.6-68.3c0-41.2,24.1-73.1,63.8-73.1c44,0,55.7,38.6,55.7,63.6c0,5-0.6,9-1.1,11.5H507.3z M579.5,347.3 c0.3-15.4-6.4-39.8-34.2-39.8c-24.9,0-35.8,22.7-37.8,39.8H579.5z"/> <path d="M643.4,293l18.2,68.6c4.2,14.8,7.3,29.4,10.1,43.4h0.8c2.8-14,7.3-28.6,12-43.1l22.4-68.9h20.4l21,67.8 c4.8,15.7,9,30.2,12,44.2h0.8c2.2-14,5.9-28.3,10.4-44.2l19.3-67.8h24.4l-44,135.2h-22.4l-20.4-64.7c-4.8-15.1-8.7-28.6-12-44.5 h-0.6c-3.4,16.2-7.6,30.5-12.3,44.8l-21.8,64.4h-22.4L618.5,293H643.4z"/> <path id="thirdletter" d="M853.7,365c0.6,33.3,21.6,47,46.5,47c17.6,0,28.6-3.1,37.5-7l4.2,17.6c-8.4,3.9-23.5,8.7-45.1,8.7 c-41.7,0-66.6-27.7-66.6-68.3c0-41.2,24.1-73.1,63.8-73.1c44,0,55.7,38.6,55.7,63.6c0,5-0.6,9-1.1,11.5H853.7z M925.9,347.3 c0.3-15.4-6.4-39.8-34.2-39.8c-24.9,0-35.8,22.7-37.8,39.8H925.9z"/> <path id="fourthletter" d="M980.2,229.5h24.4v85.1h0.6c8.7-15.1,24.4-24.6,46.2-24.6c33.6,0,57.4,28,57.4,68.9c0,48.4-31.1,72.5-61,72.5 c-19.6,0-35.3-7.6-45.6-25.2h-0.6l-1.1,22.1h-21.3c0.6-9.2,1.1-23,1.1-34.7V229.5z M1004.6,373.9c0,3.1,0.3,6.2,1.1,9 c4.8,17.4,19.3,28.8,37,28.8c26,0,41.2-21,41.2-52.1c0-27.2-14-50.4-40.6-50.4c-16.5,0-32.2,11.5-37.2,30.2 c-0.6,3.1-1.4,6.2-1.4,10.1V373.9z"/> </g> </svg>
A JQuery function for SVG, to execute 2nd animation as soon as, 1st animation completes?
I applied the animation-delay technique, but to achieve a the handwriting effect animation, I had to cut the object wherever it intersects, and drew a path and converted it to a clipping mask, e.g. letter "W" divided into 4 parts and drew different paths for different part for the said above, and animating it, to give a clean handwriting effect, giving path a stroke width, It took me a lot more time as the font was too complicated. Currently I am achieving the said animation using animation-delay, CSS function. CSS Code #W2-Path { animation-delay: .5s } #W3-Path { animation-delay: 1s } #W4-Path { animation-delay: 1.5s } #O-Path { animation-delay: 2s } #R1-Path-2 { animation-delay: 3.5s } #R2-Path-2 { animation-delay: 4s } #R3-Path-2 { animation-delay: 4.5s } #L1-Path-2 { animation-delay: 5s } #L2-Path-2 { animation-delay: 5.5s } #L3-Path-2 { animation-delay: 6s } #D1-Path { animation-delay: 6.5s } #D2-Path { animation-delay: 7s } I was thinking if there is any other way through which I can start the 2nd animation as the 1st animation completes, and it just keeps going on giving the animation more smoother effect and perfect timing, implementing JQuery? CodePen: https://codepen.io/ToxifiedM/pen/MWKeERr Original Question: How Can I Make SVG Text Animation Seamless And Accurate? Linked Question 1: To Control SVG CSS Based Animation Using Jquery? Linked Question 2: To Control The Speed Of Multiple SVG Elements Using Jquery?
I'm answering only for the latter W I've changed the svg code you have, because it can be done in a more simple way. You are wrapping every line in 2 groups. I'm using just the lines. Also you are using style="clip-path: url(#clip-path)" I've transformed this to a presentational attribute like so: clip-path="url(#clip-path)" because in javascript I want to set the animation-delay as inline style for the lines. An other change: I'm using stroke-dasharray: 8 and stroke-dashoffset: 8 since 8 is the length of the lines for the letter W. I know the length of the lines because I've used the getTotalLength() method. The stroke and the stroke-width are set only once for the group since the lines for the letter have the same style. The javascript is selecting all the lines in a group and then is looping through the lines and setting the animation-delay:${i*1}s where i is the nth line. Please observe that the order of the lines in the group is from the first to the 4-th and not vice versa as you have them in your code. let Wls = document.querySelector("#W").querySelectorAll("line");//all the lines in the W group Wls.forEach((l,i)=>{ // for each line in the W group // set the style attribute l.setAttribute("style", `animation-delay:${i*1}s`) }) body { background: white; } svg { width: 90vh; border:solid; } #W line{ stroke-dasharray: 8; stroke-dashoffset: 8; animation: letter-animation 1s linear forwards; } #keyframes letter-animation { 0% { stroke-dashoffset: 8; } 100% { stroke-dashoffset: 0; } } <svg id="WOYP" viewBox="0 0 9 9"> <defs> <clipPath id="clip-path-44" transform="translate(-5.561 -10.291)"> <path id="W4" d="M11.676,16.41l.234.578c.236-.631.477-1.261.715-1.891q.222-.6.449-1.188t.409-1.063q.181-.476.308-.8c.084-.214.136-.348.156-.4s.05-.12.066-.16a.594.594,0,0,1,.061-.111.754.754,0,0,1,.086-.1.768.768,0,0,1,.151-.11h-1.03c.121.053.192.117.212.19a.481.481,0,0,1-.04.291c0,.007-.025.079-.076.216s-.118.319-.2.546-.18.483-.287.767-.216.573-.323.867Z" /> </clipPath> <clipPath id="clip-path-45" transform="translate(-5.561 -10.291)"> <path id="W3" d="M11.675,16.358Zm0,0h0l.011.029h0l.232.575c-.152.4-.311.82-.474,1.252L10.176,15.07q-.242-.6-.478-1.183t-.433-1.058q-.2-.474-.333-.793c-.09-.213-.146-.343-.166-.389a1.8,1.8,0,0,0-.176-.27.774.774,0,0,0-.348-.209h1.833a.3.3,0,0,0-.221.239.9.9,0,0,0,.03.35c0,.006.027.076.08.209s.123.308.207.524.179.464.287.744.218.562.332.848Q11.179,15.089,11.675,16.358Z" /> </clipPath> <clipPath id="clip-path-46" transform="translate(-5.561 -10.291)"> <path id="W2" d="M9.139,16.411l.234.578c.236-.632.477-1.261.715-1.891q.222-.6.45-1.189t.408-1.062c.122-.318.224-.584.308-.8s.137-.347.157-.4l.065-.16a.556.556,0,0,1,.061-.11.7.7,0,0,1,.086-.1.8.8,0,0,1,.151-.11h-1.03c.121.054.192.117.213.191a.488.488,0,0,1-.041.29c0,.007-.025.079-.076.216s-.117.319-.2.546-.179.483-.287.768-.216.573-.323.867Z" /> </clipPath> <clipPath id="clip-path-47" transform="translate(-5.561 -10.291)"> <path id="W1" d="M9.138,16.358Zm0,0h0l.012.029h0l.233.575q-.229.6-.475,1.252L7.639,15.07q-.242-.6-.478-1.183t-.433-1.058q-.2-.474-.332-.793l-.166-.389a1.8,1.8,0,0,0-.177-.27.764.764,0,0,0-.347-.209H7.539a.305.305,0,0,0-.222.239.938.938,0,0,0,.03.35c0,.006.027.076.081.209s.122.308.206.524.18.464.287.744.218.562.332.848Q8.642,15.089,9.138,16.358Z" /> </clipPath> </defs> <g id="W" stroke="#003668" stroke-width="2"> <line x1="0.93" y1="0.482" x2="3.873" y2="7.937" clip-path="url(#clip-path-47)" /> <line x1="3.088" y1="7.937" x2="5.966" y2="0.482" clip-path="url(#clip-path-46)" /> <line x1="3.481" y1="0.482" x2="6.424" y2="7.937" clip-path="url(#clip-path-45)" /> <line x1="5.639" y1="7.937" x2="8.517" y2="0.482" clip-path="url(#clip-path-44)" /> </g> </svg> UPDATE The OP is commenting: So when I was actually trying to implement it, I got on the letter "O", its a path not a line, I tried your method, its not appearing for path, what can be done for that any clue? In this case you'll have to animate the path. This time you don't need a different css animation and since the final value for the stroke-dashoffset is 0 you don't need a different animation. However you'll need to calculate the path's total length to use it for the path's stroke-dasharray and stroke-dashoffse. In this case is 20.4. let Wls = document.querySelector("#W").querySelectorAll("line") Wls.forEach((l,i)=>{ l.setAttribute("style", `animation-delay:${i*1}s`) }) body { background: white; } svg { width: 90vh; border:solid; overflow:visible; } #W line{ stroke-dasharray: 8; stroke-dashoffset: 8; animation: letter-animation 1s linear forwards; } #O path{ stroke-dasharray: 20.4; stroke-dashoffset: 20.4; animation: letter-animation 1s linear forwards; animation-delay:4.5s } #keyframes letter-animation { 100% { stroke-dashoffset: 0; } } #keyframes letter-animation { 100% { stroke-dashoffset: 0; } } <svg id="WOYP" viewBox="0 0 29 9"> <defs> <clipPath id="clip-path-44" transform="translate(-5.561 -10.291)"> <path id="W4" d="M11.676,16.41l.234.578c.236-.631.477-1.261.715-1.891q.222-.6.449-1.188t.409-1.063q.181-.476.308-.8c.084-.214.136-.348.156-.4s.05-.12.066-.16a.594.594,0,0,1,.061-.111.754.754,0,0,1,.086-.1.768.768,0,0,1,.151-.11h-1.03c.121.053.192.117.212.19a.481.481,0,0,1-.04.291c0,.007-.025.079-.076.216s-.118.319-.2.546-.18.483-.287.767-.216.573-.323.867Z" /> </clipPath> <clipPath id="clip-path-45" transform="translate(-5.561 -10.291)"> <path id="W3" d="M11.675,16.358Zm0,0h0l.011.029h0l.232.575c-.152.4-.311.82-.474,1.252L10.176,15.07q-.242-.6-.478-1.183t-.433-1.058q-.2-.474-.333-.793c-.09-.213-.146-.343-.166-.389a1.8,1.8,0,0,0-.176-.27.774.774,0,0,0-.348-.209h1.833a.3.3,0,0,0-.221.239.9.9,0,0,0,.03.35c0,.006.027.076.08.209s.123.308.207.524.179.464.287.744.218.562.332.848Q11.179,15.089,11.675,16.358Z" /> </clipPath> <clipPath id="clip-path-46" transform="translate(-5.561 -10.291)"> <path id="W2" d="M9.139,16.411l.234.578c.236-.632.477-1.261.715-1.891q.222-.6.45-1.189t.408-1.062c.122-.318.224-.584.308-.8s.137-.347.157-.4l.065-.16a.556.556,0,0,1,.061-.11.7.7,0,0,1,.086-.1.8.8,0,0,1,.151-.11h-1.03c.121.054.192.117.213.191a.488.488,0,0,1-.041.29c0,.007-.025.079-.076.216s-.117.319-.2.546-.179.483-.287.768-.216.573-.323.867Z" /> </clipPath> <clipPath id="clip-path-47" transform="translate(-5.561 -10.291)"> <path id="W1" d="M9.138,16.358Zm0,0h0l.012.029h0l.233.575q-.229.6-.475,1.252L7.639,15.07q-.242-.6-.478-1.183t-.433-1.058q-.2-.474-.332-.793l-.166-.389a1.8,1.8,0,0,0-.177-.27.764.764,0,0,0-.347-.209H7.539a.305.305,0,0,0-.222.239.938.938,0,0,0,.03.35c0,.006.027.076.081.209s.122.308.206.524.18.464.287.744.218.562.332.848Q8.642,15.089,9.138,16.358Z" /> </clipPath> <clipPath id="clip-path-43"> <path id="clipO" d="M22.38,14.637v.026h0v.081l0,.023a3.231,3.231,0,0,1-.367,1.385,3.556,3.556,0,0,1-.9,1.089,3.814,3.814,0,0,1-1.2.655,3.724,3.724,0,0,1-1.289.2,3.869,3.869,0,0,1-1.4-.3,3.818,3.818,0,0,1-1.169-.756,3.474,3.474,0,0,1-.791-1.133A3.228,3.228,0,0,1,15,14.763v-.119h0v-.022h0V14.6h0v-.047h0v-.024h0V14.38a3.256,3.256,0,0,1,.273-1.138,3.554,3.554,0,0,1,.756-1.109,3.749,3.749,0,0,1,2.8-1.073,4.05,4.05,0,0,1,1.265.257A3.668,3.668,0,0,1,21.241,12a3.433,3.433,0,0,1,.836,1.113,3.107,3.107,0,0,1,.3,1.237l0,.021v.131h0v.025h0v.025h0v.052h0v.025ZM21.265,14.4a3.982,3.982,0,0,0-.18-1.025,2.913,2.913,0,0,0-.529-.99,2.287,2.287,0,0,0-.821-.628,2.492,2.492,0,0,0-1.043-.218,2.667,2.667,0,0,0-1.038.2,2.42,2.42,0,0,0-.826.569,2.593,2.593,0,0,0-.549.905,3.436,3.436,0,0,0-.2,1.085v.232h0v.024h0V14.6h0v.024h0v.023h0v.025l0,.023v.027a3.52,3.52,0,0,0,.228,1.105,2.93,2.93,0,0,0,.615.98,2.5,2.5,0,0,0,1.778.762,2.549,2.549,0,0,0,1.023-.2,2.313,2.313,0,0,0,.811-.584,2.739,2.739,0,0,0,.534-.915,3.439,3.439,0,0,0,.188-1.021v-.185h0v-.044h0V14.6h0v-.022h0v-.022h0v-.022h0v-.022h0V14.4Z" /> </clipPath> </defs> <g id="W" stroke="#003668" stroke-width="2"> <line x1="0.93" y1="0.482" x2="3.873" y2="7.937" clip-path="url(#clip-path-47)" /> <line x1="3.088" y1="7.937" x2="5.966" y2="0.482" clip-path="url(#clip-path-46)" /> <line x1="3.481" y1="0.482" x2="6.424" y2="7.937" clip-path="url(#clip-path-45)" /> <line x1="5.639" y1="7.937" x2="8.517" y2="0.482" clip-path="url(#clip-path-44)" /> </g> <g id="O" stroke="#003668" stroke-width="2" fill="none"> <path id="OPath" d="M18.657,11.3a3.1,3.1,0,0,0-2.289.981,3.448,3.448,0,0,0-.458,3.858,2.78,2.78,0,0,0,2.747,1.7,2.961,2.961,0,0,0,2.813-1.7,3.514,3.514,0,0,0-.458-3.858A3.055,3.055,0,0,0,18.657,11.3Z" transform="translate(-5.561 -10.291)" clip-path="url(#clip-path-43)" /> </g> </svg>
SVG straight line animation CSS
I am trying to achieve this (the picture below) in using SVG path for animation in a website. I saw this https://css-tricks.com/svg-line-animation-works/ and wanted to try it. But i am not sure how do i create the path out and the animation. Please do help me! Thanks
You can use svg code for animation. You can use CSS animation on svg paths. .st0{ fill:none; stroke:#000000; stroke-miterlimit:10; stroke-dasharray: 1000; stroke-dashoffset: 1000; -webkit-animation: draw1 4s linear forwards; animation: draw1 4s linear forwards; } .st1{ fill:none; stroke:#000000; stroke-miterlimit:10; stroke-dasharray: 200; stroke-dashoffset: 200; -webkit-animation: draw2 3s linear 2s forwards; animation: draw2 3s linear 2s forwards; } #-webkit-keyframes draw1{ to {stroke-dashoffset: 0;} } #keyframes draw1{ to {stroke-dashoffset: 0;} } #-webkit-keyframes draw2{ to {stroke-dashoffset: 0;} } #keyframes draw2{ to {stroke-dashoffset: 0;} } <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 614 53" style="enable-background:new 0 0 614 53;" xml:space="preserve"> <polyline class="st0" points="0.5,53 0.5,20.7 613.5,20.7 613.5,53 "/> <line class="st1" x1="307" y1="53" x2="307" y2="0"/> </svg>
SVG solution The animation uses the attribute <stroke-dashoffset> - the indent from the beginning of the line. At the maximum value of <stroke-dashoffset> the visible line is zero. With the value of <stroke-dashoffset ="0"> the line acquires the maximum size. It is necessary to accurately calculate the length of the line to avoid unpredictable effects in the animation. In this example, the length of <line> is 53px, for <polyline> is 680px. <style> .st0{fill:none;stroke:#000000;stroke-miterlimit:10; stroke-dasharray: 680; stroke-dashoffset: 680;} .st1{fill:none;stroke:#000000;stroke-miterlimit:10; stroke-dasharray: 53; stroke-dashoffset: 53;} </style> <svg version="1.1" viewBox="0 0 614 53" > <polyline class="st0" points="0.5,53 0.5,20.7 613.5,20.7 613.5,53 " > <animate attributeName="stroke-dashoffset" from="680" to="0" dur="2s" fill="freeze" /> </polyline> <line class="st1" x1="307" y1="53" x2="307" y2="0"> <animate attributeName="stroke-dashoffset" from="53" to="0" dur="2s" fill="freeze" /> </line> </svg>
I am working in svg file with animation is not working in forefox and i am using svg in image tag
Here is my code for svg and html there are some of div that are containing with st0 class. When i am trying to run in firefox its not fading in with these st0 class name but working fine in other browser. please help me <!doctype html> <html lang="en" class="no-js"> <head> <meta charset="UTF-8" /> <meta http-equiv="Content-Type" content="image/svg+xml" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>SVG</title> <meta name="robots" content="index, follow"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body style="text-align:center; background-color:black"> <img src="jeebs-media.svg".svg" style="margin-top:30px;"> </body> </html> <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200px" height="200px" viewBox="0 0 200 200" style="enable-background:new 0 0 200 200;" xml:space="preserve"> <style type="text/css"> .st0{fill:#ffffff !important; } .st1{fill:#C12461;} .st2{fill:#E92233;} .st3{fill:#F16726;} .st4{fill:#FFC216;} .st5{fill:#C9D92E;} .st6{fill:#26B8EB;} .st7{fill:#218ECD;} .st8{fill:#0D519E;} .st9{fill:#66328F;} .st10{fill:#962B79;} #-o-keyframes fadeIn { from { opacity:0.0; } to { opacity:1.0; } } #-webkit-keyframes fadeIn { from { opacity:0.0; } to { opacity:1.0; } } #-moz-keyframes fadeIn { from { opacity:0.0; } to { opacity:1.0; } } #-ms-keyframes fadeIn { from { opacity:0.0; } to { opacity:1.0; } } #keyframes fadeIn { from { opacity:0.0; } to { opacity:1.0; } } .fade-in { opacity:0; /* make things invisible upon start */ -webkit-animation: fadeIn 1.0s ease-in; -moz-animation: fadeIn 1.0s ease-in; -ms-animation: fadeIn 1.0s ease-in; -o-animation: fadeIn 1.0s ease-in; animation: fadeIn 1.0s ease-in; -webkit-animation-fill-mode: forwards; -moz-animation-fill-mode: forwards; -ms-animation-fill-mode: forwards; -o-animation-fill-mode: forwards; animation-fill-mode: forwards; -webkit-animation-duration: 2.0s; -moz-animation-duration: 2.0s; -ms-animation-duration: 2.0s; -o-animation-duration: 2.0s; animation-duration: 2.0s; -webkit-animation-delay: 2.0s; -moz-animation-delay: 2.0s; -ms-animation-delay: 2.0s; -o-animation-delay: 2.0s; animation-delay: 2.0s; } </style> <g class="text fade-in"> <g> <g> <path class="st0" d="M38.9,155.3c0,1.5-0.3,2.7-1,3.5c-0.6,0.8-1.6,1.2-2.9,1.2c-0.5,0-1-0.1-1.4-0.2c-0.4-0.2-0.8-0.4-1.2-0.7 c-0.4-0.3-0.7-0.7-0.9-1.2c-0.3-0.5-0.4-1.1-0.6-1.8l-2.2,0.4c0.4,1.9,1.1,3.3,2.1,4.1c1,0.9,2.4,1.3,4.1,1.3 c1,0,1.9-0.2,2.7-0.5c0.8-0.3,1.4-0.8,1.9-1.4c0.5-0.6,0.9-1.3,1.2-2.1c0.3-0.8,0.4-1.7,0.4-2.8v-15.7h-2.2V155.3z"/> <polygon class="st0" points="61.2,151.2 70.4,151.2 70.4,149.3 61.2,149.3 61.2,141.4 73.5,141.4 73.5,139.5 58.9,139.5 58.9,161.6 74.2,161.6 74.2,159.7 61.2,159.7 "/> <polygon class="st0" points="92.8,151.2 102.3,151.2 102.3,149.3 92.8,149.3 92.8,141.4 105.1,141.4 105.1,139.5 90.6,139.5 90.6,161.6 105.8,161.6 105.8,159.7 92.8,159.7 "/> <path class="st0" d="M137.3,151.8c-0.5-0.5-1-0.9-1.7-1.2c-0.7-0.3-1.5-0.5-2.4-0.6c0.7-0.2,1.3-0.4,1.8-0.7 c0.5-0.3,1-0.7,1.3-1.1c0.3-0.4,0.6-0.9,0.8-1.5c0.2-0.6,0.3-1.1,0.3-1.8c0-0.9-0.2-1.7-0.5-2.4c-0.3-0.7-0.9-1.2-1.5-1.7 c-0.7-0.4-1.5-0.7-2.4-0.9c-0.9-0.2-2-0.3-3.2-0.3h-7.7v22.1h8.6c1.1,0,2.1-0.1,3-0.3c1-0.2,1.8-0.6,2.5-1.1 c0.7-0.5,1.3-1.1,1.7-1.9c0.4-0.8,0.6-1.7,0.6-2.9c0-0.7-0.1-1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.2-0.5c0.1-0.1,0.1-0.3,0.1-0.4c0-0.1,0.1-0.2,0.1-0.2l2.4-5.7h1 v7.6H56.8z"/> <path class="st0" d="M76.3,181.6v-7.6h5v0.6h-4.3v2.7H81v0.6h-3.9v3h4.5v0.6H76.3z"/> <path class="st0" d="M106.4,177.7c0,0.6-0.1,1.2-0.3,1.7c-0.2,0.5-0.5,0.9-0.8,1.2c-0.3,0.3-0.7,0.6-1.2,0.7 c-0.4,0.2-0.9,0.2-1.5,0.2h-2.8v-7.6h2.4c0.6,0,1.1,0.1,1.6,0.2c0.5,0.1,0.9,0.4,1.3,0.7c0.4,0.3,0.6,0.7,0.8,1.2 C106.3,176.5,106.4,177,106.4,177.7z M105.6,177.7c0-0.5-0.1-1-0.2-1.4c-0.2-0.4-0.4-0.7-0.7-1c-0.3-0.2-0.6-0.4-1-0.5 c-0.4-0.1-0.8-0.2-1.3-0.2h-1.6v6.3h1.9c0.4,0,0.8-0.1,1.2-0.2c0.4-0.1,0.7-0.3,1-0.6c0.3-0.3,0.5-0.6,0.6-1 C105.5,178.7,105.6,178.2,105.6,177.7z"/> <path class="st0" d="M124.9,181.6v-7.6h0.8v7.6H124.9z"/> <path class="st0" d="M149.5,181.6l-0.9-2.4h-3.4l-0.9,2.4h-0.8l3-7.6h0.9l3,7.6H149.5z M147.4,175.9c-0.1-0.2-0.1-0.3-0.2-0.5 c-0.1-0.2-0.1-0.3-0.2-0.4c0-0.1-0.1-0.2-0.1-0.3c0-0.1,0-0.1-0.1-0.1c0,0,0,0.1,0,0.2c0,0.1-0.1,0.2-0.1,0.3 c0,0.1-0.1,0.3-0.1,0.4c-0.1,0.1-0.1,0.3-0.2,0.5l-1,2.7h3L147.4,175.9z"/> </g> </g> </g> <g class="icon"> <g> <g> <path class="st1" d="M102.3,18.5c-4.8-0.1-9.5,0.5-14,1.8c-4.5,1.3-8.8,3.3-12.7,6c-3.9,2.7-7.4,6.1-10.2,10.1 c-2.9,4.1-5,8.9-6.2,14.2c-0.4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-1.8-1.5-2.6-2.4c-2.4-2.6-4.3-5.4-5.8-8.2c-1.5-2.8-2.6-5.7-3.5-8.7c-0.8-3-1.3-6-1.5-9C56.2,54.6,56.2,51.6,56.4,48.5 "/> </g> <g> <path class="st10" d="M71.1,25c-3.8,3.4-7.1,7.6-9.6,12.2c-2.6,4.7-4.4,9.9-5.2,15.2c-0.8,5.4-0.5,11,1.3,16.4 c1.8,5.5,5,10.7,9.9,15.2c0.3,0.3,0.7,0.5,1,0.8c0.3,0.2,0.7,0.5,1,0.7c0.3,0.2,0.7,0.4,1.1,0.6c0.4,0.2,0.7,0.4,1.1,0.6 c2.1,1,4.3,1.7,6.5,2c2.2,0.3,4.4,0.2,6.6-0.2c2.1-0.4,4.2-1.2,6-2.4c1.8-1.2,3.5-2.7,4.9-4.6c-1.7,0.7-3.4,1.3-5.2,1.6 c-1.8,0.3-3.6,0.5-5.4,0.4c-1.8-0.1-3.7-0.3-5.4-0.8c-1.8-0.4-3.5-1.1-5.1-1.9c-1.2-0.6-2.3-1.3-3.4-2.1c-1.1-0.8-2.1-1.6-3-2.6 c-0.9-1-1.8-2-2.5-3.1c-0.7-1.1-1.4-2.3-1.9-3.6c-0.4-0.6-0.7-1.4-1.1-2.2c-0.4-0.8-0.7-1.7-1.1-2.6c-0.3-0.9-0.7-1.9-0.9-3 c-0.3-1.1-0.5-2.2-0.8-3.3c-0.1-3.2,0.1-6.3,0.5-9.5c0.4-3.1,1.1-6.1,2-9c0.9-2.8,2.1-5.6,3.6-8.1C67.2,29.4,69,27.1,71.1,25"/> </g> </g> <animateTransform attributeName="transform" attributeType="XML" type="rotate" from="0 100 62" to="360 100 62" dur="4s" repeatCount="0" fill="freeze" /> </g> </svg>
You got a second .svg" in your image tag. Remove it and it should work as expected. <img src="jeebs-media.svg" style="margin-top:30px; color:#white!important; fill:currentColor;"> Anyway you can only use your svg styles if you embed it in your svg image or use it directly as an <svg></svg> tag. Ref: https://developer.mozilla.org/de/docs/Web/SVG/Element/svg EDIT: If you use an SVG tag you can apply your styles like so: <svg xmlns="http://www.w3.org/2000/svg" width="150" height="100" viewBox="0 0 3 2"> .st0{fill:#ffffff;} .st1{fill:#C12461;} .st2{fill:#E92233;} .st3{fill:#F16726;} .st4{fill:#FFC216;} .st5{fill:#C9D92E;} .st6{fill:#26B8EB;} .st7{fill:#218ECD;} .st8{fill:#0D519E;} .st9{fill:#66328F;} .st10{fill:#962B79;} <rect class="st0" width="1" height="2" x="0"/> <rect class="st1" width="1" height="2" x="1"/> /.. </svg> Or you can use a css file like so: svg { color:white !important; } EDIT2 You got a missing .text {fill:white;} so u cant see the font animate. Add it to your code and its done. st0{fill:#ffffff !important; } .st1{fill:#C12461;} .st2{fill:#E92233;} .st3{fill:#F16726;} .st4{fill:#FFC216;} .st5{fill:#C9D92E;} .st6{fill:#26B8EB;} .st7{fill:#218ECD;} .st8{fill:#0D519E;} .st9{fill:#66328F;} .st10{fill:#962B79;} .text {fill:white;} #-o-keyframes fadeIn { from { opacity:0.0; } to { opacity:1.0; } } #-webkit-keyframes fadeIn { from { opacity:0.0; } to { opacity:1.0; } } #-moz-keyframes fadeIn { from { opacity:0.0; } to { opacity:1.0; } } #-ms-keyframes fadeIn { from { opacity:0.0; } to { opacity:1.0; } } #keyframes fadeIn { from { opacity:0.0; } to { opacity:1.0; } } .fade-in { opacity:0; /* make things invisible upon start */ -webkit-animation: fadeIn 1.0s ease-in; -moz-animation: fadeIn 1.0s ease-in; -ms-animation: fadeIn 1.0s ease-in; -o-animation: fadeIn 1.0s ease-in; animation: fadeIn 1.0s ease-in; -webkit-animation-fill-mode: forwards; -moz-animation-fill-mode: forwards; -ms-animation-fill-mode: forwards; -o-animation-fill-mode: forwards; animation-fill-mode: forwards; -webkit-animation-duration: 2.0s; -moz-animation-duration: 2.0s; -ms-animation-duration: 2.0s; -o-animation-duration: 2.0s; animation-duration: 2.0s; -webkit-animation-delay: 2.0s; -moz-animation-delay: 2.0s; -ms-animation-delay: 2.0s; -o-animation-delay: 2.0s; animation-delay: 2.0s; } <body style="text-align:center; background-color:black"> <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200px" height="200px" viewBox="0 0 200 200" style="enable-background:new 0 0 200 200;" xml:space="preserve"> <g class="text fade-in"> <g> <g> <path class="st0" d="M38.9,155.3c0,1.5-0.3,2.7-1,3.5c-0.6,0.8-1.6,1.2-2.9,1.2c-0.5,0-1-0.1-1.4-0.2c-0.4-0.2-0.8-0.4-1.2-0.7 c-0.4-0.3-0.7-0.7-0.9-1.2c-0.3-0.5-0.4-1.1-0.6-1.8l-2.2,0.4c0.4,1.9,1.1,3.3,2.1,4.1c1,0.9,2.4,1.3,4.1,1.3 c1,0,1.9-0.2,2.7-0.5c0.8-0.3,1.4-0.8,1.9-1.4c0.5-0.6,0.9-1.3,1.2-2.1c0.3-0.8,0.4-1.7,0.4-2.8v-15.7h-2.2V155.3z"/> <polygon class="st0" points="61.2,151.2 70.4,151.2 70.4,149.3 61.2,149.3 61.2,141.4 73.5,141.4 73.5,139.5 58.9,139.5 58.9,161.6 74.2,161.6 74.2,159.7 61.2,159.7 "/> <polygon class="st0" points="92.8,151.2 102.3,151.2 102.3,149.3 92.8,149.3 92.8,141.4 105.1,141.4 105.1,139.5 90.6,139.5 90.6,161.6 105.8,161.6 105.8,159.7 92.8,159.7 "/> <path class="st0" d="M137.3,151.8c-0.5-0.5-1-0.9-1.7-1.2c-0.7-0.3-1.5-0.5-2.4-0.6c0.7-0.2,1.3-0.4,1.8-0.7 c0.5-0.3,1-0.7,1.3-1.1c0.3-0.4,0.6-0.9,0.8-1.5c0.2-0.6,0.3-1.1,0.3-1.8c0-0.9-0.2-1.7-0.5-2.4c-0.3-0.7-0.9-1.2-1.5-1.7 c-0.7-0.4-1.5-0.7-2.4-0.9c-0.9-0.2-2-0.3-3.2-0.3h-7.7v22.1h8.6c1.1,0,2.1-0.1,3-0.3c1-0.2,1.8-0.6,2.5-1.1 c0.7-0.5,1.3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,0.1,0.3c0,0.1,0.1,0.3,0.2,0.5c0.1-0.2,0.2-0.4,0.2-0.5c0.1-0.1,0.1-0.3,0.1-0.4c0-0.1,0.1-0.2,0.1-0.2l2.4-5.7h1 v7.6H56.8z"/> <path class="st0" d="M76.3,181.6v-7.6h5v0.6h-4.3v2.7H81v0.6h-3.9v3h4.5v0.6H76.3z"/> <path class="st0" d="M106.4,177.7c0,0.6-0.1,1.2-0.3,1.7c-0.2,0.5-0.5,0.9-0.8,1.2c-0.3,0.3-0.7,0.6-1.2,0.7 c-0.4,0.2-0.9,0.2-1.5,0.2h-2.8v-7.6h2.4c0.6,0,1.1,0.1,1.6,0.2c0.5,0.1,0.9,0.4,1.3,0.7c0.4,0.3,0.6,0.7,0.8,1.2 C106.3,176.5,106.4,177,106.4,177.7z M105.6,177.7c0-0.5-0.1-1-0.2-1.4c-0.2-0.4-0.4-0.7-0.7-1c-0.3-0.2-0.6-0.4-1-0.5 c-0.4-0.1-0.8-0.2-1.3-0.2h-1.6v6.3h1.9c0.4,0,0.8-0.1,1.2-0.2c0.4-0.1,0.7-0.3,1-0.6c0.3-0.3,0.5-0.6,0.6-1 C105.5,178.7,105.6,178.2,105.6,177.7z"/> <path class="st0" d="M124.9,181.6v-7.6h0.8v7.6H124.9z"/> <path class="st0" d="M149.5,181.6l-0.9-2.4h-3.4l-0.9,2.4h-0.8l3-7.6h0.9l3,7.6H149.5z M147.4,175.9c-0.1-0.2-0.1-0.3-0.2-0.5 c-0.1-0.2-0.1-0.3-0.2-0.4c0-0.1-0.1-0.2-0.1-0.3c0-0.1,0-0.1-0.1-0.1c0,0,0,0.1,0,0.2c0,0.1-0.1,0.2-0.1,0.3 c0,0.1-0.1,0.3-0.1,0.4c-0.1,0.1-0.1,0.3-0.2,0.5l-1,2.7h3L147.4,175.9z"/> </g> </g> </g> <g class="icon"> <g> <g> <path class="st1" d="M102.3,18.5c-4.8-0.1-9.5,0.5-14,1.8c-4.5,1.3-8.8,3.3-12.7,6c-3.9,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5-1.6-1-2.4-1.6c-0.8-0.6-1.7-1.3-2.6-2 c-0.9-0.7-1.8-1.5-2.6-2.4c-2.4-2.6-4.3-5.4-5.8-8.2c-1.5-2.8-2.6-5.7-3.5-8.7c-0.8-3-1.3-6-1.5-9C56.2,54.6,56.2,51.6,56.4,48.5 "/> </g> <g> <path class="st10" d="M71.1,25c-3.8,3.4-7.1,7.6-9.6,12.2c-2.6,4.7-4.4,9.9-5.2,15.2c-0.8,5.4-0.5,11,1.3,16.4 c1.8,5.5,5,10.7,9.9,15.2c0.3,0.3,0.7,0.5,1,0.8c0.3,0.2,0.7,0.5,1,0.7c0.3,0.2,0.7,0.4,1.1,0.6c0.4,0.2,0.7,0.4,1.1,0.6 c2.1,1,4.3,1.7,6.5,2c2.2,0.3,4.4,0.2,6.6-0.2c2.1-0.4,4.2-1.2,6-2.4c1.8-1.2,3.5-2.7,4.9-4.6c-1.7,0.7-3.4,1.3-5.2,1.6 c-1.8,0.3-3.6,0.5-5.4,0.4c-1.8-0.1-3.7-0.3-5.4-0.8c-1.8-0.4-3.5-1.1-5.1-1.9c-1.2-0.6-2.3-1.3-3.4-2.1c-1.1-0.8-2.1-1.6-3-2.6 c-0.9-1-1.8-2-2.5-3.1c-0.7-1.1-1.4-2.3-1.9-3.6c-0.4-0.6-0.7-1.4-1.1-2.2c-0.4-0.8-0.7-1.7-1.1-2.6c-0.3-0.9-0.7-1.9-0.9-3 c-0.3-1.1-0.5-2.2-0.8-3.3c-0.1-3.2,0.1-6.3,0.5-9.5c0.4-3.1,1.1-6.1,2-9c0.9-2.8,2.1-5.6,3.6-8.1C67.2,29.4,69,27.1,71.1,25"/> </g> </g> <animateTransform attributeName="transform" attributeType="XML" type="rotate" from="0 100 62" to="360 100 62" dur="4s" repeatCount="0" fill="freeze" /> </g> </svg> </body>
So this is solved by using object tag and now its working fine.. I have changed only image tag to object tag.. <object type="image/svg+xml" data="jeebs-media.svg"></object>