This repository was archived by the owner on Feb 8, 2026. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
746 lines (645 loc) · 27.5 KB
/
Copy pathindex.html
File metadata and controls
746 lines (645 loc) · 27.5 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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Pumpkin Block Implementation Tracker</title>
<style>
:root {
--bg-primary: #0d1117;
--bg-secondary: #161b22;
--bg-tertiary: #21262d;
--border-color: #30363d;
--text-primary: #f0f6fc;
--text-secondary: #8b949e;
--text-muted: #656d76;
--accent-green: #238636;
--accent-green-light: #2ea043;
--accent-orange: #da7633;
--accent-yellow: #d29922;
--accent-red: #da3633;
--accent-blue: #1f6feb;
--progress-bg: #21262d;
--shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
--radius: 8px;
--radius-small: 6px;
}
* {
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
margin: 0;
padding: 0;
background: var(--bg-primary);
color: var(--text-primary);
line-height: 1.6;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
}
.header {
text-align: center;
margin-bottom: 30px;
}
.header h1 {
margin: 0 0 10px 0;
font-size: 2.5rem;
font-weight: 700;
background: linear-gradient(135deg, var(--accent-green), var(--accent-blue));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.header p {
margin: 0;
color: var(--text-secondary);
font-size: 1.1rem;
}
.overall-progress {
background: var(--bg-secondary);
border: 1px solid var(--border-color);
border-radius: var(--radius);
padding: 20px;
margin-bottom: 30px;
box-shadow: var(--shadow);
}
.overall-progress h2 {
margin: 0 0 15px 0;
font-size: 1.25rem;
color: var(--text-primary);
}
.main-progress-bar {
width: 100%;
height: 12px;
background: var(--progress-bg);
border-radius: 6px;
overflow: hidden;
margin-bottom: 10px;
border: 1px solid var(--border-color);
position: relative;
}
.main-progress-segments {
height: 100%;
display: flex;
width: 100%;
}
.progress-segment {
height: 100%;
transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.segment-fully { background: var(--accent-green); }
.segment-mostly { background: var(--accent-yellow); }
.segment-partially { background: var(--accent-orange); }
.segment-barely { background: var(--accent-red); }
.segment-not { background: var(--text-muted); }
.progress-text {
display: flex;
justify-content: space-between;
align-items: center;
color: var(--text-secondary);
font-size: 0.9rem;
}
.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 15px;
margin-bottom: 30px;
}
.stat-card {
background: var(--bg-secondary);
border: 1px solid var(--border-color);
padding: 20px;
border-radius: var(--radius);
text-align: center;
transition: transform 0.2s ease, box-shadow 0.2s ease;
box-shadow: var(--shadow);
}
.stat-card:hover {
transform: translateY(-2px);
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}
.stat-number {
font-size: 2.2rem;
font-weight: 700;
color: var(--text-primary);
margin-bottom: 5px;
}
.stat-label {
color: var(--text-secondary);
font-size: 0.9rem;
font-weight: 500;
}
.filters {
margin-bottom: 25px;
display: flex;
gap: 12px;
flex-wrap: wrap;
align-items: center;
}
.filter-input {
padding: 10px 14px;
border: 1px solid var(--border-color);
border-radius: var(--radius-small);
font-size: 14px;
background: var(--bg-secondary);
color: var(--text-primary);
transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.filter-input:focus {
outline: none;
border-color: var(--accent-blue);
box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.1);
}
.filter-input::placeholder {
color: var(--text-muted);
}
.results-count {
color: var(--text-secondary);
font-size: 0.9rem;
margin-left: auto;
}
.class-grid {
display: grid;
gap: 20px;
}
.class-card {
border: 1px solid var(--border-color);
border-radius: var(--radius);
padding: 20px;
background: var(--bg-secondary);
transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
box-shadow: var(--shadow);
}
.class-card:hover {
transform: translateY(-1px);
border-color: var(--accent-blue);
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}
.class-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 15px;
flex-wrap: wrap;
gap: 10px;
}
.class-name {
font-weight: 600;
font-size: 1.15rem;
color: var(--text-primary);
}
.progress-section {
display: flex;
flex-direction: column;
align-items: flex-end;
min-width: 220px;
}
.progress-text-small {
font-size: 0.9rem;
color: var(--text-secondary);
margin-bottom: 5px;
}
.progress-bar {
width: 200px;
height: 8px;
background: var(--progress-bg);
border-radius: 4px;
overflow: hidden;
border: 1px solid var(--border-color);
}
.progress-fill {
height: 100%;
transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
border-radius: 4px;
}
.progress-0 { background: var(--accent-red); }
.progress-low { background: var(--accent-orange); }
.progress-medium { background: var(--accent-yellow); }
.progress-high { background: var(--accent-green); }
.progress-100 { background: var(--accent-green-light); }
.methods-list {
margin-top: 15px;
}
.methods-title {
font-size: 0.9rem;
color: var(--text-secondary);
margin-bottom: 8px;
font-weight: 500;
}
.method-item {
display: inline-block;
margin: 3px 5px 3px 0;
padding: 6px 10px;
border-radius: 16px;
font-size: 12px;
font-weight: 500;
transition: transform 0.2s ease;
}
.method-item:hover {
transform: scale(1.05);
}
.method-implemented {
background: rgba(35, 134, 54, 0.2);
color: var(--accent-green-light);
border: 1px solid rgba(35, 134, 54, 0.3);
}
.method-not-implemented {
background: rgba(218, 54, 51, 0.2);
color: #ff7b72;
border: 1px solid rgba(218, 54, 51, 0.3);
}
.loading, .error {
text-align: center;
padding: 60px 20px;
border-radius: var(--radius);
background: var(--bg-secondary);
border: 1px solid var(--border-color);
}
.loading {
color: var(--text-secondary);
}
.error {
background: rgba(218, 54, 51, 0.1);
color: #ff7b72;
border-color: rgba(218, 54, 51, 0.3);
}
.loading-spinner {
width: 32px;
height: 32px;
border: 3px solid var(--border-color);
border-top: 3px solid var(--accent-blue);
border-radius: 50%;
animation: spin 1s linear infinite;
margin: 0 auto 15px auto;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
@media (max-width: 768px) {
.container {
padding: 15px;
}
.header h1 {
font-size: 2rem;
}
.class-header {
flex-direction: column;
align-items: flex-start;
}
.progress-section {
align-items: flex-start;
min-width: auto;
width: 100%;
}
.progress-bar {
width: 100%;
}
.filters {
flex-direction: column;
align-items: stretch;
}
.filter-input {
width: 100%;
}
.results-count {
margin-left: 0;
text-align: center;
}
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<h1>Pumpkin Block Implementation Tracker</h1>
<p>Tracking Rust implementation progress against Minecraft Java blocks</p>
</div>
<div id="overallProgress" class="overall-progress" style="display: none;">
<h2>Overall Implementation Progress</h2>
<div class="main-progress-bar">
<div class="main-progress-segments">
<div id="segmentFully" class="progress-segment segment-fully" style="width: 0%"></div>
<div id="segmentMostly" class="progress-segment segment-mostly" style="width: 0%"></div>
<div id="segmentPartially" class="progress-segment segment-partially" style="width: 0%"></div>
<div id="segmentBarely" class="progress-segment segment-barely" style="width: 0%"></div>
<div id="segmentNot" class="progress-segment segment-not" style="width: 0%"></div>
</div>
</div>
<div class="progress-text">
<span id="progressDetails">0 of 0 methods implemented</span>
<span id="progressPercentage">0.0%</span>
</div>
</div>
<div id="stats" class="stats-grid">
<!-- Stats will be populated here -->
</div>
<div class="filters">
<input type="text" id="searchInput" class="filter-input" placeholder="Search classes...">
<select id="statusFilter" class="filter-input">
<option value="">All Classes</option>
<option value="100">Fully Implemented (100%)</option>
<option value="75">Mostly Implemented (75-99%)</option>
<option value="25">Partially Implemented (25-74%)</option>
<option value="1">Barely Implemented (1-24%)</option>
<option value="0">Not Implemented (0%)</option>
</select>
<select id="sortSelect" class="filter-input">
<option value="name">Sort by Name</option>
<option value="progress-desc">Sort by Progress (High to Low)</option>
<option value="progress-asc">Sort by Progress (Low to High)</option>
<option value="methods-desc">Sort by Method Count (High to Low)</option>
</select>
<div id="resultsCount" class="results-count"></div>
</div>
<div id="loading" class="loading">
<div class="loading-spinner"></div>
Loading implementation data...
</div>
<div id="error" class="error" style="display: none;"></div>
<div id="classGrid" class="class-grid" style="display: none;"></div>
</div>
<script>
let classData = [];
let filteredData = [];
let jsonData = {};
// Mock data for demonstration since we don't have the JSON file
const mockData = {
classes: [
{
class_name: "BlockBase",
methods: [
{ method_name: "getStateForPlacement", status: "Implemented" },
{ method_name: "onPlace", status: "Not Implemented" },
{ method_name: "onBreak", status: "Implemented" },
{ method_name: "getDrops", status: "Not Implemented" }
]
},
{
class_name: "FluidBlock",
methods: [
{ method_name: "canFlowInto", status: "Implemented" },
{ method_name: "getFlowDirection", status: "Implemented" },
{ method_name: "spread", status: "Implemented" }
]
},
{
class_name: "CropBlock",
methods: [
{ method_name: "canGrow", status: "Not Implemented" },
{ method_name: "grow", status: "Not Implemented" },
{ method_name: "getGrowthStage", status: "Not Implemented" },
{ method_name: "isFullyGrown", status: "Not Implemented" }
]
}
]
};
async function loadData() {
try {
// Try to load real data first
const path =
'./outputs/pumpkin_blocks_analysis.json'
let response;
let loadedPath = '';
response = await fetch(path);
if (response.ok) {
loadedPath = path;
}
jsonData = await response.json();
console.log('Loaded JSON data:', jsonData);
// Handle different possible data structures
classData = jsonData.classes;
filteredData = [...classData];
document.getElementById('loading').style.display = 'none';
document.getElementById('overallProgress').style.display = 'block';
document.getElementById('classGrid').style.display = 'block';
renderOverallProgress();
renderStats();
renderClasses();
setupEventListeners();
updateResultsCount();
} catch (error) {
console.error('Error loading data:', error);
document.getElementById('loading').style.display = 'none';
const errorDiv = document.getElementById('error');
errorDiv.style.display = 'block';
errorDiv.innerHTML = `
<strong>Error loading data:</strong> ${error.message}<br>
Please ensure the JSON file is accessible and correctly formatted.
`;
}
}
function calculateStats() {
const stats = {
totalClasses: classData.length,
totalMethods: 0,
implementedMethods: 0,
fullyImplemented: 0,
mostlyImplemented: 0,
partiallyImplemented: 0,
barelyImplemented: 0,
notImplemented: 0
};
classData.forEach(classItem => {
const implemented = classItem.methods.filter(m => m.status === 'Implemented').length;
const total = classItem.methods.length;
const percentage = total === 0 ? 0 : (implemented / total) * 100;
stats.totalMethods += total;
stats.implementedMethods += implemented;
if (percentage === 100) stats.fullyImplemented++;
else if (percentage >= 75) stats.mostlyImplemented++;
else if (percentage >= 25) stats.partiallyImplemented++;
else if (percentage > 0) stats.barelyImplemented++;
else stats.notImplemented++;
});
return stats;
}
function renderOverallProgress() {
const stats = calculateStats();
const totalClasses = stats.totalClasses;
if (totalClasses === 0) return;
// Calculate percentages for each segment
const fullyPerc = (stats.fullyImplemented / totalClasses) * 100;
const mostlyPerc = (stats.mostlyImplemented / totalClasses) * 100;
const partiallyPerc = (stats.partiallyImplemented / totalClasses) * 100;
const barelyPerc = (stats.barelyImplemented / totalClasses) * 100;
const notPerc = (stats.notImplemented / totalClasses) * 100;
// Update segment widths
const segmentFully = document.getElementById('segmentFully');
const segmentMostly = document.getElementById('segmentMostly');
const segmentPartially = document.getElementById('segmentPartially');
const segmentBarely = document.getElementById('segmentBarely');
const segmentNot = document.getElementById('segmentNot');
if (segmentFully) {
segmentFully.style.width = `${fullyPerc}%`;
segmentFully.title = `Fully Implemented: ${stats.fullyImplemented} classes (${fullyPerc.toFixed(1)}%)`;
}
if (segmentMostly) {
segmentMostly.style.width = `${mostlyPerc}%`;
segmentMostly.title = `Mostly Implemented: ${stats.mostlyImplemented} classes (${mostlyPerc.toFixed(1)}%)`;
}
if (segmentPartially) {
segmentPartially.style.width = `${partiallyPerc}%`;
segmentPartially.title = `Partially Implemented: ${stats.partiallyImplemented} classes (${partiallyPerc.toFixed(1)}%)`;
}
if (segmentBarely) {
segmentBarely.style.width = `${barelyPerc}%`;
segmentBarely.title = `Barely Implemented: ${stats.barelyImplemented} classes (${barelyPerc.toFixed(1)}%)`;
}
if (segmentNot) {
segmentNot.style.width = `${notPerc}%`;
segmentNot.title = `Not Implemented: ${stats.notImplemented} classes (${notPerc.toFixed(1)}%)`;
}
// Update text details
const overallMethodPercentage = stats.totalMethods === 0 ? 0 :
(stats.implementedMethods / stats.totalMethods) * 100;
const progressDetails = document.getElementById('progressDetails');
const progressPercentage = document.getElementById('progressPercentage');
if (progressDetails) {
progressDetails.textContent = `${stats.implementedMethods} of ${stats.totalMethods} methods implemented`;
}
if (progressPercentage) {
progressPercentage.textContent = `${overallMethodPercentage.toFixed(1)}%`;
}
}
function renderStats() {
const stats = calculateStats();
document.getElementById('stats').innerHTML = `
<div class="stat-card">
<div class="stat-number">${stats.totalClasses}</div>
<div class="stat-label">Total Classes</div>
</div>
<div class="stat-card">
<div class="stat-number">${stats.fullyImplemented}</div>
<div class="stat-label">Fully Implemented</div>
</div>
<div class="stat-card">
<div class="stat-number">${stats.mostlyImplemented}</div>
<div class="stat-label">Mostly Implemented</div>
</div>
<div class="stat-card">
<div class="stat-number">${stats.partiallyImplemented}</div>
<div class="stat-label">Partially Implemented</div>
</div>
<div class="stat-card">
<div class="stat-number">${stats.barelyImplemented}</div>
<div class="stat-label">Barely Implemented</div>
</div>
<div class="stat-card">
<div class="stat-number">${stats.notImplemented}</div>
<div class="stat-label">Not Implemented</div>
</div>
`;
}
function getProgressClass(percentage) {
if (percentage === 100) return 'progress-100';
if (percentage >= 75) return 'progress-high';
if (percentage >= 25) return 'progress-medium';
if (percentage > 0) return 'progress-low';
return 'progress-0';
}
function renderClasses() {
const grid = document.getElementById('classGrid');
if (filteredData.length === 0) {
grid.innerHTML = `
<div style="text-align: center; padding: 40px; color: var(--text-secondary);">
No classes match the current filters.
</div>
`;
return;
}
grid.innerHTML = filteredData.map(classItem => {
const implemented = classItem.methods.filter(m => m.status === 'Implemented').length;
const total = classItem.methods.length;
const percentage = total === 0 ? 0 : (implemented / total) * 100;
const methodsHtml = classItem.methods.map(method => `
<span class="method-item ${method.status === 'Implemented' ? 'method-implemented' : 'method-not-implemented'}"
title="${method.method_name} - ${method.status}">
${method.method_name}
</span>
`).join('');
return `
<div class="class-card">
<div class="class-header">
<div class="class-name">${classItem.class_name}</div>
<div class="progress-section">
<div class="progress-text-small">
${implemented}/${total} methods (${percentage.toFixed(1)}%)
</div>
<div class="progress-bar">
<div class="progress-fill ${getProgressClass(percentage)}"
style="width: ${percentage}%"></div>
</div>
</div>
</div>
<div class="methods-list">
<div class="methods-title">Methods:</div>
${methodsHtml}
</div>
</div>
`;
}).join('');
}
function updateResultsCount() {
const count = filteredData.length;
const total = classData.length;
document.getElementById('resultsCount').textContent =
count === total ? `${total} classes` : `${count} of ${total} classes`;
}
function filterAndSortData() {
const searchTerm = document.getElementById('searchInput').value.toLowerCase();
const statusFilter = document.getElementById('statusFilter').value;
const sortBy = document.getElementById('sortSelect').value;
// Filter
filteredData = classData.filter(classItem => {
const matchesSearch = classItem.class_name.toLowerCase().includes(searchTerm);
if (!statusFilter) return matchesSearch;
const implemented = classItem.methods.filter(m => m.status === 'Implemented').length;
const total = classItem.methods.length;
const percentage = total === 0 ? 0 : (implemented / total) * 100;
let matchesStatus = false;
switch (statusFilter) {
case '100': matchesStatus = percentage === 100; break;
case '75': matchesStatus = percentage >= 75 && percentage < 100; break;
case '25': matchesStatus = percentage >= 25 && percentage < 75; break;
case '1': matchesStatus = percentage > 0 && percentage < 25; break;
case '0': matchesStatus = percentage === 0; break;
}
return matchesSearch && matchesStatus;
});
// Sort
filteredData.sort((a, b) => {
switch (sortBy) {
case 'name':
return a.class_name.localeCompare(b.class_name);
case 'methods-desc':
return b.methods.length - a.methods.length;
case 'progress-desc':
case 'progress-asc':
const aImpl = a.methods.filter(m => m.status === 'Implemented').length;
const aTotal = a.methods.length;
const aPerc = aTotal === 0 ? 0 : (aImpl / aTotal) * 100;
const bImpl = b.methods.filter(m => m.status === 'Implemented').length;
const bTotal = b.methods.length;
const bPerc = bTotal === 0 ? 0 : (bImpl / bTotal) * 100;
return sortBy === 'progress-desc' ? bPerc - aPerc : aPerc - bPerc;
default:
return 0;
}
});
renderClasses();
updateResultsCount();
}
function setupEventListeners() {
document.getElementById('searchInput').addEventListener('input', filterAndSortData);
document.getElementById('statusFilter').addEventListener('change', filterAndSortData);
document.getElementById('sortSelect').addEventListener('change', filterAndSortData);
}
// Load data when page loads
loadData();
</script>
</body>
</html>