added manual matching on books

This commit is contained in:
2026-01-02 16:54:40 +01:00
parent f5cfa29b64
commit 59fdadd288
18 changed files with 1235 additions and 494 deletions

View File

@@ -16,6 +16,7 @@
<link rel="stylesheet" href="/views/css/anime/player.css" />
<link rel="stylesheet" href="/views/css/components/titlebar.css">
<script src="/src/scripts/titlebar.js"></script>
<link rel="stylesheet" href="/views/css/components/match-modal.css">
</head>
<body>
<div id="titlebar">
@@ -103,20 +104,6 @@
<select id="extension-select" class="glass-select"></select>
</div>
</div>
<div class="modal-overlay" id="match-modal">
<div class="modal-content download-settings-content">
<button class="modal-close" id="close-match-modal"></button>
<h2 class="modal-title">Manual Match</h2>
<div class="dl-section">
<input type="text" id="match-search-input" class="glass-input" placeholder="Search in this extension..." autocomplete="off">
</div>
<div class="download-sections-wrapper">
<div id="match-results-list" class="dl-list"></div>
</div>
</div>
</div>
</div>
<div class="video-frame">
@@ -234,9 +221,9 @@
<script src="/src/scripts/utils/media-metadata-utils.js"></script>
<script src="/src/scripts/utils/youtube-player-utils.js"></script>
<script src="/src/scripts/utils/list-modal-manager.js"></script>
<script src="/src/scripts/utils/match-modal.js"></script>
<script src="/src/scripts/anime/player.js"></script>
<script src="/src/scripts/anime/entry.js"></script>
</body>
</html>

View File

@@ -11,6 +11,7 @@
<link rel="stylesheet" href="/views/css/books/book.css">
<link rel="stylesheet" href="/views/css/components/updateNotifier.css">
<link rel="stylesheet" href="/views/css/components/titlebar.css">
<link rel="stylesheet" href="/views/css/components/match-modal.css">
<script src="/src/scripts/titlebar.js"></script>
</head>
<body>
@@ -91,6 +92,12 @@
<h2>Chapters</h2>
<div class="chapter-controls">
<button id="manual-match-btn" class="glass-btn-icon" style="display: none;" title="Manual Match">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path>
<path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path>
</svg>
</button>
<select id="provider-filter" class="glass-select" style="display: none;">
<option value="all">All Providers</option>
</select>
@@ -150,6 +157,7 @@
<script src="/src/scripts/utils/pagination-manager.js"></script>
<script src="/src/scripts/utils/media-metadata-utils.js"></script>
<script src="/src/scripts/utils/list-modal-manager.js"></script>
<script src="/src/scripts/utils/match-modal.js"></script>
<script src="/src/scripts/books/book.js"></script>
<script src="/src/scripts/auth-guard.js"></script>
</body>

View File

@@ -935,78 +935,4 @@ body.stop-scrolling {
background: rgba(255, 255, 255, 0.15);
border-color: var(--brand-color);
box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}
/* Reutilización para los resultados de búsqueda */
.match-item {
display: flex;
align-items: center;
gap: 12px;
background: rgba(255, 255, 255, 0.05);
padding: 10px;
border-radius: 6px;
cursor: pointer;
transition: background 0.2s;
}
.match-item:hover {
background: rgba(255, 255, 255, 0.15);
}
.match-item img {
width: 40px;
height: 56px;
object-fit: cover;
border-radius: 4px;
background: #222;
}
.match-title {
font-weight: 600;
font-size: 0.95rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: #fff;
}
.match-meta {
font-size: 0.8rem;
color: #aaa;
}
/* Estado activo (seleccionado actualmente si quisieras marcarlo) */
.match-item.active {
border: 1px solid var(--brand-color);
background: rgba(139, 92, 246, 0.1);
}
.btn-view-source {
display: flex;
align-items: center;
justify-content: center;
padding: 8px;
background: rgba(255, 255, 255, 0.1);
border-radius: 6px;
color: rgba(255, 255, 255, 0.7);
transition: all 0.2s ease;
border: 1px solid rgba(255, 255, 255, 0.1);
text-decoration: none;
margin-left: auto; /* Empuja el botón a la derecha */
}
.btn-view-source:hover {
background: var(--brand-color);
color: white;
border-color: var(--brand-color-light);
transform: scale(1.1);
}
/* Ajuste para que el texto no choque con el botón */
.match-info {
flex: 1;
margin-right: 10px;
display: flex;
flex-direction: column;
overflow: hidden;
}

View File

