Spaces:
Running
Running
Upload 8 files
Browse files- src/views/InstructorView.js +29 -5
src/views/InstructorView.js
CHANGED
|
@@ -146,8 +146,8 @@ export async function renderInstructorView() {
|
|
| 146 |
<button class="annotation-tool p-2 rounded-full hover:bg-gray-700 transition-colors ring-2 ring-transparent focus:outline-none" data-color="#3b82f6" onclick="setPenColor('#3b82f6', this)">
|
| 147 |
<div class="w-4 h-4 rounded-full bg-blue-500"></div>
|
| 148 |
</button>
|
| 149 |
-
<button class="annotation-tool p-2 rounded-full hover:bg-gray-700 transition-colors ring-2 ring-transparent focus:outline-none" data-color="#22c55e" onclick="setPenColor('#
|
| 150 |
-
<div class="w-4 h-4 rounded-full bg-
|
| 151 |
</button>
|
| 152 |
<div class="w-px h-6 bg-gray-600 mx-2"></div>
|
| 153 |
<button onclick="clearCanvas()" class="text-gray-400 hover:text-white text-sm font-bold px-2">
|
|
@@ -1086,17 +1086,41 @@ export function setupInstructorEvents() {
|
|
| 1086 |
const col = document.createElement('div');
|
| 1087 |
// Check overflow-hidden to keep it contained, use flex-row for compact header + content
|
| 1088 |
col.className = 'flex flex-row h-full bg-gray-900 p-4 overflow-hidden';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1089 |
col.innerHTML = `
|
| 1090 |
<div class="w-48 flex-shrink-0 border-r border-gray-700 pr-4 mr-4 flex flex-col justify-center">
|
| 1091 |
-
<h3 class="text-xl font-bold text-cyan-400 mb-1 comparison-author"
|
| 1092 |
<p class="text-md text-gray-400 truncate" title="${item.title}">${item.title}</p>
|
| 1093 |
</div>
|
| 1094 |
-
<!-- Prompt Content: Larger Text -->
|
| 1095 |
-
<div class="flex-1 overflow-y-auto font-mono text-green-300 text-
|
| 1096 |
${item.prompt}
|
| 1097 |
</div>
|
| 1098 |
`;
|
| 1099 |
grid.appendChild(col);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1100 |
});
|
| 1101 |
|
| 1102 |
document.getElementById('prompt-list-modal').classList.add('hidden');
|
|
|
|
| 146 |
<button class="annotation-tool p-2 rounded-full hover:bg-gray-700 transition-colors ring-2 ring-transparent focus:outline-none" data-color="#3b82f6" onclick="setPenColor('#3b82f6', this)">
|
| 147 |
<div class="w-4 h-4 rounded-full bg-blue-500"></div>
|
| 148 |
</button>
|
| 149 |
+
<button class="annotation-tool p-2 rounded-full hover:bg-gray-700 transition-colors ring-2 ring-transparent focus:outline-none" data-color="#22c55e" onclick="setPenColor('#eab308', this)">
|
| 150 |
+
<div class="w-4 h-4 rounded-full bg-yellow-500"></div>
|
| 151 |
</button>
|
| 152 |
<div class="w-px h-6 bg-gray-600 mx-2"></div>
|
| 153 |
<button onclick="clearCanvas()" class="text-gray-400 hover:text-white text-sm font-bold px-2">
|
|
|
|
| 1086 |
const col = document.createElement('div');
|
| 1087 |
// Check overflow-hidden to keep it contained, use flex-row for compact header + content
|
| 1088 |
col.className = 'flex flex-row h-full bg-gray-900 p-4 overflow-hidden';
|
| 1089 |
+
|
| 1090 |
+
// Logic for anonymous
|
| 1091 |
+
let displayAuthor = item.author;
|
| 1092 |
+
let blurClass = '';
|
| 1093 |
+
|
| 1094 |
+
if (isAnonymous) {
|
| 1095 |
+
displayAuthor = '學員';
|
| 1096 |
+
blurClass = 'blur-sm'; // Initial blur
|
| 1097 |
+
// Auto remove blur after delay if needed, or keep it?
|
| 1098 |
+
// Toggle logic removes it after delay. But initial render should probably just be static '學員' or blurred.
|
| 1099 |
+
// The toggle logic uses dataset.original. We need to set it here too.
|
| 1100 |
+
}
|
| 1101 |
+
|
| 1102 |
col.innerHTML = `
|
| 1103 |
<div class="w-48 flex-shrink-0 border-r border-gray-700 pr-4 mr-4 flex flex-col justify-center">
|
| 1104 |
+
<h3 class="text-xl font-bold text-cyan-400 mb-1 comparison-author ${blurClass}" data-original="${item.author}">${displayAuthor}</h3>
|
| 1105 |
<p class="text-md text-gray-400 truncate" title="${item.title}">${item.title}</p>
|
| 1106 |
</div>
|
| 1107 |
+
<!-- Prompt Content: Larger Text (text-4xl) -->
|
| 1108 |
+
<div class="flex-1 overflow-y-auto font-mono text-green-300 text-4xl leading-relaxed whitespace-pre-wrap p-2 hover:bg-white/5 transition-colors rounded custom-scrollbar">
|
| 1109 |
${item.prompt}
|
| 1110 |
</div>
|
| 1111 |
`;
|
| 1112 |
grid.appendChild(col);
|
| 1113 |
+
|
| 1114 |
+
// If blurred, remove blur after animation purely for effect, or keep?
|
| 1115 |
+
// User intention "Hidden Name" usually means "Replaced by generic name".
|
| 1116 |
+
// The blur effect in toggle logic was transient.
|
| 1117 |
+
// If we want persistent anonymity, just "學員" is enough.
|
| 1118 |
+
// The existing toggle logic adds 'blur-sm' then removes it in 300ms.
|
| 1119 |
+
// We should replicate that effect if we want consistency, or just skip blur on init.
|
| 1120 |
+
if (isAnonymous) {
|
| 1121 |
+
const el = col.querySelector('.comparison-author');
|
| 1122 |
+
setTimeout(() => el.classList.remove('blur-sm'), 300);
|
| 1123 |
+
}
|
| 1124 |
});
|
| 1125 |
|
| 1126 |
document.getElementById('prompt-list-modal').classList.add('hidden');
|