I have this SVG path line down below that has two circles moving with a specific duration of time from one end to another. Is is possible to change the colour of the blue circle so it would be blue in the start, after 20s, it would start going white, then it would go to orange(from white)when it has 20 more seconds to go to reach the end, while the red circle would change its own colour depending on the colour of the circle and then adding a glow behind the current blue moving circle that would be the color of the current blue circle?
Does this mean the whole has to be made with javascript or how do I have to amend the HTML so it would function such way as described?
<svg width="450" height="450">
<path id="motionPath2"
d="M 50 200 L 400 200 "
stroke="
none" fill="transparent" />
<circle class="circle" r=20 fill=#ff0000 z-index=55>
<animateMotion dur="100s" repeatCount="indefinite"
rotate="auto">
<mpath href="#motionPath2" />
</animateMotion>
</circle>
<path id="motionPath"
d="M 50 200 L 400 200 "
stroke="
black" fill="transparent" />
<circle class="circle" r=5 fill=#45b6fe z-index=55>
<animateMotion dur="100s" repeatCount="indefinite"
rotate="auto">
<mpath href="#motionPath" />
</animateMotion>
</circle>
</svg>