@@ -0,0 +1,282 @@
/* match-modal.css */
:root {
--match-primary: #8b5cf6;
--match-bg: rgba(15, 15, 15, 0.95);
--match-border: rgba(255, 255, 255, 0.1);
--match-input-bg: rgba(0, 0, 0, 0.4);
--match-text-muted: #a1a1aa;
}
/* Overlay Global con efecto Glass */
.match-modal-overlay {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.85);
backdrop-filter: blur(8px);
z-index: 9999;
display: flex;
align-items: center;
justify-content: center;
padding: 1rem;
opacity: 0;
visibility: hidden;
transition: all 0.3s ease;
}
.match-modal-overlay.active {
opacity: 1;
visibility: visible;
}
/* Contenido del Modal */
.match-modal-content {
background: var(--match-bg);
border: 1px solid var(--match-border);
border-radius: 16px;
width: 100%;
max-width: 700px; /* Un poco más ancho para mejor lectura */
max-height: 85vh;
display: flex;
flex-direction: column;
box-shadow:
0 25px 80px rgba(0, 0, 0, 0.9),
0 0 0 1px rgba(255, 255, 255, 0.05);
transform: scale(0.95) translateY(10px);
transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
overflow: hidden;
}
.match-modal-overlay.active .match-modal-content {
transform: scale(1) translateY(0);
}
/* Header Estilizado */
.match-header {
padding: 1.5rem 2rem;
border-bottom: 1px solid var(--match-border);
display: flex;
justify-content: space-between;
align-items: center;
background: linear-gradient(to bottom, rgba(255,255,255,0.02), transparent);
}
.match-title {
font-size: 1.5rem;
font-weight: 800;
margin: 0;
letter-spacing: -0.02em;
/* Efecto gradiente en el texto como en anilist-modal */
background: linear-gradient(to right, #fff, #aaa);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
#match-provider-badge {
opacity: 0.6;
font-size: 0.8em;
margin-left: 8px;
font-weight: normal;
-webkit-text-fill-color: #888; /* Resetear el gradiente para el badge */
}
.match-close-btn {
background: rgba(255, 255, 255, 0.03);
border: 1px solid var(--match-border);
color: #ccc;
width: 32px;
height: 32px;
border-radius: 8px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s;
}
.match-close-btn:hover {
background: #ef4444;
border-color: #ef4444;
color: white;
transform: rotate(90deg);
}
/* Buscador y Controles */
.match-search-container {
padding: 1.5rem 2rem 1rem 2rem;
display: flex;
gap: 1rem;
background: rgba(0,0,0,0.2);
}
.match-input {
flex: 1;
background: var(--match-input-bg);
border: 1px solid var(--match-border);
color: white;
padding: 1rem 1.2rem;
border-radius: 10px;
font-size: 1rem;
font-family: inherit;
font-weight: 500;
transition: all 0.2s ease;
outline: none;
}
.match-input:focus {
background: rgba(0,0,0,0.6);
border-color: var(--match-primary);
box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}
.match-search-btn {
padding: 0 1.8rem;
background: var(--match-primary);
color: white;
border: none;
border-radius: 10px;
font-weight: 700;
cursor: pointer;
transition: all 0.2s ease;
box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}
.match-search-btn:hover {
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
filter: brightness(1.1);
}
/* Lista de Resultados */
.match-results-body {
flex: 1;
overflow-y: auto;
padding: 0.5rem 2rem 2rem 2rem;
scrollbar-width: thin;
scrollbar-color: rgba(255,255,255,0.2) transparent;
}
.match-results-body::-webkit-scrollbar { width: 6px; }
.match-results-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 10px; }
.match-list-grid {
display: flex;
flex-direction: column;
gap: 0.8rem;
margin-top: 1rem;
}
/* Tarjeta de Resultado Mejorada */
.match-item {
display: flex;
align-items: center;
gap: 1.2rem;
background: rgba(255, 255, 255, 0.02);
padding: 0.8rem;
border-radius: 12px;
border: 1px solid transparent;
transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
cursor: pointer;
position: relative;
}
.match-item:hover {
background: rgba(255, 255, 255, 0.06);
border-color: rgba(255, 255, 255, 0.1);
transform: translateX(4px);
box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.match-poster {
width: 50px;
height: 72px;
object-fit: cover;
border-radius: 8px;
background: #222;
flex-shrink: 0;
box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.match-info {
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
gap: 0.3rem;
min-width: 0;
}
.match-item-title {
font-size: 1rem;
font-weight: 600;
color: #fff;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.match-item-meta {
font-size: 0.85rem;
color: var(--match-text-muted);
font-weight: 500;
}
/* Botón de enlace externo refinado */
.match-link-btn {
display: flex;
align-items: center;
justify-content: center;
width: 36px;
height: 36px;
background: rgba(255, 255, 255, 0.05);
border-radius: 8px;
color: rgba(255, 255, 255, 0.4);
transition: all 0.2s;
border: 1px solid rgba(255, 255, 255, 0.05);
margin-left: 0.5rem;
}
.match-link-btn:hover {
background: var(--match-primary);
color: white;
border-color: var(--match-primary);
transform: scale(1.05);
box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}
/* Mensajes y Spinner */
.match-spinner {
width: 40px; height: 40px;
border: 3px solid rgba(255,255,255,0.1);
border-top-color: var(--match-primary);
border-radius: 50%;
animation: spin 0.8s linear infinite;
margin: 3rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.match-msg {
text-align: center;
color: var(--match-text-muted);
margin-top: 3rem;
font-size: 0.95rem;
}
.match-msg.error { color: #ef4444; }
/* Responsive */
@media (max-width: 768px) {
.match-modal-content {
height: 100%;
max-height: 100vh;
border-radius: 0;
border: none;
}
.match-search-container {
flex-direction: column;
gap: 0.8rem;
}
.match-search-btn {
width: 100%;
padding: 1rem;
}
}