- Fixed syntax errors: hexToRgb function completion and this.azienda.logo reference
- Implemented complete generaPDFCliente() with shop-mode style graphics
* Professional gradient header with brand colors from logo
* Info cards for company and client with colored headers
* Milestone table with MVP and additional milestones
* Summary totals box with INPS, IVA, and withholding tax support
* KPI stats section for hours breakdown
- Implemented complete generaPDFInterno() for internal analysis
* Reserved document header with orange theme
* Active team members section with rates
* Two-column financial analysis (revenue vs costs)
* KPI dashboard with margin and hours metrics
* Tax regime information section
- Both PDFs now feature rounded corners, alternating backgrounds, and professional typography
- PDFs adapt colors from uploaded logo for brand consistency
Fixed JavaScript syntax error:
- Removed extra comma after generaPDFInterno() closing brace (line 2679)
- Error: 'missing : in conditional expression' at line 2681:30
The comma was causing the parser to expect another property in the
object literal, but instead found the closing brace.
Before: }, (extra comma caused syntax error)
After: } (correct - last method in object)
Features added to project-mode.html:
- Logo upload section in 'Dati Azienda' (matches shop-mode design)
- Base64 logo encoding and preview
- K-means color palette extraction (5-7 colors)
- Average color calculation as brand color
- Visual palette display with color chips
Functions copied from shop-mode:
- handleLogoUpload() - File upload with size validation (2MB max)
- extractDominantColor() - K-means clustering algorithm
- kMeansClustering() - Palette extraction with convergence
- rgbToHex() / hexToRgb() - Color conversion utilities
PDF improvements:
- generaPDFCliente() now includes logo in header
- generaPDFInterno() now includes logo in header
- Dynamic brand colors from extracted palette
- Responsive layout (centered without logo, left-aligned with logo)
- White card background for logo with subtle border
Data persistence:
- logoColor and colorPalette added to salvaDati()
- Logo and palette restored in caricaPreventivoSalvato()
UI features:
- Drag & drop logo upload
- Real-time color extraction on upload
- Palette visualization (8x8px color chips with hover effect)
- Brand color display with hex value
- Delete logo button
Algorithm specs:
- Skip whites (RGB > 235), blacks (< 20), grays (sat < 0.2)
- 3-6 clusters based on image complexity
- 10 iterations with early convergence
- Lightness filter (0.25-0.80 range)
- Sort by saturation (most vibrant first)
Both modes now have identical logo/branding features!
- Add shop-mode.html and project-mode.html for separate calculation
modes - Refactor index.html as a landing page for mode selection - Add
Dockerfile with optimized nginx config and healthcheck - Add
.dockerignore for cleaner Docker builds - Add deploy.sh for
Helm/Kubernetes deployment automation - Add helm-chart/ with
values.yaml, Chart.yaml, templates, and documentation - Update README.md
with full instructions, features, and CI/CD examples