After extensively searching through similar questions on various platforms, I've come to stackoverflow seeking help. Though I'm relatively new to Angular, I usually manage to piece together something for UX & UI Design demonstrations.
Currently, I have two HTML-based components positioned in different areas on my page. One component features a layout with a photo on one side and text on the other. Here's a visual representation:
https://i.sstatic.net/yuUEu.png
Further down the page, there's a variation of this layout design. It consists of a full-width background with an image overlay. The graphic designer at my workplace has provided special images with dimensions that don't match the previous layout. Here's what it looks like:
https://i.sstatic.net/HIPbe.png
Although the screenshots may not do justice, the underlying HTML for both components is identical. If you were able to see them all together (which unfortunately isn't feasible), you'd notice that the text sizes and layouts are consistent while the CTA links differ for each layout.
The issue: Due to the vastly different image dimensions (despite my objections), I need to ensure that the height of the full-width background image aligns perfectly with the other layouts. I've attempted various CSS techniques, but achieving consistency would require numerous breakpoints given the disparity in dimensions.
If I could utilize TypeScript/JavaScript through Angular, I could dynamically adjust the height of the full-width background image based on window resizing. Admittedly, it's not the most elegant solution, but I must resolve this by end of day tomorrow.
So, how can I effectively leverage something like HTMLElement (or any suitable method) to retrieve the dimensions of one HTML element and then harmonize its height (along with potentially other style attributes) to maintain uniformity?
Despite researching extensively, the solutions that appeared to work were beyond my current capabilities - plus, I'm working within someone else's component.ts file, so drastically altering it isn't ideal.
Any advice? Suggestions? Tips? Resources to explore further?