It won't be long before we encode it. So I'd like to tell you the simplest way to use the algorithm. It can give you an idea and help you get it in your head. If you want to do them only with vanilla javascript without using any library:
Html and Css:
1 -Create the search screen with HTML css.
2 -Edit and display none with css in which position and where you want the search screen to appear on the screen.
Javascript:
3 - Use keyup or keydown events to press the same key on the window you are using. ( You can check here How to detect if multiple keys are pressed at once using JavaScript? )
4 -make the display block of the call screen when the same key is pressed.
5 -after the search screen opens, write a function about how the search should be.
6 -in this section, you can use index of or similar search methods to display block if there is an item, and display none if there is no item.
This is the simplest basic algorithm I've ever written. If you try and fail, please write. I'd like to examine it. Good Luck!