# Lift and zoom card

> On hover the card rises, its colored shadow grows and the image inside zooms in slowly.

- Category: [Cards](https://library.aimran.es/components/cards)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/uv-card-lift
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

This hover card is the workhorse of any grid with pictures: collections in an online shop, destinations on a travel blog, listings on a real estate site or recent posts on a magazine homepage. When the cursor arrives, the card floats up, a shadow tinted with your color spreads underneath and the image zooms gently inside its frame.

The demo uses a gradient as the image; swap it for your own photo in the HTML. The zoom crops the edges a little, so avoid pictures with text or faces right at the border.

## Code

### HTML

```html
<div class="uv-kl"><div class="img"></div><div class="tx"><h3>Mountains at sunrise</h3><p>Collection · 24 pieces</p></div></div>
```

### CSS

```css
.uv-kl {
  --c1: #0071e3;
  --c2: #8ec5ff;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uv-kl {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  width: 15em;
  overflow: hidden;
  border-radius: 1.4em;
  font-size: var(--s);
  background: var(--bg);
  box-shadow: 0 2px 10px rgba(0,0,0,.08),0 0 0 1px color-mix(in srgb,var(--fg) 8%,transparent);
  cursor: pointer;
  transition: transform calc(0.45s / var(--k)) cubic-bezier(.25,.1,.25,1),box-shadow calc(0.45s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uv-kl .img {
  height: 10em;
  background: radial-gradient(circle at 70% 30%,#fde68a,transparent 30%),linear-gradient(180deg,var(--c2),var(--c1) 60%,color-mix(in srgb,var(--c1) 50%,#000));
  transition: transform calc(0.6s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uv-kl .tx {
  padding: 1em 1.2em 1.2em;
}

.uv-kl h3 {
  margin: 0;
  font-size: 1em;
  color: var(--fg);
}

.uv-kl p {
  margin: .3em 0 0;
  font-size: .8em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uv-kl:hover {
  transform: translateY(-.5em);
  box-shadow: 0 24px 48px -18px color-mix(in srgb,var(--c1) 55%,transparent),0 0 0 1px color-mix(in srgb,var(--fg) 8%,transparent);
}

.uv-kl:hover .img {
  transform: scale(1.1);
}
```

### React

```tsx
import type { CSSProperties } from "react";

const css = `
.uv-kl {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  width: 15em;
  overflow: hidden;
  border-radius: 1.4em;
  font-size: var(--s);
  background: var(--bg);
  box-shadow: 0 2px 10px rgba(0,0,0,.08),0 0 0 1px color-mix(in srgb,var(--fg) 8%,transparent);
  cursor: pointer;
  transition: transform calc(0.45s / var(--k)) cubic-bezier(.25,.1,.25,1),box-shadow calc(0.45s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uv-kl .img {
  height: 10em;
  background: radial-gradient(circle at 70% 30%,#fde68a,transparent 30%),linear-gradient(180deg,var(--c2),var(--c1) 60%,color-mix(in srgb,var(--c1) 50%,#000));
  transition: transform calc(0.6s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uv-kl .tx {
  padding: 1em 1.2em 1.2em;
}

.uv-kl h3 {
  margin: 0;
  font-size: 1em;
  color: var(--fg);
}

.uv-kl p {
  margin: .3em 0 0;
  font-size: .8em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uv-kl:hover {
  transform: translateY(-.5em);
  box-shadow: 0 24px 48px -18px color-mix(in srgb,var(--c1) 55%,transparent),0 0 0 1px color-mix(in srgb,var(--fg) 8%,transparent);
}

.uv-kl:hover .img {
  transform: scale(1.1);
}
`;

export default function CardLift() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#0071e3",
          "--c2": "#8ec5ff",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uv-kl"><div className="img"></div><div className="tx"><h3>Mountains at sunrise</h3><p>Collection · 24 pieces</p></div></div>
      </div>
    </>
  );
}
```

## Prompt for AI assistants

Paste this into ChatGPT, Claude, Cursor, v0 or Lovable to adapt the block to your stack (Tailwind, Vue, Svelte…):

````text
I want to add the “Lift and zoom card” block (Cards) from AIMRAN Library to my project.

## What it is
On hover the card rises, its colored shadow grows and the image inside zooms in slowly.

## Chosen settings
- Main color: #0071e3
- Secondary color: #8ec5ff
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Mountains at sunrise"

## What I need
1. Add it to my project with the same look and animation as the reference code: same sizes, colours, radii, shadows, timings and easing.
2. It is built with plain HTML and CSS (the reference wraps it in a React component with its CSS). If my project uses something else (Vue, Svelte, Astro, plain HTML…), translate it without losing any behaviour. If I use Tailwind, turn the styles into classes; if not, keep the CSS in its own file.
3. Expose the settings above as props (or CSS variables) with those values as defaults.
4. Make it work well on phones: nothing that depends only on hover, touch targets of at least 44 px and no overflow on 320 px screens.
5. Make it look right in light and dark mode.
6. Keep it accessible: semantic HTML, roles and aria-* where needed, visible focus and keyboard support.
7. Respect prefers-reduced-motion: with reduced motion, no big animations but the same end result.

## Reference code
```tsx
import type { CSSProperties } from "react";

const css = `
.uv-kl {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  width: 15em;
  overflow: hidden;
  border-radius: 1.4em;
  font-size: var(--s);
  background: var(--bg);
  box-shadow: 0 2px 10px rgba(0,0,0,.08),0 0 0 1px color-mix(in srgb,var(--fg) 8%,transparent);
  cursor: pointer;
  transition: transform calc(0.45s / var(--k)) cubic-bezier(.25,.1,.25,1),box-shadow calc(0.45s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uv-kl .img {
  height: 10em;
  background: radial-gradient(circle at 70% 30%,#fde68a,transparent 30%),linear-gradient(180deg,var(--c2),var(--c1) 60%,color-mix(in srgb,var(--c1) 50%,#000));
  transition: transform calc(0.6s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uv-kl .tx {
  padding: 1em 1.2em 1.2em;
}

.uv-kl h3 {
  margin: 0;
  font-size: 1em;
  color: var(--fg);
}

.uv-kl p {
  margin: .3em 0 0;
  font-size: .8em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uv-kl:hover {
  transform: translateY(-.5em);
  box-shadow: 0 24px 48px -18px color-mix(in srgb,var(--c1) 55%,transparent),0 0 0 1px color-mix(in srgb,var(--fg) 8%,transparent);
}

.uv-kl:hover .img {
  transform: scale(1.1);
}
`;

export default function CardLift() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#0071e3",
          "--c2": "#8ec5ff",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uv-kl"><div className="img"></div><div className="tx"><h3>Mountains at sunrise</h3><p>Collection · 24 pieces</p></div></div>
      </div>
    </>
  );
}
```

Give me the complete final code, ready to paste, and tell me in one line where to put it in my project.
````
