Let’s assume there is a style like the following:
.main{
margin: 0;
padding: 0;
box-sizing: border-box;
display: flex;
position: relative;
height: 100vh;
perspective: 1000px;
}
.page-L{
position: relative;
height: 100%;
width: 30%;
transform-origin: left;
transform: rotateY(α);
}
.page-R{
position: relative;
margin: auto;
height: 100%;
width: 70%;
}
If you have any misunderstandings about my question, please take a look at this!!
These two elements are children of “main”.
As you can see, you can clearly see that the element ‘page-L’ will undergo a deformation, and this will cause a visual change to its right side.
What should I do to obtain its changed value (height) through JavaScript and apply it to the element ‘page-R’?
2
Answers
As I was saying in comment, to measure the right side, you have two option
Understand the projective geometry involved. I am not sure that is even standard (reproducible from one browser to another). Maybe it is.
Basically, the coordinates are passed through a projective matrix, in homogeneous coordinates (that is, in 3D, 4 values (x y z w), that are equivalency classes (x/w, y/w, z/w, 1).
Easier method: place an invisible 0-width witness div at the side of .page-L, and see what is its bounding box. Since it is 0-width, its bounging box height is its real height