+function slideStartDown() {
+ $("#start").removeClass("slideup");
+ $("#start").addClass("slidedown");
+}
+function setView(view) {
+ console.log("Setting view to " + view);
+ if (view == "history") {
+ toggleStartUp();
+ $("#matchhistory").show();
+ } else if (view == "stats") {
+ toggleStartUp();
+ $("#stats").show();
+ }
+ app.view = view;
+}
+function changeView(view) {
+ let oldView = app.view;
+ console.log("changing view from " + oldView + " to " + view);
+ if (oldView == "start") {
+ if (view == "history") {
+ slideStartUp();
+ $("#matchhistory").show("blind", { direction: "down" }, 300);
+ } else if (view == "stats") {
+ slideStartUp();
+ $("#stats").show("blind", { direction: "down" }, 300);
+ }
+ } else if (oldView == "history") {
+ if (view == "start") {
+ $("#matchhistory").hide("blind", { direction: "down" }, 300);
+ slideStartDown();
+ } else if (view == "stats") {
+ $("#stats").show("blind", { direction: "right" });
+ $("#matchhistory").hide("blind", { direction: "left" });
+ }
+ } else if (oldView == "stats") {
+ if (view == "start") {
+ $("#stats").hide("blind", { direction: "down" }, 300);
+ slideStartDown();
+ } else if (view == "history") {
+ $("#matchhistory").show("blind", { direction: "left" });
+ $("#stats").hide("blind", { direction: "right" });
+ }
+ }
+ app.view = view;
+}
+let app = new Vue({