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:
@@ -63,52 +63,103 @@
|
||||
font-size: 0.8rem;
|
||||
font-weight: 500;
|
||||
color: #999;
|
||||
transition: color 0.3s ease;
|
||||
transition: all 0.3s ease;
|
||||
white-space: nowrap;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/* Highlight active label based on parent container state */
|
||||
/* Flag icons - special styling */
|
||||
.flag-icon {
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
/* Highlight active label/icon based on parent container state */
|
||||
.language-toggle:has(#langToggle:not(:checked)) .toggle-label-left,
|
||||
.cv-length-toggle:has(#lengthToggle:not(:checked)) .toggle-label-left,
|
||||
.logo-toggle:has(#logoToggle:not(:checked)) .toggle-label-left {
|
||||
color: #fff;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.language-toggle:has(#langToggle:checked) .toggle-label-right,
|
||||
.cv-length-toggle:has(#lengthToggle:checked) .toggle-label-right,
|
||||
.logo-toggle:has(#logoToggle:checked) .toggle-label-right {
|
||||
color: #fff;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* Dim inactive icons */
|
||||
.language-toggle:has(#langToggle:not(:checked)) .toggle-label-right,
|
||||
.cv-length-toggle:has(#lengthToggle:not(:checked)) .toggle-label-right,
|
||||
.logo-toggle:has(#logoToggle:not(:checked)) .toggle-label-right {
|
||||
opacity: 0.4;
|
||||
}
|
||||
|
||||
.language-toggle:has(#langToggle:checked) .toggle-label-left,
|
||||
.cv-length-toggle:has(#lengthToggle:checked) .toggle-label-left,
|
||||
.logo-toggle:has(#logoToggle:checked) .toggle-label-left {
|
||||
opacity: 0.4;
|
||||
}
|
||||
|
||||
/* Experience Item with Logo Support */
|
||||
.experience-item {
|
||||
margin-bottom: 1.5rem;
|
||||
margin-bottom: 2.5rem;
|
||||
padding-bottom: 2rem;
|
||||
border-bottom: 2px solid #ddd;
|
||||
page-break-inside: avoid;
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
gap: 1.2rem;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.experience-item:last-child {
|
||||
border-bottom: none;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.company-logo {
|
||||
display: none; /* Hidden by default */
|
||||
display: block;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.company-logo img {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
object-fit: contain;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #ddd;
|
||||
background: white;
|
||||
}
|
||||
|
||||
.default-company-icon {
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #ddd;
|
||||
background: #f5f5f5;
|
||||
color: #999;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.experience-content {
|
||||
flex: 1;
|
||||
min-width: 0; /* Prevents flex item from overflowing */
|
||||
}
|
||||
|
||||
/* Show logos when toggle is active */
|
||||
/* Hide logos when toggle is OFF */
|
||||
.cv-paper:not(.show-logos) .company-logo {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Show logos when toggle is ON (default) */
|
||||
.show-logos .company-logo {
|
||||
display: block;
|
||||
}
|
||||
|
||||
+9
-4
@@ -437,11 +437,16 @@ a:hover {
|
||||
|
||||
.experience-period,
|
||||
.experience-separator,
|
||||
.experience-location {
|
||||
color: #aaa;
|
||||
font-weight: 500;
|
||||
.experience-location,
|
||||
.experience-duration {
|
||||
color: #555;
|
||||
font-weight: 600;
|
||||
display: inline-block;
|
||||
font-size: 0.9rem;
|
||||
font-size: 1.05rem;
|
||||
}
|
||||
|
||||
.experience-duration {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.short-desc {
|
||||
|
||||
Reference in New Issue
Block a user