finished gallery section

This commit is contained in:
2025-12-01 16:54:11 +01:00
parent cace0119c6
commit 7a7b8dc2f1
13 changed files with 1402 additions and 522 deletions

View File

@@ -1,15 +1,8 @@
/* NOTA: Este archivo asume que home.css define variables como:
--bg-base, --bg-surface, --accent, --text-primary, --nav-height, etc.,
y estilos base para .navbar y .section.
*/
/* Placeholder para la altura del navbar fijo */
.gallery-hero-placeholder {
height: var(--nav-height);
width: 100%;
}
/* --- Controles de Búsqueda y Proveedor --- */
.gallery-controls {
display: flex;
gap: 1.5rem;
@@ -17,7 +10,6 @@
margin-bottom: 2rem;
padding-top: 1rem;
}
/* ... (Estilos de búsqueda y selector sin cambios relevantes) ... */
.provider-selector {
appearance: none;
@@ -50,46 +42,35 @@
font-size: 0.8rem;
}
/* --- Grid de la Galería (Masonry Setup) --- */
.gallery-results {
position: relative;
padding-bottom: 3rem;
margin: 0 -0.75rem;
}
/* El elemento individual (grid-item) - Definición del ancho de columna */
.gallery-card {
width: calc(25% - 1.5rem);
margin: 0.75rem;
background: var(--bg-surface);
border-radius: var(--radius-md);
overflow: hidden;
cursor: pointer;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
border: 1px solid rgba(255,255,255,0.05);
position: relative;
/* --- INICIO DE CORRECCIÓN (TRANSICIONES) --- */
/* Define la transición para los cambios de Masonry (top/left) y la aparición (opacity/transform) */
/* Estado inicial: Oculto y ligeramente desplazado */
opacity: 0;
transform: translateY(20px) scale(0.98);
/* --- FIN DE CORRECCIÓN --- */
border: 1px solid rgba(255,255,255,0.05);
}
/* Estado final: Visible y en su posición correcta */
.gallery-card.is-loaded {
opacity: 1;
transform: translateY(0) scale(1);
}
.gallery-card:hover {
transform: translateY(-5px);
/* Aseguramos que el hover se aplique solo si ya está cargada/visible */
transform: translateY(-8px);
z-index: 10;
}
.gallery-card-img {
@@ -97,43 +78,234 @@
height: auto;
object-fit: cover;
display: block;
transition: transform 0.4s ease;
}
.gallery-card:hover .gallery-card-img {
transform: scale(1.05);
}
.fav-btn {
position: absolute;
top: 10px;
right: 10px;
background: rgba(0,0,0,0.6);
color: white;
border: none;
border-radius: 50%;
width: 38px;
height: 38px;
font-size: 1.2rem;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
backdrop-filter: blur(6px);
transition: all 0.25s ease;
z-index: 3;
}
.fav-btn:hover {
background: rgba(0,0,0,0.85);
transform: scale(1.15);
}
.fav-btn.favorited {
color: #ff6b6b;
background: rgba(255, 107, 107, 0.25);
box-shadow: 0 0 12px rgba(255, 107, 107, 0.4);
}
.provider-badge {
position: absolute;
bottom: 8px;
left: 8px;
background: rgba(0,0,0,0.7);
color: white;
font-size: 0.75rem;
font-weight: 500;
padding: 5px 9px;
border-radius: 6px;
backdrop-filter: blur(6px);
z-index: 2;
}
.gallery-card:hover .gallery-card-img { transform: scale(1.05); }
/* Estilos de respuesta (Responsiveness) */
@media (max-width: 1200px) {
.gallery-card {
width: calc(33.333% - 1.5rem);
}
.gallery-card { width: calc(33.333% - 1.5rem); }
}
/* ... (media queries restantes sin cambios) ... */
@media (max-width: 900px) {
.gallery-card {
width: calc(50% - 1.5rem);
}
.gallery-card { width: calc(50% - 1.5rem); }
}
@media (max-width: 600px) {
.gallery-card {
width: calc(100% - 1.5rem);
}
.gallery-card { width: calc(100% - 1.5rem); }
.fav-btn { width: 42px; height: 42px; font-size: 1.4rem; }
}
/* Estilos para el Skeleton Card */
.gallery-card.skeleton {
min-height: 250px;
aspect-ratio: 1/1.4;
display: flex;
align-items: center;
justify-content: center;
/* Los esqueletos también deben tener transición para cuando son eliminados/reemplazados */
}
/* --- Botón Cargar Más --- */
.load-more-container {
display: flex;
justify-content: center;
padding: 2rem 0 4rem 0;
}
.provider-and-fav {
display: flex;
gap: 12px;
align-items: center;
position: relative;
}
.fav-toggle-btn {
display: flex;
align-items: center;
gap: 8px;
background: rgba(255,255,255,0.07);
color: var(--text-primary);
border: 1px solid rgba(255,255,255,0.15);
padding: 0.7rem 1rem;
border-radius: 99px;
font-size: 0.95rem;
font-family: inherit;
cursor: pointer;
transition: all 0.25s ease;
white-space: nowrap;
}
.fav-toggle-btn:hover {
background: rgba(255,255,255,0.12);
border-color: var(--accent);
}
.fav-toggle-btn.active {
background: rgba(255,107,107,0.2);
border-color: #ff6b6b;
color: #ff6b6b;
box-shadow: 0 0 15px rgba(255,107,107,0.3);
}
.fav-toggle-btn.active i {
color: #ff6b6b;
animation: beat 1.4s ease infinite;
}
.fav-toggle-btn i {
font-size: 1.1rem;
transition: color 0.25s;
}
@keyframes beat {
0%, 100% { transform: scale(1); }
50% { transform: scale(1.15); }
}
@media (max-width: 720px) {
.fav-text { display: none; }
.fav-toggle-btn { padding: 0.7rem 0.9rem; }
.provider-and-fav { gap: 8px; }
}
.gallery-controls {
display: flex;
gap: 1.5rem; /* Reduced gap since there are fewer items */
align-items: center;
margin-bottom: 2rem;
padding-top: 1rem;
/* Center the provider selector since it's the only one */
justify-content: flex-start;
}
.provider-selector {
appearance: none;
width: auto; /* Allow it to shrink */
max-width: 250px; /* Adjusted for better fit */
background: rgba(255,255,255,0.08);
border: 1px solid rgba(255,255,255,0.15);
color: var(--text-primary);
padding: 0.75rem 2.8rem 0.75rem 1rem;
border-radius: 99px;
font-size: 0.95rem;
cursor: pointer;
min-width: 170px;
flex-shrink: 0;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23888888' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 6.646a.5.5 0 0 1 .708 0L8 9.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 12px center;
transition: all 0.25s ease;
}
.provider-selector:hover { background-color: rgba(255,255,255,0.12); border-color: var(--accent); }
.provider-selector:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,107,107,0.2); }
.provider-selector option {
background: #111;
color: white;
padding: 12px;
}
.search-gallery-wrapper {
flex: 1;
min-width: 200px;
max-width: none;
}
.search-input {
width: 100%;
background: rgba(255,255,255,0.08);
border: 1px solid rgba(255,255,255,0.15);
color: var(--text-primary);
padding: 0.75rem 1.3rem;
border-radius: 99px;
font-size: 1rem;
transition: all 0.25s;
}
.search-input:focus {
outline: none;
border-color: var(--accent);
box-shadow: 0 0 0 3px rgba(255,107,107,0.2);
}
.fav-toggle-btn {
flex-shrink: 0;
display: flex;
align-items: center;
gap: 8px;
background: rgba(255,255,255,0.08);
color: var(--text-primary);
border: 1px solid rgba(255,255,255,0.15);
padding: 0.75rem 1.1rem;
border-radius: 99px;
font-size: 0.95rem;
cursor: pointer;
transition: all 0.3s ease;
white-space: nowrap;
}
.fav-toggle-btn:hover { background: rgba(255,255,255,0.15); border-color: #ff6b6b; }
.fav-toggle-btn.active {
background: rgba(255,107,107,0.25);
border-color: #ff6b6b;
color: #ff6b6b;
box-shadow: 0 0 15px rgba(255,107,107,0.4);
}
.fav-toggle-btn.active i { color: #ff6b6b; animation: heartbeat 1.5s ease infinite; }
@keyframes heartbeat { 0%,100%{transform:scale(1)} 50%{transform:scale(1.2)} }
@media (max-width: 900px) {
.gallery-controls {
flex-wrap: wrap;
gap: 0.8rem;
}
.provider-selector { max-width: none; width: 48%; }
.search-gallery-wrapper { order: -1; width: 100%; }
.fav-toggle-btn { width: 48%; justify-content: center; }
.fav-text { display: none; }
}

View File

@@ -1,145 +1,270 @@
/* Placeholder para la altura del navbar fijo */
.gallery-hero-placeholder {
height: var(--nav-height);
width: 100%;
:root {
--accent: #8b5cf6;
--text-primary: #ffffff;
--text-secondary: #a1a1aa;
--radius-lg: 24px;
--radius-full: 9999px;
--glass-border: 1px solid rgba(255, 255, 255, 0.1);
--glass-bg: rgba(20, 20, 23, 0.7);
--nav-height: 80px;
}
.item-content {
.gallery-hero-placeholder { height: var(--nav-height); width: 100%; }
.item-content-flex-wrapper {
display: flex;
gap: 3rem;
padding-top: 2rem;
padding: 2rem 0 4rem;
min-height: 80vh;
max-width: 1400px;
margin: 0 auto;
}
.image-col {
flex: 2;
max-width: 65%;
display: flex;
justify-content: center;
align-items: flex-start;
position: relative;
padding-bottom: 2rem;
}
.item-image {
max-width: 100%;
max-height: 85vh;
height: auto;
border-radius: var(--radius-md);
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
border-radius: var(--radius-lg, 16px);
box-shadow: 0 20px 50px rgba(0,0,0,0.6);
object-fit: contain;
opacity: 0; /* Inicialmente oculto para fade-in */
transition: opacity 0.5s ease;
transition: all 0.4s ease;
cursor: zoom-in;
}
.item-image.loaded {
opacity: 1;
.item-image:hover {
transform: scale(1.02);
box-shadow: 0 30px 70px rgba(0,0,0,0.7);
}
.info-col {
flex: 1;
max-width: 35%;
display: flex;
flex-direction: column;
gap: 1.5rem;
gap: 2rem;
min-width: 300px;
}
.info-header h1 {
font-size: 2.2rem;
margin: 0 0 0.5rem 0;
font-size: 2.4rem;
margin: 0 0 0.8rem 0;
line-height: 1.2;
word-break: break-word;
}
.info-header .provider-name {
.provider-name {
color: var(--text-secondary);
font-size: 1rem;
margin-bottom: 1rem;
display: block;
opacity: 0.9;
}
.tags-section {
border-top: 1px solid rgba(255,255,255,0.1);
padding-top: 1.5rem;
.actions-row {
display: flex;
flex-direction: column;
gap: 1rem;
}
.action-btn {
display: flex;
align-items: center;
justify-content: center;
gap: 12px;
padding: 1rem 1.5rem;
border-radius: 99px;
font-size: 1.05rem;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
text-decoration: none;
border: none;
}
.fav-action {
background: rgba(255,255,255,0.08);
border: 2px solid rgba(255,255,255,0.2);
color: white;
}
.fav-action:hover { background: rgba(255,255,255,0.15); }
.fav-action.favorited {
background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
border-color: #ff6b6b;
color: white;
animation: pulse 2s infinite;
}
.fav-action i { font-size: 1.4rem; }
.fav-action.favorited i { animation: heartbeat 1.4s ease infinite; }
@keyframes heartbeat {
0%,100% { transform: scale(1); }
50% { transform: scale(1.25); }
}
@keyframes pulse {
0% { box-shadow: 0 0 0 0 rgba(255,107,107,0.4); }
70% { box-shadow: 0 0 0 12px rgba(255,107,107,0); }
100% { box-shadow: 0 0 0 0 rgba(255,107,107,0); }
}
.download-btn {
background: var(--accent);
color: white;
}
.download-btn:hover {
background: #7c4dff;
transform: translateY(-2px);
box-shadow: 0 10px 30px rgba(139,92,246,0.4);
}
.copy-link-btn {
background: rgba(255,255,255,0.1);
border: 2px solid rgba(255,255,255,0.2);
color: white;
}
.copy-link-btn:hover { background: rgba(255,255,255,0.18); }
.tags-section h3 {
margin: 0 0 1rem 0;
font-size: 1.2rem;
color: var(--text-secondary);
font-weight: 500;
}
.tag-list {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
gap: 0.6rem;
}
.tag-item {
background: rgba(139, 92, 246, 0.2);
background: rgba(139,92,246,0.2);
color: var(--accent);
padding: 0.4rem 0.8rem;
padding: 0.5rem 1rem;
border-radius: 99px;
font-size: 0.9rem;
font-size: 0.95rem;
text-decoration: none;
transition: background 0.2s;
transition: all 0.2s;
backdrop-filter: blur(4px);
}
.tag-item:hover {
background: rgba(139, 92, 246, 0.4);
background: rgba(139,92,246,0.4);
transform: translateY(-2px);
}
.download-btn {
padding: 1rem 2rem;
background: var(--accent);
color: var(--text-primary);
border: none;
border-radius: var(--radius-md);
font-size: 1.1rem;
font-weight: bold;
cursor: pointer;
text-align: center;
text-decoration: none;
transition: background 0.2s, box-shadow 0.2s;
margin-top: 1rem; /* Espacio después de las etiquetas */
}
.download-btn:hover {
background: #7c4dff;
box-shadow: 0 5px 20px var(--accent-glow);
}
/* --- Skeleton Styles --- */
.item-skeleton {
display: flex;
gap: 3rem;
width: 100%;
}
.image-col-skeleton {
flex: 2;
max-width: 65%;
aspect-ratio: 16/9;
height: 500px;
border-radius: var(--radius-md);
background: var(--bg-surface);
}
.info-col .provider-skeleton { width: 30%; height: 18px; margin-bottom: 1rem; }
.info-col .title-skeleton { width: 90%; height: 36px; margin-bottom: 3rem; }
.info-col .tag-label-skeleton { width: 40%; height: 20px; margin-bottom: 1rem; }
.info-col .tags-skeleton { width: 80%; height: 50px; margin-bottom: 3rem; }
.info-col .download-skeleton { width: 100%; height: 50px; }
/* Media Queries */
@media (max-width: 900px) {
.item-content, .item-skeleton {
flex-direction: column;
.item-content-flex-wrapper { flex-direction: column; align-items: center; gap: 2rem; }
.info-col { width: 100%; max-width: 600px; }
.item-image { max-height: 70vh; }
.actions-row { flex-direction: row; }
.action-btn { flex: 1; }
}
@media (max-width: 500px) {
.actions-row { flex-direction: column; }
.action-btn { padding: 0.9rem; font-size: 1rem; }
}
.similar-section {
margin-top: 4rem;
padding: 2rem 0;
border-top: 1px solid rgba(255,255,255,0.1);
max-width: 1400px;
margin-left: auto;
margin-right: auto;
}
.similar-section h3 {
margin: 0 0 1.5rem 0;
font-size: 1.6rem;
color: var(--text-primary);
text-align: center;
}
.similar-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 1rem;
padding: 1rem 0;
}
.similar-card {
height: 180px;
border-radius: var(--radius-lg, 16px);
overflow: hidden;
position: relative;
cursor: pointer;
transition: transform 0.3s ease;
box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}
.similar-card:hover {
transform: scale(1.03);
}
.similar-card img {
width: 100%;
height: 100%;
object-fit: cover;
transition: opacity 0.3s;
}
.similar-card:hover img {
opacity: 0.9;
}
.similar-card::after {
content: '';
position: absolute;
inset: 0;
background: linear-gradient(transparent 60%, rgba(0,0,0,0.7));
pointer-events: none;
}
.similar-overlay {
position: absolute;
bottom: 0;
left: 0;
right: 0;
padding: 1rem;
color: white;
font-size: 0.9rem;
font-weight: 500;
text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}
.back-btn {
position: fixed;
top: 5rem; left: 2rem; z-index: 100;
display: flex; align-items: center; gap: 0.5rem;
padding: 0.8rem 1.5rem;
background: var(--glass-bg); backdrop-filter: blur(12px);
border: var(--glass-border); border-radius: var(--radius-full);
color: white; text-decoration: none; font-weight: 600;
transition: all 0.2s ease;
}
.back-btn:hover { background: rgba(255, 255, 255, 0.15); transform: translateX(-5px); }
@media (max-width: 768px) {
.similar-grid {
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
padding: 1rem;
}
.image-col, .info-col, .image-col-skeleton {
max-width: 100%;
}
.item-image {
max-height: 80vh; /* Ajustar en móviles */
.similar-card { height: 140px; }
}
@media (max-width: 500px) {
.similar-grid {
grid-template-columns: 1fr;
}
}

View File

@@ -13,7 +13,7 @@
<body>
<nav class="navbar" id="navbar">
<a href="/public" class="nav-brand">
<a href="/" class="nav-brand">
<div class="brand-icon">
<img src="/public/assets/waifuboards.ico" alt="WF Logo">
</div>
@@ -23,34 +23,31 @@
<div class="nav-center">
<button class="nav-button" onclick="window.location.href='/'">Anime</button>
<button class="nav-button" onclick="window.location.href='/books'">Books</button>
<button class="nav-button active" onclick="window.location.href='/art'">Gallery</button>
<button class="nav-button active" onclick="window.location.href='/gallery'">Gallery</button>
<button class="nav-button" onclick="window.location.href='/schedule'">Schedule</button>
<button class="nav-button">My List</button>
<button class="nav-button">Marketplace</button>
</div>
<div class="search-wrapper" id="global-search-wrapper" style="width: 250px;">
<div class="search-wrapper" id="global-search-wrapper" style="visibility: hidden;width: 250px;">
<svg class="search-icon" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><circle cx="11" cy="11" r="8"/><path d="M21 21l-4.35-4.35"/></svg>
<input type="text" class="search-input" placeholder="Search site..." autocomplete="off">
<div class="search-results"></div>
</div>
</nav>
<a href="/gallery" class="back-btn">
<svg width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" viewBox="0 0 24 24"><path d="M15 19l-7-7 7-7"/></svg>
Back to Gallery
</a>
<main class="gallery-item-main">
<div class="gallery-hero-placeholder"></div>
<section class="section">
<div id="item-content" class="item-content">
<div class="item-skeleton">
<div class="image-col-skeleton skeleton"></div>
<div class="info-col">
<div class="provider-skeleton skeleton"></div>
<div class="title-skeleton skeleton"></div>
<div class="tag-label-skeleton skeleton"></div>
<div class="tags-skeleton skeleton"></div>
<div class="download-skeleton skeleton"></div>
</div>
</div>
<div id="item-main-content" class="item-content"></div>
<div id="similar-section" class="similar-section">
<p style="text-align:center;color:var(--text-secondary);opacity:0.7;padding:3rem 0;">Loading similar images...</p>
</div>
</section>
</main>

View File

@@ -30,10 +30,14 @@
<button class="nav-button">Marketplace</button>
</div>
<div class="search-wrapper" id="global-search-wrapper" style="width: 250px;">
<svg class="search-icon" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><circle cx="11" cy="11" r="8"/><path d="M21 21l-4.35-4.35"/></svg>
<input type="text" class="search-input" placeholder="Search site..." autocomplete="off">
<div class="search-results"></div>
<div class="search-wrapper" style="width: 350px;">
<input type="text" id="main-search-input" class="search-input" placeholder="Search in gallery..." autocomplete="off">
<div class="search-results">
<button id="favorites-toggle-nav" class="fav-toggle-btn" title="Mostrar favoritos" style="margin: 10px; width: auto; font-size: 0.85rem;">
<i class="far fa-heart"></i>
<span class="fav-text">Favorites Mode</span>
</button>
</div>
</div>
</nav>
@@ -42,16 +46,7 @@
<section class="section">
<div class="gallery-controls">
<div class="search-provider-wrapper">
<select id="provider-selector" class="provider-selector"></select>
<i class="fa-solid fa-chevron-down provider-icon"></i>
</div>
<div class="search-gallery-wrapper">
<i class="fa-solid fa-magnifying-glass search-icon"></i>
<input type="text" id="gallery-search-input" class="search-input" placeholder="Search gallery images..." autocomplete="off">
</div>
<select id="provider-selector" class="provider-selector"></select>
</div>
<div class="gallery-results grid" id="gallery-results">