I'm using angular animations and CSS animations to animate the progress in svg progress gauge. When I open the page on firefox, my animations are fired twice (once for the angular animations and once for the css animations). This doesn’t occur on chrome. Is there a way to fix this? Can I temporarily pause the CSS animations when the page loads on firefox browser?
app.component.ts: (i only attached the code snippet of the svg that uses the animation)
<path #progressPath
id= "{{ idStr }}"
[attr.d]="describeArc(90, 270, 1, 1)"
class="rpb-arc"
[style.stroke-dasharray]="'0' + ', ' + circumference"
[class.rpb-arc-done]="amount === maxValue"
[style.stroke-width.px]="strokeWidth"
[@progress]="{
value: !disabled,
params: {
default: '0' + ', ' + circumference,
final:
(circumference / 2) * (amount / maxValue) + ', ' + circumference
}
}"
></path>
animations: [
trigger('progress', [
state(
'true',
style({
'stroke-dasharray': '{{final}}'
}),
{ params: { default: '0,100', final: '100,100' } }
),
transition('* => true', [animate('2s')]),
transition('* => false', [animate('0s')])
])
]
CSS:
.rpb-arc {
fill: transparent;
stroke-linecap: round;
transition: stroke-dasharray 2s ease-in;
animation-fill-mode: forwards;
}