Spaces:
Sleeping
Sleeping
Upload 58 files
Browse files- App.tsx +5 -5
- components/Card.tsx +11 -6
- components/DataForm.tsx +1 -7
App.tsx
CHANGED
|
@@ -341,7 +341,7 @@ const App: React.FC = () => {
|
|
| 341 |
<div className="p-2 bg-surface rounded-lg group-hover:bg-primary/20 transition-colors">
|
| 342 |
<Layers className="text-primary" size={24} />
|
| 343 |
</div>
|
| 344 |
-
<span className="text-xl font-bold tracking-tight text-white">
|
| 345 |
CodeBy<span className="text-primary">Dante</span>
|
| 346 |
</span>
|
| 347 |
</div>
|
|
@@ -359,7 +359,7 @@ const App: React.FC = () => {
|
|
| 359 |
</div>
|
| 360 |
)}
|
| 361 |
|
| 362 |
-
<div className="flex items-center gap-3">
|
| 363 |
<Button
|
| 364 |
variant="secondary"
|
| 365 |
onClick={() => {
|
|
@@ -368,7 +368,7 @@ const App: React.FC = () => {
|
|
| 368 |
const nextOrder = orders[(currentIndex + 1) % orders.length];
|
| 369 |
setSortOrder(nextOrder);
|
| 370 |
}}
|
| 371 |
-
className="bg-surface border border-white/5 hover:bg-surfaceHover transition-all hover:scale-105 active:scale-95 flex items-center gap-2 px-
|
| 372 |
title={`Ordenar por: ${sortOrder === 'updated' ? 'Modificación' : sortOrder === 'created' ? 'Fecha' : sortOrder === 'name' ? 'Nombre' : 'Aleatorio'}`}
|
| 373 |
>
|
| 374 |
{sortOrder === 'updated' && (
|
|
@@ -401,7 +401,7 @@ const App: React.FC = () => {
|
|
| 401 |
<Button
|
| 402 |
variant="secondary"
|
| 403 |
onClick={() => setIsSettingsOpen(!isSettingsOpen)}
|
| 404 |
-
className="bg-surface border border-white/5 hover:bg-surfaceHover"
|
| 405 |
>
|
| 406 |
<Settings size={20} />
|
| 407 |
</Button>
|
|
@@ -439,7 +439,7 @@ const App: React.FC = () => {
|
|
| 439 |
</div>
|
| 440 |
|
| 441 |
{viewMode === 'admin' && (
|
| 442 |
-
<Button onClick={() => { setSelectedItem(null); setView('CREATE'); }}>
|
| 443 |
<Plus size={20} /> <span className="hidden sm:inline">Nueva Entrada</span>
|
| 444 |
</Button>
|
| 445 |
)}
|
|
|
|
| 341 |
<div className="p-2 bg-surface rounded-lg group-hover:bg-primary/20 transition-colors">
|
| 342 |
<Layers className="text-primary" size={24} />
|
| 343 |
</div>
|
| 344 |
+
<span className="text-lg sm:text-xl font-bold tracking-tight text-white">
|
| 345 |
CodeBy<span className="text-primary">Dante</span>
|
| 346 |
</span>
|
| 347 |
</div>
|
|
|
|
| 359 |
</div>
|
| 360 |
)}
|
| 361 |
|
| 362 |
+
<div className="flex items-center gap-1 sm:gap-3">
|
| 363 |
<Button
|
| 364 |
variant="secondary"
|
| 365 |
onClick={() => {
|
|
|
|
| 368 |
const nextOrder = orders[(currentIndex + 1) % orders.length];
|
| 369 |
setSortOrder(nextOrder);
|
| 370 |
}}
|
| 371 |
+
className="bg-surface border border-white/5 hover:bg-surfaceHover transition-all hover:scale-105 active:scale-95 flex items-center gap-2 !px-2 sm:!px-4 min-w-[36px] sm:min-w-[140px] justify-center"
|
| 372 |
title={`Ordenar por: ${sortOrder === 'updated' ? 'Modificación' : sortOrder === 'created' ? 'Fecha' : sortOrder === 'name' ? 'Nombre' : 'Aleatorio'}`}
|
| 373 |
>
|
| 374 |
{sortOrder === 'updated' && (
|
|
|
|
| 401 |
<Button
|
| 402 |
variant="secondary"
|
| 403 |
onClick={() => setIsSettingsOpen(!isSettingsOpen)}
|
| 404 |
+
className="bg-surface border border-white/5 hover:bg-surfaceHover !px-2 sm:!px-4 justify-center"
|
| 405 |
>
|
| 406 |
<Settings size={20} />
|
| 407 |
</Button>
|
|
|
|
| 439 |
</div>
|
| 440 |
|
| 441 |
{viewMode === 'admin' && (
|
| 442 |
+
<Button onClick={() => { setSelectedItem(null); setView('CREATE'); }} className="!px-2 sm:!px-4 justify-center">
|
| 443 |
<Plus size={20} /> <span className="hidden sm:inline">Nueva Entrada</span>
|
| 444 |
</Button>
|
| 445 |
)}
|
components/Card.tsx
CHANGED
|
@@ -24,9 +24,14 @@ export const Card: React.FC<CardProps> = ({ item, onClick }) => {
|
|
| 24 |
</div>
|
| 25 |
)}
|
| 26 |
<h3
|
| 27 |
-
className="text-base sm:text-lg font-bold text-white mb-2 group-hover:text-primary transition-colors
|
| 28 |
-
|
| 29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
</div>
|
| 31 |
<div
|
| 32 |
className="text-zinc-400 text-[11px] sm:text-xs leading-normal [&>p]:m-0 [&_img]:w-full [&_img]:h-full [&_img]:object-cover [&_img]:p-0 [&_img]:m-0 [&_img]:rounded-none [&_figure]:p-0 [&_figure]:m-0 [&_figure]:bg-transparent overflow-hidden"
|
|
@@ -45,14 +50,14 @@ export const Card: React.FC<CardProps> = ({ item, onClick }) => {
|
|
| 45 |
{/* Buttons Section */}
|
| 46 |
{/* Buttons Section */}
|
| 47 |
{(item.visitUrl || item.downloadUrl) && (
|
| 48 |
-
<div className="mt-auto flex
|
| 49 |
{item.visitUrl && (
|
| 50 |
<a
|
| 51 |
href={item.visitUrl}
|
| 52 |
target="_blank"
|
| 53 |
rel="noopener noreferrer"
|
| 54 |
onClick={(e) => e.stopPropagation()}
|
| 55 |
-
className={`flex-1 bg-transparent border border-[#bb86fc] text-[#bb86fc] font-medium py-
|
| 56 |
>
|
| 57 |
<ExternalLink size={14} className="sm:w-4 sm:h-4" strokeWidth={2.5} />
|
| 58 |
Visitar
|
|
@@ -65,7 +70,7 @@ export const Card: React.FC<CardProps> = ({ item, onClick }) => {
|
|
| 65 |
target="_blank"
|
| 66 |
rel="noopener noreferrer"
|
| 67 |
onClick={(e) => e.stopPropagation()}
|
| 68 |
-
className={`flex-1 bg-transparent border border-[#bb86fc] text-[#bb86fc] font-medium py-
|
| 69 |
>
|
| 70 |
<Download size={14} className="sm:w-4 sm:h-4" strokeWidth={2.5} />
|
| 71 |
Descargar
|
|
|
|
| 24 |
</div>
|
| 25 |
)}
|
| 26 |
<h3
|
| 27 |
+
className="text-base sm:text-lg font-bold text-white mb-2 group-hover:text-primary transition-colors break-words"
|
| 28 |
+
title={(item.title || '').replace(/<[^>]*>?/gm, '')}
|
| 29 |
+
>
|
| 30 |
+
{(() => {
|
| 31 |
+
const text = (item.title || '').replace(/<[^>]*>?/gm, '').replace(/ /g, ' ');
|
| 32 |
+
return text.length > 30 ? text.slice(0, 30).trim() + '...' : text;
|
| 33 |
+
})()}
|
| 34 |
+
</h3>
|
| 35 |
</div>
|
| 36 |
<div
|
| 37 |
className="text-zinc-400 text-[11px] sm:text-xs leading-normal [&>p]:m-0 [&_img]:w-full [&_img]:h-full [&_img]:object-cover [&_img]:p-0 [&_img]:m-0 [&_img]:rounded-none [&_figure]:p-0 [&_figure]:m-0 [&_figure]:bg-transparent overflow-hidden"
|
|
|
|
| 50 |
{/* Buttons Section */}
|
| 51 |
{/* Buttons Section */}
|
| 52 |
{(item.visitUrl || item.downloadUrl) && (
|
| 53 |
+
<div className="mt-auto flex flex-col sm:flex-row gap-2 pt-3">
|
| 54 |
{item.visitUrl && (
|
| 55 |
<a
|
| 56 |
href={item.visitUrl}
|
| 57 |
target="_blank"
|
| 58 |
rel="noopener noreferrer"
|
| 59 |
onClick={(e) => e.stopPropagation()}
|
| 60 |
+
className={`flex-1 w-full bg-transparent border border-[#bb86fc] text-[#bb86fc] font-medium py-2 px-3 sm:py-2.5 sm:px-4 rounded-lg flex items-center justify-center gap-2 hover:bg-[#bb86fc] hover:text-[#121212] transition-all text-xs sm:text-sm shadow-[0_0_5px_rgba(187,134,252,0.2)]`}
|
| 61 |
>
|
| 62 |
<ExternalLink size={14} className="sm:w-4 sm:h-4" strokeWidth={2.5} />
|
| 63 |
Visitar
|
|
|
|
| 70 |
target="_blank"
|
| 71 |
rel="noopener noreferrer"
|
| 72 |
onClick={(e) => e.stopPropagation()}
|
| 73 |
+
className={`flex-1 w-full bg-transparent border border-[#bb86fc] text-[#bb86fc] font-medium py-2 px-3 sm:py-2.5 sm:px-4 rounded-lg flex items-center justify-center gap-2 hover:bg-[#bb86fc] hover:text-[#121212] transition-all text-xs sm:text-sm shadow-[0_0_5px_rgba(187,134,252,0.2)]`}
|
| 74 |
>
|
| 75 |
<Download size={14} className="sm:w-4 sm:h-4" strokeWidth={2.5} />
|
| 76 |
Descargar
|
components/DataForm.tsx
CHANGED
|
@@ -56,12 +56,7 @@ export const DataForm: React.FC<DataFormProps> = ({ initialData, onSave, onCance
|
|
| 56 |
{/* MAIN INFO CARD */}
|
| 57 |
<div className="bg-surface p-8 rounded-2xl border border-white/5 shadow-xl space-y-6">
|
| 58 |
<div>
|
| 59 |
-
<
|
| 60 |
-
<label className="block text-sm font-medium text-gray-400">Título</label>
|
| 61 |
-
<span className={`text-xs ${title.length >= 30 ? 'text-red-400' : 'text-gray-500'}`}>
|
| 62 |
-
{title.length}/30
|
| 63 |
-
</span>
|
| 64 |
-
</div>
|
| 65 |
<div className="flex gap-4 items-start">
|
| 66 |
<IconPicker
|
| 67 |
selectedIcon={icon}
|
|
@@ -69,7 +64,6 @@ export const DataForm: React.FC<DataFormProps> = ({ initialData, onSave, onCance
|
|
| 69 |
/>
|
| 70 |
<input
|
| 71 |
required
|
| 72 |
-
maxLength={30}
|
| 73 |
type="text"
|
| 74 |
className="w-full bg-background border border-white/10 rounded-lg p-4 text-white text-lg focus:border-primary focus:ring-1 focus:ring-primary outline-none transition-colors"
|
| 75 |
value={title}
|
|
|
|
| 56 |
{/* MAIN INFO CARD */}
|
| 57 |
<div className="bg-surface p-8 rounded-2xl border border-white/5 shadow-xl space-y-6">
|
| 58 |
<div>
|
| 59 |
+
<label className="block text-sm font-medium text-gray-400 mb-2">Título</label>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
<div className="flex gap-4 items-start">
|
| 61 |
<IconPicker
|
| 62 |
selectedIcon={icon}
|
|
|
|
| 64 |
/>
|
| 65 |
<input
|
| 66 |
required
|
|
|
|
| 67 |
type="text"
|
| 68 |
className="w-full bg-background border border-white/10 rounded-lg p-4 text-white text-lg focus:border-primary focus:ring-1 focus:ring-primary outline-none transition-colors"
|
| 69 |
value={title}
|