Section
Animated Hero
Animated rotating-word hero with floating blobs.
- Section
- Vanilla
- HTML
- MIT
What it does
Capabilities
- ARIA
- Semantic HTML
Preview
Live section
No interactive preview for this section.
Install it with the CLI below, or read the implementation on this page.
Install
Add to your project
npx devsnips add Vanilla/Sections/Hero/hero-animated Vanilla/Sections/Hero/hero-animated <!-- Snippet Name: Animated Hero | Family: Hero | Description: Animated rotating-word hero with floating blobs. | Author: DevSnips Contributors | Usage: Copy the .nb section into your page. -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Animated Hero | DevSnips</title>
<meta name="description" content="Neo-brutalist vanilla HTML/CSS/JS section: hero-animated. Copy, customize, ship.">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap" rel="stylesheet">
<style> /* ---- Neo-Brutalist design tokens ---- */
:root{
--bg:#fbfbf9; --surface:#ffffff; --foreground:#0a0a0a; --muted:#525252;
--border:#0a0a0a; --primary:#4f46e5; --primary-fg:#ffffff;
--accent:#facc15; --pink:#ec4899; --lime:#a3e635; --cyan:#22d3ee;
--radius:6px; --radius-lg:10px;
--shadow:4px 4px 0 var(--border); --shadow-lg:8px 8px 0 var(--border);
--ring:0 0 0 3px #fff, 0 0 0 6px var(--primary);
--container:1200px; --gutter:20px;
--fs-h1:clamp(2.4rem,6vw,4.25rem); --fs-h2:clamp(1.9rem,4vw,2.9rem);
--fs-h3:clamp(1.25rem,2.4vw,1.6rem); --fs-lead:clamp(1.05rem,2vw,1.25rem);
--ff:'Inter',system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
}
@media (prefers-color-scheme:dark){
:root{ --bg:#0a0a0a; --surface:#151515; --foreground:#fafafa; --muted:#a3a3a3;
--border:#fafafa; --ring:0 0 0 3px #000, 0 0 0 6px var(--primary); }
}
/* ---- base layout + components ---- */
*{box-sizing:border-box}
.nb{font-family:var(--ff);background:var(--bg);color:var(--foreground);
line-height:1.6;-webkit-font-smoothing:antialiased;margin:0}
.nb .container{width:100%;max-width:var(--container);margin-inline:auto;padding-inline:var(--gutter)}
.nb section{position:relative;padding-block:clamp(56px,9vw,120px)}
.nb h1,.nb h2,.nb h3,.nb h4{font-weight:800;letter-spacing:-.02em;line-height:1.08;margin:0}
.nb h1{font-size:var(--fs-h1)} .nb h2{font-size:var(--fs-h2)} .nb h3{font-size:var(--fs-h3)}
.nb p{margin:0} .nb a{color:inherit}
.nb .eyebrow{display:inline-flex;align-items:center;gap:8px;font-size:.78rem;
font-weight:700;text-transform:uppercase;letter-spacing:.14em;
border:2px solid var(--border);background:var(--surface);padding:6px 12px;
border-radius:999px;box-shadow:var(--shadow)}
.nb .lead{font-size:var(--fs-lead);color:var(--muted);max-width:62ch}
.nb .muted{color:var(--muted)}
.nb .center{text-align:center;margin-inline:auto}
.nb .grid{display:grid;gap:var(--gutter)}
.nb .btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;
font:inherit;font-weight:700;font-size:.98rem;line-height:1;cursor:pointer;
text-decoration:none;border:3px solid var(--border);border-radius:var(--radius);
padding:14px 22px;background:var(--primary);color:var(--primary-fg);
box-shadow:var(--shadow);transition:transform .12s ease,box-shadow .12s ease,background .12s}
.nb .btn:hover{transform:translate(-2px,-2px);box-shadow:var(--shadow-lg)}
.nb .btn:active{transform:translate(2px,2px);box-shadow:0 0 0 var(--border)}
.nb .btn.outline{background:var(--surface);color:var(--foreground)}
.nb .btn.ghost{background:transparent;border-color:transparent;box-shadow:none}
.nb .btn.ghost:hover{box-shadow:var(--shadow);border-color:var(--border);transform:translate(-2px,-2px)}
.nb .btn.accent{background:var(--accent);color:#0a0a0a}
.nb .card{background:var(--surface);border:3px solid var(--border);border-radius:var(--radius);
box-shadow:var(--shadow);padding:24px;transition:transform .14s ease,box-shadow .14s ease}
.nb .card.hover:hover{transform:translate(-3px,-3px);box-shadow:var(--shadow-lg)}
.nb .badge{display:inline-flex;align-items:center;gap:6px;font-size:.72rem;font-weight:700;
text-transform:uppercase;letter-spacing:.08em;border:2px solid var(--border);
padding:4px 10px;border-radius:999px;background:var(--surface)}
.nb :focus-visible{outline:none;box-shadow:var(--ring);border-radius:4px}
.nb .skip{position:absolute;left:-999px;top:8px;background:var(--accent);color:#000;
padding:10px 16px;border:2px solid var(--border);z-index:50;font-weight:700}
.nb .skip:focus{left:8px}
.nb .visually-hidden{position:absolute!important;width:1px;height:1px;overflow:hidden;
clip:rect(0 0 0 0);white-space:nowrap;border:0;padding:0;margin:-1px}
@media (prefers-reduced-motion:reduce){
.nb *,.nb *::before,.nb *::after{animation-duration:.001ms!important;
transition-duration:.001ms!important;animation-iteration-count:1!important}
}
.ha{text-align:center;overflow:hidden}
.ha h1{margin:18px 0 14px}.ha .lead{margin:0 auto 30px}
.ha .word{display:inline-block;min-width:5ch;color:var(--primary);position:relative}
.ha .word .w{position:absolute;inset:0;display:flex;justify-content:center;align-items:center;opacity:0;transform:translateY(.4em)}
.ha .word .w.on{opacity:1;transform:none;transition:opacity .4s,transform .4s}
.ha .cta{display:flex;gap:14px;justify-content:center;flex-wrap:wrap}
.ha .blobs{position:absolute;inset:0;z-index:0;opacity:.5}
.ha .blobs i{position:absolute;width:240px;height:240px;border-radius:50%;filter:blur(40px);animation:hafloat 9s ease-in-out infinite}
.ha .blobs i:nth-child(1){background:var(--primary);left:8%;top:10%}.ha .blobs i:nth-child(2){background:var(--accent);right:6%;top:30%;animation-delay:-3s}
.ha .blobs i:nth-child(3){background:var(--pink);left:40%;bottom:0;animation-delay:-5s}
.ha .container{position:relative;z-index:2}
@keyframes hafloat{50%{transform:translateY(-26px) scale(1.08)}}
@media(prefers-reduced-motion:reduce){.ha .blobs i{animation:none}.ha .word .w{transition:none}}</style>
</head>
<body class="nb">
<a class="skip" href="#main">Skip to content</a>
<section class="ha" aria-labelledby="ha-title">
<div class="blobs" aria-hidden="true"><i></i><i></i><i></i></div>
<div class="container">
<span class="eyebrow"><svg class="is" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d='M12 2v6M12 16v6M2 12h6M16 12h6M5 5l3 3M16 16l3 3M19 5l-3 3M8 16l-3 3'/></svg> Animated</span>
<h1 id="ha-title">Build it <span class="word" data-cycle aria-hidden="true"><span class="w">faster.</span><span class="w">smarter.</span><span class="w">together.</span><span class="w">anywhere.</span><span class="w on" aria-hidden="true">faster.</span></span><span class="visually-hidden">faster., smarter., together., anywhere.</span></h1>
<p class="lead">An animated hero that keeps attention without distracting. Pauses for reduced-motion users.</p>
<div class="cta"><a class="btn" href="#">Get started</a><a class="btn outline" href="#">Learn more</a></div>
</div>
</section>
<script>
(function(){
var root=document.querySelector('[data-cycle]');if(!root)return;
var spans=[].slice.call(root.querySelectorAll('.w'));
if(spans.length<2)return;
var i=0;
var mq=window.matchMedia('(prefers-reduced-motion:reduce)');
if(mq.matches)return;
setInterval(function(){
spans[i].classList.remove('on');i=(i+1)%spans.length;spans[i].classList.add('on');
},1900);
})();</script>
</body>
</html> # Animated Hero
Animated rotating-word hero with floating blobs.
**Technology:** Vanilla HTML/CSS/JS
**Category:** sections / hero
**Design:** Neo-Brutalist (flat colors, hard shadows, bold borders)
**Responsive:** Mobile-first (320px → 1920px)
**Dark mode:** via `prefers-color-scheme`
**Tags:** hero, animated, text-cycle
**Features:** reduced-motion safe, accessible fallback, visually-hidden text
## Usage
1. Copy the contents of `code.html` into your page.
2. The section is self-contained (inline CSS + JS). No build step.
3. Tweak the CSS variables in `:root` to rebrand. 113 lines UTF-8 · LF · Spaces: 2
DevSnips AI ready Claude · Cursor · Windsurf
Agent skill & Model Context Protocol
Pass this section straight into your AI workflow. DevSnips exposes each resource as a structured, addressable registry entry, so your agent installs the real files instead of approximating them.
devsnips://sections/hero/hero-animated I want to use this DevSnips resource in production: Page: https://devsnips.site/library/vanilla/sections/hero/hero-animated/ Install: npx devsnips add Vanilla/Sections/Hero/hero-animated This is the Animated Hero — Animated rotating-word hero with floating blobs. Use this DevSnips resource as the starting point for my project. Adapt it to my project's stack and conventions, fix any issues, and make it production-ready while preserving its intended design and behavior.
Paste into ChatGPT, Claude or your agent — it already carries the page URL and the exact install path.
Resource URI
devsnips://sections/hero/hero-animated