How to make such an effect for text and picture?
Sketched on the knee, don't judge strictly.
LOGIC: when clicking on the link, add / remove the "active" class from the tag.
For a tag with an active class - we write separately the logic of the behavior of elements on the page, for a tag without an active class - we hide all elements from the user's field of view.
The code is not finished, it took 5 seconds, I hope this helps you!)
https://codepen.io/MrPackage/pen/XWKWGvR "Juliet Gamble
To place the code, please use CodePen or similar tool. Thanks you!