Using width and height on an svg element defeats the purpose of using svg. It is better to use the viewbox. I applied the scale to the viewbox instead of the polygons to simplify future animations. (This article explains it nicely: https://css-tricks.com/scale-svg/ )
Also, I added a conditional to only apply fill-opacity to individual elements if they are different from the 1st shape's alpha channel (maybe there's a better way to do this than array[0]).
Using width and height on an svg element defeats the purpose of using svg. It is better to use the viewbox. I applied the scale to the viewbox instead of the polygons to simplify future animations. (This article explains it nicely: https://css-tricks.com/scale-svg/ )
Also, I added a conditional to only apply fill-opacity to individual elements if they are different from the 1st shape's alpha channel (maybe there's a better way to do this than array[0]).