-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompatibility.html
More file actions
252 lines (230 loc) · 8.24 KB
/
compatibility.html
File metadata and controls
252 lines (230 loc) · 8.24 KB
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta property="og:title" content="PS2 Classics Compatibility List" />
<meta property="og:description" content="Compatibility details of PS2 emulation on PS3." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://ps3classics.github.io/ps2/compatibility.html" />
<meta property="og:image" content="https://ps3classics.github.io/ps2/icon.png" />
<meta name="description" content="Detailed PS2 Classics compatibility list with stats, guides, and updates." />
<meta name="author" content="PS3 Classics" />
<title>PS2 Compatibility</title>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
text-align: center;
color: white;
background: linear-gradient(-45deg, #002244, #004488, #001122, #003366);
background-size: 400% 400%;
animation: gradientShift 15s ease infinite;
}
@keyframes gradientShift {
0% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
100% { background-position: 0% 50%; }
}
nav {
background-color: rgba(0, 0, 0, 0.6);
display: flex;
justify-content: left;
padding: 1rem;
position: sticky;
top: 0;
}
nav a {
color: #fff;
margin: 0 1rem;
text-decoration: none;
font-weight: bold;
}
nav a:hover {
text-decoration: underline;
}
.content {
padding: 20px;
max-width: 900px;
margin: auto;
}
.progress-bar {
width: 100%;
max-width: 800px;
height: 40px;
display: flex;
border: 2px solid white;
border-radius: 10px;
overflow: hidden;
margin: 30px auto;
}
.progress-segment {
height: 100%;
}
canvas {
margin: 30px auto;
display: block;
max-width: 800px;
}
ul {
list-style: none;
padding: 0;
margin-top: 20px;
text-align: left;
max-width: 400px;
margin-left: auto;
margin-right: auto;
}
ul li { margin: 8px 0; }
.totals {
margin-top: 30px;
font-size: 1.2em;
}
</style>
</head>
<body>
<nav>
<a href="index.html">Home</a>
<a href="faq.html">FAQ</a>
<a href="compatibility.html">Compatibility</a>
<a href="config-guide.html">CONFIG</a>
<a href="https://ps3classics.github.io/ps1">PS1</a>
<a href="https://ps3classics.github.io/psp">PSP</a>
</nav>
<div class="content">
<h1>PS2 Compatibility Details</h1>
<p id="last-updated">Loading...</p>
<h2>Overall Compatibility</h2>
<div id="progress-bar" class="progress-bar"></div>
<ul id="percentages"></ul>
<h2>Tested Compatibility</h2>
<div id="progress-bar-tested" class="progress-bar"></div>
<ul id="percentages-tested"></ul>
<h2>Stacked Breakdown</h2>
<canvas id="stackedChart"></canvas>
<h2>Breakdown</h2>
<ul id="breakdown"></ul>
<div class="totals" id="totals"></div>
</div>
<script>
async function loadData() {
const response = await fetch("data.json");
const { stats, last_updated } = await response.json();
document.getElementById("last-updated").textContent =
"Last updated: " + last_updated;
const total = Object.values(stats).reduce((a, b) => a + b, 0);
const colors = {
"PS2 Classic": "rgb(0, 136, 238)",
"Playable": "rgb(153, 221, 153)",
"Minor Issues": "rgb(238, 238, 136)",
"Major Issues": "rgb(238, 153, 51)",
"Unplayable": "rgb(238, 68, 68)",
"Untested": "rgb(187, 187, 187)"
};
// -------- progress bar (all games) --------
const mergedStats = {
"Perfect": stats["PS2 Classic"] + stats["Playable"],
"Minor Issues": stats["Minor Issues"],
"Major Issues": stats["Major Issues"],
"Unplayable": stats["Unplayable"],
"Untested": stats["Untested"]
};
const mergedColors = {
"Perfect": "rgb(153, 221, 153)",
"Minor Issues": "rgb(238, 238, 136)",
"Major Issues": "rgb(238, 153, 51)",
"Unplayable": "rgb(238, 68, 68)",
"Untested": "rgb(187, 187, 187)"
};
function renderProgressBar(containerId, stats, total) {
const bar = document.getElementById(containerId);
bar.innerHTML = "";
for (const [key, value] of Object.entries(stats)) {
const percent = (value / total) * 100;
const segment = document.createElement("div");
segment.className = "progress-segment";
segment.style.backgroundColor = mergedColors[key];
segment.style.width = percent + "%";
bar.appendChild(segment);
}
}
// progress bar including untested
renderProgressBar("progress-bar", mergedStats, total);
// bullet list including untested
const list = document.getElementById("percentages");
list.innerHTML = "";
for (const [key, value] of Object.entries(mergedStats)) {
const percent = ((value / total) * 100).toFixed(1);
const li = document.createElement("li");
li.textContent = `${key}: ${percent}%`;
list.appendChild(li);
}
// tested only
const testedTotal = total - mergedStats["Untested"];
const testedStats = {
"Perfect": mergedStats["Perfect"],
"Minor Issues": mergedStats["Minor Issues"],
"Major Issues": mergedStats["Major Issues"],
"Unplayable": mergedStats["Unplayable"]
};
// second bar for tested-only
renderProgressBar("progress-bar-tested", testedStats, testedTotal);
// add tested-only text summary
const testedList = document.getElementById("percentages-tested");
testedList.innerHTML = "";
for (const [key, value] of Object.entries(testedStats)) {
const percent = ((value / testedTotal) * 100).toFixed(1);
const li = document.createElement("li");
li.textContent = `${key}: ${percent}% (of tested games)`;
testedList.appendChild(li);
}
// stacked bar chart
const ctx = document.getElementById("stackedChart").getContext("2d");
new Chart(ctx, {
type: "bar",
data: {
labels: ["Compatibility"],
datasets: Object.entries(stats).map(([key, value]) => ({
label: key,
data: [value],
backgroundColor: colors[key],
stack: "stack1"
}))
},
options: {
plugins: { legend: { labels: { color: "white" } } },
responsive: true,
scales: {
x: { stacked: true, ticks: { color: "white" } },
y: { stacked: true, ticks: { color: "white" } }
}
}
});
// breakdown list
const breakdownList = document.getElementById("breakdown");
breakdownList.innerHTML = "";
for (const [key, value] of Object.entries(stats)) {
const percent = ((value / total) * 100).toFixed(1);
const li = document.createElement("li");
li.textContent = `${key}: ${percent}% (${value} games)`;
breakdownList.appendChild(li);
}
// totals
const fullyCompatible = stats["PS2 Classic"] + stats["Playable"];
const fullyPercent = ((fullyCompatible / total) * 100).toFixed(1);
const noMajorIssues = fullyCompatible + stats["Minor Issues"];
const noMajorPercent = ((noMajorIssues / total) * 100).toFixed(1);
const testedPercent = ((fullyCompatible / (total - stats["Untested"])) * 100).toFixed(1);
const noMajorTestedPercent = ((noMajorIssues / (total - stats["Untested"])) * 100).toFixed(1);
const noMajorIssuesTested = noMajorIssues - stats["Untested"];
document.getElementById("totals").innerHTML =
`<strong>Fully Compatible (PS2 Classic + Perfect):</strong> ${fullyPercent}% (${fullyCompatible} games out of ${total})<br>
<strong>Tested Compatibility:</strong> ${testedPercent}% of tested games are fully compatible
<strong>Playable Tested:</strong> ${noMajorTestedPercent}% of tested games have no major issues (${noMajorIssuesTested} out of ${total - stats["Untested"]})<br>`;
}
loadData();
</script>
</body>
</html>