Implement complete autoparts catalog system (5 phases)

FASE 1: Parts Database
- Added part_categories, part_groups, parts, vehicle_parts tables
- 12 categories, 190 groups with Spanish translations
- API endpoints for categories, groups, parts CRUD

FASE 2: Cross-References & Aftermarket
- Added manufacturers, aftermarket_parts, part_cross_references tables
- 24 manufacturers, quality tier system (economy/standard/premium/oem)
- Part number search across OEM and aftermarket

FASE 3: Exploded Diagrams
- Added diagrams, vehicle_diagrams, diagram_hotspots tables
- SVG viewer with zoom controls and interactive hotspots
- 3 sample diagrams (brake, oil filter, suspension)

FASE 4: Search & VIN Decoder
- SQLite FTS5 full-text search with auto-sync triggers
- NHTSA VIN decoder API integration with 30-day cache
- Unified search endpoint

FASE 5: Optimization & UX
- API pagination (page/per_page, max 100 items)
- Dark mode with localStorage persistence
- Keyboard shortcuts (/, Ctrl+K, Escape, Backspace, Ctrl+D)
- Breadcrumb navigation
- ARIA accessibility (labels, roles, focus management)
- Skip link for keyboard users

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-05 07:13:46 +00:00
parent 61474f7abe
commit d4d1c9b7ba
14 changed files with 7262 additions and 41 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Base de Datos de Vehículos</title>
<title>Catálogo de Autopartes</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
<style>
@@ -12,26 +12,50 @@
--secondary-color: #3498db;
--accent-color: #e74c3c;
--bg-color: #ecf0f1;
--text-color: #212529;
--card-bg: #ffffff;
--border-color: #dee2e6;
--header-gradient-start: #2c3e50;
--header-gradient-end: #1a252f;
--table-hover-bg: #f8f9fa;
--muted-text: #7f8c8d;
}
[data-theme="dark"] {
--primary-color: #4a6fa5;
--secondary-color: #5dade2;
--accent-color: #e74c3c;
--bg-color: #1a1a2e;
--text-color: #eee;
--card-bg: #16213e;
--border-color: #0f3460;
--header-gradient-start: #0f3460;
--header-gradient-end: #1a1a2e;
--table-hover-bg: #1f2a44;
--muted-text: #a0a0a0;
}
body {
background-color: var(--bg-color);
color: var(--text-color);
min-height: 100vh;
transition: background-color 0.3s ease, color 0.3s ease;
}
.dashboard-header {
background: linear-gradient(135deg, var(--primary-color), #1a252f);
background: linear-gradient(135deg, var(--header-gradient-start), var(--header-gradient-end));
color: white;
padding: 2rem 0;
margin-bottom: 2rem;
}
.breadcrumb-nav {
background: white;
background: var(--card-bg);
padding: 1rem 1.5rem;
border-radius: 10px;
margin-bottom: 1.5rem;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
transition: background-color 0.3s ease;
}
.breadcrumb-nav .breadcrumb {
@@ -49,13 +73,13 @@
}
.breadcrumb-nav .breadcrumb-item.active {
color: var(--primary-color);
color: var(--text-color);
font-weight: 600;
}
/* Tarjetas de marcas */
.brand-card {
background: white;
background: var(--card-bg);
border-radius: 15px;
padding: 2rem;
text-align: center;
@@ -87,24 +111,24 @@
.brand-card .brand-name {
font-size: 1.3rem;
font-weight: 700;
color: var(--primary-color);
color: var(--text-color);
margin-bottom: 0.5rem;
}
.brand-card .brand-count {
color: #7f8c8d;
color: var(--muted-text);
font-size: 0.9rem;
}
.brand-card .brand-country {
font-size: 0.85rem;
color: #95a5a6;
color: var(--muted-text);
margin-top: 0.5rem;
}
/* Tarjetas de modelos */
.model-card {
background: white;
background: var(--card-bg);
border-radius: 12px;
padding: 1.5rem;
transition: all 0.3s ease;
@@ -122,18 +146,18 @@
.model-card .model-name {
font-size: 1.2rem;
font-weight: 600;
color: var(--primary-color);
color: var(--text-color);
margin-bottom: 0.5rem;
}
.model-card .model-info {
color: #7f8c8d;
color: var(--muted-text);
font-size: 0.9rem;
}
/* Tarjetas de vehículos */
.vehicle-card {
background: white;
background: var(--card-bg);
border-radius: 12px;
overflow: hidden;
transition: all 0.3s ease;
@@ -146,7 +170,7 @@
}
.vehicle-header {
background: linear-gradient(135deg, var(--primary-color), #1a252f);
background: linear-gradient(135deg, var(--header-gradient-start), var(--header-gradient-end));
color: white;
padding: 1.2rem;
}
@@ -178,6 +202,7 @@
border-radius: 8px;
text-align: center;
font-size: 0.85rem;
transition: background-color 0.3s ease;
}
.spec-item i {
@@ -188,20 +213,24 @@
.spec-item .spec-value {
font-weight: 600;
color: var(--primary-color);
color: var(--text-color);
}
/* Filtros en vista de vehículos */
.filters-bar {
background: white;
background: var(--card-bg);
padding: 1rem 1.5rem;
border-radius: 10px;
margin-bottom: 1.5rem;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
transition: background-color 0.3s ease;
}
.filters-bar .form-select {
border-radius: 8px;
background-color: var(--card-bg);
color: var(--text-color);
border-color: var(--border-color);
}
/* Grid de contenido */
@@ -222,17 +251,187 @@
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.content-grid.categories-grid {
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
/* Tarjetas de categorías */
.category-card {
background: var(--card-bg);
border-radius: 15px;
padding: 2rem;
text-align: center;
transition: all 0.3s ease;
cursor: pointer;
border: 2px solid transparent;
height: 100%;
}
.category-card:hover {
transform: translateY(-10px);
box-shadow: 0 15px 30px rgba(0,0,0,0.15);
border-color: var(--accent-color);
}
.category-card .category-icon {
width: 70px;
height: 70px;
background: linear-gradient(135deg, var(--accent-color), #c0392b);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto 1rem;
font-size: 1.8rem;
color: white;
}
.category-card .category-name {
font-size: 1.1rem;
font-weight: 700;
color: var(--text-color);
margin-bottom: 0.5rem;
}
.category-card .category-count {
color: var(--muted-text);
font-size: 0.85rem;
}
/* Tabla de partes */
.parts-table {
background: var(--card-bg);
border-radius: 12px;
overflow: hidden;
box-shadow: 0 2px 15px rgba(0,0,0,0.1);
transition: background-color 0.3s ease;
}
.parts-table table {
width: 100%;
margin-bottom: 0;
}
.parts-table thead {
background: linear-gradient(135deg, var(--header-gradient-start), var(--header-gradient-end));
color: white;
}
.parts-table thead th {
padding: 1rem;
font-weight: 600;
border: none;
}
.parts-table tbody tr {
transition: background-color 0.2s ease;
}
.parts-table tbody tr:hover {
background-color: var(--table-hover-bg);
}
.parts-table tbody td {
padding: 0.8rem 1rem;
vertical-align: middle;
border-bottom: 1px solid var(--border-color);
color: var(--text-color);
}
.parts-table .btn-view {
background: var(--secondary-color);
color: white;
border: none;
padding: 0.4rem 1rem;
border-radius: 6px;
font-size: 0.85rem;
transition: all 0.3s;
}
.parts-table .btn-view:hover {
background: #2980b9;
}
/* Botón Ver Partes */
.btn-parts {
background: var(--accent-color);
color: white;
border: none;
padding: 0.6rem 1.2rem;
border-radius: 8px;
font-weight: 500;
transition: all 0.3s;
width: 100%;
margin-top: 1rem;
}
.btn-parts:hover {
background: #c0392b;
color: white;
}
/* Modal de detalle de parte */
.part-detail-header {
background: linear-gradient(135deg, var(--header-gradient-start), var(--header-gradient-end));
color: white;
padding: 1.5rem;
border-radius: 0;
}
.part-detail-body {
padding: 1.5rem;
background-color: var(--card-bg);
}
.part-detail-row {
display: flex;
justify-content: space-between;
padding: 0.8rem 0;
border-bottom: 1px solid var(--border-color);
}
.part-detail-row:last-child {
border-bottom: none;
}
.part-detail-label {
font-weight: 600;
color: var(--secondary-color);
}
.part-detail-value {
color: var(--text-color);
}
.modal-content {
background-color: var(--card-bg);
color: var(--text-color);
}
.modal-footer {
background-color: var(--card-bg);
border-top-color: var(--border-color);
}
.part-oem-badge {
background: var(--secondary-color);
color: white;
padding: 0.3rem 0.8rem;
border-radius: 20px;
font-size: 0.9rem;
}
/* Estados */
.loading-state, .empty-state {
text-align: center;
padding: 4rem 2rem;
color: #7f8c8d;
color: var(--muted-text);
}
.loading-state i, .empty-state i {
font-size: 4rem;
margin-bottom: 1rem;
color: #bdc3c7;
color: var(--muted-text);
}
/* Botón volver */
@@ -288,15 +487,464 @@
grid-template-columns: 1fr;
}
}
/* FASE 2: Search bar styles */
.search-bar {
max-width: 500px;
}
.search-bar .form-control {
border-radius: 25px 0 0 25px;
padding: 0.6rem 1.2rem;
border: 2px solid rgba(255,255,255,0.3);
background: rgba(255,255,255,0.1);
color: white;
}
.search-bar .form-control::placeholder {
color: rgba(255,255,255,0.7);
}
.search-bar .form-control:focus {
background: rgba(255,255,255,0.2);
border-color: rgba(255,255,255,0.5);
box-shadow: none;
color: white;
}
.search-bar .btn {
border-radius: 0 25px 25px 0;
padding: 0.6rem 1.2rem;
border: 2px solid rgba(255,255,255,0.3);
border-left: none;
}
/* FASE 2: Quality tier badges */
.quality-badge {
display: inline-block;
padding: 0.25rem 0.6rem;
border-radius: 12px;
font-size: 0.75rem;
font-weight: 600;
color: white;
text-transform: uppercase;
}
.quality-economy { background-color: #f39c12; }
.quality-standard { background-color: #3498db; }
.quality-premium { background-color: #27ae60; }
.quality-oem { background-color: #9b59b6; }
/* FASE 2: Search results modal */
.search-results-list {
max-height: 400px;
overflow-y: auto;
}
.search-result-item {
padding: 1rem;
border-bottom: 1px solid #eee;
cursor: pointer;
transition: background-color 0.2s;
}
.search-result-item:hover {
background-color: #f8f9fa;
}
.search-result-item:last-child {
border-bottom: none;
}
.search-result-part-number {
font-weight: 600;
color: var(--primary-color);
}
.search-result-name {
color: #666;
font-size: 0.9rem;
}
/* FASE 2: Alternatives table */
.alternatives-section, .crossref-section {
margin-top: 1.5rem;
padding-top: 1.5rem;
border-top: 2px solid #eee;
}
.alternatives-section h5, .crossref-section h5 {
color: var(--primary-color);
margin-bottom: 1rem;
font-weight: 600;
}
.alternatives-table {
width: 100%;
font-size: 0.9rem;
}
.alternatives-table thead {
background-color: #f8f9fa;
}
.alternatives-table th, .alternatives-table td {
padding: 0.75rem;
border-bottom: 1px solid #eee;
}
.alternatives-table tbody tr:hover {
background-color: #f8f9fa;
}
.crossref-badge {
display: inline-block;
background-color: #e9ecef;
color: var(--primary-color);
padding: 0.3rem 0.6rem;
border-radius: 6px;
margin: 0.2rem;
font-size: 0.85rem;
}
.price-tag {
font-weight: 600;
color: #27ae60;
}
/* FASE 3: Diagram viewer styles */
.diagram-viewer {
background: var(--card-bg);
border-radius: 12px;
overflow: hidden;
box-shadow: 0 2px 15px rgba(0,0,0,0.1);
transition: background-color 0.3s ease;
}
.diagram-header {
background: linear-gradient(135deg, var(--header-gradient-start), var(--header-gradient-end));
color: white;
padding: 1rem 1.5rem;
display: flex;
justify-content: space-between;
align-items: center;
}
.diagram-container {
position: relative;
padding: 1rem;
min-height: 400px;
display: flex;
justify-content: center;
align-items: center;
}
.diagram-svg-wrapper {
position: relative;
display: inline-block;
}
.diagram-svg-wrapper svg {
max-width: 100%;
height: auto;
}
.hotspot {
position: absolute;
cursor: pointer;
transition: all 0.2s ease;
}
.hotspot:hover {
transform: scale(1.1);
filter: brightness(1.2);
}
.hotspot-label {
position: absolute;
background: var(--primary-color);
color: white;
padding: 2px 8px;
border-radius: 10px;
font-size: 0.75rem;
font-weight: bold;
pointer-events: none;
white-space: nowrap;
}
.diagram-thumbnails {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
gap: 1rem;
padding: 1rem;
}
.diagram-thumbnail {
background: var(--card-bg);
border-radius: 8px;
padding: 0.5rem;
cursor: pointer;
border: 2px solid transparent;
transition: all 0.2s ease;
}
.diagram-thumbnail:hover, .diagram-thumbnail.active {
border-color: var(--accent-color);
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.diagram-thumbnail img, .diagram-thumbnail svg {
width: 100%;
height: 100px;
object-fit: contain;
}
.diagram-thumbnail-name {
text-align: center;
font-size: 0.85rem;
margin-top: 0.5rem;
color: var(--text-color);
}
.zoom-controls {
display: flex;
gap: 0.5rem;
}
.zoom-controls button {
background: rgba(255,255,255,0.2);
border: none;
color: white;
width: 32px;
height: 32px;
border-radius: 6px;
cursor: pointer;
}
.zoom-controls button:hover {
background: rgba(255,255,255,0.3);
}
/* FASE 4: VIN Decoder styles */
.vin-input-group {
max-width: 400px;
}
.vin-result {
background: var(--card-bg);
border-radius: 12px;
padding: 1.5rem;
margin-top: 1rem;
transition: background-color 0.3s ease;
}
.vin-result-header {
display: flex;
align-items: center;
gap: 1rem;
margin-bottom: 1rem;
}
.vin-badge {
background: var(--header-gradient-start);
color: white;
padding: 0.5rem 1rem;
border-radius: 8px;
font-family: monospace;
font-size: 1.1rem;
letter-spacing: 1px;
}
.vehicle-match-card {
background: linear-gradient(135deg, #27ae60, #2ecc71);
color: white;
border-radius: 10px;
padding: 1rem;
margin-top: 1rem;
}
.vehicle-no-match {
background: #f39c12;
}
.search-tabs {
display: flex;
gap: 0.5rem;
margin-bottom: 1rem;
}
.search-tab {
padding: 0.5rem 1rem;
border: none;
background: #e9ecef;
border-radius: 8px;
cursor: pointer;
transition: all 0.2s;
}
.search-tab.active {
background: var(--secondary-color);
color: white;
}
.search-results-section {
margin-top: 1.5rem;
}
.search-results-section h5 {
color: var(--primary-color);
margin-bottom: 1rem;
padding-bottom: 0.5rem;
border-bottom: 2px solid #eee;
}
/* FASE 4: Enhanced search bar */
.search-bar .btn-vin {
border-radius: 0;
border: 2px solid rgba(255,255,255,0.3);
border-left: none;
background: rgba(255,255,255,0.1);
color: white;
}
.search-bar .btn-vin:hover {
background: rgba(255,255,255,0.2);
}
.search-bar .btn-search {
border-radius: 0 25px 25px 0;
}
/* FASE 5: Dark mode toggle button */
#darkModeToggle {
background: rgba(255,255,255,0.1);
border: 2px solid rgba(255,255,255,0.3);
color: white;
width: 40px;
height: 40px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.3s ease;
}
#darkModeToggle:hover {
background: rgba(255,255,255,0.2);
border-color: rgba(255,255,255,0.5);
}
#darkModeToggle i {
font-size: 1.1rem;
}
/* FASE 5: Keyboard shortcut hint */
.keyboard-hint {
display: inline-block;
background: rgba(255,255,255,0.2);
padding: 0.1rem 0.4rem;
border-radius: 4px;
font-size: 0.75rem;
margin-left: 0.5rem;
font-family: monospace;
}
[data-theme="dark"] .keyboard-hint {
background: rgba(0,0,0,0.3);
}
/* FASE 5: Breadcrumb year display */
.breadcrumb-year {
font-weight: 600;
color: var(--secondary-color);
}
/* FASE 5: Accessibility styles */
.skip-link {
position: absolute;
top: -40px;
left: 0;
background: #000;
color: #fff;
padding: 8px 16px;
z-index: 1000;
text-decoration: none;
font-weight: 600;
border-radius: 0 0 4px 0;
}
.skip-link:focus {
top: 0;
outline: 2px solid #fff;
outline-offset: 2px;
}
/* Focus styles for interactive elements */
.brand-card:focus,
.model-card:focus,
.category-card:focus,
.diagram-thumbnail:focus,
.search-result-item:focus {
outline: 3px solid var(--secondary-color);
outline-offset: 2px;
box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.3);
}
.brand-card:focus-visible,
.model-card:focus-visible,
.category-card:focus-visible,
.diagram-thumbnail:focus-visible,
.search-result-item:focus-visible {
outline: 3px solid var(--secondary-color);
outline-offset: 2px;
}
/* Ensure buttons and links have visible focus */
.btn:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
outline: 3px solid var(--secondary-color);
outline-offset: 2px;
}
/* High contrast focus for dark backgrounds */
.dashboard-header .btn:focus-visible,
.dashboard-header input:focus-visible {
outline-color: #fff;
}
/* Screen reader only class for hidden labels */
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
</style>
</head>
<body>
<div class="dashboard-header">
<!-- FASE 5: Skip to content link for accessibility -->
<a href="#mainContent" class="skip-link">Saltar al contenido</a>
<header class="dashboard-header" role="banner">
<div class="container">
<div class="row align-items-center">
<div class="col-md-6">
<h1><i class="fas fa-car-side"></i> Base de Datos de Vehículos</h1>
<p class="lead mb-0">Explora vehículos por marca, modelo y especificaciones</p>
<div class="d-flex align-items-center gap-3">
<h1 class="mb-0"><i class="fas fa-car-side"></i> Catalogo de Autopartes</h1>
<button class="btn" id="darkModeToggle" title="Alternar modo oscuro (Ctrl+D)">
<i class="fas fa-moon"></i>
</button>
</div>
<p class="lead mb-0 mt-2">Explora vehiculos y partes por marca, modelo y especificaciones</p>
</div>
<div class="col-md-6">
<div class="stats-bar justify-content-md-end">
@@ -312,9 +960,25 @@
<div class="stat-number" id="totalVehicles">0</div>
<div class="stat-label">Vehículos</div>
</div>
<div class="stat-item">
<div class="stat-number" id="totalParts">0</div>
<div class="stat-label">Partes</div>
</div>
</div>
</div>
</div>
<!-- FASE 4: Enhanced Search bar with VIN support -->
<div class="search-bar mt-3">
<div class="input-group">
<input type="text" id="partNumberSearch" class="form-control" placeholder="Buscar por numero de parte o texto... (presiona / para enfocar)" aria-label="Buscar partes" onkeypress="if(event.key==='Enter') dashboard.searchPartNumber()">
<button class="btn btn-vin" onclick="dashboard.openVinDecoder()" title="Decodificar VIN">
<i class="fas fa-barcode"></i>
</button>
<button class="btn btn-light btn-search" onclick="dashboard.searchPartNumber()">
<i class="fas fa-search"></i>
</button>
</div>
</div>
</div>
</div>
@@ -330,34 +994,124 @@
</nav>
</div>
<!-- Barra de filtros (solo visible en vista de vehículos) -->
<div class="filters-bar" id="filtersBar" style="display: none;">
<!-- Barra de filtros (solo visible en vista de vehiculos) -->
<div class="filters-bar" id="filtersBar" style="display: none;" role="search" aria-label="Filtros de vehiculos">
<div class="row g-3 align-items-center">
<div class="col-auto">
<label class="col-form-label fw-bold">Filtrar por:</label>
<span class="col-form-label fw-bold" id="filterLabel">Filtrar por:</span>
</div>
<div class="col-md-3">
<select id="yearFilter" class="form-select">
<label for="yearFilter" class="sr-only">Filtrar por año</label>
<select id="yearFilter" class="form-select" aria-label="Filtrar por año">
<option value="">Todos los años</option>
</select>
</div>
<div class="col-md-3">
<select id="engineFilter" class="form-select">
<label for="engineFilter" class="sr-only">Filtrar por motor</label>
<select id="engineFilter" class="form-select" aria-label="Filtrar por motor">
<option value="">Todos los motores</option>
</select>
</div>
<div class="col-auto">
<span id="resultCount" class="badge bg-secondary fs-6">0 resultados</span>
<span id="resultCount" class="badge bg-secondary fs-6" role="status" aria-live="polite">0 resultados</span>
</div>
</div>
</div>
<!-- Contenedor principal -->
<div id="mainContent">
<div class="loading-state">
<i class="fas fa-spinner fa-spin"></i>
<main id="mainContent" role="main" tabindex="-1" aria-live="polite">
<div class="loading-state" role="status" aria-label="Cargando contenido">
<i class="fas fa-spinner fa-spin" aria-hidden="true"></i>
<h4>Cargando...</h4>
</div>
</main>
</div>
<!-- Modal de Detalle de Parte -->
<div class="modal fade" id="partDetailModal" tabindex="-1" aria-labelledby="partDetailModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg modal-dialog-scrollable">
<div class="modal-content">
<div class="modal-header part-detail-header">
<h5 class="modal-title" id="partDetailModalLabel">
<i class="fas fa-cog"></i> Detalle de Parte
</h5>
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Cerrar"></button>
</div>
<div class="modal-body part-detail-body" id="partDetailContent">
<!-- Contenido dinámico -->
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cerrar</button>
</div>
</div>
</div>
</div>
<!-- FASE 2: Modal de Resultados de Búsqueda -->
<div class="modal fade" id="searchResultsModal" tabindex="-1" aria-labelledby="searchResultsModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header part-detail-header">
<h5 class="modal-title" id="searchResultsModalLabel">
<i class="fas fa-search"></i> Resultados de Búsqueda
</h5>
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Cerrar"></button>
</div>
<div class="modal-body" id="searchResultsContent">
<!-- Contenido dinámico -->
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cerrar</button>
</div>
</div>
</div>
</div>
<!-- FASE 3: Modal de Diagrama -->
<div class="modal fade" id="diagramModal" tabindex="-1" role="dialog" aria-labelledby="diagramModalLabel" aria-modal="true">
<div class="modal-dialog modal-xl">
<div class="modal-content">
<div class="modal-header part-detail-header">
<h5 class="modal-title" id="diagramModalLabel">
<i class="fas fa-project-diagram" aria-hidden="true"></i> Diagrama
</h5>
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Cerrar"></button>
</div>
<div class="modal-body p-0" id="diagramModalContent">
<!-- Dynamic content -->
</div>
</div>
</div>
</div>
<!-- FASE 4: Modal de VIN Decoder -->
<div class="modal fade" id="vinDecoderModal" tabindex="-1" role="dialog" aria-labelledby="vinDecoderModalLabel" aria-modal="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header part-detail-header">
<h5 class="modal-title" id="vinDecoderModalLabel">
<i class="fas fa-barcode" aria-hidden="true"></i> Decodificador de VIN
</h5>
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Cerrar"></button>
</div>
<div class="modal-body" id="vinDecoderContent">
<div class="vin-input-group mb-4">
<label for="vinInput" class="form-label">Ingresa el VIN (17 caracteres)</label>
<div class="input-group">
<input type="text" id="vinInput" class="form-control"
maxlength="17" placeholder="Ej: 4T1BF1FK5CU123456"
style="text-transform: uppercase; font-family: monospace;"
aria-describedby="vinHelp"
onkeypress="if(event.key==='Enter') dashboard.decodeVin()">
<button class="btn btn-primary" onclick="dashboard.decodeVin()" aria-label="Decodificar VIN">
<i class="fas fa-search" aria-hidden="true"></i> Decodificar
</button>
</div>
<small id="vinHelp" class="text-muted">El VIN se encuentra en la placa del tablero o en la puerta del conductor</small>
</div>
<div id="vinResult" role="region" aria-live="polite"></div>
</div>
</div>
</div>
</div>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="600" height="400" viewBox="0 0 600 400" xmlns="http://www.w3.org/2000/svg">
<defs>
<linearGradient id="metalGrad" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" style="stop-color:#b0b0b0"/>
<stop offset="50%" style="stop-color:#808080"/>
<stop offset="100%" style="stop-color:#606060"/>
</linearGradient>
</defs>
<!-- Background -->
<rect width="600" height="400" fill="#f5f5f5"/>
<!-- Title -->
<text x="300" y="30" text-anchor="middle" font-family="Arial, sans-serif" font-size="18" font-weight="bold" fill="#333">
Front Brake Assembly / Ensamble de Freno Delantero
</text>
<!-- Brake Rotor (large circle) -->
<circle cx="250" cy="200" r="120" fill="url(#metalGrad)" stroke="#333" stroke-width="3" id="rotor"/>
<circle cx="250" cy="200" r="100" fill="none" stroke="#555" stroke-width="2"/>
<circle cx="250" cy="200" r="40" fill="#444" stroke="#333" stroke-width="2"/>
<!-- Rotor ventilation slots -->
<line x1="250" y1="60" x2="250" y2="80" stroke="#666" stroke-width="3"/>
<line x1="250" y1="320" x2="250" y2="340" stroke="#666" stroke-width="3"/>
<line x1="130" y1="200" x2="150" y2="200" stroke="#666" stroke-width="3"/>
<line x1="350" y1="200" x2="370" y2="200" stroke="#666" stroke-width="3"/>
<!-- Brake Caliper -->
<rect x="320" y="140" width="80" height="120" rx="10" ry="10" fill="#c0392b" stroke="#922b21" stroke-width="3" id="caliper"/>
<rect x="330" y="155" width="60" height="35" rx="5" ry="5" fill="#e74c3c"/>
<rect x="330" y="210" width="60" height="35" rx="5" ry="5" fill="#e74c3c"/>
<!-- Caliper bolts -->
<circle cx="340" cy="150" r="6" fill="#333"/>
<circle cx="380" cy="150" r="6" fill="#333"/>
<circle cx="340" cy="250" r="6" fill="#333"/>
<circle cx="380" cy="250" r="6" fill="#333"/>
<!-- Brake Pads (visible through caliper) -->
<rect x="300" y="160" width="15" height="80" fill="#8b7355" stroke="#5d4e37" stroke-width="2" id="pad-inner"/>
<rect x="405" y="160" width="15" height="80" fill="#8b7355" stroke="#5d4e37" stroke-width="2" id="pad-outer"/>
<!-- Callout lines and numbers -->
<!-- Callout 1: Brake Rotor -->
<line x1="170" y1="120" x2="100" y2="60" stroke="#333" stroke-width="1.5"/>
<circle cx="100" cy="60" r="15" fill="#3498db" stroke="#2980b9" stroke-width="2"/>
<text x="100" y="65" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white">1</text>
<!-- Callout 2: Brake Caliper -->
<line x1="400" y1="140" x2="480" y2="80" stroke="#333" stroke-width="1.5"/>
<circle cx="480" cy="80" r="15" fill="#3498db" stroke="#2980b9" stroke-width="2"/>
<text x="480" y="85" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white">2</text>
<!-- Callout 3: Brake Pads -->
<line x1="307" y1="250" x2="250" y2="320" stroke="#333" stroke-width="1.5"/>
<circle cx="250" cy="320" r="15" fill="#3498db" stroke="#2980b9" stroke-width="2"/>
<text x="250" y="325" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white">3</text>
<!-- Legend -->
<rect x="440" y="300" width="150" height="90" fill="white" stroke="#ccc" stroke-width="1" rx="5"/>
<text x="515" y="320" text-anchor="middle" font-family="Arial" font-size="12" font-weight="bold" fill="#333">Parts / Partes</text>
<text x="450" y="340" font-family="Arial" font-size="11" fill="#333">1. Brake Rotor / Disco</text>
<text x="450" y="358" font-family="Arial" font-size="11" fill="#333">2. Brake Caliper / Caliper</text>
<text x="450" y="376" font-family="Arial" font-size="11" fill="#333">3. Brake Pads / Balatas</text>
</svg>

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="600" height="400" viewBox="0 0 600 400" xmlns="http://www.w3.org/2000/svg">
<defs>
<linearGradient id="oilGrad" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#8B4513"/>
<stop offset="100%" style="stop-color:#654321"/>
</linearGradient>
<linearGradient id="filterGrad" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0%" style="stop-color:#2c3e50"/>
<stop offset="50%" style="stop-color:#34495e"/>
<stop offset="100%" style="stop-color:#2c3e50"/>
</linearGradient>
</defs>
<!-- Background -->
<rect width="600" height="400" fill="#f5f5f5"/>
<!-- Title -->
<text x="300" y="30" text-anchor="middle" font-family="Arial, sans-serif" font-size="18" font-weight="bold" fill="#333">
Oil Filter System / Sistema de Filtro de Aceite
</text>
<!-- Engine Block (simplified) -->
<rect x="50" y="100" width="200" height="200" fill="#555" stroke="#333" stroke-width="3" rx="10"/>
<text x="150" y="200" text-anchor="middle" font-family="Arial" font-size="14" fill="#ccc">ENGINE</text>
<text x="150" y="220" text-anchor="middle" font-family="Arial" font-size="12" fill="#999">MOTOR</text>
<!-- Oil passage from engine -->
<rect x="250" y="180" width="60" height="20" fill="url(#oilGrad)"/>
<path d="M250,190 L230,190" stroke="#8B4513" stroke-width="8" fill="none"/>
<!-- Oil Filter Housing -->
<rect x="310" y="120" width="100" height="160" fill="#777" stroke="#555" stroke-width="3" rx="5"/>
<!-- Oil Filter (canister type) -->
<rect x="320" y="140" width="80" height="120" fill="url(#filterGrad)" stroke="#1a252f" stroke-width="3" rx="8" id="oil-filter"/>
<!-- Filter ridges -->
<line x1="320" y1="160" x2="400" y2="160" stroke="#1a252f" stroke-width="2"/>
<line x1="320" y1="180" x2="400" y2="180" stroke="#1a252f" stroke-width="2"/>
<line x1="320" y1="200" x2="400" y2="200" stroke="#1a252f" stroke-width="2"/>
<line x1="320" y1="220" x2="400" y2="220" stroke="#1a252f" stroke-width="2"/>
<line x1="320" y1="240" x2="400" y2="240" stroke="#1a252f" stroke-width="2"/>
<!-- Filter label area -->
<rect x="335" y="175" width="50" height="50" fill="#2980b9" rx="3"/>
<text x="360" y="195" text-anchor="middle" font-family="Arial" font-size="10" fill="white">OIL</text>
<text x="360" y="210" text-anchor="middle" font-family="Arial" font-size="10" fill="white">FILTER</text>
<!-- Oil return passage -->
<rect x="410" y="180" width="60" height="20" fill="url(#oilGrad)"/>
<!-- Oil Pan (simplified) -->
<path d="M470,170 L530,170 L550,300 L450,300 Z" fill="#666" stroke="#444" stroke-width="3"/>
<text x="500" y="250" text-anchor="middle" font-family="Arial" font-size="12" fill="#ccc">OIL PAN</text>
<text x="500" y="265" text-anchor="middle" font-family="Arial" font-size="10" fill="#999">CARTER</text>
<!-- Flow arrows -->
<polygon points="275,185 285,190 275,195" fill="#8B4513"/>
<polygon points="435,185 445,190 435,195" fill="#8B4513"/>
<!-- Callout for Oil Filter -->
<line x1="360" y1="140" x2="360" y2="70" stroke="#333" stroke-width="1.5"/>
<line x1="360" y1="70" x2="420" y2="70" stroke="#333" stroke-width="1.5"/>
<circle cx="420" cy="70" r="15" fill="#3498db" stroke="#2980b9" stroke-width="2"/>
<text x="420" y="75" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white">1</text>
<!-- Legend -->
<rect x="50" y="320" width="200" height="60" fill="white" stroke="#ccc" stroke-width="1" rx="5"/>
<text x="150" y="340" text-anchor="middle" font-family="Arial" font-size="12" font-weight="bold" fill="#333">Parts / Partes</text>
<text x="60" y="360" font-family="Arial" font-size="11" fill="#333">1. Oil Filter / Filtro de Aceite</text>
<!-- Oil flow label -->
<text x="300" y="380" text-anchor="middle" font-family="Arial" font-size="10" fill="#666">Oil Flow Direction / Direccion del Flujo de Aceite</text>
</svg>

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="600" height="400" viewBox="0 0 600 400" xmlns="http://www.w3.org/2000/svg">
<defs>
<linearGradient id="strutGrad" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0%" style="stop-color:#444"/>
<stop offset="50%" style="stop-color:#666"/>
<stop offset="100%" style="stop-color:#444"/>
</linearGradient>
<linearGradient id="springGrad" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0%" style="stop-color:#27ae60"/>
<stop offset="50%" style="stop-color:#2ecc71"/>
<stop offset="100%" style="stop-color:#27ae60"/>
</linearGradient>
</defs>
<!-- Background -->
<rect width="600" height="400" fill="#f5f5f5"/>
<!-- Title -->
<text x="300" y="30" text-anchor="middle" font-family="Arial, sans-serif" font-size="18" font-weight="bold" fill="#333">
Front Suspension / Suspension Delantera
</text>
<!-- Vehicle body mounting point -->
<rect x="180" y="50" width="240" height="30" fill="#555" stroke="#333" stroke-width="2"/>
<text x="300" y="70" text-anchor="middle" font-family="Arial" font-size="10" fill="#ccc">BODY / CARROCERIA</text>
<!-- Strut Mount (top) -->
<ellipse cx="300" cy="95" rx="35" ry="15" fill="#888" stroke="#555" stroke-width="2"/>
<!-- Strut Assembly -->
<rect x="285" y="95" width="30" height="150" fill="url(#strutGrad)" stroke="#333" stroke-width="2" id="strut"/>
<!-- Strut piston rod -->
<rect x="293" y="95" width="14" height="60" fill="#999" stroke="#777" stroke-width="1"/>
<!-- Coil Spring around strut -->
<path d="M275,120 Q310,130 275,140 Q240,150 275,160 Q310,170 275,180 Q240,190 275,200 Q310,210 275,220"
fill="none" stroke="url(#springGrad)" stroke-width="8" stroke-linecap="round"/>
<!-- Lower Control Arm -->
<path d="M150,320 L300,280 L450,320" fill="none" stroke="#444" stroke-width="12" stroke-linecap="round"/>
<rect x="140" y="310" width="30" height="30" fill="#666" stroke="#444" stroke-width="2" rx="5"/>
<rect x="430" y="310" width="30" height="30" fill="#666" stroke="#444" stroke-width="2" rx="5"/>
<!-- Ball Joint (connecting strut to control arm) -->
<circle cx="300" cy="280" r="20" fill="#c0392b" stroke="#922b21" stroke-width="3" id="ball-joint"/>
<circle cx="300" cy="280" r="8" fill="#333"/>
<!-- Steering Knuckle (simplified) -->
<rect x="280" y="250" width="40" height="25" fill="#777" stroke="#555" stroke-width="2"/>
<!-- Wheel hub representation -->
<circle cx="300" cy="340" r="40" fill="#444" stroke="#333" stroke-width="3"/>
<circle cx="300" cy="340" r="15" fill="#333"/>
<text x="300" y="345" text-anchor="middle" font-family="Arial" font-size="8" fill="#999">HUB</text>
<!-- Sway Bar Link -->
<line x1="350" y1="300" x2="420" y2="250" stroke="#555" stroke-width="6"/>
<circle cx="350" cy="300" r="6" fill="#777" stroke="#555" stroke-width="2"/>
<circle cx="420" cy="250" r="6" fill="#777" stroke="#555" stroke-width="2"/>
<!-- Callout 1: Strut Assembly -->
<line x1="320" y1="150" x2="420" y2="100" stroke="#333" stroke-width="1.5"/>
<circle cx="420" cy="100" r="15" fill="#3498db" stroke="#2980b9" stroke-width="2"/>
<text x="420" y="105" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white">1</text>
<!-- Callout 2: Ball Joint -->
<line x1="280" y1="280" x2="180" y2="280" stroke="#333" stroke-width="1.5"/>
<line x1="180" y1="280" x2="150" y2="250" stroke="#333" stroke-width="1.5"/>
<circle cx="150" cy="250" r="15" fill="#3498db" stroke="#2980b9" stroke-width="2"/>
<text x="150" y="255" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white">2</text>
<!-- Callout 3: Control Arm -->
<line x1="400" y1="320" x2="500" y2="350" stroke="#333" stroke-width="1.5"/>
<circle cx="500" cy="350" r="15" fill="#3498db" stroke="#2980b9" stroke-width="2"/>
<text x="500" y="355" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white">3</text>
<!-- Legend -->
<rect x="440" y="50" width="150" height="100" fill="white" stroke="#ccc" stroke-width="1" rx="5"/>
<text x="515" y="70" text-anchor="middle" font-family="Arial" font-size="12" font-weight="bold" fill="#333">Parts / Partes</text>
<text x="450" y="90" font-family="Arial" font-size="10" fill="#333">1. Strut / Amortiguador</text>
<text x="450" y="108" font-family="Arial" font-size="10" fill="#333">2. Ball Joint / Rotula</text>
<text x="450" y="126" font-family="Arial" font-size="10" fill="#333">3. Control Arm / Brazo</text>
</svg>

After

Width:  |  Height:  |  Size: 4.5 KiB