Adding Javascript to redirect to the correct game URL

This commit is contained in:
David Négrier 2020-06-01 16:22:42 +02:00
parent 0574cb7d33
commit b652a986c8

View file

@ -7,6 +7,12 @@
<link rel="stylesheet" href="main.css"> <link rel="stylesheet" href="main.css">
<script src="bundle.js"></script> <script src="bundle.js"></script>
<script>
function startGame() {
let playUrl = window.location.protocol + "//play."+window.location.host;
window.location.assign(playUrl);
}
</script>
</head> </head>
<body> <body>
@ -21,7 +27,7 @@
<h2>Start a casual conversation</h2> <h2>Start a casual conversation</h2>
</div> </div>
<div> <div>
<a class="custom-link start" href="#" title="START !"> <a class="custom-link start" href="#" title="START !" onclick="startGame()">
</a> </a>
</div> </div>
</div> </div>
@ -50,11 +56,11 @@
</div> </div>
<div class="row justify-content-md-center pt-5"> <div class="row justify-content-md-center pt-5">
<div class="col col-lg-3"> <div class="col col-lg-3">
<a class="custom-link light demo" href="#" title="DEMO !"> <a class="custom-link light demo" href="#" title="DEMO !" onclick="startGame()">
</a> </a>
</div> </div>
<div class="col col-lg-3"> <div class="col col-lg-3">
<a class="custom-link start" href="#" title="START !"> <a class="custom-link start" href="#" title="START !" onclick="startGame()">
</a> </a>
</div> </div>
</div> </div>