3 function getRegions() {
4 return [ "euw", "na", "kr", "br" ];
6 function getChampions() {
7 return [ {name: "Aatrox"}, {name: "Annie"}, {name: "Braum"}, {name: "Not"} ];
9 function getMatchProps() {
12 function getMatches() {
15 app.summoner = $("#nameinput").val();
16 app.region = $("#regionselect").val();
19 window.history.pushState("object or string", "Title",
28 function toggleStart(up) {
29 $("#start").removeClass(up ? "down" : "up");
30 $("#start").addClass(up ? "up" : "down");
32 function slideStart() {
33 $("#start").addClass("slideup");
41 regions: getRegions(),
42 champions: getChampions(),
43 matchprops: getMatchProps(),
44 matches: getMatches(),
49 if (app.view == "start") {
53 $("#matchhistory").show("slide", { direction: "down" }, 300);
58 historyToStats: function() {
61 $("#stats").show("blind", { direction: "right" });
62 $("#matchhistory").hide("blind", { direction: "left" });
64 statsToHistory: function() {
67 $("#matchhistory").show("blind", { direction: "left" });
68 $("#stats").hide("blind", { direction: "right" });
73 // Check for URL parameters
74 let url = new URL(window.location.href);
75 if (url.searchParams.has("summoner")) {
76 app.summoner = url.searchParams.get("summoner");
77 $("#nameinput").val(app.summoner);
79 if (url.searchParams.has("region")) {
80 app.region = url.searchParams.get("region");
81 $("#regionselect").val(app.region);
83 if (url.searchParams.has("view")) {
84 let view = url.searchParams.get("view");
85 if (view == "history") {
87 $("#matchhistory").show();
89 else if (view == "stats") {