How do I make a slide in web page that slides in on a button and slides out when i push that button again?

Im trying to make a portfolio website and would like to have a mechanic that lets the user stay on the same page while having access to all my information. Now instead of just having a long page of information for the user to scroll endlessly through, I have a side menu that allows the user to select what information they would like to see. My goal is for that said information, when selected by the menue, to then slide in from the right and cover the rest of the screen (not the menu). I have not seen anything explaining this on youtube but did see a video where someone had implemented it.youtube. I do not know what this is called and would apreciate any help leading to the answer.

Ive tried toggleable images that had the information on them but that resulted in me being unable to add links, animations, and download buttons.

I also tried this code, that lets me slide between pages but that resulted in either the whole page being covered or the user able to see all pages.