I have some animating svg illustrations that draw in across the width of the viewport as the user scrolls to them.
They work great at regular screensizes, however, my colleagues 2560x1440 monitor is not showing the SVGs dasharray to the correct length. The best way to describe it is to just show it:
From my MacBook retina display:
I have a script measuring the length of the paths on the page:
let lineLength = this.getTotalLength()
$(this).css('stroke-dasharray', lineLength)
$(this).css('stroke-dashoffset', lineLength)
The SVG illustrated above is always being set a dasharray of 2138.14px
regardless of the viewport width.
SVG markup for the example above:
<svg focusable="false" class="illustration illustration--full" data-il="line" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1810 124.7">
<path vector-effect="non-scaling-stroke" data-path="main" d="M1.9 82.6S212-18.5 313.9 10.4s78.6 118.6 14.8 112c-63.8-6.6-38.8-157.6 208.5-112s334.7 105.9 561.1 45.3 447.2-90.6 709.8 40.1" />
</svg>
EDIT: I just dropped off the non-scaling-stroke
tag and this appears to have resolved this issue, but it now leaves me with the problem that the non-scaling-stroke setting was fixing...
non-scaling-stroke
. But this now leaves me with the inconsistent stroke weights issue I was having before. – Jay