Gallery Hover Zoom
A copy-paste galleries & carousels component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.
Galleries & CarouselsHTMLCSSany framework
Northern LightsTromsø, 2025
Copy into your project
HTML
<div class="nuda-galzoom">
<div class="nuda-galzoom__inner">
<div class="nuda-galzoom__img" style="background:..."></div>
</div>
<div class="nuda-galzoom__caption">
<span>Northern Lights</span>
<span>Tromsø, 2025</span>
</div>
</div>CSS
.nuda-galzoom {
position: relative;
width: 100%;
max-width: 200px;
border-radius: 12px;
overflow: hidden;
cursor: pointer;
border: 1px solid rgba(255,255,255,.06);
}
.nuda-galzoom__inner {
overflow: hidden;
height: 140px;
}
.nuda-galzoom__img {
width: 100%;
height: 100%;
transform: scale(1);
transition: transform .8s cubic-bezier(.16,1,.3,1),filter .5s;
}
.nuda-galzoom:hover .nuda-galzoom__img {
transform: scale(1.12);
filter: saturate(1.2);
}
.nuda-galzoom__caption {
position: absolute;
left: 0;
right: 0;
bottom: 0;
padding: 14px 12px 8px;
background: linear-gradient(180deg,transparent,rgba(0,0,0,.7));
color: #fafafa;
display: flex;
flex-direction: column;
gap: 1px;
transform: translateY(8px);
transition: transform .35s cubic-bezier(.16,1,.3,1);
}
.nuda-galzoom__caption span:first-child {
font-size: 13px;
font-weight: 600;
}
.nuda-galzoom__caption span:last-child {
font-size: 10px;
color: #a0a0a8;
}
.nuda-galzoom:hover .nuda-galzoom__caption {
transform: translateY(0);
}
How to use Gallery Hover Zoom
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.