Sure, I can create a simple game where you can move around and place portals using WASD keys and Spacebar. Here's an example implementation for you:
Save the above code in an HTML file and open it in a web browser. You will be able to control the player character using WASD keys and place portals by pressing the Spacebar. The player will be able to travel between the two portals just like in the game you described.