feat: optimize mobile layout with unified design system
Comprehensive mobile optimization (≤768px) for improved consistency and readability: - Center profile photo between name and intro text on mobile - Unify all logo/icon sizes to 60×60px for visual consistency - Standardize spacing across experience, courses, projects, and awards - Reduce font sizes proportionally for better mobile readability - Remove justified text alignment (except intro/skills) to prevent awkward spacing - Apply consistent 1rem gaps and 1.5rem padding throughout - Optimize sidebar items with reduced margins and font sizes Technical improvements: - Add comprehensive mobile breakpoint rules at 768px - Implement flexible photo positioning (absolute on desktop, static on mobile) - Ensure uniform typography scale across all content types
This commit is contained in:
+79
-21
@@ -185,6 +185,7 @@ func (h *CVHandler) CVContent(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
// ExportPDF handles PDF export requests using chromedp
|
||||
// TEMPORARILY DISABLED - Work in progress
|
||||
func (h *CVHandler) ExportPDF(w http.ResponseWriter, r *http.Request) {
|
||||
// Get language from query parameter
|
||||
lang := r.URL.Query().Get("lang")
|
||||
@@ -198,33 +199,90 @@ func (h *CVHandler) ExportPDF(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
// Construct URL to generate PDF from
|
||||
// Use localhost instead of the actual server address to avoid network overhead
|
||||
url := fmt.Sprintf("http://%s/?lang=%s", h.serverAddr, lang)
|
||||
log.Printf("PDF export requested but temporarily disabled (redirecting to print friendly)")
|
||||
|
||||
log.Printf("Generating PDF from URL: %s", url)
|
||||
|
||||
// Generate PDF
|
||||
pdfData, err := h.pdfGenerator.GenerateFromURL(r.Context(), url)
|
||||
if err != nil {
|
||||
log.Printf("PDF generation failed: %v", err)
|
||||
HandleError(w, r, InternalError(err))
|
||||
return
|
||||
// Return HTML with message and redirect to print friendly
|
||||
message := "PDF Export - Work in Progress"
|
||||
body := "The PDF export feature is currently being improved. Please use the <strong>Print Friendly</strong> button instead (Ctrl+P or Cmd+P to save as PDF)."
|
||||
if lang == "es" {
|
||||
message = "Exportación PDF - En Desarrollo"
|
||||
body = "La función de exportación a PDF está siendo mejorada. Por favor, usa el botón <strong>Imprimir Amigable</strong> en su lugar (Ctrl+P o Cmd+P para guardar como PDF)."
|
||||
}
|
||||
|
||||
// Set response headers
|
||||
filename := fmt.Sprintf("CV-Juan-Andres-Moreno-Rubio-%s.pdf", lang)
|
||||
w.Header().Set("Content-Type", "application/pdf")
|
||||
w.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=%s", filename))
|
||||
w.Header().Set("Content-Length", fmt.Sprintf("%d", len(pdfData)))
|
||||
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
|
||||
// Write PDF data
|
||||
if _, err := w.Write(pdfData); err != nil {
|
||||
log.Printf("Failed to write PDF response: %v", err)
|
||||
return
|
||||
redirectMsg := "Redirecting in 5 seconds..."
|
||||
if lang == "es" {
|
||||
redirectMsg = "Redirigiendo en 5 segundos..."
|
||||
}
|
||||
|
||||
log.Printf("Successfully generated PDF: %s (%d bytes)", filename, len(pdfData))
|
||||
html := fmt.Sprintf(`<!DOCTYPE html>
|
||||
<html lang="%s">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>%s</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: 100vh;
|
||||
margin: 0;
|
||||
background: linear-gradient(135deg, #667eea 0%%, #764ba2 100%%);
|
||||
}
|
||||
.container {
|
||||
background: white;
|
||||
padding: 3rem;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 20px 60px rgba(0,0,0,0.3);
|
||||
max-width: 500px;
|
||||
text-align: center;
|
||||
}
|
||||
h1 {
|
||||
color: #333;
|
||||
margin: 0 0 1rem 0;
|
||||
font-size: 1.8rem;
|
||||
}
|
||||
p {
|
||||
color: #666;
|
||||
line-height: 1.6;
|
||||
margin: 1rem 0;
|
||||
}
|
||||
.redirect-info {
|
||||
margin-top: 2rem;
|
||||
padding: 1rem;
|
||||
background: #f0f4ff;
|
||||
border-radius: 8px;
|
||||
font-size: 0.9rem;
|
||||
color: #555;
|
||||
}
|
||||
.icon {
|
||||
font-size: 3rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
setTimeout(function() {
|
||||
window.location.href = '/?lang=%s';
|
||||
}, 5000);
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="icon">🚧</div>
|
||||
<h1>%s</h1>
|
||||
<p>%s</p>
|
||||
<div class="redirect-info">
|
||||
%s
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>`, lang, message, lang, message, body, redirectMsg)
|
||||
|
||||
w.Write([]byte(html))
|
||||
}
|
||||
|
||||
// splitSkills splits skill categories between left (page 1) and right (page 2) sidebars
|
||||
|
||||
Reference in New Issue
Block a user