RetroMenu.js

A retro-styled menu in JavaScript, HTML & CSS.

Originally developed for POKE THE GAME.

You can easily create alerts, prompts and confirm dialogs. As such it is also a very nice replacement for the built-in window methods.

API Documentation - Source code

Create a simple dialog that can be closed by pressing <ENTER>. Give it a title and some text.

Alternatively, it can be closed by clicking on the message.
//show a nice dialog
RetroMenu.alert_dialog("Message", "I am a nice message. ", function(){
    //destroy it on enter
    this.destroy();
});    
                
Run Code
RetroMenu.confirm_dialog("Confirm me", "Are you OK?", function(response){
    //close dialog
    this.destroy();

    //Did we answer OK or cancel.
    if(response){
        RetroMenu.alert_dialog("Response", "That's great!", function(){
            this.destroy();
        });
    } else {
        RetroMenu.alert_dialog("Response", "You should better go see a doctor. ", function(){
            this.destroy();
        });
    }
});
                
Run Code
Create a confirm dialog where the user can respond with "OK" or "Cancel". Confirm using <ENTER> and navigate using W - A - S - D or the arrow keys.

Alternatively, you can close it by clicking on the question. You can select by clicking on the items as well. Double-clicking will submit the dialog.
Create a prompt dialog where you can easily enter text.
RetroMenu.prompt_dialog("Question", "What is your name?", "<Your name here>", function(name){
          this.destroy();
          RetroMenu.alert_dialog("Response", "Hello "+name, function(){this.destroy(); });
      });
                
Run Code