Skip to content

Grain Gradient Hero

A copy-paste hero sections component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.

Hero SectionsHTMLCSSany framework

Texture matters.

Get started

Copy into your project

HTML
<!-- Grain Gradient Hero — drifting gradient + film-grain overlay -->
<section class="nuda-grainh">
  <div class="nuda-grainh__grain"></div>
  <div class="nuda-grainh__content">
    <h2>Texture matters.</h2>
    <button class="nuda-grainh__btn" type="button">Get started</button>
  </div>
</section>
CSS
/* Grain Gradient Hero
   Slowly shifting dark gradient with a stepped film-grain overlay.
   Customize: gradient stops, --grainh-accent. */

.nuda-grainh {
  --grainh-accent: #e4ff54;
  position: relative;
  width: 100%;
  height: 420px;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a05, #09090b 55%, #0d1a12);
  background-size: 200% 200%;
  animation: nuda-grainh-shift 10s ease infinite;
}

.nuda-grainh__grain {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.18) 0.5px, transparent 0.5px);
  background-size: 3px 3px;
  opacity: 0.35;
  mix-blend-mode: overlay;
  animation: nuda-grainh-grain 0.6s steps(3) infinite;
}

.nuda-grainh__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.nuda-grainh__content h2 {
  font: 800 clamp(2rem, 5vw, 3.5rem) ui-sans-serif, system-ui, sans-serif;
  color: #fafafa;
  margin: 0;
  letter-spacing: -0.02em;
}

.nuda-grainh__btn {
  padding: 10px 24px;
  background: var(--grainh-accent);
  border: none;
  color: #09090b;
  font: 700 0.95rem ui-sans-serif, system-ui, sans-serif;
  border-radius: 8px;
  cursor: pointer;
}

@keyframes nuda-grainh-shift {
  0%, 100% { background-position: 0% 0%; }
  50%      { background-position: 100% 100%; }
}

@keyframes nuda-grainh-grain {
  0%   { transform: translate(0, 0); }
  33%  { transform: translate(-1px, 1px); }
  66%  { transform: translate(1px, -1px); }
  100% { transform: translate(0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .nuda-grainh, .nuda-grainh__grain { animation: none; }
}

How to use Grain Gradient Hero

Paste the HTML where you need it and the CSS into a global stylesheet (or a <style> tag). Every class is prefixed nuda- so it never collides with Tailwind or your own styles. Tweak the CSS custom properties to match your design system.

Works in React, Vue, Svelte, Astro, Next.js, Nuxt, Laravel Blade, Django, Rails — or a single .html file. No npm install, no build step.

More hero sections components

← Browse all NudaUI components