refactor: rediseñar tablero de cartas en sentido horizontal, añadiendo zoom y lupa cuando hay muchas cartas para poder ver toda la escala y tener control al mismo tiempo.

This commit is contained in:
Alexis
2026-03-26 09:43:45 +01:00
parent cf838837a0
commit 11f3fb1415
4 changed files with 82 additions and 41 deletions
+7 -11
View File
@@ -1,10 +1,9 @@
export default function CardEditor({ index, level, handleLevelChange, handleRemoveLevel, totalLevels, error }) {
return (
<div className="flex flex-col items-center">
<div className={`relative w-72 h-44 bg-white border-2 rounded-xl shadow-[0_8px_30px_rgb(0,0,0,0.08)] flex flex-col items-center justify-center transition-transform hover:-translate-y-1 hover:shadow-[0_12px_40px_rgb(0,0,0,0.12)] group ${
<div className="flex flex-col items-center mx-2 my-4">
<div className={`relative w-44 h-60 bg-white border-2 rounded-2xl shadow-[0_8px_30px_rgb(0,0,0,0.08)] flex flex-col items-center justify-center transition-transform hover:-translate-y-2 hover:shadow-[0_12px_40px_rgb(0,0,0,0.12)] group ${
error ? 'border-red-400 shadow-red-100' : 'border-slate-200'
}`}>
{/* Botón para eliminar */}
{totalLevels > 3 && (
<button
onClick={() => handleRemoveLevel(index)}
@@ -15,30 +14,27 @@ export default function CardEditor({ index, level, handleLevelChange, handleRemo
</button>
)}
{/* Detalles tipo naipe */}
<span className="absolute top-4 left-4 text-sm font-black text-slate-300">{index + 1}</span>
<span className="absolute bottom-4 right-4 text-sm font-black text-slate-300 rotate-180">{index + 1}</span>
<span className="absolute top-3 left-4 text-sm font-black text-slate-300">{index + 1}</span>
<span className="absolute bottom-3 right-4 text-sm font-black text-slate-300 rotate-180">{index + 1}</span>
<input
type="text"
placeholder="Escribe aquí..."
placeholder="Etiqueta..."
value={level}
onChange={(e) => handleLevelChange(index, e.target.value)}
className={`w-4/5 text-center text-2xl font-bold text-slate-700 bg-transparent border-b-2 border-dashed outline-none pb-1 ${
className={`w-10/12 text-center text-xl font-bold text-slate-700 bg-transparent border-b-2 border-dashed outline-none pb-1 ${
error ? 'border-red-300 focus:border-red-500 placeholder:text-red-200' : 'border-slate-300 focus:border-blue-500'
}`}
/>
</div>
{/* Mensaje de error */}
<div className="h-6 mt-2">
<div className="h-6 mt-3">
{error && (
<p className="text-red-500 text-sm font-semibold animate-pulse">
Escribe una etiqueta
</p>
)}
</div>
</div>
);
}