Thinking about it, I do get the appeal of being able to make a nice trapezoid for the segments of the digits. And it’s definitely doable (if you don’t access exotic properties).
So here’s a small pen how you can directly access the path (circle in this case) by it’s id to show or hide it :
You could make a div with an id for each digit and give classes to all segments. Each string to show or hide the elements would then be something like this :
And the HTML :
<svg id=”digit_1″ … >
<path class=”middle” … >
Using classes, you’d only need a single function for both digits (and pass the svg id as a parameter to that function)…