-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompatibility.html
More file actions
194 lines (177 loc) · 5.47 KB
/
compatibility.html
File metadata and controls
194 lines (177 loc) · 5.47 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
<!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="PSP Classics - Compatibility" />
<meta property="og:description" content="Compatibility details for PSP emulation on PS3." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://ps3classics.github.io/psp/compatibility.html" />
<meta property="og:image" content="https://ps3classics.github.io/psp/icon.png" />
<meta name="description" content="Compatibility details for PS1 emulation on PS3." />
<meta name="author" content="PS3 Classics" />
<title>PSP Classics - Compatibility</title>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<style>
body {
margin: 0;
font-family: Arial, sans-serif;
color: #fff;
background: linear-gradient(-45deg, #d12575, #4f2483, #2e1455, #4a257a);
background-size: 600% 600%;
animation: gradientShift 20s ease infinite;
min-height: 100vh;
display: flex;
flex-direction: column;
}
@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="https://ps3classics.github.io/ps1">PS1</a>
<a href="https://ps3classics.github.io/ps2">PS2</a>
</nav>
<div class="content">
<h1>PSP Compatibility Details</h1>
<p id="last-updated">Loading...</p>
<h2>Overall Compatibility Progress</h2>
<div id="progress-bar" class="progress-bar"></div>
<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);
// Updated color scheme
const colors = {
"Perfect": "rgb(153, 221, 153)",
"Playable": "rgb(238, 238, 136)",
"Major Issues": "rgb(238, 153, 51)",
"Unplayable": "rgb(238, 68, 68)",
"Untested": "rgb(187, 187, 187)"
};
// Progress bar (with merged categories)
const bar = document.getElementById("progress-bar");
bar.innerHTML = "";
const mergedStats = {
"Perfect": stats["Playable"],
"Playable": stats["Minor Issues"],
"Major Issues": stats["Major Issues"],
"Unplayable": stats["Unplayable"],
"Untested": stats["Untested"]
};
for (const [key, value] of Object.entries(mergedStats)) {
const percent = (value / total) * 100;
const segment = document.createElement("div");
segment.className = "progress-segment";
segment.style.backgroundColor = colors[key];
segment.style.width = percent + "%";
bar.appendChild(segment);
}
const ctx = document.getElementById("stackedChart").getContext("2d");
new Chart(ctx, {
type: "bar",
data: {
labels: ["Compatibility"],
datasets: Object.entries(mergedStats).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" } }
}
}
});
const breakdownList = document.getElementById("breakdown");
breakdownList.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}% (${value} games)`;
breakdownList.appendChild(li);
}
const fullyCompatible = mergedStats["Perfect"];
const fullyPercent = ((fullyCompatible / total) * 100).toFixed(1);
document.getElementById("totals").innerHTML =
`<strong>Fully Compatible (Perfect):</strong> ${fullyPercent}% (${fullyCompatible} games out of ${total})`;
}
loadData();
</script>
</body>
</html>