43414b79ac
Problem: Inline icons embedded in responsibilities, courses, and projects had explicit width='60' height='60' attributes that made them too large (60px instead of ~16px). Solution: - Added CSS with !important to override inline width/height attributes - Targeted inline icons in: * Course responsibilities and descriptions * Project descriptions and technologies * Experience responsibilities (within divs) - Preserved large icons (80px) for main company/course/project logos Changes: - static/css/03-components/_courses.css: Override to 1.2em - static/css/03-components/_projects.css: Override to 1.2em - static/css/03-components/_cv-section.css: Override to 1.2em Test Results: ✅ 7 course inline icons: 16px × 16px ✅ Main company icons: 80px × 80px (preserved)
282 lines
12 KiB
HTML
282 lines
12 KiB
HTML
{{define "pdf-modal"}}
|
|
<!-- PDF Download Modal - Interactive Thumbnails -->
|
|
<dialog id="pdf-modal" class="info-modal pdf-download-modal no-print"
|
|
_="on click
|
|
if event.target is me
|
|
call me.close()
|
|
end">
|
|
<div class="info-modal-content">
|
|
<!-- Close Button -->
|
|
<button class="info-modal-close"
|
|
onclick="document.getElementById('pdf-modal').close()"
|
|
aria-label="{{if eq .Lang "es"}}Cerrar{{else}}Close{{end}}">
|
|
<iconify-icon icon="mdi:close" width="24" height="24"></iconify-icon>
|
|
</button>
|
|
|
|
<!-- Header -->
|
|
<div class="info-modal-header">
|
|
<iconify-icon icon="catppuccin:pdf" width="40" height="40" style="margin-bottom: 0.5rem;"></iconify-icon>
|
|
<h2>{{if eq .Lang "es"}}Descargar PDF{{else}}Download PDF{{end}}</h2>
|
|
<p class="pdf-modal-subtitle">
|
|
{{if eq .Lang "es"}}Elige tu formato preferido{{else}}Choose your preferred format{{end}}
|
|
</p>
|
|
</div>
|
|
|
|
<!-- Body: Three Thumbnail Cards -->
|
|
<div class="pdf-options-grid">
|
|
|
|
<!-- Short CV Card -->
|
|
<div class="pdf-option-card"
|
|
data-cv-format="short"
|
|
role="radio"
|
|
aria-checked="false"
|
|
aria-label="{{if eq .Lang "es"}}CV Corto - Una página, información esencial{{else}}Short CV - One page, essential information{{end}}"
|
|
tabindex="0"
|
|
_="on click
|
|
-- Remove selected from all cards
|
|
set cards to .pdf-option-card in #pdf-modal
|
|
for card in cards
|
|
remove .selected from card
|
|
set card's @aria-checked to 'false'
|
|
end
|
|
|
|
-- Add selected to this card
|
|
add .selected to me
|
|
set my @aria-checked to 'true'
|
|
|
|
-- Enable download button
|
|
set downloadBtn to .pdf-download-btn in #pdf-modal
|
|
remove @disabled from downloadBtn
|
|
|
|
-- Store selected format
|
|
set :selectedFormat to my @data-cv-format
|
|
|
|
-- Announce to screen readers
|
|
set announcement to #pdf-selection-announcement
|
|
if :selectedFormat is 'short'
|
|
set announcement.textContent to '{{if eq .Lang "es"}}Seleccionado: CV Corto - Una página{{else}}Selected: Short CV - One page{{end}}'
|
|
end
|
|
end
|
|
|
|
on keydown
|
|
if event.key is 'Enter' or event.key is ' '
|
|
halt the event
|
|
trigger click on me
|
|
end
|
|
end">
|
|
|
|
<div class="pdf-thumbnail thumbnail-short">
|
|
<!-- Header representation -->
|
|
<div class="skeleton-block" style="height: 48px;"></div>
|
|
|
|
<!-- Content sections (compact) -->
|
|
<div class="skeleton-block" style="height: 60px;"></div>
|
|
<div class="skeleton-block" style="height: 60px;"></div>
|
|
<div class="skeleton-block" style="height: 60px;"></div>
|
|
|
|
<!-- Page count badge -->
|
|
<div class="thumbnail-badge">
|
|
{{if eq .Lang "es"}}4 Páginas{{else}}4 Pages{{end}}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="pdf-option-info">
|
|
<h3>{{if eq .Lang "es"}}CV Corto{{else}}Short CV{{end}}</h3>
|
|
<p>{{if eq .Lang "es"}}Información esencial{{else}}Essential info{{end}}</p>
|
|
</div>
|
|
|
|
<div class="pdf-option-badge">
|
|
<iconify-icon icon="mdi:check-circle" width="32" height="32"></iconify-icon>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Long CV Card -->
|
|
<div class="pdf-option-card"
|
|
data-cv-format="long"
|
|
role="radio"
|
|
aria-checked="false"
|
|
aria-label="{{if eq .Lang "es"}}CV Completo - Versión completa, todos los detalles{{else}}Long CV - Full version, all details{{end}}"
|
|
tabindex="0"
|
|
_="on click
|
|
-- Remove selected from all cards
|
|
set cards to .pdf-option-card in #pdf-modal
|
|
for card in cards
|
|
remove .selected from card
|
|
set card's @aria-checked to 'false'
|
|
end
|
|
|
|
-- Add selected to this card
|
|
add .selected to me
|
|
set my @aria-checked to 'true'
|
|
|
|
-- Enable download button
|
|
set downloadBtn to .pdf-download-btn in #pdf-modal
|
|
remove @disabled from downloadBtn
|
|
|
|
-- Store selected format
|
|
set :selectedFormat to my @data-cv-format
|
|
|
|
-- Announce to screen readers
|
|
set announcement to #pdf-selection-announcement
|
|
if :selectedFormat is 'long'
|
|
set announcement.textContent to '{{if eq .Lang "es"}}Seleccionado: CV Completo - Versión completa{{else}}Selected: Long CV - Full version{{end}}'
|
|
end
|
|
end
|
|
|
|
on keydown
|
|
if event.key is 'Enter' or event.key is ' '
|
|
halt the event
|
|
trigger click on me
|
|
end
|
|
end">
|
|
|
|
<div class="pdf-thumbnail thumbnail-long">
|
|
<!-- Header representation -->
|
|
<div class="skeleton-block" style="height: 48px;"></div>
|
|
|
|
<!-- More content sections (detailed) -->
|
|
<div class="skeleton-block" style="height: 40px;"></div>
|
|
<div class="skeleton-block" style="height: 40px;"></div>
|
|
<div class="skeleton-block" style="height: 40px;"></div>
|
|
<div class="skeleton-block" style="height: 40px;"></div>
|
|
<div class="skeleton-block" style="height: 40px;"></div>
|
|
|
|
<!-- Page count badge -->
|
|
<div class="thumbnail-badge">
|
|
{{if eq .Lang "es"}}8 Páginas{{else}}8 Pages{{end}}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="pdf-option-info">
|
|
<h3>{{if eq .Lang "es"}}CV Completo{{else}}Long CV{{end}}</h3>
|
|
<p>{{if eq .Lang "es"}}Todos los detalles{{else}}All details{{end}}</p>
|
|
</div>
|
|
|
|
<div class="pdf-option-badge">
|
|
<iconify-icon icon="mdi:check-circle" width="32" height="32"></iconify-icon>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Current View Card -->
|
|
<div class="pdf-option-card"
|
|
data-cv-format="current"
|
|
role="radio"
|
|
aria-checked="false"
|
|
aria-label="{{if eq .Lang "es"}}Vista Actual - Como se ve en pantalla{{else}}Current View - As shown on screen{{end}}"
|
|
tabindex="0"
|
|
_="on click
|
|
-- Remove selected from all cards
|
|
set cards to .pdf-option-card in #pdf-modal
|
|
for card in cards
|
|
remove .selected from card
|
|
set card's @aria-checked to 'false'
|
|
end
|
|
|
|
-- Add selected to this card
|
|
add .selected to me
|
|
set my @aria-checked to 'true'
|
|
|
|
-- Enable download button
|
|
set downloadBtn to .pdf-download-btn in #pdf-modal
|
|
remove @disabled from downloadBtn
|
|
|
|
-- Store selected format
|
|
set :selectedFormat to my @data-cv-format
|
|
|
|
-- Announce to screen readers
|
|
set announcement to #pdf-selection-announcement
|
|
if :selectedFormat is 'current'
|
|
set announcement.textContent to '{{if eq .Lang "es"}}Seleccionado: Vista Actual{{else}}Selected: Current View{{end}}'
|
|
end
|
|
end
|
|
|
|
on keydown
|
|
if event.key is 'Enter' or event.key is ' '
|
|
halt the event
|
|
trigger click on me
|
|
end
|
|
end">
|
|
|
|
<div class="pdf-thumbnail thumbnail-custom">
|
|
<!-- Centered icon representing current screen view -->
|
|
<div class="custom-placeholder">
|
|
<iconify-icon icon="mdi:monitor" width="80" height="80"></iconify-icon>
|
|
<p>{{if eq .Lang "es"}}En Pantalla{{else}}On Screen{{end}}</p>
|
|
</div>
|
|
|
|
<!-- Current view badge -->
|
|
<div class="thumbnail-badge">
|
|
{{if eq .Lang "es"}}Vista Actual{{else}}Current{{end}}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="pdf-option-info">
|
|
<h3>{{if eq .Lang "es"}}Vista Actual{{else}}Current View{{end}}</h3>
|
|
<p>{{if eq .Lang "es"}}Como se ve en pantalla{{else}}As shown on screen{{end}}</p>
|
|
</div>
|
|
|
|
<div class="pdf-option-badge">
|
|
<iconify-icon icon="mdi:check-circle" width="32" height="32"></iconify-icon>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Footer: Download Button -->
|
|
<div class="pdf-modal-footer">
|
|
<button class="pdf-download-btn"
|
|
id="pdf-download-btn"
|
|
disabled
|
|
onclick="downloadPDF()">
|
|
<iconify-icon icon="mdi:download" width="20" height="20"></iconify-icon>
|
|
{{if eq .Lang "es"}}Descargar PDF{{else}}Download PDF{{end}}
|
|
</button>
|
|
</div>
|
|
|
|
<script>
|
|
function downloadPDF() {
|
|
const selectedCard = document.querySelector('#pdf-modal .pdf-option-card.selected');
|
|
if (!selectedCard) {
|
|
console.error('No card selected');
|
|
return;
|
|
}
|
|
|
|
const selectedFormat = selectedCard.getAttribute('data-cv-format');
|
|
const lang = '{{.Lang}}';
|
|
let url;
|
|
|
|
console.log('Download requested for format:', selectedFormat);
|
|
|
|
if (selectedFormat === 'short') {
|
|
// Short CV: clean version (no skills), detailed length
|
|
url = `/export/pdf?lang=${lang}&length=detailed&icons=show&version=clean`;
|
|
} else if (selectedFormat === 'long') {
|
|
// Long CV: with skills sidebar, extended length
|
|
url = `/export/pdf?lang=${lang}&length=extended&icons=show&version=with_skills`;
|
|
} else if (selectedFormat === 'current') {
|
|
// Current view: use localStorage settings
|
|
let currentLength = localStorage.getItem('cv-length') || 'short';
|
|
// Map old values to new naming convention
|
|
if (currentLength === 'short') currentLength = 'detailed';
|
|
if (currentLength === 'long') currentLength = 'extended';
|
|
|
|
const currentIcons = localStorage.getItem('cv-icons') || 'show';
|
|
const currentTheme = localStorage.getItem('cv-theme') || 'default';
|
|
const version = currentTheme === 'clean' ? 'clean' : 'with_skills';
|
|
url = `/export/pdf?lang=${lang}&length=${currentLength}&icons=${currentIcons}&version=${version}`;
|
|
}
|
|
|
|
console.log('Navigating to:', url);
|
|
window.location.href = url;
|
|
|
|
setTimeout(() => {
|
|
document.getElementById('pdf-modal').close();
|
|
}, 500);
|
|
}
|
|
</script>
|
|
|
|
<!-- Screen Reader Announcement Area -->
|
|
<div id="pdf-selection-announcement" class="sr-only" aria-live="polite" aria-atomic="true"></div>
|
|
</div>
|
|
</dialog>
|
|
{{end}}
|