248 lines
8.8 KiB
JavaScript
248 lines
8.8 KiB
JavaScript
// EEAT (Expertise, Experience, Authoritativeness, Trustworthiness) Component
|
|
function createEEAT(options = {}) {
|
|
const defaults = {
|
|
author: {
|
|
name: "Dr. María Elena Rodríguez",
|
|
title: "Consultora Senior en Sistemas ERP",
|
|
experience: "15+ años de experiencia en transformación digital",
|
|
image: "/maria-elena-rodriguez.png"
|
|
},
|
|
publishDate: "20 de julio de 2025",
|
|
modifiedDate: null
|
|
};
|
|
|
|
const settings = { ...defaults, ...options };
|
|
|
|
// Ensure image is always properly set - force global image for consistency
|
|
if (settings.author) {
|
|
// Always use the global María Elena Rodríguez image for consistency
|
|
settings.author.image = "/maria-elena-rodriguez.png";
|
|
|
|
// If no name is provided, use default
|
|
if (!settings.author.name) {
|
|
settings.author.name = "Dr. María Elena Rodríguez";
|
|
}
|
|
|
|
// If no title is provided, use default
|
|
if (!settings.author.title) {
|
|
settings.author.title = "Consultora Senior en Sistemas ERP";
|
|
}
|
|
|
|
// If no experience is provided, use default
|
|
if (!settings.author.experience) {
|
|
settings.author.experience = "15+ años de experiencia en transformación digital";
|
|
}
|
|
}
|
|
|
|
return `
|
|
<div class="eeat-section">
|
|
<div class="container">
|
|
<div class="eeat-container">
|
|
<div class="eeat-author-info">
|
|
<div class="eeat-author-image">
|
|
<div class="author-photo-container">
|
|
<img
|
|
src="${settings.author.image}"
|
|
alt="${settings.author.name}"
|
|
class="author-photo"
|
|
onerror="this.onerror=null; this.style.display='none'; this.parentElement.classList.add('fallback');"
|
|
/>
|
|
<div class="author-photo-fallback">
|
|
<svg width="80" height="80" viewBox="0 0 80 80" fill="none">
|
|
<circle cx="40" cy="40" r="40" fill="#2a2a2a"/>
|
|
<path d="M40 45C47.732 45 54 38.732 54 31C54 23.268 47.732 17 40 17C32.268 17 26 23.268 26 31C26 38.732 32.268 45 40 45Z" fill="#FF6B35"/>
|
|
<path d="M40 50C26.745 50 16 58.954 16 70V72C16 73.105 16.895 74 18 74H62C63.105 74 64 73.105 64 72V70C64 58.954 53.255 50 40 50Z" fill="#FF6B35"/>
|
|
</svg>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="eeat-author-details">
|
|
<h3 class="eeat-author-name">${settings.author.name}</h3>
|
|
<p class="eeat-author-title">${settings.author.title}</p>
|
|
<p class="eeat-author-experience">${settings.author.experience}</p>
|
|
<div class="eeat-dates">
|
|
<span class="eeat-publish-date">
|
|
<strong>Publicado:</strong> ${settings.publishDate}
|
|
</span>
|
|
${settings.modifiedDate ? `
|
|
<span class="eeat-modified-date">
|
|
<strong>Actualizado:</strong> ${settings.modifiedDate}
|
|
</span>
|
|
` : ''}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="eeat-trust-signals">
|
|
<div class="trust-signal">
|
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="#FF6B35">
|
|
<path d="M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z"/>
|
|
</svg>
|
|
<span>Experto Certificado</span>
|
|
</div>
|
|
<div class="trust-signal">
|
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="#FF6B35">
|
|
<path d="M9 11H7V13H9V11ZM13 11H11V13H13V11ZM17 11H15V13H17V11ZM19 4H18V2H16V4H8V2H6V4H5C3.89 4 3.01 4.9 3.01 6L3 20C3 21.1 3.89 22 5 22H19C20.1 22 21 21.1 21 20V6C21 4.9 20.1 4 19 4ZM19 20H5V9H19V20Z"/>
|
|
</svg>
|
|
<span>${settings.author.experience}</span>
|
|
</div>
|
|
<div class="trust-signal">
|
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="#FF6B35">
|
|
<path d="M12 1L3 5V11C3 16.55 6.84 21.74 12 23C17.16 21.74 21 16.55 21 11V5L12 1ZM10 17L6 13L7.41 11.59L10 14.17L16.59 7.58L18 9L10 17Z"/>
|
|
</svg>
|
|
<span>Contenido Verificado</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<style>
|
|
.eeat-section {
|
|
background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
|
|
border-top: 2px solid var(--primary-color);
|
|
border-bottom: 2px solid var(--primary-color);
|
|
padding: 3rem 0;
|
|
margin: 3rem 0;
|
|
}
|
|
|
|
.eeat-container {
|
|
background: var(--light-bg);
|
|
border-radius: 12px;
|
|
padding: 2rem;
|
|
border: 1px solid rgba(255,107,53,0.2);
|
|
box-shadow: 0 4px 20px rgba(255,107,53,0.1);
|
|
}
|
|
|
|
.eeat-author-info {
|
|
display: flex;
|
|
gap: 1.5rem;
|
|
align-items: center;
|
|
margin-bottom: 2rem;
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
.eeat-author-image {
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.author-photo-container {
|
|
width: 80px;
|
|
height: 80px;
|
|
border-radius: 50%;
|
|
overflow: hidden;
|
|
border: 3px solid var(--primary-color);
|
|
box-shadow: 0 4px 12px rgba(255,107,53,0.3);
|
|
position: relative;
|
|
background: #2a2a2a;
|
|
}
|
|
|
|
.author-photo {
|
|
width: 100%;
|
|
height: 100%;
|
|
object-fit: cover;
|
|
display: block;
|
|
}
|
|
|
|
.author-photo-fallback {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
display: none;
|
|
}
|
|
|
|
.author-photo-container.fallback .author-photo-fallback {
|
|
display: block;
|
|
}
|
|
|
|
.author-photo-container.fallback .author-photo {
|
|
display: none;
|
|
}
|
|
|
|
.eeat-author-details {
|
|
flex: 1;
|
|
min-width: 250px;
|
|
}
|
|
|
|
.eeat-author-name {
|
|
color: var(--primary-color);
|
|
font-size: 1.5rem;
|
|
margin: 0 0 0.5rem 0;
|
|
}
|
|
|
|
.eeat-author-title {
|
|
color: var(--white);
|
|
font-size: 1.1rem;
|
|
margin: 0 0 0.25rem 0;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.eeat-author-experience {
|
|
color: var(--text-color);
|
|
margin: 0 0 1rem 0;
|
|
}
|
|
|
|
.eeat-dates {
|
|
display: flex;
|
|
gap: 2rem;
|
|
flex-wrap: wrap;
|
|
color: var(--text-color);
|
|
font-size: 0.9rem;
|
|
}
|
|
|
|
.eeat-dates strong {
|
|
color: var(--primary-color);
|
|
}
|
|
|
|
.eeat-trust-signals {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
|
gap: 1rem;
|
|
padding-top: 1.5rem;
|
|
border-top: 1px solid rgba(255,107,53,0.2);
|
|
}
|
|
|
|
.trust-signal {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.75rem;
|
|
padding: 0.75rem;
|
|
background: rgba(255,107,53,0.05);
|
|
border-radius: 8px;
|
|
border: 1px solid rgba(255,107,53,0.2);
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.trust-signal:hover {
|
|
background: rgba(255,107,53,0.1);
|
|
border-color: var(--primary-color);
|
|
transform: translateY(-2px);
|
|
}
|
|
|
|
.trust-signal svg {
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.trust-signal span {
|
|
color: var(--text-color);
|
|
font-size: 0.9rem;
|
|
font-weight: 500;
|
|
}
|
|
|
|
@media (max-width: 768px) {
|
|
.eeat-author-info {
|
|
flex-direction: column;
|
|
text-align: center;
|
|
}
|
|
|
|
.eeat-dates {
|
|
justify-content: center;
|
|
}
|
|
|
|
.eeat-trust-signals {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
}
|
|
</style>
|
|
`;
|
|
} |