Adding Javascript to redirect to the correct game URL
authorDavid Négrier <d.negrier@thecodingmachine.com>
Mon, 1 Jun 2020 14:22:42 +0000 (16:22 +0200)
committerDavid Négrier <d.negrier@thecodingmachine.com>
Mon, 1 Jun 2020 14:22:42 +0000 (16:22 +0200)
landing_page/dist/index.html

index 3e361beece2dcdd99ea23aae83bdac4d6e333db2..8f935d330c8b54724c62aefd0a91e9ff53d430eb 100644 (file)
@@ -7,6 +7,12 @@
 
     <link rel="stylesheet" href="main.css">
     <script src="bundle.js"></script>
+    <script>
+        function startGame() {
+            let playUrl = window.location.protocol + "//play."+window.location.host;
+            window.location.assign(playUrl);
+        }
+    </script>
 </head>
 
 <body>
@@ -21,7 +27,7 @@
                     <h2>Start a casual conversation</h2>
                 </div>
                 <div>
-                    <a class="custom-link start" href="#" title="START !">
+                    <a class="custom-link start" href="#" title="START !" onclick="startGame()">
                     </a>
                 </div>
             </div>
         </div>
         <div class="row justify-content-md-center pt-5">
             <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>
             </div>
             <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>
             </div>
         </div>