Save current state (unmerged, broken, not working...)
[vchess.git] / public / javascripts / variant.js
index d617c60..eac1ec0 100644 (file)
@@ -1,26 +1,30 @@
 new Vue({
        el: "#variantPage",
        data: {
-               display: "play", //default: play!
-               problem: undefined, //current problem in view
+               display: "room", //default: main hall
+               gameid: "undefined", //...yet
        },
        created: function() {
+               // TODO: navigation becomes a little more complex
                const url = window.location.href;
                const hashPos = url.indexOf("#");
-               console.log(hashPos + " " + url);
                if (hashPos >= 0)
                        this.setDisplay(url.substr(hashPos+1));
        },
        methods: {
-               showProblem: function(problemTxt) {
-                       this.problem = JSON.parse(problemTxt);
-                       this.display = "play";
-               },
                setDisplay: function(elt) {
                        this.display = elt;
+                       // Close menu on small screens:
                        let menuToggle = document.getElementById("drawer-control");
                        if (!!menuToggle)
                                menuToggle.checked = false;
                },
        },
 });
+               
+//const continuation = (localStorage.getItem("variant") === variant.name);
+//                     if (continuation) //game VS human has priority
+//                             this.continueGame("human");
+
+// TODO:
+// si quand on arrive il y a une continuation "humaine" : display="game" et retour à la partie !