My current project operates in 2 layers: the bottom layer features a large SVG object with numerous paths, while the top layer displays a small SVG object that I aim to keep perfectly centered. The bottom layer is positioned absolutely using CSS, and the top layer is fixed. Although the top SVG appears "kindof" centered, changing the zoom level on browsers like Safari can disrupt the centered effect in certain cases. Are there any life cycle methods in web design? Is it possible to invoke a method whenever ANY change occurs to the viewport, enabling me to dynamically reposition the top layer SVG design and maintain perfect centering under all circumstances?
PS: In the future, I plan to transition this project to React-Native (a platform I have limited knowledge of). Do standard web design principles still apply when preparing for a mobile-based platform migration? Apologies for the absence of code, and thank you for taking the time to read!