JSFiddle - React, Tailwind, and code Playground

HTML

<script src="https://dl.dropboxusercontent.com/s/nprvawkml8mav45/phaser.min.js"></script>
<div id="game_div"> </div>

CSS

#game_div {
      width: 400px;
      margin: auto;
      margin-top: 50px;
    }

JavaScript

var game = new Phaser.Game(400, 490, Phaser.AUTO, 'game_div');
var game_state = {};

game_state.main = function() { };  
game_state.main.prototype = {

    preload: function() {
      //Load sprites
    this.shopS = this.add.bitmapData(400, 490);
		this.shopS.ctx.beginPath();
		this.shopS.ctx.rect(0, 0, 400, 490);
		this.shopS.ctx.fillStyle = '#000000';
		this.shopS.ctx.fill();
  
    this.btnexS = this.add.bitmapData(150, 150);
		this.btnexS.ctx.beginPath();
		this.btnexS.ctx.rect(0, 0, 150, 150);
		this.btnexS.ctx.fillStyle = '#FFFFFF';
		this.btnexS.ctx.fill();

    },

    create: function() { 
      //Show message
      var message = game.add.text(10,10,"Press E to open shop");
		  message.fill = "#E09F1D";
    },
    
    update: function() {
      //Open shop when 'E' is pressed
      if (game.input.keyboard.isDown(Phaser.Keyboard.E)){
				this.openShop();
			}
      if (game.input.keyboard.isDown(Phaser.Keyboard.F)){
        this.closeShop();
      }
    },
    
    openShop: function() {
      //Display shop UI and button
      this.shop = game.add.sprite(0,0,this.shopS);
      this.btnExit = game.add.button(0,0,this.btnexS,game_state.main.prototype.closeShop,this);
    },
    
    closeShop: function () {
      //Remove shop items
      this.shop.kill();
      this.btnExit.kill();
      console.log('end');
    },
};

game.state.add('main', game_state.main);  
game.state.start('main');