Sure! Here's a simple text-based FNAF (Five Nights at Freddy's) game implemented as a single HTML file using JavaScript:
To play the game, simply open the HTML file in a web browser. The game will prompt you to hide or run from an animatronic each night. Type "hide" or "run" as your decision. Try to survive all nights!
Please note that in this simple implementation, the outcome is logged to the browser's console. You can open the console to see the game messages. If you want to display the messages on the page itself, you can modify the code to update an HTML element with the game output.