fix: DifferenceCards grid uniforme 3 columnas iguales

- Sacar bento grid asimétrico (hero card col-span-2)
- Todas las cards mismo tamaño, padding y tipografía
- Eliminar 'Equipo de 3 ingenieros SRE' y avatares
- Renombrar clases bento-* → diff-*
This commit is contained in:
Mauricio López Coria
2026-07-01 23:52:37 -03:00
parent 1db0e7a185
commit 9ef05f8eea
+15 -68
View File
@@ -1,6 +1,5 @@
--- ---
// "Por qué elegirnos" — Bento grid with glass cards + magnetic hover glow // "Por qué elegirnos" — Uniform 3-column grid with glass cards
// Phase 3 — Organic Fluidity Premium
import SectionEyebrow from './SectionEyebrow.astro'; import SectionEyebrow from './SectionEyebrow.astro';
import type { TranslationKey } from '@/i18n/ui'; import type { TranslationKey } from '@/i18n/ui';
import MateIcon from './icons/MateIcon.astro'; import MateIcon from './icons/MateIcon.astro';
@@ -12,16 +11,8 @@ interface Props {
} }
const { t } = Astro.props; const { t } = Astro.props;
interface DiffItem { const items = [
Icon?: typeof MateIcon; { Icon: MateIcon, titleKey: 'diff.support.title' as TranslationKey, bodyKey: 'diff.support.body' as TranslationKey },
titleKey: TranslationKey;
bodyKey: TranslationKey;
hero?: boolean;
area?: string;
}
const items: DiffItem[] = [
{ Icon: MateIcon, titleKey: 'diff.support.title' as TranslationKey, bodyKey: 'diff.support.body' as TranslationKey, hero: true },
{ Icon: SovereigntyIcon, titleKey: 'diff.sovereignty.title' as TranslationKey, bodyKey: 'diff.sovereignty.body' as TranslationKey }, { Icon: SovereigntyIcon, titleKey: 'diff.sovereignty.title' as TranslationKey, bodyKey: 'diff.sovereignty.body' as TranslationKey },
{ Icon: GlobeIcon, titleKey: 'diff.infra.title' as TranslationKey, bodyKey: 'diff.infra.body' as TranslationKey }, { Icon: GlobeIcon, titleKey: 'diff.infra.title' as TranslationKey, bodyKey: 'diff.infra.body' as TranslationKey },
]; ];
@@ -38,49 +29,18 @@ const items: DiffItem[] = [
</p> </p>
</div> </div>
<!-- Bento Grid: asymmetric 3-column layout --> <div class="diff-grid">
<div class="bento-grid">
{items.map((item, i) => ( {items.map((item, i) => (
<article <article class="glass-card diff-card p-8 flex flex-col" data-diff-index={i}>
class:list={[
'glass-card bento-item p-8 md:p-10 flex flex-col',
{ 'bento-hero md:col-span-2 md:row-span-2': item.hero },
]}
data-bento-index={i}
>
<div class="icon-circle mb-6"> <div class="icon-circle mb-6">
{item.Icon && <item.Icon class="w-7 h-7" />} <item.Icon class="w-7 h-7" />
</div> </div>
<h3 <h3 class="text-xl md:text-2xl font-semibold mb-4" style="color: var(--hds-fg);">
class:list={[
'mb-4',
{ 'text-2xl md:text-3xl': item.hero, 'text-xl md:text-2xl': !item.hero },
]}
style="color: var(--hds-fg); font-weight: 600;"
>
{t(item.titleKey)} {t(item.titleKey)}
</h3> </h3>
<p <p class="text-[15px] leading-relaxed" style="color: var(--hds-fg-soft);">
class:list={[
'leading-relaxed',
{ 'text-base md:text-lg': item.hero, 'text-[15px]': !item.hero },
]}
style="color: var(--hds-fg-soft);"
>
{t(item.bodyKey)} {t(item.bodyKey)}
</p> </p>
{item.hero && (
<div class="mt-6 pt-6 border-t flex items-center gap-4" style="border-color: var(--glass-border);">
<div class="flex -space-x-2">
<div class="w-8 h-8 rounded-full flex items-center justify-center text-[10px] font-bold text-white" style="background: var(--color-hds-naranja);">M</div>
<div class="w-8 h-8 rounded-full flex items-center justify-center text-[10px] font-bold" style="background: var(--color-hds-coral); color: var(--hds-tinta);">+2</div>
</div>
<span class="text-sm" style="color: var(--hds-fg-soft);">
{t('diff.eyebrow') === 'La diferencia' ? 'Equipo de 3 ingenieros SRE' : 'Team of 3 SRE engineers'}
</span>
</div>
)}
</article> </article>
))} ))}
</div> </div>
@@ -93,8 +53,7 @@ const items: DiffItem[] = [
gsap.registerPlugin(ScrollTrigger); gsap.registerPlugin(ScrollTrigger);
// Mouse-tracking glow on glass cards document.querySelectorAll('.diff-card').forEach((card) => {
document.querySelectorAll('.bento-item').forEach((card) => {
card.addEventListener('mousemove', (e) => { card.addEventListener('mousemove', (e) => {
const rect = (e.currentTarget as HTMLElement).getBoundingClientRect(); const rect = (e.currentTarget as HTMLElement).getBoundingClientRect();
const x = ((e.clientX - rect.left) / rect.width) * 100; const x = ((e.clientX - rect.left) / rect.width) * 100;
@@ -104,12 +63,11 @@ const items: DiffItem[] = [
}); });
}); });
// ScrollTrigger stagger reveal
const prefersReduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches; const prefersReduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
if (!prefersReduced) { if (!prefersReduced) {
gsap.from('.bento-item', { gsap.from('.diff-card', {
scrollTrigger: { scrollTrigger: {
trigger: '.bento-grid', trigger: '.diff-grid',
start: 'top 80%', start: 'top 80%',
toggleActions: 'play none none none', toggleActions: 'play none none none',
}, },
@@ -123,31 +81,20 @@ const items: DiffItem[] = [
</script> </script>
<style> <style>
.bento-grid { .diff-grid {
display: grid; display: grid;
grid-template-columns: 1fr; grid-template-columns: 1fr;
gap: 1.5rem; gap: 1.5rem;
} }
@media (min-width: 768px) { @media (min-width: 768px) {
.bento-grid { .diff-grid {
grid-template-columns: repeat(3, 1fr); grid-template-columns: repeat(3, 1fr);
grid-auto-rows: auto;
gap: 1.5rem; gap: 1.5rem;
} }
} }
.bento-item { .diff-card {
min-height: 200px; min-height: 240px;
}
.bento-hero {
min-height: 320px;
}
@media (min-width: 768px) {
.bento-hero {
min-height: 380px;
}
} }
</style> </style>