feat: Implement dark mode support by adjusting background and text colors across various pages and components.

This commit is contained in:
2026-02-26 16:57:28 -03:00
parent 947abcb0bc
commit e5373919c9
56 changed files with 536 additions and 517 deletions
@@ -177,18 +177,18 @@ export default function AudioResponsePlayer({
return (
<div className="space-y-6" id={id}>
<div className="p-8 glass border-white/5 rounded-3xl space-y-6">
<div className="p-8 glass border-black/5 dark:border-white/5 rounded-3xl space-y-6 bg-black/[0.02] dark:bg-black/20">
<div className="flex items-start gap-4">
<div className="p-3 bg-purple-500/20 rounded-xl">
<Mic className="w-6 h-6 text-purple-400" />
<div className="p-3 bg-purple-600/10 dark:bg-purple-500/20 rounded-xl">
<Mic className="w-6 h-6 text-purple-600 dark:text-purple-400" />
</div>
<div className="flex-1">
<h3 id={`audio-prompt-${id}`} className="text-xl font-bold text-gray-100">{prompt}</h3>
<h3 id={`audio-prompt-${id}`} className="text-xl font-bold text-gray-900 dark:text-gray-100">{prompt}</h3>
{keywords.length > 0 && !submitted && (
<div className="flex flex-wrap gap-2 mt-3">
<span className="text-xs text-gray-500 uppercase tracking-wider">Expected topics:</span>
<span className="text-xs text-gray-500 dark:text-gray-500 uppercase tracking-wider">Expected topics:</span>
{keywords.map((kw, i) => (
<span key={i} className="px-2 py-1 bg-purple-500/10 border border-purple-500/20 rounded text-xs text-purple-300">
<span key={i} className="px-2 py-1 bg-purple-600/10 dark:bg-purple-500/10 border border-purple-600/20 dark:border-purple-500/20 rounded text-xs text-purple-700 dark:text-purple-300">
{kw}
</span>
))}
@@ -222,9 +222,9 @@ export default function AudioResponsePlayer({
aria-label={`Recording time: ${formatTime(recordingTime)}`}
>
<div className="w-3 h-3 bg-red-500 rounded-full animate-pulse" aria-hidden="true" />
<span className="font-mono text-xl font-bold text-red-400">{formatTime(recordingTime)}</span>
<span className="font-mono text-xl font-bold text-red-600 dark:text-red-400">{formatTime(recordingTime)}</span>
{timeLimit && (
<span className="text-sm text-gray-400">/ {formatTime(timeLimit)}</span>
<span className="text-sm text-gray-500 dark:text-gray-400">/ {formatTime(timeLimit)}</span>
)}
</div>
<button
@@ -250,7 +250,7 @@ export default function AudioResponsePlayer({
</button>
<button
onClick={reset}
className="flex items-center gap-2 px-6 py-3 glass hover:bg-white/10 rounded-xl font-bold text-gray-300 transition-all outline-none focus:ring-2 focus:ring-white/20"
className="flex items-center gap-2 px-6 py-3 glass hover:bg-black/5 dark:hover:bg-white/10 rounded-xl font-bold text-gray-600 dark:text-gray-300 transition-all outline-none focus:ring-2 focus:ring-black/10 dark:focus:ring-white/20 border-black/5 dark:border-white/5"
aria-label="Delete and re-record"
>
<RotateCcw className="w-4 h-4" aria-hidden="true" />
@@ -262,9 +262,9 @@ export default function AudioResponsePlayer({
{/* Transcript Preview */}
{transcript && !submitted && (
<div className="p-4 bg-white/5 border border-white/10 rounded-xl">
<p className="text-xs text-gray-500 uppercase tracking-wider mb-2">Transcript:</p>
<p className="text-sm text-gray-300">{transcript}</p>
<div className="p-4 bg-black/5 dark:bg-white/5 border border-black/5 dark:border-white/10 rounded-xl">
<p className="text-xs text-gray-500 dark:text-gray-500 uppercase tracking-wider mb-2">Transcript:</p>
<p className="text-sm text-gray-700 dark:text-gray-300">{transcript}</p>
</div>
)}
@@ -285,16 +285,16 @@ export default function AudioResponsePlayer({
<div className="space-y-4">
<div
className={`p-6 rounded-2xl border-2 ${evaluation.score >= 70
? 'bg-green-500/10 border-green-500'
? 'bg-green-500/10 border-green-600 dark:border-green-500'
: evaluation.score >= 40
? 'bg-yellow-500/10 border-yellow-500'
: 'bg-red-500/10 border-red-500'
? 'bg-yellow-500/10 border-yellow-600 dark:border-yellow-500'
: 'bg-red-500/10 border-red-600 dark:border-red-500'
}`}
aria-live="assertive"
>
<div className="flex items-center justify-between mb-4">
<span className="text-sm font-bold uppercase tracking-wider text-gray-400">Your Score</span>
<span className="text-3xl font-black">{evaluation.score}%</span>
<span className="text-sm font-bold uppercase tracking-wider text-gray-500 dark:text-gray-400">Your Score</span>
<span className="text-3xl font-black text-gray-900 dark:text-white">{evaluation.score}%</span>
</div>
{keywords.length > 0 && (
@@ -306,9 +306,9 @@ export default function AudioResponsePlayer({
return (
<span
key={i}
className={`px-3 py-1 rounded-lg text-sm font-medium flex items-center gap-1 ${found
? 'bg-green-500/20 border border-green-500/50 text-green-300'
: 'bg-gray-500/20 border border-gray-500/50 text-gray-400'
className={`px-3 py-1 rounded-lg text-sm font-bold flex items-center gap-1 ${found
? 'bg-green-600/10 dark:bg-green-500/20 border border-green-600/20 dark:border-green-500/50 text-green-700 dark:text-green-300'
: 'bg-gray-500/10 dark:bg-gray-500/20 border border-gray-600/20 dark:border-gray-500/50 text-gray-600 dark:text-gray-400'
}`}
>
{found ? <Check className="w-3 h-3" /> : <X className="w-3 h-3" />}
@@ -326,25 +326,25 @@ export default function AudioResponsePlayer({
<div className="absolute top-0 right-0 p-4 opacity-5 group-hover:opacity-10 transition-opacity">
<BrainCircuit className="w-20 h-20 text-blue-400" />
</div>
<div className="flex items-center gap-2 text-xs font-black uppercase tracking-widest text-blue-400">
<div className="flex items-center gap-2 text-xs font-black uppercase tracking-widest text-blue-600 dark:text-blue-400">
<BrainCircuit className="w-4 h-4" />
AI Teacher Feedback
</div>
<p className="text-gray-200 leading-relaxed italic text-lg relative z-10">
<p className="text-gray-800 dark:text-gray-200 leading-relaxed italic text-lg relative z-10">
&quot;{evaluation.feedback}&quot;
</p>
</div>
)}
<div className="p-4 bg-white/5 border border-white/10 rounded-xl">
<div className="p-4 bg-black/5 dark:bg-white/5 border border-black/5 dark:border-white/10 rounded-xl">
<p className="text-xs text-gray-500 uppercase tracking-wider mb-2">Your Transcript:</p>
<p className="text-sm text-gray-300">{transcript}</p>
<p className="text-sm text-gray-700 dark:text-gray-300">{transcript}</p>
</div>
{!isGraded && evaluation.score < 70 && (
<button
onClick={reset}
className="w-full py-4 glass hover:bg-white/10 rounded-xl font-bold text-blue-400 transition-all"
className="w-full py-4 glass hover:bg-black/5 dark:hover:bg-white/10 rounded-xl font-bold text-blue-600 dark:text-blue-400 border-black/5 dark:border-white/5 transition-all"
>
Try Again
</button>
@@ -58,22 +58,22 @@ export default function CodeExercisePlayer({
return (
<div className="flex flex-col gap-6 animate-in fade-in duration-700">
<div className="glass-card p-6 border-white/5">
<div className="glass-card p-6 border-black/5 dark:border-white/5 bg-black/[0.02] dark:bg-black/20">
<div className="flex items-center gap-3 mb-4">
<div className="p-2 rounded-lg bg-indigo-500/10 text-indigo-400">
<div className="p-2 rounded-lg bg-indigo-600/10 dark:bg-indigo-500/10 text-indigo-600 dark:text-indigo-400">
<Code2 size={24} />
</div>
<h2 className="text-xl font-black tracking-tight">{title}</h2>
<h2 className="text-xl font-black tracking-tight text-gray-900 dark:text-white">{title}</h2>
</div>
<div className="prose prose-invert max-w-none text-gray-400 text-sm leading-relaxed">
<div className="prose dark:prose-invert max-w-none text-gray-600 dark:text-gray-400 text-sm leading-relaxed">
{instructions}
</div>
</div>
<div className="grid grid-cols-1 lg:grid-cols-2 gap-4 h-[500px]">
{/* Editor Area */}
<div className="flex flex-col rounded-2xl overflow-hidden border border-white/5 bg-[#1a1c21]">
<div className="px-4 py-2 bg-white/5 border-b border-white/5 flex items-center justify-between text-[10px] font-black uppercase tracking-widest text-gray-500">
<div className="flex flex-col rounded-2xl overflow-hidden border border-black/5 dark:border-white/5 bg-[#1a1c21]">
<div className="px-4 py-2 bg-black/40 dark:bg-white/5 border-b border-black/5 dark:border-white/5 flex items-center justify-between text-[10px] font-black uppercase tracking-widest text-gray-400 dark:text-gray-500">
<span>main.py</span>
<div className="flex gap-2">
<div className="w-2 h-2 rounded-full bg-red-500/20" />
@@ -87,7 +87,7 @@ export default function CodeExercisePlayer({
className="flex-1 bg-transparent p-6 font-mono text-sm resize-none focus:outline-none text-indigo-100 selection:bg-indigo-500/30"
spellCheck={false}
/>
<div className="p-4 bg-black/20 border-t border-white/5 flex gap-2">
<div className="p-4 bg-black/40 dark:bg-black/20 border-t border-black/5 dark:border-white/5 flex gap-2">
<button
onClick={runCode}
disabled={status === "running"}
@@ -111,12 +111,12 @@ export default function CodeExercisePlayer({
</div>
{/* Console / Results Area */}
<div className="flex flex-col rounded-2xl overflow-hidden border border-white/5 bg-black/40">
<div className="px-4 py-2 bg-white/5 border-b border-white/5 text-[10px] font-black uppercase tracking-widest text-gray-500">
<div className="flex flex-col rounded-2xl overflow-hidden border border-black/5 dark:border-white/5 bg-black/[0.05] dark:bg-black/40">
<div className="px-4 py-2 bg-black/10 dark:bg-white/5 border-b border-black/5 dark:border-white/5 text-[10px] font-black uppercase tracking-widest text-gray-500">
Console Output
</div>
<div className="flex-1 p-6 font-mono text-sm overflow-auto">
{!output && <span className="text-gray-600 italic">Click &quot;Run Code&quot; to execute tests...</span>}
{!output && <span className="text-gray-500 dark:text-gray-600 italic">Click &quot;Run Code&quot; to execute tests...</span>}
{output && (
<pre className={`whitespace-pre-wrap ${status === "success" ? "text-green-400" :
status === "error" ? "text-red-400" :
@@ -13,12 +13,12 @@ export default function DescriptionPlayer({ id, title, content }: DescriptionPla
return (
<div className="space-y-8" id={id}>
<div className="space-y-2">
<h3 className="text-xl font-bold border-l-4 border-blue-500 pl-4 py-1 tracking-tight text-white uppercase tracking-widest text-[10px]">
<h3 className="text-xl font-bold border-l-4 border-blue-600 dark:border-blue-500 pl-4 py-1 tracking-tight text-gray-900 dark:text-white uppercase tracking-widest text-[10px]">
{title || "Resumen"}
</h3>
</div>
<div className="prose prose-invert prose-lg max-w-none prose-p:text-gray-300 prose-p:leading-relaxed prose-p:font-medium prose-headings:text-white prose-a:text-blue-400 prose-img:rounded-2xl prose-img:shadow-2xl">
<div className="prose dark:prose-invert prose-lg max-w-none prose-p:text-gray-700 dark:prose-p:text-gray-300 prose-p:leading-relaxed prose-p:font-medium prose-headings:text-gray-900 dark:prose-headings:text-white prose-a:text-blue-600 dark:prose-a:text-blue-400 prose-img:rounded-2xl prose-img:shadow-2xl">
<ReactMarkdown urlTransform={getImageUrl}>{content}</ReactMarkdown>
</div>
</div>
@@ -26,14 +26,14 @@ export default function DocumentPlayer({ id, title, url }: DocumentPlayerProps)
return (
<div className="space-y-6" id={id}>
<div className="flex items-center justify-between">
<h3 className="text-xs font-black uppercase tracking-widest text-gray-400">
<h3 className="text-xs font-black uppercase tracking-widest text-gray-500 dark:text-gray-400">
{title || "Material de Lectura"}
</h3>
</div>
<div className="relative">
{isPdf ? (
<div className="glass-card !p-0 overflow-hidden border-white/5 bg-white/5 aspect-[4/3] w-full group relative">
<div className="glass-card !p-0 overflow-hidden border-black/5 dark:border-white/5 bg-black/[0.02] dark:bg-white/5 aspect-[4/3] w-full group relative">
<iframe
src={`${displayUrl}#view=FitH&toolbar=0`}
className="w-full h-full border-none"
@@ -41,7 +41,7 @@ export default function DocumentPlayer({ id, title, url }: DocumentPlayerProps)
/>
{/* Overlay Controls */}
<div className="absolute bottom-0 inset-x-0 p-4 bg-gradient-to-t from-black to-transparent opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-between">
<div className="absolute bottom-0 inset-x-0 p-4 bg-gradient-to-t from-black/80 to-transparent opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-between">
<span className="text-[10px] font-black uppercase tracking-widest text-white/50 flex items-center gap-2">
<Eye size={12} /> Vista Previa
</span>
@@ -65,13 +65,13 @@ export default function DocumentPlayer({ id, title, url }: DocumentPlayerProps)
</div>
</div>
) : (
<div className="glass-card p-12 flex flex-col items-center text-center gap-6 border-white/5 bg-white/5">
<div className="glass-card p-12 flex flex-col items-center text-center gap-6 border-black/5 dark:border-white/5 bg-black/[0.02] dark:bg-white/5">
<div className="w-20 h-20 rounded-2xl bg-blue-500/10 flex items-center justify-center text-blue-400">
<FileText size={40} />
</div>
<div>
<p className="text-xl font-bold text-white mb-2">Documento Adjunto</p>
<p className="text-sm text-gray-500 max-w-sm mx-auto uppercase tracking-widest font-black leading-relaxed">
<p className="text-xl font-bold text-gray-900 dark:text-white mb-2">Documento Adjunto</p>
<p className="text-sm text-gray-600 dark:text-gray-500 max-w-sm mx-auto uppercase tracking-widest font-black leading-relaxed">
Este archivo no puede previsualizarse. Descárgalo para leerlo.
</p>
</div>
@@ -45,13 +45,13 @@ export default function FillInTheBlanksPlayer({ id, title, content, allowRetry =
return (
<div className="space-y-8" id={id}>
<div className="space-y-2">
<h3 className="text-xl font-bold border-l-4 border-blue-500 pl-4 py-1 tracking-tight text-white uppercase tracking-widest text-[10px]">
<h3 className="text-xl font-bold border-l-4 border-blue-600 dark:border-blue-500 pl-4 py-1 tracking-tight text-gray-900 dark:text-white uppercase tracking-widest text-[10px]">
{title || "Rellena los Espacios en Blanco"}
</h3>
</div>
<div className="p-8 glass border-white/5 rounded-3xl space-y-8">
<div className="text-lg leading-loose text-gray-100">
<div className="p-8 glass border-black/5 dark:border-white/5 rounded-3xl space-y-8 bg-black/[0.02] dark:bg-black/20">
<div className="text-lg leading-loose text-gray-800 dark:text-gray-100">
{parsed.parts.map((part, i) => (
part.type === 'text' ? (
<span key={i}>{part.value}</span>
@@ -67,8 +67,8 @@ export default function FillInTheBlanksPlayer({ id, title, content, allowRetry =
}}
disabled={submitted}
className={`mx-1 px-2 py-0 border-b-2 bg-transparent transition-all focus:outline-none text-center rounded-t-sm ${submitted
? (isCorrect(part.index!) ? "border-green-500 text-green-400 bg-green-500/10" : "border-red-500 text-red-100 bg-red-500/10")
: "border-blue-500/30 focus:border-blue-500 text-blue-400 focus:bg-blue-500/5"
? (isCorrect(part.index!) ? "border-green-600 dark:border-green-500 text-green-700 dark:text-green-400 bg-green-500/10" : "border-red-600 dark:border-red-500 text-red-700 dark:text-red-100 bg-red-500/10")
: "border-blue-600/30 dark:border-blue-500/30 focus:border-blue-600 dark:focus:border-blue-500 text-blue-700 dark:text-blue-400 focus:bg-blue-600/5 dark:focus:bg-blue-500/5"
}`}
style={{ width: `${Math.max((part.answer?.length || 5) * 12, 60)}px` }}
placeholder="..."
@@ -91,7 +91,7 @@ export default function FillInTheBlanksPlayer({ id, title, content, allowRetry =
{submitted && (
<button
onClick={handleReset}
className="w-full py-5 glass text-blue-400 font-black text-xs uppercase tracking-[0.2em] hover:bg-white/5 transition-all rounded-3xl border-white/5"
className="w-full py-5 glass text-blue-600 dark:text-blue-400 font-black text-xs uppercase tracking-[0.2em] hover:bg-black/5 dark:hover:bg-white/5 transition-all rounded-3xl border-black/5 dark:border-white/5"
>
Intentar de Nuevo
</button>
@@ -68,18 +68,18 @@ export default function HotspotPlayer({
return (
<div className="flex flex-col gap-6 animate-in fade-in zoom-in duration-700">
<div className="glass-card p-6 border-indigo-500/20 bg-indigo-500/5">
<div className="glass-card p-6 border-indigo-600/10 dark:border-indigo-500/20 bg-indigo-600/5 dark:bg-indigo-500/5">
<div className="flex items-center justify-between mb-4">
<div className="flex items-center gap-3">
<div className="p-3 rounded-2xl bg-amber-400 text-black shadow-lg shadow-amber-400/20">
<Search size={24} strokeWidth={3} />
</div>
<div>
<h2 className="text-xl font-black tracking-tight text-white">{title}</h2>
<p className="text-xs text-indigo-300 font-bold uppercase tracking-widest">{description}</p>
<h2 className="text-xl font-black tracking-tight text-gray-900 dark:text-white">{title}</h2>
<p className="text-xs text-indigo-600 dark:text-indigo-300 font-bold uppercase tracking-widest">{description}</p>
</div>
</div>
<div className="px-4 py-2 rounded-full bg-white/5 border border-white/10 text-xs font-black">
<div className="px-4 py-2 rounded-full bg-black/5 dark:bg-white/5 border border-black/5 dark:border-white/10 text-xs font-black text-gray-900 dark:text-white">
{found.length} / {hotspots.length} FOUND
</div>
</div>
@@ -88,7 +88,7 @@ export default function HotspotPlayer({
<div
ref={containerRef}
onClick={handleClick}
className="relative aspect-video rounded-3xl overflow-hidden border-4 border-white/10 bg-black cursor-crosshair group select-none shadow-2xl"
className="relative aspect-video rounded-3xl overflow-hidden border-4 border-black/5 dark:border-white/10 bg-black cursor-crosshair group select-none shadow-2xl"
>
<Image
src={getImageUrl(imageUrl)}
@@ -149,8 +149,8 @@ export default function HotspotPlayer({
<div
key={h.id}
className={`px-4 py-2 rounded-xl text-xs font-black tracking-widest uppercase transition-all flex items-center gap-2 ${found.includes(h.id)
? "bg-green-500 text-white translate-y-[-2px] shadow-lg shadow-green-500/20"
: "bg-white/5 text-gray-500 border border-white/5"
? "bg-green-600 dark:bg-green-500 text-white translate-y-[-2px] shadow-lg shadow-green-500/20"
: "bg-black/5 dark:bg-white/5 text-gray-500 dark:text-gray-500 border border-black/5 dark:border-white/5"
}`}
>
{found.includes(h.id) ? <CheckCircle size={14} /> : <div className="w-1 h-1 rounded-full bg-current" />}
@@ -40,21 +40,21 @@ export default function MatchingPlayer({ id, title, pairs, allowRetry = true }:
return (
<div className="space-y-8" id={id}>
<div className="space-y-2">
<h3 className="text-xl font-bold border-l-4 border-blue-500 pl-4 py-1 tracking-tight text-white uppercase tracking-widest text-[10px]">
<h3 className="text-xl font-bold border-l-4 border-blue-600 dark:border-blue-500 pl-4 py-1 tracking-tight text-gray-900 dark:text-white uppercase tracking-widest text-[10px]">
{title || "Emparejamiento de Conceptos"}
</h3>
</div>
<div className="grid grid-cols-1 md:grid-cols-2 gap-12 p-8 glass border-white/5 rounded-3xl relative">
<div className="grid grid-cols-1 md:grid-cols-2 gap-12 p-8 glass border-black/5 dark:border-white/5 rounded-3xl relative bg-black/[0.02] dark:bg-black/20">
<div className="space-y-4">
<label className="text-[10px] font-black uppercase tracking-widest text-gray-500 mb-4 block">Término</label>
<label className="text-[10px] font-black uppercase tracking-widest text-gray-500 dark:text-gray-400 mb-4 block">Término</label>
{(pairs || []).map((pair, i) => (
<button
key={i}
onClick={() => !submitted && setSelectedLeft(i)}
className={`w-full p-4 rounded-xl border text-left text-sm font-bold transition-all ${selectedLeft === i ? "border-blue-500 bg-blue-500/10 text-white shadow-lg" :
matches[i] !== undefined ? "border-blue-500/20 bg-blue-500/5 text-blue-400" :
"border-white/5 bg-white/5 text-gray-200 hover:border-white/20"
className={`w-full p-4 rounded-xl border text-left text-sm font-bold transition-all ${selectedLeft === i ? "border-blue-600 dark:border-blue-500 bg-blue-600/10 dark:bg-blue-500/10 text-blue-700 dark:text-white shadow-lg" :
matches[i] !== undefined ? "border-blue-600/20 dark:border-blue-500/20 bg-blue-600/5 dark:bg-blue-500/5 text-blue-700 dark:text-blue-400" :
"border-black/5 dark:border-white/5 bg-black/5 dark:bg-white/5 text-gray-800 dark:text-gray-200 hover:border-black/20 dark:hover:border-white/20"
}`}
>
{pair.left}
@@ -63,7 +63,7 @@ export default function MatchingPlayer({ id, title, pairs, allowRetry = true }:
</div>
<div className="space-y-4">
<label className="text-[10px] font-black uppercase tracking-widest text-gray-500 mb-4 block">Definición</label>
<label className="text-[10px] font-black uppercase tracking-widest text-gray-500 dark:text-gray-400 mb-4 block">Definición</label>
{shuffledRight.map((item, i) => {
const matchedLeftIdx = Object.keys(matches).find(k => matches[parseInt(k)] === item.originalIdx);
const isCorrect = submitted && matchedLeftIdx !== undefined && parseInt(matchedLeftIdx) === item.originalIdx;
@@ -74,11 +74,11 @@ export default function MatchingPlayer({ id, title, pairs, allowRetry = true }:
key={i}
disabled={selectedLeft === null || submitted}
onClick={() => handleMatch(selectedLeft!, item.originalIdx)}
className={`w-full p-4 rounded-xl border text-left text-sm font-bold transition-all ${selectedLeft !== null && matchedLeftIdx === undefined ? "hover:border-blue-500/50 hover:bg-white/5" : ""
} ${isCorrect ? "border-green-500 bg-green-500/20 text-green-400" :
isWrong ? "border-red-500 bg-red-500/20 text-red-100" :
matchedLeftIdx !== undefined ? "border-blue-500/30 bg-blue-500/5 text-blue-400" :
"border-white/5 bg-white/5 text-gray-200"
className={`w-full p-4 rounded-xl border text-left text-sm font-bold transition-all ${selectedLeft !== null && matchedLeftIdx === undefined ? "hover:border-blue-600/50 dark:hover:border-blue-500/50 hover:bg-black/5 dark:hover:bg-white/5" : ""
} ${isCorrect ? "border-green-600 dark:border-green-500 bg-green-500/20 text-green-700 dark:text-green-400" :
isWrong ? "border-red-600 dark:border-red-500 bg-red-500/20 text-red-700 dark:text-red-100" :
matchedLeftIdx !== undefined ? "border-blue-600/30 dark:border-blue-500/30 bg-blue-600/5 dark:bg-blue-500/5 text-blue-700 dark:text-blue-400" :
"border-black/5 dark:border-white/5 bg-black/5 dark:bg-white/5 text-gray-800 dark:text-gray-200"
}`}
>
<div className="flex items-center justify-between">
@@ -104,7 +104,7 @@ export default function MatchingPlayer({ id, title, pairs, allowRetry = true }:
{submitted && (
<button
onClick={handleReset}
className="w-full py-5 glass text-blue-400 font-black text-xs uppercase tracking-[0.2em] hover:bg-white/5 transition-all rounded-2xl border-white/5"
className="w-full py-5 glass text-blue-600 dark:text-blue-400 font-black text-xs uppercase tracking-[0.2em] hover:bg-black/5 dark:hover:bg-white/5 transition-all rounded-2xl border-black/5 dark:border-white/5"
>
Intentar de Nuevo
</button>
@@ -95,14 +95,14 @@ export default function MediaPlayer({ id, lessonId, title, url, media_type, conf
if (locked) {
return (
<div className="space-y-4" id={id}>
<h3 className="text-xs font-black uppercase tracking-widest text-gray-400">{title || "Contenido Multimedia"}</h3>
<div className="glass-card aspect-video flex flex-col items-center justify-center gap-6 border-red-500/20 bg-red-500/5">
<div className="w-16 h-16 rounded-full bg-red-500/10 flex items-center justify-center text-red-500">
<h3 className="text-xs font-black uppercase tracking-widest text-gray-500 dark:text-gray-400">{title || "Contenido Multimedia"}</h3>
<div className="glass-card aspect-video flex flex-col items-center justify-center gap-6 border-red-500/10 dark:border-red-500/20 bg-red-500/5">
<div className="w-16 h-16 rounded-full bg-red-500/10 flex items-center justify-center text-red-600 dark:text-red-500">
<Lock size={32} />
</div>
<div className="text-center">
<p className="text-xl font-bold text-white mb-2">Contenido Bloqueado</p>
<p className="text-sm text-gray-500 max-w-xs uppercase tracking-widest font-black">
<p className="text-xl font-bold text-gray-900 dark:text-white mb-2">Contenido Bloqueado</p>
<p className="text-sm text-gray-600 dark:text-gray-500 max-w-xs uppercase tracking-widest font-black">
Has alcanzado el límite de {maxPlays} reproducciones para este contenido.
</p>
</div>
@@ -135,9 +135,9 @@ export default function MediaPlayer({ id, lessonId, title, url, media_type, conf
return (
<div className="space-y-6" id={id}>
<div className="flex items-center justify-between">
<h3 className="text-xs font-black uppercase tracking-widest text-gray-400">{title || "Contenido Multimedia"}</h3>
<h3 className="text-xs font-black uppercase tracking-widest text-gray-500 dark:text-gray-400">{title || "Contenido Multimedia"}</h3>
{maxPlays > 0 && (
<span className="text-[10px] font-bold uppercase tracking-widest px-3 py-1 rounded-full bg-white/5 border border-white/5 text-gray-500">
<span className="text-[10px] font-bold uppercase tracking-widest px-3 py-1 rounded-full bg-black/5 dark:bg-white/5 border border-black/5 dark:border-white/5 text-gray-500 dark:text-gray-400">
{playCount} / {maxPlays} REPRODUCCIONES
</span>
)}
@@ -196,9 +196,9 @@ export default function MediaPlayer({ id, lessonId, title, url, media_type, conf
{!isLocalFile && playCount === 0 && (
<div
onClick={handlePlay}
className="absolute inset-0 bg-black/40 flex items-center justify-center cursor-pointer group-hover:bg-black/20 transition-all"
className="absolute inset-0 bg-white/40 dark:bg-black/40 flex items-center justify-center cursor-pointer group-hover:bg-white/20 dark:group-hover:bg-black/20 transition-all"
>
<div className="w-20 h-20 rounded-full bg-blue-500 flex items-center justify-center shadow-2xl shadow-blue-500/40 group-hover:scale-110 transition-transform">
<div className="w-20 h-20 rounded-full bg-blue-600 dark:bg-blue-500 flex items-center justify-center shadow-2xl shadow-blue-500/40 group-hover:scale-110 transition-transform">
<Play size={32} className="text-white fill-white ml-2" />
</div>
</div>
@@ -213,8 +213,8 @@ export default function MediaPlayer({ id, lessonId, title, url, media_type, conf
)}
{/* Question Overlay */}
{activeMarker && (
<div className="absolute inset-0 z-50 flex items-center justify-center p-4 bg-black/60 backdrop-blur-md rounded-xl animate-in fade-in duration-300">
<div className="bg-white text-black p-6 rounded-2xl shadow-2xl max-w-sm w-full space-y-4">
<div className="absolute inset-0 z-50 flex items-center justify-center p-4 bg-white/60 dark:bg-black/60 backdrop-blur-md rounded-xl animate-in fade-in duration-300">
<div className="bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 p-6 rounded-2xl shadow-2xl max-w-sm w-full space-y-4 border border-black/5 dark:border-white/5">
<div className="flex items-center gap-2 text-blue-600 font-bold text-xs uppercase tracking-widest">
<AlertCircle size={16} />
<span>Quick Check</span>
@@ -259,9 +259,9 @@ export default function MediaPlayer({ id, lessonId, title, url, media_type, conf
}}
className={`px-4 py-3 rounded-xl font-medium transition-all text-left ${feedback
? idx === activeMarker.correctIndex
? "bg-green-500 text-white"
: feedback.isCorrect === false && "bg-red-500 text-white"
: "bg-gray-100 hover:bg-blue-500 hover:text-white"
? "bg-green-600 dark:bg-green-500 text-white"
: feedback.isCorrect === false && "bg-red-600 dark:bg-red-500 text-white"
: "bg-black/5 dark:bg-gray-800 hover:bg-blue-600 dark:hover:bg-blue-500 hover:text-white"
}`}
>
{option}
@@ -105,8 +105,8 @@ export default function MemoryPlayer({
<Sparkles size={28} className="animate-pulse" />
</div>
<div>
<h2 className="text-2xl font-black tracking-tight text-white">{title}</h2>
<div className="flex items-center gap-2 text-[10px] font-black uppercase tracking-widest text-indigo-400">
<h2 className="text-2xl font-black tracking-tight text-gray-900 dark:text-white">{title}</h2>
<div className="flex items-center gap-2 text-[10px] font-black uppercase tracking-widest text-indigo-600 dark:text-indigo-400">
<span>Brain Training</span>
<span className="w-1 h-1 rounded-full bg-indigo-800" />
<span>Level: Beginner</span>
@@ -114,16 +114,16 @@ export default function MemoryPlayer({
</div>
</div>
<div className="flex gap-4">
<div className="px-5 py-3 rounded-2xl bg-white/5 border border-white/10 text-center">
<div className="px-5 py-3 rounded-2xl bg-black/5 dark:bg-white/5 border border-black/5 dark:border-white/10 text-center">
<div className="text-[10px] font-black uppercase tracking-widest text-gray-500">Moves</div>
<div className="text-xl font-black text-white">{moves}</div>
<div className="text-xl font-black text-gray-900 dark:text-white">{moves}</div>
</div>
<button
onClick={initializeGame}
className="p-4 rounded-2xl bg-white/5 hover:bg-white/10 border border-white/10 transition-all active:scale-90"
className="p-4 rounded-2xl bg-black/5 dark:bg-white/5 hover:bg-black/10 dark:hover:bg-white/10 border border-black/5 dark:border-white/10 transition-all active:scale-90"
title="Restart"
>
<RotateCcw size={20} className="text-gray-400" />
<RotateCcw size={20} className="text-gray-500 dark:text-gray-400" />
</button>
</div>
</div>
@@ -138,8 +138,8 @@ export default function MemoryPlayer({
<div className={`relative w-full h-full transition-all duration-500 transform-style-3d ${(card.isFlipped || card.isMatched) ? "rotate-y-180" : ""
}`}>
{/* Card Front (Hidden) */}
<div className="absolute inset-0 backface-hidden flex items-center justify-center rounded-2xl bg-[#1a1c21] border-2 border-white/5 hover:border-indigo-500/50 transition-colors shadow-lg">
<HelpCircle size={40} className="text-white/10 group-hover:text-indigo-500/30 transition-colors" />
<div className="absolute inset-0 backface-hidden flex items-center justify-center rounded-2xl bg-gray-100 dark:bg-[#1a1c21] border-2 border-black/5 dark:border-white/5 hover:border-indigo-600 dark:hover:border-indigo-500/50 transition-colors shadow-lg">
<HelpCircle size={40} className="text-black/10 dark:text-white/10 group-hover:text-indigo-600 dark:group-hover:text-indigo-500/30 transition-colors" />
</div>
{/* Card Back (Content) */}
@@ -166,8 +166,8 @@ export default function MemoryPlayer({
<div className="w-16 h-16 rounded-full bg-green-500 text-white flex items-center justify-center mb-4 shadow-lg shadow-green-500/20">
<CheckCircle2 size={32} strokeWidth={3} />
</div>
<h3 className="text-2xl font-black text-white mb-1">BRAVO!</h3>
<p className="text-green-500/80 font-bold uppercase tracking-widest text-xs">
<h3 className="text-2xl font-black text-gray-900 dark:text-white mb-1">BRAVO!</h3>
<p className="text-green-600 dark:text-green-500/80 font-bold uppercase tracking-widest text-xs">
Finished in {moves} moves
</p>
</div>
@@ -36,15 +36,15 @@ export default function OrderingPlayer({ id, title, items, allowRetry = true }:
return (
<div className="space-y-8" id={id}>
<div className="space-y-2">
<h3 className="text-xl font-bold border-l-4 border-blue-500 pl-4 py-1 tracking-tight text-white uppercase tracking-widest text-[10px]">
<h3 className="text-xl font-bold border-l-4 border-blue-600 dark:border-blue-500 pl-4 py-1 tracking-tight text-gray-900 dark:text-white uppercase tracking-widest text-[10px]">
{title || "Ordenamiento de Secuencia"}
</h3>
</div>
<div className="space-y-8 p-8 glass border-white/5 rounded-3xl">
<div className="space-y-8 p-8 glass border-black/5 dark:border-white/5 rounded-3xl bg-black/[0.02] dark:bg-black/20">
<div className="grid grid-cols-1 md:grid-cols-2 gap-12">
<div className="space-y-4">
<label className="text-[10px] font-black uppercase tracking-widest text-gray-500 mb-4 block">Elementos Disponibles</label>
<label className="text-[10px] font-black uppercase tracking-widest text-gray-500 dark:text-gray-400 mb-4 block">Elementos Disponibles</label>
<div className="flex flex-wrap gap-3">
{shuffledItems.map((item, i) => {
const isPicked = userOrder.includes(item.originalIdx);
@@ -53,8 +53,8 @@ export default function OrderingPlayer({ id, title, items, allowRetry = true }:
key={i}
disabled={isPicked || submitted}
onClick={() => handlePick(item.originalIdx)}
className={`px-6 py-3 rounded-full border text-sm font-bold transition-all ${isPicked ? "opacity-20 grayscale border-white/5 bg-white/5" :
"border-white/10 bg-white/5 text-gray-200 hover:border-blue-500/50 hover:bg-blue-500/5"
className={`px-6 py-3 rounded-full border text-sm font-bold transition-all ${isPicked ? "opacity-20 grayscale border-black/5 dark:border-white/5 bg-black/5 dark:bg-white/5" :
"border-black/10 dark:border-white/10 bg-black/5 dark:bg-white/5 text-gray-800 dark:text-gray-200 hover:border-blue-600/50 dark:hover:border-blue-500/50 hover:bg-blue-600/5 dark:hover:bg-blue-500/5"
}`}
>
{item.value}
@@ -65,9 +65,9 @@ export default function OrderingPlayer({ id, title, items, allowRetry = true }:
</div>
<div className="space-y-4">
<label className="text-[10px] font-black uppercase tracking-widest text-gray-500 mb-4 block">Tu Secuencia</label>
<label className="text-[10px] font-black uppercase tracking-widest text-gray-500 dark:text-gray-400 mb-4 block">Tu Secuencia</label>
<div className="space-y-3">
{userOrder.length === 0 && <p className="text-xs text-gray-600 italic py-4">Haz clic en los elementos para construir la secuencia...</p>}
{userOrder.length === 0 && <p className="text-xs text-gray-500 dark:text-gray-600 italic py-4">Haz clic en los elementos para construir la secuencia...</p>}
{userOrder.map((idx, i) => {
const isItemCorrect = submitted && idx === i;
const isItemWrong = submitted && idx !== i;
@@ -76,9 +76,9 @@ export default function OrderingPlayer({ id, title, items, allowRetry = true }:
<div
key={i}
onClick={() => !submitted && handlePick(idx)}
className={`flex items-center gap-4 p-4 rounded-xl border text-sm font-bold transition-all cursor-pointer ${isItemCorrect ? "border-green-500 bg-green-500/20 text-green-400" :
isItemWrong ? "border-red-500 bg-red-500/20 text-red-100" :
"border-blue-500/30 bg-blue-500/5 text-blue-400 hover:bg-blue-500/10"
className={`flex items-center gap-4 p-4 rounded-xl border text-sm font-bold transition-all cursor-pointer ${isItemCorrect ? "border-green-600 dark:border-green-500 bg-green-500/20 text-green-700 dark:text-green-400" :
isItemWrong ? "border-red-600 dark:border-red-500 bg-red-500/20 text-red-700 dark:text-red-100" :
"border-blue-600/30 dark:border-blue-500/30 bg-blue-600/5 dark:bg-blue-500/5 text-blue-700 dark:text-blue-400 hover:bg-blue-600/10 dark:hover:bg-blue-500/10"
}`}
>
<span className="opacity-50 text-xs">{i + 1}.</span>
@@ -106,7 +106,7 @@ export default function OrderingPlayer({ id, title, items, allowRetry = true }:
{submitted && (
<button
onClick={handleReset}
className="w-full py-5 glass text-blue-400 font-black text-xs uppercase tracking-[0.2em] hover:bg-white/5 transition-all rounded-2xl border-white/5"
className="w-full py-5 glass text-blue-600 dark:text-blue-400 font-black text-xs uppercase tracking-[0.2em] hover:bg-black/5 dark:hover:bg-white/5 transition-all rounded-2xl border-black/5 dark:border-white/5"
>
Intentar de Nuevo
</button>
@@ -64,11 +64,11 @@ export default function QuizPlayer({ id, title, quizData, allowRetry = true, max
return (
<div className="space-y-8 notranslate" id={id} translate="no">
<div className="space-y-2">
<h3 className="text-xl font-bold border-l-4 border-blue-500 pl-4 py-1 tracking-tight text-white uppercase tracking-widest text-[10px]">
<h3 className="text-xl font-bold border-l-4 border-blue-600 dark:border-blue-500 pl-4 py-1 tracking-tight text-gray-900 dark:text-white uppercase tracking-widest text-[10px]">
{title || "Verificación de Conocimientos"}
</h3>
{maxAttempts > 0 && (
<span className="text-[10px] font-bold uppercase tracking-widest px-3 py-1 rounded-full bg-white/5 border border-white/5 text-gray-500">
<span className="text-[10px] font-bold uppercase tracking-widest px-3 py-1 rounded-full bg-black/5 dark:bg-white/5 border border-black/5 dark:border-white/5 text-gray-500 dark:text-gray-400">
Intento {attempts} / {maxAttempts}
</span>
)}
@@ -76,8 +76,8 @@ export default function QuizPlayer({ id, title, quizData, allowRetry = true, max
<div className="space-y-8">
{questions.map((q) => (
<fieldset key={q.id} className="space-y-4 p-8 glass border-white/5 rounded-3xl" aria-labelledby={`q-${q.id}-text`}>
<legend id={`q-${q.id}-text`} className="font-bold text-xl text-gray-100 leading-tight mb-4">{q.question}</legend>
<fieldset key={q.id} className="space-y-4 p-8 glass border-black/5 dark:border-white/5 rounded-3xl bg-black/[0.02] dark:bg-black/20" aria-labelledby={`q-${q.id}-text`}>
<legend id={`q-${q.id}-text`} className="font-bold text-xl text-gray-900 dark:text-gray-100 leading-tight mb-4">{q.question}</legend>
<div
className="grid gap-3"
role={q.type === 'multiple-select' ? 'group' : 'radiogroup'}
@@ -90,14 +90,14 @@ export default function QuizPlayer({ id, title, quizData, allowRetry = true, max
const isWrongSelection = !isCorrect && isSelected;
const missedCorrect = isCorrect && !isSelected;
let style = "glass border-white/10 hover:bg-white/5";
let style = "glass border-black/10 dark:border-white/10 hover:bg-black/5 dark:hover:bg-white/5 text-gray-700 dark:text-gray-300";
if (submitted) {
if (isActuallyCorrect) style = "bg-green-500/20 border-green-500 text-green-400";
else if (isWrongSelection) style = "bg-red-500/20 border-red-500 text-red-100";
else if (missedCorrect) style = "border-orange-500/50 text-orange-400 animate-pulse";
else style = "opacity-50 grayscale border-white/5";
} else if (isSelected) {
style = "bg-blue-500/20 border-blue-500 text-white shadow-[0_0_20px_rgba(59,130,246,0.2)]";
style = "bg-blue-600/10 dark:bg-blue-500/20 border-blue-600 dark:border-blue-500 text-blue-700 dark:text-white shadow-[0_0_20px_rgba(59,130,246,0.2)]";
}
return (
@@ -145,7 +145,7 @@ export default function QuizPlayer({ id, title, quizData, allowRetry = true, max
setUserAnswers({});
}}
disabled={maxAttempts > 0 && attempts >= maxAttempts}
className={`w-full py-5 glass text-blue-400 font-black text-xs uppercase tracking-[0.2em] hover:bg-white/5 transition-all rounded-3xl border-white/5 ${maxAttempts > 0 && attempts >= maxAttempts ? 'opacity-50 cursor-not-allowed' : ''}`}
className={`w-full py-5 glass text-blue-600 dark:text-blue-400 font-black text-xs uppercase tracking-[0.2em] hover:bg-black/5 dark:hover:bg-white/5 transition-all rounded-3xl border-black/5 dark:border-white/5 ${maxAttempts > 0 && attempts >= maxAttempts ? 'opacity-50 cursor-not-allowed' : ''}`}
>
{maxAttempts > 0 && attempts >= maxAttempts ? 'Máximo de Intentos Alcanzado' : 'Intentar de Nuevo'}
</button>
@@ -24,13 +24,13 @@ export default function ShortAnswerPlayer({ id, title, prompt, correctAnswers, a
return (
<div className="space-y-8" id={id}>
<div className="space-y-2">
<h3 className="text-xl font-bold border-l-4 border-blue-500 pl-4 py-1 tracking-tight text-white uppercase tracking-widest text-[10px]">
<h3 className="text-xl font-bold border-l-4 border-blue-600 dark:border-blue-500 pl-4 py-1 tracking-tight text-gray-900 dark:text-white uppercase tracking-widest text-[10px]">
{title || "Respuesta Corta"}
</h3>
</div>
<div className="p-8 glass border-white/5 rounded-3xl space-y-8">
<p className="text-xl font-bold text-gray-100">{prompt || "Por favor, introduce tu respuesta a continuación:"}</p>
<div className="p-8 glass border-black/5 dark:border-white/5 rounded-3xl space-y-8 bg-black/[0.02] dark:bg-black/20">
<p className="text-xl font-bold text-gray-800 dark:text-gray-100">{prompt || "Por favor, introduce tu respuesta a continuación:"}</p>
<div className="space-y-4">
<input
@@ -38,9 +38,9 @@ export default function ShortAnswerPlayer({ id, title, prompt, correctAnswers, a
value={userAnswer}
onChange={(e) => setUserAnswer(e.target.value)}
disabled={submitted}
className={`w-full bg-white/5 border-2 rounded-2xl px-6 py-4 text-lg transition-all focus:outline-none ${submitted
? (isCorrect ? "border-green-500 bg-green-500/10 text-green-400" : "border-red-500 bg-red-500/10 text-red-100")
: "border-white/10 focus:border-blue-500 text-white"
className={`w-full bg-black/5 dark:bg-white/5 border-2 rounded-2xl px-6 py-4 text-lg transition-all focus:outline-none ${submitted
? (isCorrect ? "border-green-600 dark:border-green-500 bg-green-500/10 text-green-700 dark:text-green-400" : "border-red-600 dark:border-red-500 bg-red-500/10 text-red-700 dark:text-red-100")
: "border-black/10 dark:border-white/10 focus:border-blue-600 dark:focus:border-blue-500 text-gray-900 dark:text-white"
}`}
placeholder="Escribe tu respuesta..."
/>
@@ -68,7 +68,7 @@ export default function ShortAnswerPlayer({ id, title, prompt, correctAnswers, a
{submitted && (
<button
onClick={handleReset}
className="w-full py-5 glass text-blue-400 font-black text-xs uppercase tracking-[0.2em] hover:bg-white/5 transition-all rounded-3xl border-white/5"
className="w-full py-5 glass text-blue-600 dark:text-blue-400 font-black text-xs uppercase tracking-[0.2em] hover:bg-black/5 dark:hover:bg-white/5 transition-all rounded-3xl border-black/5 dark:border-white/5"
>
Intentar de Nuevo
</button>