Communitygithub.com

hero-section

Design and build the hero (first screen) of a website, including headline layout, media treatment, CTA, proof badge, marquee and entrance animation. Use this whenever someone asks for a hero section, a landing page header, "the top of my homepage", a cinematic or animated intro, a video background, a text marquee, or says their first screen looks plain or generic.

What is hero-section?

hero-section is a Claude Code agent skill that design and build the hero (first screen) of a website, including headline layout, media treatment, CTA, proof badge, marquee and entrance animation. Use this whenever someone asks for a hero section, a landing page header, "the top of my homepage", a cinematic or animated intro, a video background, a text marquee, or says their first screen looks plain or generic.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/imperfec-t/webcraft/tree/main/skills/hero-section

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Hero section

The hero decides whether a visitor scrolls. It needs to say what this is, look intentional, and load fast. Most weak heroes fail on the first or third point, not the second.

Decide the pattern first

Pick one. Mixing them is how heroes get cluttered.

PatternUse whenCore structure
Type-ledStrong positioning, no great imageryOversized multi-line headline, small supporting line, CTA
SplitA product, person or screenshot to showText left, media right, 55/45
Full-bleed mediaCinematic brand, strong video or photoMedia fills the screen, text overlaid with a scrim
Stacked with media cardAgency or studio feelHeadline on top, rounded media block below that grows on scroll
Portfolio wallDesigners, photographersSmall intro line over a grid or carousel of work

Content rules

  • Headline: what you do and for whom, in 6 to 12 words. For type-led heroes, break into 2 or 3 short lines of similar length so the block reads as a shape.
  • Supporting line: one sentence, max 20 words. It adds the detail the headline left out.
  • CTA: a verb plus outcome ("Plan your project"), one primary button. A secondary text link is fine.
  • Proof element: one small badge near the CTA or overlapping the media: a rating, a count, or client logos. Use real numbers only.
  • Do not put a paragraph, a form with more than two fields, or a slider in the hero.

Layout specifics

  • Headline size: clamp(2.5rem, 7vw, 6.5rem), line-height 0.95 to 1.05, letter-spacing -0.02em to -0.04em for large display type.
  • Hero height: min-height: 100svh only for full-bleed media; otherwise let content define height so the next section peeks in.
  • Media corners: 16 to 32px radius for the stacked pattern. Keep one radius across the site.
  • Text over media needs a scrim: a gradient from 60% black to transparent, or 4.5:1 contrast will fail.

Motion that helps

Entrance order: headline lines, then supporting line and CTA, then media, then decorations. Total under 1.6 seconds, because the visitor is waiting.

// Line-by-line headline reveal. Wrap each line: <span class="line"><span>Text</span></span>
// .line { display:block; overflow:hidden }  .line > span { display:block }
gsap.from(".hero .line > span", {
  yPercent: 110, duration: 0.9, ease: "power3.out", stagger: 0.08
});
gsap.from(".hero [data-fade]", {
  y: 24, opacity: 0, duration: 0.7, ease: "power2.out", stagger: 0.08, delay: 0.35
});

Media that grows on scroll:

gsap.fromTo(".hero-media", { scale: 0.86, borderRadius: 32 }, {
  scale: 1, borderRadius: 0, ease: "none",
  scrollTrigger: { trigger: ".hero-media", start: "top 85%", end: "top 15%", scrub: true }
});

Infinite marquee (duplicate the track's content once so the loop is seamless):

.marquee { overflow: hidden; }
.marquee__track { display: flex; gap: 3rem; width: max-content; animation: marquee 28s linear infinite; }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee__track { animation: none; } }

Video backgrounds

  • autoplay muted loop playsinline plus a poster image; without muted and playsinline mobile browsers will not autoplay.
  • Keep it under 3 MB: 8 to 12 seconds, 1280px wide, no audio track, H.264 MP4 with a WebM alternative.
  • Never make the video the LCP blocker: the poster should be a preloaded image.
  • On small screens or prefers-reduced-motion, show the poster only.

Checks

  • Cover the headline: can a stranger still tell what the business does from the rest? If yes, the headline is too vague.
  • First screen at 390px wide shows headline, CTA and part of the media without scrolling.
  • Largest Contentful Paint under 2.5s on a throttled connection.
  • With animations disabled, nothing is invisible or misplaced.

Individual skills in this repo

This repo contains 4 individual skills — each has its own dedicated page.

homepage-blueprint

Plan the section structure and content slots of a homepage for an agency, freelancer, studio or service business before any design or code. Use this whenever someone asks "what sections should my homepage have", "plan my website", "structure a landing page for my business", wants a wireframe or sitemap for a service site, or starts building a homepage without a clear outline.

responsive-layout

Build page layouts that work from phones to wide desktops using CSS grid, flexbox, container queries and fluid sizing, including card grids, bento grids, split sections, sticky sidebars and navigation that collapses. Use this whenever someone says their site "breaks on mobile", asks for a responsive grid, a bento layout, a mobile menu, fixing horizontal scroll or overflow, or is laying out any multi-column section.

scroll-motion

Add scroll-driven and entrance animation to a website with GSAP, ScrollTrigger and Lenis, including reveals, parallax, pinned sections, horizontal scroll, line drawing, counters and preloaders. Use this whenever someone wants a site to "feel premium", asks for smooth scrolling, scroll animations, parallax, text reveals, a pinned or sticky scroll section, an animated preloader, or names GSAP, ScrollTrigger, Lenis, Locomotive or AOS.

website-workflow

Plan and sequence a whole website build, from structure through design, code, WordPress and launch, by routing each stage to the right webcraft skill. Use this when someone asks to "build me a website", "design my site from scratch", "redo our homepage", wants an end-to-end plan for a marketing, agency, studio or service site, or the request spans more than one of structure, look, layout, motion, CMS and QA.

Related Skills