Overview
The Results Display component shows the final summary after processing all vehicle forms. It presents client information, total costs with breakdown, ITV status for each vehicle, and consolidated observations.HTML Structure
The results section is initially hidden and displayed after form processing:- HTML
- CSS
index.html:68-105
Sections
Client Information Card
Displays customer details from the client form. Container ID:#informacion
Populated by: mostrarInformacionCliente(datos) (script.js:210-218)
Content Structure:
Total Amount Card
Shows cost breakdown by motorization type and grand total. Container ID:#total
Populated by: calcularYMostrarTotal() (script.js:268-319)
Content Structure:
ITV Status Card
Displays approval status for each vehicle. Container ID:#raprobado
Populated by: mostrarEstadosITV() (script.js:223-239)
Content Structure:
Observations Card
Consolidates all vehicle observations. Container ID:#robservaciones
Populated by: mostrarObservaciones() (script.js:244-263)
Content Structure:
Related Functions
mostrarInformacionCliente(datos)
Populates the client information card with customer data.script.js:210-218
datos(Object):nombre(string): Customer first nameapellidos(string): Customer last name(s)razonSocial(string): Business namenAutos(number): Number of vehicles
mostrarEstadosITV()
Displays ITV approval status for all vehicles using data fromvehiculosData array.
script.js:223-239
vehiculosData)
Returns: void
Styling:
.estado-vehiculo.aprobado: Green theme (styles.css:646-650).estado-vehiculo.no-aprobado: Red theme (styles.css:651-655)
mostrarObservaciones()
Consolidates and displays observations from all vehicles.script.js:244-263
vehiculosData)
Returns: void
Behavior: Only displays vehicles with non-empty observations. Shows fallback message if none exist.
calcularYMostrarTotal()
Calculates total cost based on motorization types and displays detailed breakdown.script.js:268-319
vehiculosData)
Returns: void
Pricing:
- Diesel: €50
- Gasolina: €45
- Hibrido: €35
- Electrico: €30
ocultarCaja()
Hides the client and vehicle forms with animation before showing results.script.js:339-355
mostrarResultados()
mostrarResultados()
Reveals the results section with smooth animation.script.js:360-375
- Adds
.showclass to enable grid display - Fades in with transform animation
- Smoothly scrolls results into view
calcularYMostrar()
Orchestrates the entire calculation and display workflow.script.js:693-704
- Validates all vehicle forms
- Calls
calcular()to process data - Calls
ocultarCaja()to hide forms - After 500ms, adds action buttons (print, export, reset)
calcular()
Core calculation function that populates all result sections.script.js:119-148
CSS Classes
.results-section
Main container for all result cards. Hidden by default.styles.css:291-304
.show class is added
.info-card
Individual card wrapper for each result section.styles.css:306-322
.full-width: Spans all grid columns (used for observations)
.total-amount
Highlighted container for total cost display.styles.css:361-374
Dynamic Status Classes
Classes for ITV status indicators:styles.css:638-655
Cost Breakdown Classes
styles.css:663-684
Usage Example
Action Buttons
After results are displayed, additional action buttons are added:script.js:578-604
- Imprimir: Prints results via
imprimirResultados()(script.js:551-573) - Exportar JSON: Downloads data as JSON via
exportarResultados()(script.js:529-548) - Nuevo Formulario: Resets application via
reiniciarFormulario()(script.js:522-526)
Responsive Behavior
- Desktop (>768px): Auto-fit grid with multiple columns
- Tablet (768px): Single column layout (styles.css:448-452)
- Mobile (<480px): Reduced padding (styles.css:472-478)
Accessibility Features
- Semantic HTML with proper heading hierarchy
- High contrast text on colored backgrounds
- Keyboard-accessible action buttons
- Smooth scroll to results when displayed
- Clear visual distinction between approved/rejected status