feat: Hero section (01) with HV-1 hormozi + V-a editorial variants
This commit is contained in:
1 parent
d218b19655
commit
ccfcf71491
3 files changed
+70
-96
No files matched your search
+4
-96
@@ -1,101 +1,9 @@
|
|||||||
import Image from "next/image";
|
import { Hero } from '@/components/sections/Hero';
|
||||||
|
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
return (
|
return (
|
||||||
<div className="grid grid-rows-[20px_1fr_20px] items-center justify-items-center min-h-screen p-8 pb-20 gap-16 sm:p-20 font-[family-name:var(--font-geist-sans)]">
|
<main>
|
||||||
<main className="flex flex-col gap-8 row-start-2 items-center sm:items-start">
|
<Hero variant="editorial" />
|
||||||
<Image
|
</main>
|
||||||
className="dark:invert"
|
|
||||||
src="https://nextjs.org/icons/next.svg"
|
|
||||||
alt="Next.js logo"
|
|
||||||
width={180}
|
|
||||||
height={38}
|
|
||||||
priority
|
|
||||||
/>
|
|
||||||
<ol className="list-inside list-decimal text-sm text-center sm:text-left font-[family-name:var(--font-geist-mono)]">
|
|
||||||
<li className="mb-2">
|
|
||||||
Get started by editing{" "}
|
|
||||||
<code className="bg-black/[.05] dark:bg-white/[.06] px-1 py-0.5 rounded font-semibold">
|
|
||||||
app/page.tsx
|
|
||||||
</code>
|
|
||||||
.
|
|
||||||
</li>
|
|
||||||
<li>Save and see your changes instantly.</li>
|
|
||||||
</ol>
|
|
||||||
|
|
||||||
<div className="flex gap-4 items-center flex-col sm:flex-row">
|
|
||||||
<a
|
|
||||||
className="rounded-full border border-solid border-transparent transition-colors flex items-center justify-center bg-foreground text-background gap-2 hover:bg-[#383838] dark:hover:bg-[#ccc] text-sm sm:text-base h-10 sm:h-12 px-4 sm:px-5"
|
|
||||||
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
>
|
|
||||||
<Image
|
|
||||||
className="dark:invert"
|
|
||||||
src="https://nextjs.org/icons/vercel.svg"
|
|
||||||
alt="Vercel logomark"
|
|
||||||
width={20}
|
|
||||||
height={20}
|
|
||||||
/>
|
|
||||||
Deploy now
|
|
||||||
</a>
|
|
||||||
<a
|
|
||||||
className="rounded-full border border-solid border-black/[.08] dark:border-white/[.145] transition-colors flex items-center justify-center hover:bg-[#f2f2f2] dark:hover:bg-[#1a1a1a] hover:border-transparent text-sm sm:text-base h-10 sm:h-12 px-4 sm:px-5 sm:min-w-44"
|
|
||||||
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
>
|
|
||||||
Read our docs
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</main>
|
|
||||||
<footer className="row-start-3 flex gap-6 flex-wrap items-center justify-center">
|
|
||||||
<a
|
|
||||||
className="flex items-center gap-2 hover:underline hover:underline-offset-4"
|
|
||||||
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
>
|
|
||||||
<Image
|
|
||||||
aria-hidden
|
|
||||||
src="https://nextjs.org/icons/file.svg"
|
|
||||||
alt="File icon"
|
|
||||||
width={16}
|
|
||||||
height={16}
|
|
||||||
/>
|
|
||||||
Learn
|
|
||||||
</a>
|
|
||||||
<a
|
|
||||||
className="flex items-center gap-2 hover:underline hover:underline-offset-4"
|
|
||||||
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
>
|
|
||||||
<Image
|
|
||||||
aria-hidden
|
|
||||||
src="https://nextjs.org/icons/window.svg"
|
|
||||||
alt="Window icon"
|
|
||||||
width={16}
|
|
||||||
height={16}
|
|
||||||
/>
|
|
||||||
Examples
|
|
||||||
</a>
|
|
||||||
<a
|
|
||||||
className="flex items-center gap-2 hover:underline hover:underline-offset-4"
|
|
||||||
href="https://nextjs.org?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
>
|
|
||||||
<Image
|
|
||||||
aria-hidden
|
|
||||||
src="https://nextjs.org/icons/globe.svg"
|
|
||||||
alt="Globe icon"
|
|
||||||
width={16}
|
|
||||||
height={16}
|
|
||||||
/>
|
|
||||||
Go to nextjs.org →
|
|
||||||
</a>
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { motion } from 'framer-motion';
|
||||||
|
import { Wordmark } from '@/components/primitives/Wordmark';
|
||||||
|
import { CTA } from '@/components/primitives/CTA';
|
||||||
|
import { Container } from '@/components/primitives/Container';
|
||||||
|
import { hero } from '@/lib/content';
|
||||||
|
import { easeOutExpo, fadeInUp, staggerContainer } from '@/lib/motion';
|
||||||
|
|
||||||
|
type Variant = 'hormozi' | 'editorial';
|
||||||
|
|
||||||
|
export function Hero({ variant = 'editorial' }: { variant?: Variant }) {
|
||||||
|
const isHormozi = variant === 'hormozi';
|
||||||
|
const headlineBase = isHormozi
|
||||||
|
? 'font-sans font-black uppercase tracking-tight'
|
||||||
|
: 'font-serif italic font-bold';
|
||||||
|
const headlineSize = 'text-4xl md:text-6xl leading-[1.1]';
|
||||||
|
|
||||||
|
return (
|
||||||
|
<section className="bg-bg-pure">
|
||||||
|
<Container className="min-h-[88vh] flex flex-col items-center justify-center text-center py-24">
|
||||||
|
<motion.div variants={staggerContainer} initial="hidden" animate="visible" className="flex flex-col items-center">
|
||||||
|
<motion.div variants={fadeInUp}><Wordmark size="xl" /></motion.div>
|
||||||
|
<motion.p variants={fadeInUp} className="mt-6 text-xs md:text-sm tracking-[0.3em] uppercase font-semibold text-gold">
|
||||||
|
{hero.eyebrow}
|
||||||
|
</motion.p>
|
||||||
|
<motion.h1 variants={fadeInUp} className={`mt-8 ${headlineBase} ${headlineSize} text-ink`}>
|
||||||
|
{hero.headline.line1}{' '}
|
||||||
|
<span className="text-gold">{hero.headline.effort}</span>{' '}
|
||||||
|
{hero.headline.line3}{' '}
|
||||||
|
<span style={{ borderBottom: isHormozi ? '5px solid #B8901f' : '3px solid #B8901f', paddingBottom: 2 }}>
|
||||||
|
{hero.headline.clarity}
|
||||||
|
</span>
|
||||||
|
</motion.h1>
|
||||||
|
<motion.div variants={fadeInUp} className="mt-10">
|
||||||
|
<CTA href="#contacto" label={hero.cta} variant="light" />
|
||||||
|
</motion.div>
|
||||||
|
</motion.div>
|
||||||
|
</Container>
|
||||||
|
</section>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import { render, screen } from '@testing-library/react';
|
||||||
|
import { describe, it, expect } from 'vitest';
|
||||||
|
import { Hero } from '../Hero';
|
||||||
|
|
||||||
|
describe('<Hero />', () => {
|
||||||
|
it('renders the eyebrow', () => {
|
||||||
|
render(<Hero variant="editorial" />);
|
||||||
|
expect(screen.getByText(/tu estratega de crecimiento/i)).toBeInTheDocument();
|
||||||
|
});
|
||||||
|
it('renders the headline copy', () => {
|
||||||
|
render(<Hero variant="hormozi" />);
|
||||||
|
expect(screen.getByText(/Tu negocio/i)).toBeInTheDocument();
|
||||||
|
expect(screen.getByText(/más esfuerzo/i)).toBeInTheDocument();
|
||||||
|
expect(screen.getByText(/más claridad/i)).toBeInTheDocument();
|
||||||
|
});
|
||||||
|
it('renders the CTA', () => {
|
||||||
|
render(<Hero variant="editorial" />);
|
||||||
|
expect(screen.getByRole('link', { name: /define tu siguiente movimiento/i })).toBeInTheDocument();
|
||||||
|
});
|
||||||
|
it('does NOT render scarcity (cupos/cohorte)', () => {
|
||||||
|
const { container } = render(<Hero variant="editorial" />);
|
||||||
|
expect(container.textContent).not.toMatch(/cupos|cohorte|generación fundadora/i);
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in new issue
Block a user