Because the centered SVGs are absolutely positioned and appended to the document body, when the viewport is scrolled, the SVGs move but some of their targets will not, say if they have position: fixed or positon: sticky. Also, if there are targets in scrollable areas, when those areas are scrolled those SVGs also don't remain with their targets.
If each SVG was appended to its target (el.appendChild(svg) instead of document.body.appendChild(svg) in the unminified code) and positioned relatively, I think this would resolve the issue but it would require different calculations for centering them.
Because the centered SVGs are absolutely positioned and appended to the document body, when the viewport is scrolled, the SVGs move but some of their targets will not, say if they have
position: fixed
orpositon: sticky
. Also, if there are targets in scrollable areas, when those areas are scrolled those SVGs also don't remain with their targets.If each SVG was appended to its target (
el.appendChild(svg)
instead ofdocument.body.appendChild(svg)
in the unminified code) and positioned relatively, I think this would resolve the issue but it would require different calculations for centering them.