+function slideStartDown() {
+ $("#start").removeClass("slideup");
+ $("#start").addClass("slidedown");
+}
+function changeView(view) {
+ if (view != "start" && view != "history" && view != "stats") {
+ setUrl();
+ return;
+ }
+ let oldView = app.view;
+ if (oldView == "start") {
+ if (view == "history") {
+ slideStartUp();
+ $("#matchhistory").show("slide", { direction: "down" }, 300);
+ } else if (view == "stats") {
+ slideStartUp();
+ $("#stats").show("slide", { direction: "down" }, 300);
+ }
+ } else if (oldView == "history") {
+ if (view == "start") {
+ $("#matchhistory").hide("slide", { 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("slide", { 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({