Skip to content

Commit 7ae440a

Browse files
committed
fixing
1 parent 2af3c09 commit 7ae440a

File tree

2 files changed

+30
-38
lines changed

2 files changed

+30
-38
lines changed

app/public/css/style.css

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -205,33 +205,27 @@ body {
205205

206206
/* Fin Responsividad */
207207

208-
209208
.url-item {
210-
padding: 8px 10px;
211-
border-bottom: 1px solid #eee;
212-
list-style-type: decimal;
209+
display: flex;
210+
align-items: center;
211+
justify-content: space-between;
212+
padding: 8px 0;
213213
}
214214

215215
.url-content-wrapper {
216216
display: flex;
217217
align-items: center;
218218
justify-content: space-between;
219-
219+
width: 100%;
220220
}
221221

222+
222223
.short-url {
223224
cursor: pointer;
224-
color: var(--bright-blue);
225-
text-decoration: underline;
226-
flex-grow: 1;
227-
margin-right: 10px;
228-
word-break: break-word;
229225
}
230226

231-
232-
/* boton Delete */
233227
.delete-btn {
234-
background-color: #ff4d4f;
228+
background-color: #ff4d4d;
235229
color: white;
236230
border: none;
237231
padding: 6px 12px;
@@ -240,7 +234,5 @@ body {
240234
}
241235

242236
.delete-btn:hover {
243-
background-color: #ff7875;
237+
background-color: #e60000;
244238
}
245-
246-
/* Fin boton Delete */

app/public/static/FetcherUrl.js

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,44 +18,43 @@ export async function fetchAllUrls() {
1818
}
1919

2020
data.forEach(item => {
21-
const shortUrl = `${window.location.origin}/${item.hash}`;
22-
21+
const shortUrl = `link.codegeekery.com/${item.hash}`;
22+
2323
const li = document.createElement('li');
2424
li.classList.add('url-item');
25-
26-
// Nuevo div para organizar internamente (flex)
25+
26+
// Div wrapper
2727
const contentWrapper = document.createElement('div');
28-
contentWrapper.className = 'url-content-wrapper';
29-
28+
contentWrapper.className = 'url-content-wrapper'; // clase flex
29+
30+
// El span
3031
const span = document.createElement('span');
31-
span.textContent = shortUrl;
32+
span.textContent = item.hash;
3233
span.className = 'short-url';
33-
34-
// Al hacer clic en el enlace, copiar al portapapeles
34+
3535
span.addEventListener('click', async function () {
3636
try {
3737
await navigator.clipboard.writeText(shortUrl);
3838
span.textContent = '¡Copiado!';
3939
setTimeout(() => {
40-
span.textContent = shortUrl;
40+
span.textContent = item.hash;
4141
}, 2000);
4242
} catch (err) {
4343
console.error('Error al copiar:', err);
4444
alert('Error al copiar el enlace. Intenta manualmente.');
4545
}
4646
});
47-
48-
// Botón de eliminar
47+
48+
// Botón eliminar
4949
const deleteBtn = document.createElement('button');
5050
deleteBtn.className = 'delete-btn';
5151
deleteBtn.textContent = 'Eliminar';
5252
deleteBtn.onclick = async () => {
5353
const authCode = document.getElementById('authCode').value;
54-
55-
// Limpia errores anteriores
54+
5655
document.querySelectorAll('.error-message').forEach(e => e.remove());
5756
document.querySelectorAll('.form-group').forEach(e => e.classList.remove('error'));
58-
57+
5958
try {
6059
await deleteUrl(item.hash, authCode);
6160
fetchAllUrls();
@@ -72,23 +71,24 @@ export async function fetchAllUrls() {
7271
});
7372
}
7473
};
75-
76-
77-
// Insertamos el span y el botón dentro del div
74+
75+
// Insertamos el span y el botón dentro del mismo contentWrapper
7876
contentWrapper.appendChild(span);
7977
contentWrapper.appendChild(deleteBtn);
80-
81-
// Insertamos el div dentro del li
78+
79+
// Insertamos el contentWrapper dentro del li
8280
li.appendChild(contentWrapper);
83-
84-
// Insertamos el li dentro de la lista
81+
82+
// Insertamos el li en la lista
8583
list.appendChild(li);
8684
});
85+
8786
} catch (err) {
8887
const list = document.getElementById('urlsList');
8988
list.innerHTML = `<li>Error al cargar las URLs: ${err.message}</li>`;
9089
}
9190
}
9291

92+
9393
// Cargar URLs automáticamente al cargar la página
9494
window.addEventListener('DOMContentLoaded', fetchAllUrls);

0 commit comments

Comments
 (0)