Commit Graph

5 Commits

Author SHA1 Message Date
d.viti
e5a72183b5 feat: Add back button to return to index.html in both modes
All checks were successful
Build and Deploy / build (push) Successful in 32s
2025-10-14 00:46:43 +02:00
d.viti
d759bec45d fix: Complete PDF generation with professional graphics in project-mode
All checks were successful
Build and Deploy / build (push) Successful in 41s
- 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
2025-10-14 00:43:46 +02:00
d.viti
720b926f21 fix: Remove trailing comma in generaPDFInterno function
All checks were successful
Build and Deploy / build (push) Successful in 32s
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)
2025-10-14 00:31:55 +02:00
d.viti
9ff03cd41a feat: Add logo and color palette support to project-mode
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!
2025-10-14 00:27:00 +02:00
d.viti
23ec5d5f32 Add multi-mode HTML, Docker, Helm chart, and deploy script
All checks were successful
Build and Deploy / build (push) Successful in 46s
- 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
2025-10-13 23:25:33 +02:00