feat: enhance experience section with icons, duration, and improved styling
Experience Section Improvements: - Increased company logo size from 48px to 64px - Added default office building icon for companies without logos - Increased spacing between entries (2.5rem margin, 2rem padding) - Added visible separator lines (2px solid #ddd) - Made dates bold (weight: 600) and larger (1.05rem) - Changed date color to #555 for better contrast Dynamic Duration Calculation: - Added automatic years/months calculation for each position - Format: "(4 years 10 months)", "(2 years)", "(6 months)" - Smart pluralization in English and Spanish - Handles current positions (calculates to today) - Added Duration field to Experience model Iconify Integration: - Added Iconify library (v3.1.1) for icon management - Replaced EN/ES text with round flag icons (circle-flags:us, circle-flags:es) - Updated CV site icon to mdi:file-account - Replaced toggle text with intuitive icons: * Short/Long: mdi:file-document-outline / mdi:file-document-multiple-outline * Logos: mdi:image-off-outline / mdi:image-multiple-outline - Default company icon: mdi:office-building (64x64px, light gray background) Logo Display: - Logos now show by default (toggle checked on page load) - Toggle controls icon visibility - Consistent spacing with default icon placeholder Files modified: - internal/handlers/cv.go: Added calculateDuration() function - internal/models/cv.go: Added Duration field to Experience struct - templates/index.html: Iconify integration, flag icons, toggle icons - templates/cv-content.html: Duration display, default icon logic - static/css/main.css: Bold dates, larger font sizes - static/css/logo-toggle.css: Icon styling, separator lines, spacing
This commit is contained in:
@@ -74,11 +74,13 @@
|
||||
|
||||
{{range .CV.Experience}}
|
||||
<div class="experience-item">
|
||||
{{if .CompanyLogo}}
|
||||
<div class="company-logo">
|
||||
<img src="/static/images/companies/{{.CompanyLogo}}" alt="{{.Company}} logo" onerror="this.style.display='none'">
|
||||
{{if .CompanyLogo}}
|
||||
<img src="/static/images/companies/{{.CompanyLogo}}" alt="{{.Company}} logo" onerror="this.parentElement.innerHTML='<span class=\'iconify default-company-icon\' data-icon=\'mdi:office-building\' data-width=\'48\' data-height=\'48\'></span>'">
|
||||
{{else}}
|
||||
<span class="iconify default-company-icon" data-icon="mdi:office-building" data-width="48" data-height="48"></span>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="experience-content">
|
||||
<div class="experience-header">
|
||||
<div class="experience-title-line">
|
||||
@@ -93,6 +95,10 @@
|
||||
{{end}}
|
||||
</h4>
|
||||
<span class="experience-period">{{.StartDate}} / {{if .Current}}{{if eq $.Lang "es"}}presente{{else}}now{{end}}{{else}}{{.EndDate}}{{end}}</span>
|
||||
{{if .Duration}}
|
||||
<span class="experience-separator"> - </span>
|
||||
<span class="experience-duration">{{.Duration}}</span>
|
||||
{{end}}
|
||||
<span class="experience-separator"> - </span>
|
||||
<span class="experience-location">({{.Location}})</span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user