LinearGradiant SVG Animation looks incorrect in Firefox
up vote
1
down vote
favorite
I'm working with the following SVG animation that fills the house from bottom to top. It works just fine in Chrome, Safari and Internet Explorer, but doesn't work correctly in Firefox. If you pull up the snippet in Firefox you'll see that it doesn't play correctly.
.house-container
height: 200px;
width: 200px
<div class="house-container">
<svg viewBox="0 0 30 30" version="1.1" preserveAspectRatio="none">
<g
id="Dashboard"
stroke="none"
stroke-width="1"
fill="none"
fillRule="evenodd"
>
<linearGradient id="house-1" x2="1" y2="4">
<stop offset="0%" stop-color="#ddd" />
<stop offset="0%" stop-color="#ddd">
<animate
id="house-1"
attributeName="offset"
to="100%"
dur="0.5s"
begin="0s"
fill="freeze"
/>
</stop>
<stop offset="100%" stop-color="#10004c">
<animate
id="house-1"
attributeName="offset"
to="100%"
dur="0.5s"
begin="0s"
fill="freeze"
/>
</stop>
</linearGradient>
<g
transform="translate(-1161.000000, -558.000000)"
fill="url(#house-1)"
>
<g transform="translate(437.000000, 475.000000)">
<g id="houses" transform="translate(340.000000, 83.000000)">
<g id="house" transform="translate(384.000000, 0.000000)">
<polygon
id="Path"
points="21 6.66002593 21 3 25 3 25 11.1000432 30 16.6500648 25.3846154 16.6500648 25.3846154 30 4.61538462 30 4.62306431 16.6500648 0 16.6500648 15 0"
/>
</g>
</g>
</g>
</g>
</g>
</svg>
</div>Gif of what it looks like in Firefox:
https://imgur.com/a/SrOUHUN
I've read that Firefox has issues with SVG's, but all of my attempts to solve the animation issue have been in vein. Is there something obvious like a property I'm missing?
html svg
|
show 2 more comments
up vote
1
down vote
favorite
I'm working with the following SVG animation that fills the house from bottom to top. It works just fine in Chrome, Safari and Internet Explorer, but doesn't work correctly in Firefox. If you pull up the snippet in Firefox you'll see that it doesn't play correctly.
.house-container
height: 200px;
width: 200px
<div class="house-container">
<svg viewBox="0 0 30 30" version="1.1" preserveAspectRatio="none">
<g
id="Dashboard"
stroke="none"
stroke-width="1"
fill="none"
fillRule="evenodd"
>
<linearGradient id="house-1" x2="1" y2="4">
<stop offset="0%" stop-color="#ddd" />
<stop offset="0%" stop-color="#ddd">
<animate
id="house-1"
attributeName="offset"
to="100%"
dur="0.5s"
begin="0s"
fill="freeze"
/>
</stop>
<stop offset="100%" stop-color="#10004c">
<animate
id="house-1"
attributeName="offset"
to="100%"
dur="0.5s"
begin="0s"
fill="freeze"
/>
</stop>
</linearGradient>
<g
transform="translate(-1161.000000, -558.000000)"
fill="url(#house-1)"
>
<g transform="translate(437.000000, 475.000000)">
<g id="houses" transform="translate(340.000000, 83.000000)">
<g id="house" transform="translate(384.000000, 0.000000)">
<polygon
id="Path"
points="21 6.66002593 21 3 25 3 25 11.1000432 30 16.6500648 25.3846154 16.6500648 25.3846154 30 4.61538462 30 4.62306431 16.6500648 0 16.6500648 15 0"
/>
</g>
</g>
</g>
</g>
</g>
</svg>
</div>Gif of what it looks like in Firefox:
https://imgur.com/a/SrOUHUN
I've read that Firefox has issues with SVG's, but all of my attempts to solve the animation issue have been in vein. Is there something obvious like a property I'm missing?
html svg
1
a) you have multiple elements with the same id value (that's invalid) b) what are you trying to achieve with x2="1" y2="4". Those are very strange values, what do you want the animation to look like?
– Robert Longson
Nov 9 at 17:04
I want the animation to look exactly like it does in Firefox as it does in Chrome. It Firefox it behaves slightly strange.
– James Ives
Nov 9 at 18:01
It goes up non-horizontally (if you slow it down you'll see that). That odd angle is exactly what you want is it?
– Robert Longson
Nov 9 at 18:15
Ideally it would fill from bottom to top, but in Firefox it doesn't even do that. I'll update the post with a gif. The issue is more to do with how it doesn't look like it's even playing in Firefox at all, but it looks normal in all other browsers.
– James Ives
Nov 9 at 18:17
starting grey and finishing purple or the other way round?
– Robert Longson
Nov 9 at 18:21
|
show 2 more comments
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I'm working with the following SVG animation that fills the house from bottom to top. It works just fine in Chrome, Safari and Internet Explorer, but doesn't work correctly in Firefox. If you pull up the snippet in Firefox you'll see that it doesn't play correctly.
.house-container
height: 200px;
width: 200px
<div class="house-container">
<svg viewBox="0 0 30 30" version="1.1" preserveAspectRatio="none">
<g
id="Dashboard"
stroke="none"
stroke-width="1"
fill="none"
fillRule="evenodd"
>
<linearGradient id="house-1" x2="1" y2="4">
<stop offset="0%" stop-color="#ddd" />
<stop offset="0%" stop-color="#ddd">
<animate
id="house-1"
attributeName="offset"
to="100%"
dur="0.5s"
begin="0s"
fill="freeze"
/>
</stop>
<stop offset="100%" stop-color="#10004c">
<animate
id="house-1"
attributeName="offset"
to="100%"
dur="0.5s"
begin="0s"
fill="freeze"
/>
</stop>
</linearGradient>
<g
transform="translate(-1161.000000, -558.000000)"
fill="url(#house-1)"
>
<g transform="translate(437.000000, 475.000000)">
<g id="houses" transform="translate(340.000000, 83.000000)">
<g id="house" transform="translate(384.000000, 0.000000)">
<polygon
id="Path"
points="21 6.66002593 21 3 25 3 25 11.1000432 30 16.6500648 25.3846154 16.6500648 25.3846154 30 4.61538462 30 4.62306431 16.6500648 0 16.6500648 15 0"
/>
</g>
</g>
</g>
</g>
</g>
</svg>
</div>Gif of what it looks like in Firefox:
https://imgur.com/a/SrOUHUN
I've read that Firefox has issues with SVG's, but all of my attempts to solve the animation issue have been in vein. Is there something obvious like a property I'm missing?
html svg
I'm working with the following SVG animation that fills the house from bottom to top. It works just fine in Chrome, Safari and Internet Explorer, but doesn't work correctly in Firefox. If you pull up the snippet in Firefox you'll see that it doesn't play correctly.
.house-container
height: 200px;
width: 200px
<div class="house-container">
<svg viewBox="0 0 30 30" version="1.1" preserveAspectRatio="none">
<g
id="Dashboard"
stroke="none"
stroke-width="1"
fill="none"
fillRule="evenodd"
>
<linearGradient id="house-1" x2="1" y2="4">
<stop offset="0%" stop-color="#ddd" />
<stop offset="0%" stop-color="#ddd">
<animate
id="house-1"
attributeName="offset"
to="100%"
dur="0.5s"
begin="0s"
fill="freeze"
/>
</stop>
<stop offset="100%" stop-color="#10004c">
<animate
id="house-1"
attributeName="offset"
to="100%"
dur="0.5s"
begin="0s"
fill="freeze"
/>
</stop>
</linearGradient>
<g
transform="translate(-1161.000000, -558.000000)"
fill="url(#house-1)"
>
<g transform="translate(437.000000, 475.000000)">
<g id="houses" transform="translate(340.000000, 83.000000)">
<g id="house" transform="translate(384.000000, 0.000000)">
<polygon
id="Path"
points="21 6.66002593 21 3 25 3 25 11.1000432 30 16.6500648 25.3846154 16.6500648 25.3846154 30 4.61538462 30 4.62306431 16.6500648 0 16.6500648 15 0"
/>
</g>
</g>
</g>
</g>
</g>
</svg>
</div>Gif of what it looks like in Firefox:
https://imgur.com/a/SrOUHUN
I've read that Firefox has issues with SVG's, but all of my attempts to solve the animation issue have been in vein. Is there something obvious like a property I'm missing?
.house-container
height: 200px;
width: 200px
<div class="house-container">
<svg viewBox="0 0 30 30" version="1.1" preserveAspectRatio="none">
<g
id="Dashboard"
stroke="none"
stroke-width="1"
fill="none"
fillRule="evenodd"
>
<linearGradient id="house-1" x2="1" y2="4">
<stop offset="0%" stop-color="#ddd" />
<stop offset="0%" stop-color="#ddd">
<animate
id="house-1"
attributeName="offset"
to="100%"
dur="0.5s"
begin="0s"
fill="freeze"
/>
</stop>
<stop offset="100%" stop-color="#10004c">
<animate
id="house-1"
attributeName="offset"
to="100%"
dur="0.5s"
begin="0s"
fill="freeze"
/>
</stop>
</linearGradient>
<g
transform="translate(-1161.000000, -558.000000)"
fill="url(#house-1)"
>
<g transform="translate(437.000000, 475.000000)">
<g id="houses" transform="translate(340.000000, 83.000000)">
<g id="house" transform="translate(384.000000, 0.000000)">
<polygon
id="Path"
points="21 6.66002593 21 3 25 3 25 11.1000432 30 16.6500648 25.3846154 16.6500648 25.3846154 30 4.61538462 30 4.62306431 16.6500648 0 16.6500648 15 0"
/>
</g>
</g>
</g>
</g>
</g>
</svg>
</div>.house-container
height: 200px;
width: 200px
<div class="house-container">
<svg viewBox="0 0 30 30" version="1.1" preserveAspectRatio="none">
<g
id="Dashboard"
stroke="none"
stroke-width="1"
fill="none"
fillRule="evenodd"
>
<linearGradient id="house-1" x2="1" y2="4">
<stop offset="0%" stop-color="#ddd" />
<stop offset="0%" stop-color="#ddd">
<animate
id="house-1"
attributeName="offset"
to="100%"
dur="0.5s"
begin="0s"
fill="freeze"
/>
</stop>
<stop offset="100%" stop-color="#10004c">
<animate
id="house-1"
attributeName="offset"
to="100%"
dur="0.5s"
begin="0s"
fill="freeze"
/>
</stop>
</linearGradient>
<g
transform="translate(-1161.000000, -558.000000)"
fill="url(#house-1)"
>
<g transform="translate(437.000000, 475.000000)">
<g id="houses" transform="translate(340.000000, 83.000000)">
<g id="house" transform="translate(384.000000, 0.000000)">
<polygon
id="Path"
points="21 6.66002593 21 3 25 3 25 11.1000432 30 16.6500648 25.3846154 16.6500648 25.3846154 30 4.61538462 30 4.62306431 16.6500648 0 16.6500648 15 0"
/>
</g>
</g>
</g>
</g>
</g>
</svg>
</div>html svg
html svg
edited Nov 9 at 18:18
asked Nov 9 at 16:18
James Ives
1,0831130
1,0831130
1
a) you have multiple elements with the same id value (that's invalid) b) what are you trying to achieve with x2="1" y2="4". Those are very strange values, what do you want the animation to look like?
– Robert Longson
Nov 9 at 17:04
I want the animation to look exactly like it does in Firefox as it does in Chrome. It Firefox it behaves slightly strange.
– James Ives
Nov 9 at 18:01
It goes up non-horizontally (if you slow it down you'll see that). That odd angle is exactly what you want is it?
– Robert Longson
Nov 9 at 18:15
Ideally it would fill from bottom to top, but in Firefox it doesn't even do that. I'll update the post with a gif. The issue is more to do with how it doesn't look like it's even playing in Firefox at all, but it looks normal in all other browsers.
– James Ives
Nov 9 at 18:17
starting grey and finishing purple or the other way round?
– Robert Longson
Nov 9 at 18:21
|
show 2 more comments
1
a) you have multiple elements with the same id value (that's invalid) b) what are you trying to achieve with x2="1" y2="4". Those are very strange values, what do you want the animation to look like?
– Robert Longson
Nov 9 at 17:04
I want the animation to look exactly like it does in Firefox as it does in Chrome. It Firefox it behaves slightly strange.
– James Ives
Nov 9 at 18:01
It goes up non-horizontally (if you slow it down you'll see that). That odd angle is exactly what you want is it?
– Robert Longson
Nov 9 at 18:15
Ideally it would fill from bottom to top, but in Firefox it doesn't even do that. I'll update the post with a gif. The issue is more to do with how it doesn't look like it's even playing in Firefox at all, but it looks normal in all other browsers.
– James Ives
Nov 9 at 18:17
starting grey and finishing purple or the other way round?
– Robert Longson
Nov 9 at 18:21
1
1
a) you have multiple elements with the same id value (that's invalid) b) what are you trying to achieve with x2="1" y2="4". Those are very strange values, what do you want the animation to look like?
– Robert Longson
Nov 9 at 17:04
a) you have multiple elements with the same id value (that's invalid) b) what are you trying to achieve with x2="1" y2="4". Those are very strange values, what do you want the animation to look like?
– Robert Longson
Nov 9 at 17:04
I want the animation to look exactly like it does in Firefox as it does in Chrome. It Firefox it behaves slightly strange.
– James Ives
Nov 9 at 18:01
I want the animation to look exactly like it does in Firefox as it does in Chrome. It Firefox it behaves slightly strange.
– James Ives
Nov 9 at 18:01
It goes up non-horizontally (if you slow it down you'll see that). That odd angle is exactly what you want is it?
– Robert Longson
Nov 9 at 18:15
It goes up non-horizontally (if you slow it down you'll see that). That odd angle is exactly what you want is it?
– Robert Longson
Nov 9 at 18:15
Ideally it would fill from bottom to top, but in Firefox it doesn't even do that. I'll update the post with a gif. The issue is more to do with how it doesn't look like it's even playing in Firefox at all, but it looks normal in all other browsers.
– James Ives
Nov 9 at 18:17
Ideally it would fill from bottom to top, but in Firefox it doesn't even do that. I'll update the post with a gif. The issue is more to do with how it doesn't look like it's even playing in Firefox at all, but it looks normal in all other browsers.
– James Ives
Nov 9 at 18:17
starting grey and finishing purple or the other way round?
– Robert Longson
Nov 9 at 18:21
starting grey and finishing purple or the other way round?
– Robert Longson
Nov 9 at 18:21
|
show 2 more comments
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
Something like this?
I've removed the duplicated ids, corrected the x1, y1, x2 and y2 values and swappd the colours round (I could have swapped the animation so it went to 0% instead I suppose).
.house-container
height: 200px;
width: 200px
<div class="house-container">
<svg viewBox="0 0 30 30" version="1.1" preserveAspectRatio="none">
<g
id="Dashboard"
stroke="none"
stroke-width="1"
fill="none"
fillRule="evenodd"
>
<linearGradient id="house-1" x2="0" y1="0" y2="1">
<stop offset="0%" stop-color="#ddd" />
<stop offset="100%" stop-color="#ddd">
<animate
attributeName="offset"
to="0%"
dur="0.5s"
begin="0s"
fill="freeze"
/>
</stop>
<stop offset="100%" stop-color="#10004c">
<animate
attributeName="offset"
to="0%"
dur="0.5s"
begin="0s"
fill="freeze"
/>
</stop>
</linearGradient>
<g
transform="translate(-1161.000000, -558.000000)"
fill="url(#house-1)"
>
<g transform="translate(437.000000, 475.000000)">
<g id="houses" transform="translate(340.000000, 83.000000)">
<g id="house" transform="translate(384.000000, 0.000000)">
<polygon
id="Path"
points="21 6.66002593 21 3 25 3 25 11.1000432 30 16.6500648 25.3846154 16.6500648 25.3846154 30 4.61538462 30 4.62306431 16.6500648 0 16.6500648 15 0"
/>
</g>
</g>
</g>
</g>
</g>
</svg>
</div>
This works in Firefox now, but no longer works in Chrome :(
– James Ives
Nov 9 at 18:27
1
@JamesIves how about now, I tried this alternative on Safari so presumably Chrome is likely to work too. Chrome/Safari's failure on my previous version is a bug in their implementation.
– Robert Longson
Nov 9 at 18:32
Yep! Totally works now. Thanks for your assistance.
– James Ives
Nov 9 at 18:33
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Something like this?
I've removed the duplicated ids, corrected the x1, y1, x2 and y2 values and swappd the colours round (I could have swapped the animation so it went to 0% instead I suppose).
.house-container
height: 200px;
width: 200px
<div class="house-container">
<svg viewBox="0 0 30 30" version="1.1" preserveAspectRatio="none">
<g
id="Dashboard"
stroke="none"
stroke-width="1"
fill="none"
fillRule="evenodd"
>
<linearGradient id="house-1" x2="0" y1="0" y2="1">
<stop offset="0%" stop-color="#ddd" />
<stop offset="100%" stop-color="#ddd">
<animate
attributeName="offset"
to="0%"
dur="0.5s"
begin="0s"
fill="freeze"
/>
</stop>
<stop offset="100%" stop-color="#10004c">
<animate
attributeName="offset"
to="0%"
dur="0.5s"
begin="0s"
fill="freeze"
/>
</stop>
</linearGradient>
<g
transform="translate(-1161.000000, -558.000000)"
fill="url(#house-1)"
>
<g transform="translate(437.000000, 475.000000)">
<g id="houses" transform="translate(340.000000, 83.000000)">
<g id="house" transform="translate(384.000000, 0.000000)">
<polygon
id="Path"
points="21 6.66002593 21 3 25 3 25 11.1000432 30 16.6500648 25.3846154 16.6500648 25.3846154 30 4.61538462 30 4.62306431 16.6500648 0 16.6500648 15 0"
/>
</g>
</g>
</g>
</g>
</g>
</svg>
</div>
This works in Firefox now, but no longer works in Chrome :(
– James Ives
Nov 9 at 18:27
1
@JamesIves how about now, I tried this alternative on Safari so presumably Chrome is likely to work too. Chrome/Safari's failure on my previous version is a bug in their implementation.
– Robert Longson
Nov 9 at 18:32
Yep! Totally works now. Thanks for your assistance.
– James Ives
Nov 9 at 18:33
add a comment |
up vote
1
down vote
accepted
Something like this?
I've removed the duplicated ids, corrected the x1, y1, x2 and y2 values and swappd the colours round (I could have swapped the animation so it went to 0% instead I suppose).
.house-container
height: 200px;
width: 200px
<div class="house-container">
<svg viewBox="0 0 30 30" version="1.1" preserveAspectRatio="none">
<g
id="Dashboard"
stroke="none"
stroke-width="1"
fill="none"
fillRule="evenodd"
>
<linearGradient id="house-1" x2="0" y1="0" y2="1">
<stop offset="0%" stop-color="#ddd" />
<stop offset="100%" stop-color="#ddd">
<animate
attributeName="offset"
to="0%"
dur="0.5s"
begin="0s"
fill="freeze"
/>
</stop>
<stop offset="100%" stop-color="#10004c">
<animate
attributeName="offset"
to="0%"
dur="0.5s"
begin="0s"
fill="freeze"
/>
</stop>
</linearGradient>
<g
transform="translate(-1161.000000, -558.000000)"
fill="url(#house-1)"
>
<g transform="translate(437.000000, 475.000000)">
<g id="houses" transform="translate(340.000000, 83.000000)">
<g id="house" transform="translate(384.000000, 0.000000)">
<polygon
id="Path"
points="21 6.66002593 21 3 25 3 25 11.1000432 30 16.6500648 25.3846154 16.6500648 25.3846154 30 4.61538462 30 4.62306431 16.6500648 0 16.6500648 15 0"
/>
</g>
</g>
</g>
</g>
</g>
</svg>
</div>
This works in Firefox now, but no longer works in Chrome :(
– James Ives
Nov 9 at 18:27
1
@JamesIves how about now, I tried this alternative on Safari so presumably Chrome is likely to work too. Chrome/Safari's failure on my previous version is a bug in their implementation.
– Robert Longson
Nov 9 at 18:32
Yep! Totally works now. Thanks for your assistance.
– James Ives
Nov 9 at 18:33
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Something like this?
I've removed the duplicated ids, corrected the x1, y1, x2 and y2 values and swappd the colours round (I could have swapped the animation so it went to 0% instead I suppose).
.house-container
height: 200px;
width: 200px
<div class="house-container">
<svg viewBox="0 0 30 30" version="1.1" preserveAspectRatio="none">
<g
id="Dashboard"
stroke="none"
stroke-width="1"
fill="none"
fillRule="evenodd"
>
<linearGradient id="house-1" x2="0" y1="0" y2="1">
<stop offset="0%" stop-color="#ddd" />
<stop offset="100%" stop-color="#ddd">
<animate
attributeName="offset"
to="0%"
dur="0.5s"
begin="0s"
fill="freeze"
/>
</stop>
<stop offset="100%" stop-color="#10004c">
<animate
attributeName="offset"
to="0%"
dur="0.5s"
begin="0s"
fill="freeze"
/>
</stop>
</linearGradient>
<g
transform="translate(-1161.000000, -558.000000)"
fill="url(#house-1)"
>
<g transform="translate(437.000000, 475.000000)">
<g id="houses" transform="translate(340.000000, 83.000000)">
<g id="house" transform="translate(384.000000, 0.000000)">
<polygon
id="Path"
points="21 6.66002593 21 3 25 3 25 11.1000432 30 16.6500648 25.3846154 16.6500648 25.3846154 30 4.61538462 30 4.62306431 16.6500648 0 16.6500648 15 0"
/>
</g>
</g>
</g>
</g>
</g>
</svg>
</div>Something like this?
I've removed the duplicated ids, corrected the x1, y1, x2 and y2 values and swappd the colours round (I could have swapped the animation so it went to 0% instead I suppose).
.house-container
height: 200px;
width: 200px
<div class="house-container">
<svg viewBox="0 0 30 30" version="1.1" preserveAspectRatio="none">
<g
id="Dashboard"
stroke="none"
stroke-width="1"
fill="none"
fillRule="evenodd"
>
<linearGradient id="house-1" x2="0" y1="0" y2="1">
<stop offset="0%" stop-color="#ddd" />
<stop offset="100%" stop-color="#ddd">
<animate
attributeName="offset"
to="0%"
dur="0.5s"
begin="0s"
fill="freeze"
/>
</stop>
<stop offset="100%" stop-color="#10004c">
<animate
attributeName="offset"
to="0%"
dur="0.5s"
begin="0s"
fill="freeze"
/>
</stop>
</linearGradient>
<g
transform="translate(-1161.000000, -558.000000)"
fill="url(#house-1)"
>
<g transform="translate(437.000000, 475.000000)">
<g id="houses" transform="translate(340.000000, 83.000000)">
<g id="house" transform="translate(384.000000, 0.000000)">
<polygon
id="Path"
points="21 6.66002593 21 3 25 3 25 11.1000432 30 16.6500648 25.3846154 16.6500648 25.3846154 30 4.61538462 30 4.62306431 16.6500648 0 16.6500648 15 0"
/>
</g>
</g>
</g>
</g>
</g>
</svg>
</div>.house-container
height: 200px;
width: 200px
<div class="house-container">
<svg viewBox="0 0 30 30" version="1.1" preserveAspectRatio="none">
<g
id="Dashboard"
stroke="none"
stroke-width="1"
fill="none"
fillRule="evenodd"
>
<linearGradient id="house-1" x2="0" y1="0" y2="1">
<stop offset="0%" stop-color="#ddd" />
<stop offset="100%" stop-color="#ddd">
<animate
attributeName="offset"
to="0%"
dur="0.5s"
begin="0s"
fill="freeze"
/>
</stop>
<stop offset="100%" stop-color="#10004c">
<animate
attributeName="offset"
to="0%"
dur="0.5s"
begin="0s"
fill="freeze"
/>
</stop>
</linearGradient>
<g
transform="translate(-1161.000000, -558.000000)"
fill="url(#house-1)"
>
<g transform="translate(437.000000, 475.000000)">
<g id="houses" transform="translate(340.000000, 83.000000)">
<g id="house" transform="translate(384.000000, 0.000000)">
<polygon
id="Path"
points="21 6.66002593 21 3 25 3 25 11.1000432 30 16.6500648 25.3846154 16.6500648 25.3846154 30 4.61538462 30 4.62306431 16.6500648 0 16.6500648 15 0"
/>
</g>
</g>
</g>
</g>
</g>
</svg>
</div>.house-container
height: 200px;
width: 200px
<div class="house-container">
<svg viewBox="0 0 30 30" version="1.1" preserveAspectRatio="none">
<g
id="Dashboard"
stroke="none"
stroke-width="1"
fill="none"
fillRule="evenodd"
>
<linearGradient id="house-1" x2="0" y1="0" y2="1">
<stop offset="0%" stop-color="#ddd" />
<stop offset="100%" stop-color="#ddd">
<animate
attributeName="offset"
to="0%"
dur="0.5s"
begin="0s"
fill="freeze"
/>
</stop>
<stop offset="100%" stop-color="#10004c">
<animate
attributeName="offset"
to="0%"
dur="0.5s"
begin="0s"
fill="freeze"
/>
</stop>
</linearGradient>
<g
transform="translate(-1161.000000, -558.000000)"
fill="url(#house-1)"
>
<g transform="translate(437.000000, 475.000000)">
<g id="houses" transform="translate(340.000000, 83.000000)">
<g id="house" transform="translate(384.000000, 0.000000)">
<polygon
id="Path"
points="21 6.66002593 21 3 25 3 25 11.1000432 30 16.6500648 25.3846154 16.6500648 25.3846154 30 4.61538462 30 4.62306431 16.6500648 0 16.6500648 15 0"
/>
</g>
</g>
</g>
</g>
</g>
</svg>
</div>edited Nov 9 at 18:31
answered Nov 9 at 18:25
Robert Longson
74.6k13150155
74.6k13150155
This works in Firefox now, but no longer works in Chrome :(
– James Ives
Nov 9 at 18:27
1
@JamesIves how about now, I tried this alternative on Safari so presumably Chrome is likely to work too. Chrome/Safari's failure on my previous version is a bug in their implementation.
– Robert Longson
Nov 9 at 18:32
Yep! Totally works now. Thanks for your assistance.
– James Ives
Nov 9 at 18:33
add a comment |
This works in Firefox now, but no longer works in Chrome :(
– James Ives
Nov 9 at 18:27
1
@JamesIves how about now, I tried this alternative on Safari so presumably Chrome is likely to work too. Chrome/Safari's failure on my previous version is a bug in their implementation.
– Robert Longson
Nov 9 at 18:32
Yep! Totally works now. Thanks for your assistance.
– James Ives
Nov 9 at 18:33
This works in Firefox now, but no longer works in Chrome :(
– James Ives
Nov 9 at 18:27
This works in Firefox now, but no longer works in Chrome :(
– James Ives
Nov 9 at 18:27
1
1
@JamesIves how about now, I tried this alternative on Safari so presumably Chrome is likely to work too. Chrome/Safari's failure on my previous version is a bug in their implementation.
– Robert Longson
Nov 9 at 18:32
@JamesIves how about now, I tried this alternative on Safari so presumably Chrome is likely to work too. Chrome/Safari's failure on my previous version is a bug in their implementation.
– Robert Longson
Nov 9 at 18:32
Yep! Totally works now. Thanks for your assistance.
– James Ives
Nov 9 at 18:33
Yep! Totally works now. Thanks for your assistance.
– James Ives
Nov 9 at 18:33
add a comment |
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53229498%2flineargradiant-svg-animation-looks-incorrect-in-firefox%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
a) you have multiple elements with the same id value (that's invalid) b) what are you trying to achieve with x2="1" y2="4". Those are very strange values, what do you want the animation to look like?
– Robert Longson
Nov 9 at 17:04
I want the animation to look exactly like it does in Firefox as it does in Chrome. It Firefox it behaves slightly strange.
– James Ives
Nov 9 at 18:01
It goes up non-horizontally (if you slow it down you'll see that). That odd angle is exactly what you want is it?
– Robert Longson
Nov 9 at 18:15
Ideally it would fill from bottom to top, but in Firefox it doesn't even do that. I'll update the post with a gif. The issue is more to do with how it doesn't look like it's even playing in Firefox at all, but it looks normal in all other browsers.
– James Ives
Nov 9 at 18:17
starting grey and finishing purple or the other way round?
– Robert Longson
Nov 9 at 18:21