feat(front-end): responsive layout
All checks were successful
Build, Test and Deploy / test-backend (push) Successful in 31s
Build, Test and Deploy / build-and-push (push) Successful in 1m40s
Build, Test and Deploy / deploy (push) Successful in 6s

This commit is contained in:
2026-02-06 11:09:46 +01:00
parent 99ae6db064
commit cb7b44073c
3 changed files with 121 additions and 93 deletions

View File

@@ -1,4 +1,4 @@
import { Component, signal, ViewChild } from '@angular/core';
import { Component, signal, ViewChild, ElementRef } from '@angular/core';
import { CommonModule } from '@angular/common';
import { TranslateModule } from '@ngx-translate/core';
@@ -47,7 +47,7 @@ import { Router } from '@angular/router';
</div>
<!-- Right Column: Result or Info -->
<div class="col-result">
<div class="col-result" #resultCol>
@if (error()) {
<app-alert type="error">Si è verificato un errore durante il calcolo del preventivo.</app-alert>
}
@@ -86,9 +86,10 @@ import { Router } from '@angular/router';
.content-grid {
display: grid;
grid-template-columns: 1fr;
gap: var(--space-8);
gap: var(--space-6);
@media(min-width: 768px) {
grid-template-columns: 1.5fr 1fr;
gap: var(--space-8);
}
}
@@ -98,6 +99,10 @@ import { Router } from '@angular/router';
align-self: center;
}
}
.col-input, .col-result {
min-width: 0; /* Prevent grid blowout */
}
/* Mode Selector (Segmented Control style) */
.mode-selector {
@@ -184,6 +189,7 @@ export class CalculatorPageComponent {
error = signal<boolean>(false);
@ViewChild('uploadForm') uploadForm!: UploadFormComponent;
@ViewChild('resultCol') resultCol!: ElementRef;
constructor(private estimator: QuoteEstimatorService, private router: Router) {}
@@ -194,6 +200,13 @@ export class CalculatorPageComponent {
this.error.set(false);
this.result.set(null);
// Auto-scroll on mobile to make analysis visible
setTimeout(() => {
if (this.resultCol && window.innerWidth < 768) {
this.resultCol.nativeElement.scrollIntoView({ behavior: 'smooth', block: 'start' });
}
}, 100);
this.estimator.calculate(req).subscribe({
next: (event) => {
if (typeof event === 'number') {