-
Notifications
You must be signed in to change notification settings - Fork 0
/
kartbuilder.php
98 lines (89 loc) · 2.63 KB
/
kartbuilder.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
$DATA = file_get_contents("data.json");
$DATA = json_decode($DATA, true);
$BOOL_LIST = array(
array('id'=>"b0",'name'=>'OFF','value'=>0),
array('id'=>"b1",'name'=>'ON', 'value'=>1),
);
?>
<html>
<head>
<meta charset="UTF-8"/>
<title>Mario Kart 8 Kart builder</title>
</head>
<body>
<h2>Stat</h2>
<button onclick='click_set_all("stat_box",true)'>All</button>
<table>
<tr>
<th></th>
<?php
for($i=$DATA["stat_min"];$i<=$DATA["stat_max"];$i+=1){
print("<th>".$i."</th>\n");
}
?>
</tr>
<?php
foreach($DATA["stat_type_list"] as $stat_type){
print("<tr>\n");
if($stat_type["type"]=="int"){
print("<th>".$stat_type["name"]."</th>\n");
for($i=$DATA["stat_min"];$i<=$DATA["stat_max"];$i+=1){
$key = "stat_".$stat_type["id"]."_".$i;
print("<td id='".$key."_bg'>\n");
print("<input class='box stat_box' onclick='box_click()' type='checkbox' id='".$key."_box'/>\n");
print("<span style='cursor:pointer' onclick='stat_arrow_click(\"".$stat_type["id"]."\",".$i.")'>◀</span>\n");
print("</td>\n");
}
print("</tr>\n");
}
}
?>
<tr>
<th></th>
<?php
foreach($BOOL_LIST as $bool){
print("<th>".$bool["name"]."</th>\n");
}
?>
</tr>
<?php
foreach($DATA["stat_type_list"] as $stat_type){
if($stat_type["type"]=="bool"){
print("<tr>\n");
print("<th>".$stat_type["name"]."</th>\n");
foreach($BOOL_LIST as $bool){
$key = "stat_".$stat_type["id"]."_".$bool['id'];
print("<td id='".$key."_bg'><input class='box' onclick='box_click()' type='checkbox' id='".$key."_box'/></td>\n");
}
print("</tr>\n");
}
}
?>
</table>
<?php
foreach($DATA["part_type_list"] as $part_type){
print("<h2>".$part_type["name"]."</h2>\n");
print("<button onclick='click_set_all(\"".$part_type["id"]."_box\",true)'>All</button>\n");
print("<button onclick='click_set_all(\"".$part_type["id"]."_box\",false)'>None</button>\n");
print("<table>\n");
foreach($DATA["part_dict"][$part_type["id"]] as $part){
$key = $part_type["id"]."_".$part["id"];
print("<tr><th>".$part["name"]."</th><td id='".$key."_bg'><input class='box ".$part_type["id"]."_box' onclick='box_click()' type='checkbox' id='".$key."_box'/></td></tr>\n");
}
print("</table>\n");
}
?>
<h2>Search result</h2>
<div id="search_count"></div>
<table id="search_result">
</table>
<p>Data based on <a href="http://amzn.asia/g64LQEj">"マリオカート8 デラックス パーフェクトガイド超∞"</a>.<br/>
<a href="stat.csv">Parts data</a><br/>
<a href="https://github.com/luzi82/mk8dx-kart-builder">Github link</a></p>
<p>Version: <span id="ver_version"></span><br/>
Build: <span id="ver_build"></span></p>
<script src="jquery-3.2.1.min.js"></script>
<script src="kartbuilder.js"></script>
</body>
</html>