Spaces:
Running
Running
Upload 8 files
Browse files- src/views/InstructorView.js +20 -18
src/views/InstructorView.js
CHANGED
|
@@ -864,17 +864,18 @@ export function setupInstructorEvents() {
|
|
| 864 |
|
| 865 |
prompts.forEach(p => {
|
| 866 |
const card = document.createElement('div');
|
| 867 |
-
|
|
|
|
| 868 |
card.innerHTML = `
|
| 869 |
-
<div class="flex justify-between items-start mb-
|
| 870 |
-
<h3 class="font-bold text-white truncate w-3/4" title="${p.title}">${p.title}</h3>
|
| 871 |
-
<!-- Checkbox
|
| 872 |
-
<input type="checkbox" class="w-
|
| 873 |
data-id="${p.id}"
|
| 874 |
onchange="handlePromptSelection(this)">
|
| 875 |
</div>
|
| 876 |
-
<div class="bg-black/30 rounded p-
|
| 877 |
-
<div class="text-[10px] text-gray-500 text-right">${p.time}</div>
|
| 878 |
`;
|
| 879 |
container.appendChild(card);
|
| 880 |
});
|
|
@@ -948,24 +949,25 @@ export function setupInstructorEvents() {
|
|
| 948 |
const modal = document.getElementById('comparison-modal');
|
| 949 |
const grid = document.getElementById('comparison-grid');
|
| 950 |
|
| 951 |
-
// Setup Grid
|
| 952 |
-
let
|
| 953 |
-
if (items.length === 2)
|
| 954 |
-
if (items.length === 3)
|
| 955 |
|
| 956 |
-
grid.className = `absolute inset-0 grid ${
|
| 957 |
grid.innerHTML = '';
|
| 958 |
|
| 959 |
items.forEach(item => {
|
| 960 |
const col = document.createElement('div');
|
| 961 |
-
|
|
|
|
| 962 |
col.innerHTML = `
|
| 963 |
-
<div class="
|
| 964 |
-
<h3 class="text-
|
| 965 |
-
<p class="text-
|
| 966 |
</div>
|
| 967 |
-
<!-- Prompt Content:
|
| 968 |
-
<div class="flex-1 overflow-y-auto font-mono text-green-300 text-
|
| 969 |
${item.prompt}
|
| 970 |
</div>
|
| 971 |
`;
|
|
|
|
| 864 |
|
| 865 |
prompts.forEach(p => {
|
| 866 |
const card = document.createElement('div');
|
| 867 |
+
// Reduced height (h-64 -> h-48) and padding, but larger text inside
|
| 868 |
+
card.className = 'bg-gray-800 rounded-xl p-3 border border-gray-700 hover:border-cyan-500 transition-colors flex flex-col h-48 group';
|
| 869 |
card.innerHTML = `
|
| 870 |
+
<div class="flex justify-between items-start mb-1.5">
|
| 871 |
+
<h3 class="font-bold text-white text-base truncate w-3/4" title="${p.title}">${p.title}</h3>
|
| 872 |
+
<!-- Checkbox -->
|
| 873 |
+
<input type="checkbox" class="w-6 h-6 rounded border-gray-600 text-purple-600 focus:ring-purple-500 bg-gray-700 prompt-select-checkbox cursor-pointer transform scale-110"
|
| 874 |
data-id="${p.id}"
|
| 875 |
onchange="handlePromptSelection(this)">
|
| 876 |
</div>
|
| 877 |
+
<div class="bg-black/30 rounded p-2 flex-1 overflow-y-auto font-mono text-green-300 whitespace-pre-wrap custom-scrollbar text-base leading-snug group-hover:text-green-200 transaction-colors">${p.prompt}</div>
|
| 878 |
+
<div class="text-[10px] text-gray-500 text-right mt-1">${p.time}</div>
|
| 879 |
`;
|
| 880 |
container.appendChild(card);
|
| 881 |
});
|
|
|
|
| 949 |
const modal = document.getElementById('comparison-modal');
|
| 950 |
const grid = document.getElementById('comparison-grid');
|
| 951 |
|
| 952 |
+
// Setup Grid Rows (Vertical Stacking)
|
| 953 |
+
let rowClass = 'grid-rows-1';
|
| 954 |
+
if (items.length === 2) rowClass = 'grid-rows-2';
|
| 955 |
+
if (items.length === 3) rowClass = 'grid-rows-3';
|
| 956 |
|
| 957 |
+
grid.className = `absolute inset-0 grid ${rowClass} gap-0 divide-y divide-gray-600`;
|
| 958 |
grid.innerHTML = '';
|
| 959 |
|
| 960 |
items.forEach(item => {
|
| 961 |
const col = document.createElement('div');
|
| 962 |
+
// Check overflow-hidden to keep it contained, use flex-row for compact header + content
|
| 963 |
+
col.className = 'flex flex-row h-full bg-gray-900 p-4 overflow-hidden';
|
| 964 |
col.innerHTML = `
|
| 965 |
+
<div class="w-48 flex-shrink-0 border-r border-gray-700 pr-4 mr-4 flex flex-col justify-center">
|
| 966 |
+
<h3 class="text-xl font-bold text-cyan-400 mb-1">${item.author}</h3>
|
| 967 |
+
<p class="text-md text-gray-400 truncate" title="${item.title}">${item.title}</p>
|
| 968 |
</div>
|
| 969 |
+
<!-- Prompt Content: Larger Text -->
|
| 970 |
+
<div class="flex-1 overflow-y-auto font-mono text-green-300 text-2xl leading-relaxed whitespace-pre-wrap p-2 hover:bg-white/5 transition-colors rounded custom-scrollbar">
|
| 971 |
${item.prompt}
|
| 972 |
</div>
|
| 973 |
`;
|