stevefaulkner / targetsize

GNU General Public License v3.0
17 stars 6 forks source link

SVG positioning and viewport movement #8

Open extra808 opened 1 year ago

extra808 commented 1 year ago

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.

stevefaulkner commented 1 year ago

thanks @extra808 will look into it