How to count scale or z position of camera when zoom

Hi!
I’m trying to implement a zoom feature that should work like this:
There is a scene with several objects, when you put the mouse cursor over any area of the scene and after scrolling the mouse wheel, the scene with objects should zoom in or zoom out. But the main requirement is that the area or object above which the cursor is placed remains in the same place, but at the same time increases or decreases as other objects (the size of objects is constant).
You can find similar behavior in the example by clicking this link. https://stackoverflow.com/questions/2916081/zoom-in-on-a-point-using-scale-and-translate .
However, there is a problem with calculation of camera height above the scene or calculation of scaling factor. Please help to solve this problem. Thank you.
You can find a live example on the following link.
https://jsfiddle.net/KramRul/ovcd8Lnx/latest/ .

Are you looking for something like this: