Skip to content

Commit b3c4285

Browse files
t0tclaude
andcommitted
Finalizar implementación completa de UI responsive y sistema de navegación
• Logo optimizado: 'REFS' con tipografía bold y interletrado amplio • Sistema de favoritos: Contador eliminado, filtro integrado en menú principal • Menú hamburguesa: Breakpoint unificado a 1024px para mejor UX • Scroll navigation: Diseño consistente entre indicator y scroll-to-top • Console limpia: Eliminados todos los console.log y warnings • Accesibilidad: Corregidos problemas de aria-hidden y focus management • Toast notifications: Eliminadas para experiencia más discreta • Diseño unificado: Ambos elementos de scroll comparten estilo y posición 🔖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 8bfe894 commit b3c4285

12 files changed

Lines changed: 658 additions & 117 deletions

File tree

proyectos/referencias-diseno/assets/css/style.css

Lines changed: 302 additions & 56 deletions
Large diffs are not rendered by default.

proyectos/referencias-diseno/assets/js/favorites.js

Lines changed: 12 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ class FavoritesSystem {
1616
this.addFavoriteButtons();
1717
this.setupStyles();
1818
this.updateAllButtons();
19-
this.updateHeaderCounter();
20-
21-
console.log('🎯 Sistema de favoritos inicializado:', this.favorites.length, 'favoritos');
2219
}
2320

2421
// ===== GESTIÓN DE ESTADO =====
@@ -37,7 +34,6 @@ class FavoritesSystem {
3734
try {
3835
localStorage.setItem(this.storageKey, JSON.stringify(this.favorites));
3936
this.notifySubscribers();
40-
this.updateHeaderCounter();
4137
return true;
4238
} catch (error) {
4339
console.error('Error guardando favoritos:', error);
@@ -71,15 +67,6 @@ class FavoritesSystem {
7167
this.saveFavorites();
7268
this.updateButton(id);
7369

74-
// Usar el nuevo sistema de notificaciones si está disponible
75-
if (window.toast) {
76-
window.toast.success('Referencia añadida a favoritos', {
77-
duration: 2000,
78-
title: '❤️ Favorito añadido'
79-
});
80-
} else {
81-
this.showNotification(`Añadido a favoritos`, 'success');
82-
}
8370
return true;
8471
}
8572
return false;
@@ -92,15 +79,6 @@ class FavoritesSystem {
9279
this.saveFavorites();
9380
this.updateButton(id);
9481

95-
// Usar el nuevo sistema de notificaciones si está disponible
96-
if (window.toast) {
97-
window.toast.info('Referencia quitada de favoritos', {
98-
duration: 2000,
99-
title: '🗑️ Favorito eliminado'
100-
});
101-
} else {
102-
this.showNotification(`Quitado de favoritos`, 'info');
103-
}
10482
return true;
10583
}
10684
return false;
@@ -312,17 +290,20 @@ class FavoritesSystem {
312290
});
313291
}
314292

