Spaces:
Running
Running
Upload 9 files
Browse files- src/views/InstructorView.js +11 -11
src/views/InstructorView.js
CHANGED
|
@@ -467,7 +467,7 @@ export function setupInstructorEvents() {
|
|
| 467 |
const floatDelay = Math.random() * 2;
|
| 468 |
|
| 469 |
card.innerHTML = `
|
| 470 |
-
<
|
| 471 |
<div class="mb-1 text-center bg-gray-900/60 backdrop-blur-sm rounded-lg px-2 py-1 border border-gray-600/30 group-hover/card:bg-gray-800 group-hover/card:border-cyan-500/50 transition-all opacity-80 group-hover/card:opacity-100 transform translate-y-2 group-hover/card:translate-y-0 duration-300">
|
| 472 |
<div class="text-[10px] text-gray-300 mb-0.5 whitespace-nowrap">${monster.name.split(' ')[1] || monster.name}</div>
|
| 473 |
<div class="flex items-center justify-center space-x-2">
|
|
@@ -479,14 +479,14 @@ export function setupInstructorEvents() {
|
|
| 479 |
</div>
|
| 480 |
</div>
|
| 481 |
|
| 482 |
-
<!--Monster Image--
|
| 483 |
<div class="monster-img-container relative ${sizeClass} flex items-center justify-center transform group-hover/card:scale-125 transition-transform duration-300" style="animation: float 3s ease-in-out infinite; animation-delay: -${floatDelay}s;">
|
| 484 |
<div class="w-full h-full pixel-art drop-shadow-md filter group-hover/card:brightness-110 transition-all">
|
| 485 |
${generateMonsterSVG(monster)}
|
| 486 |
</div>
|
| 487 |
</div>
|
| 488 |
|
| 489 |
-
<!--Bottom Info: User Nickname--
|
| 490 |
<div class="mt-1 text-center bg-black/60 backdrop-blur-sm rounded-full px-3 py-0.5 border border-gray-600/50 group-hover/card:bg-cyan-900/80 group-hover/card:border-cyan-400 transition-all">
|
| 491 |
<div class="text-xs font-bold text-white shadow-black drop-shadow-md whitespace-nowrap tracking-wide">${s.nickname}</div>
|
| 492 |
</div>
|
|
@@ -628,17 +628,17 @@ function renderTransposedHeatmap(students) {
|
|
| 628 |
// Sticky Top for Header Row
|
| 629 |
// Sticky Left for the first cell ("Challenge/Student")
|
| 630 |
let headerHtml = `
|
| 631 |
-
<
|
| 632 |
<div class="flex justify-between items-end">
|
| 633 |
<span class="text-sm text-gray-400">題目</span>
|
| 634 |
<span class="text-sm text-cyan-400">學員 (${students.length})</span>
|
| 635 |
</div>
|
| 636 |
-
</th
|
| 637 |
`;
|
| 638 |
|
| 639 |
students.forEach(student => {
|
| 640 |
headerHtml += `
|
| 641 |
-
<
|
| 642 |
<div class="flex flex-col items-center space-y-2 py-2">
|
| 643 |
<div class="w-8 h-8 rounded-full bg-gradient-to-br from-gray-700 to-gray-600 flex items-center justify-center text-xs font-bold text-white uppercase border border-gray-500 shadow-sm relative">
|
| 644 |
${student.nickname[0]}
|
|
@@ -654,7 +654,7 @@ function renderTransposedHeatmap(students) {
|
|
| 654 |
</button>
|
| 655 |
</div>
|
| 656 |
</div>
|
| 657 |
-
</th
|
| 658 |
`;
|
| 659 |
});
|
| 660 |
thead.innerHTML = headerHtml;
|
|
@@ -699,17 +699,17 @@ function renderTransposedHeatmap(students) {
|
|
| 699 |
}
|
| 700 |
|
| 701 |
return `
|
| 702 |
-
<
|
| 703 |
<div class="mx-auto w-10 h-10 rounded-lg border flex items-center justify-center ${statusClass} transition-all duration-300" ${action}>
|
| 704 |
${content}
|
| 705 |
</div>
|
| 706 |
-
</td
|
| 707 |
`;
|
| 708 |
}).join('');
|
| 709 |
|
| 710 |
// Row Header (Challenge Title)
|
| 711 |
return `
|
| 712 |
-
<
|
| 713 |
<td class="p-3 sticky left-0 bg-gray-900 z-10 border-r border-b border-gray-700 shadow-md">
|
| 714 |
<div class="flex items-center justify-between">
|
| 715 |
<div class="flex flex-col">
|
|
@@ -721,7 +721,7 @@ function renderTransposedHeatmap(students) {
|
|
| 721 |
</div>
|
| 722 |
</td>
|
| 723 |
${rowCells}
|
| 724 |
-
</tr
|
| 725 |
`;
|
| 726 |
}).join('');
|
| 727 |
}
|
|
|
|
| 467 |
const floatDelay = Math.random() * 2;
|
| 468 |
|
| 469 |
card.innerHTML = `
|
| 470 |
+
<!--Top Info: Monster Stats-->
|
| 471 |
<div class="mb-1 text-center bg-gray-900/60 backdrop-blur-sm rounded-lg px-2 py-1 border border-gray-600/30 group-hover/card:bg-gray-800 group-hover/card:border-cyan-500/50 transition-all opacity-80 group-hover/card:opacity-100 transform translate-y-2 group-hover/card:translate-y-0 duration-300">
|
| 472 |
<div class="text-[10px] text-gray-300 mb-0.5 whitespace-nowrap">${monster.name.split(' ')[1] || monster.name}</div>
|
| 473 |
<div class="flex items-center justify-center space-x-2">
|
|
|
|
| 479 |
</div>
|
| 480 |
</div>
|
| 481 |
|
| 482 |
+
<!--Monster Image-->
|
| 483 |
<div class="monster-img-container relative ${sizeClass} flex items-center justify-center transform group-hover/card:scale-125 transition-transform duration-300" style="animation: float 3s ease-in-out infinite; animation-delay: -${floatDelay}s;">
|
| 484 |
<div class="w-full h-full pixel-art drop-shadow-md filter group-hover/card:brightness-110 transition-all">
|
| 485 |
${generateMonsterSVG(monster)}
|
| 486 |
</div>
|
| 487 |
</div>
|
| 488 |
|
| 489 |
+
<!--Bottom Info: User Nickname-->
|
| 490 |
<div class="mt-1 text-center bg-black/60 backdrop-blur-sm rounded-full px-3 py-0.5 border border-gray-600/50 group-hover/card:bg-cyan-900/80 group-hover/card:border-cyan-400 transition-all">
|
| 491 |
<div class="text-xs font-bold text-white shadow-black drop-shadow-md whitespace-nowrap tracking-wide">${s.nickname}</div>
|
| 492 |
</div>
|
|
|
|
| 628 |
// Sticky Top for Header Row
|
| 629 |
// Sticky Left for the first cell ("Challenge/Student")
|
| 630 |
let headerHtml = `
|
| 631 |
+
<th class="p-3 text-left sticky left-0 top-0 bg-gray-800 z-30 border-b border-gray-600 min-w-[200px] border-r border-gray-700 shadow-md">
|
| 632 |
<div class="flex justify-between items-end">
|
| 633 |
<span class="text-sm text-gray-400">題目</span>
|
| 634 |
<span class="text-sm text-cyan-400">學員 (${students.length})</span>
|
| 635 |
</div>
|
| 636 |
+
</th>
|
| 637 |
`;
|
| 638 |
|
| 639 |
students.forEach(student => {
|
| 640 |
headerHtml += `
|
| 641 |
+
<th class="p-2 text-center sticky top-0 bg-gray-800 z-20 border-b border-gray-700 min-w-[80px] group">
|
| 642 |
<div class="flex flex-col items-center space-y-2 py-2">
|
| 643 |
<div class="w-8 h-8 rounded-full bg-gradient-to-br from-gray-700 to-gray-600 flex items-center justify-center text-xs font-bold text-white uppercase border border-gray-500 shadow-sm relative">
|
| 644 |
${student.nickname[0]}
|
|
|
|
| 654 |
</button>
|
| 655 |
</div>
|
| 656 |
</div>
|
| 657 |
+
</th>
|
| 658 |
`;
|
| 659 |
});
|
| 660 |
thead.innerHTML = headerHtml;
|
|
|
|
| 699 |
}
|
| 700 |
|
| 701 |
return `
|
| 702 |
+
<td class="p-1 border border-gray-800/50 text-center align-middle h-14 hover:bg-white/5 transition-colors">
|
| 703 |
<div class="mx-auto w-10 h-10 rounded-lg border flex items-center justify-center ${statusClass} transition-all duration-300" ${action}>
|
| 704 |
${content}
|
| 705 |
</div>
|
| 706 |
+
</td>
|
| 707 |
`;
|
| 708 |
}).join('');
|
| 709 |
|
| 710 |
// Row Header (Challenge Title)
|
| 711 |
return `
|
| 712 |
+
<tr class="hover:bg-gray-800/50 transition-colors">
|
| 713 |
<td class="p-3 sticky left-0 bg-gray-900 z-10 border-r border-b border-gray-700 shadow-md">
|
| 714 |
<div class="flex items-center justify-between">
|
| 715 |
<div class="flex flex-col">
|
|
|
|
| 721 |
</div>
|
| 722 |
</td>
|
| 723 |
${rowCells}
|
| 724 |
+
</tr>
|
| 725 |
`;
|
| 726 |
}).join('');
|
| 727 |
}
|