315-
updateHeaderCounter() {
316-
const counter = document.getElementById('favorites-count');
317-
const favoritesCount = document.querySelector('.favorites-count');
318-
319-
if (counter) {
320-
counter.textContent = this.favorites.length;
293+
294+
getCardIdFromCard(card) {
295+
// Obtener ID de la card (similar a getCardId pero desde la card directamente)
296+
const link = card.querySelector('.reference-link');
297+
if (link && link.href) {
298+
return this.urlToId(link.href);
321299
}
322300

323-
if (favoritesCount) {
324-
favoritesCount.classList.toggle('has-favorites', this.favorites.length > 0);
301+
const title = card.querySelector('.reference-title');
302+
if (title) {
303+
return this.titleToId(title.textContent);
325304
}
305+
306+
return `ref-${Array.from(document.querySelectorAll('.reference-card')).indexOf(card)}`;
326307
}
327308

328309
// ===== ESTILOS =====
@@ -441,7 +422,7 @@ class FavoritesSystem {
441422
}
442423
443424
/* Responsive Mobile */
444-
@media (max-width: 768px) {
425+
@media (max-width: 1024px) {
445426
.favorite-btn {
446427
width: 36px;
447428
height: 36px;

proyectos/referencias-diseno/assets/js/header-scroll.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ class HeaderScrollBehavior {
2222

2323
this.bindEvents();
2424
this.updateHeaderHeight();
25-
26-
console.log('🎯 Header scroll behavior inicializado');
2725
}
2826

2927
bindEvents() {

proyectos/referencias-diseno/assets/js/image-loader.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ class ImageLoader {
1313

1414
init() {
1515
this.enhanceExistingImages();
16-
17-
console.log('🖼️ Sistema de carga de imágenes inicializado');
1816
}
1917

2018
enhanceExistingImages() {

proyectos/referencias-diseno/assets/js/main.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,20 @@ document.addEventListener('DOMContentLoaded', function() {
1919
const cards = document.querySelectorAll('.reference-card');
2020

2121
cards.forEach(card => {
22-
const cardCategories = card.dataset.category || '';
23-
const shouldShow = category === 'all' || cardCategories.includes(category);
22+
let shouldShow = false;
23+
24+
if (category === 'all') {
25+
shouldShow = true;
26+
} else if (category === 'favorites') {
27+
// Usar el sistema de favoritos para determinar si mostrar
28+
if (window.favorites) {
29+
const cardId = window.favorites.getCardIdFromCard(card);
30+
shouldShow = window.favorites.isFavorite(cardId);
31+
}
32+
} else {
33+
const cardCategories = card.dataset.category || '';
34+
shouldShow = cardCategories.includes(category);
35+
}
2436

2537
if (shouldShow) {
2638
card.style.display = 'block';

proyectos/referencias-diseno/assets/js/mobile-menu.js

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ class MobileMenu {
1717
this.createElements();
1818
this.setupEventListeners();
1919
this.setupMediaQuery();
20-
21-
console.log('📱 Sistema de menú móvil inicializado');
2220
}
2321

2422
createElements() {
@@ -73,15 +71,15 @@ class MobileMenu {
7371

7472
// Resize handler
7573
window.addEventListener('resize', () => {
76-
if (window.innerWidth > 768 && this.isOpen) {
74+
if (window.innerWidth > 1024 && this.isOpen) {
7775
this.closeMenu();
7876
}
7977
});
8078

8179
// Scroll para cerrar en móvil
8280
let scrollTimeout;
8381
window.addEventListener('scroll', () => {
84-
if (this.isOpen && window.innerWidth <= 768) {
82+
if (this.isOpen && window.innerWidth <= 1024) {
8583
clearTimeout(scrollTimeout);
8684
scrollTimeout = setTimeout(() => {
8785
this.closeMenu();
@@ -92,7 +90,7 @@ class MobileMenu {
9290

9391
setupMediaQuery() {
9492
// Media query listener para cambios de viewport
95-
const mediaQuery = window.matchMedia('(max-width: 768px)');
93+
const mediaQuery = window.matchMedia('(max-width: 1024px)');
9694

9795
const handleMediaChange = (e) => {
9896
if (!e.matches && this.isOpen) {
@@ -132,8 +130,6 @@ class MobileMenu {
132130

133131
// Focus management
134132
this.trapFocus();
135-
136-
console.log('📱 Menú móvil abierto');
137133
}
138134

139135
closeMenu() {
@@ -155,8 +151,6 @@ class MobileMenu {
155151

156152
// Devolver focus al toggle
157153
this.menuToggle?.focus();
158-
159-
console.log('📱 Menú móvil cerrado');
160154
}
161155

162156
trapFocus() {
@@ -230,8 +224,6 @@ class MobileMenu {
230224
}
231225

232226
document.body.style.overflow = '';
233-
234-
console.log('📱 Sistema de menú móvil destruído');
235227
}
236228
}
237229

0 commit comments

Comments
 (0)