# Brushed metal

> A brushed aluminum texture with a streak of light that slides across it every few seconds.

- Category: [Backgrounds](https://library.aimran.es/components/patterns)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/pt-metal
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

Brushed metal gives a page a solid, engineered feel. It’s a good fit for the product page of a watch or audio brand, the landing page of a hardware startup or the top plan on a pricing page. The moving highlight makes the surface feel real, not printed. A brushed metal background made only with CSS gradients.

Dark text reads better than white on the light default colors, so check contrast before you publish. For a gold or copper version, switch the first two colors to warm tones and tint the highlight to match.

## Code

### HTML

```html
<div class="pt-metal"><i></i><b></b></div>
```

### CSS

```css
.pt-metal {
  --c1: #9aa4b2;
  --c2: #d7dde5;
  --c3: #8ec5ff;
  --k: 1;
  /* velocidad */
  --d: 1;
  /* densidad / escala */
  --o: 1;
  /* opacidad */
  --bg: #05060a;
  --fg: #ffffff;
  --blend: screen;
  min-height: 100vh;
}

.pt-metal {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg);
  container-type: size;
  isolation: isolate;
}

.pt-metal>* {
  opacity: var(--o);
}

.pt-metal {
  background: linear-gradient(180deg,color-mix(in srgb,var(--c1) 55%,#16181c),var(--c2) 48%,color-mix(in srgb,var(--c1) 70%,#16181c) 52%,color-mix(in srgb,var(--c1) 40%,#0e0f12))!important;
}

.pt-metal i {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg,rgba(255,255,255,.07) 0 1px,transparent 1px 3px,rgba(0,0,0,.08) 3px 4px),repeating-linear-gradient(0deg,rgba(255,255,255,.05) 0 1px,transparent 1px 7px);
  background-size: 100% calc(4px * var(--d)),100% calc(7px * var(--d));
}

.pt-metal b {
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: 0;
  width: 45%;
  background: linear-gradient(90deg,transparent,color-mix(in srgb,var(--c3) 20%,rgba(255,255,255,.6)),transparent);
  transform: skewX(-20deg);
  filter: blur(10px);
  mix-blend-mode: overlay;
  animation: pt-metal-s calc(5s / var(--k)) ease-in-out infinite;
}

@keyframes pt-metal-s {
  0% {
    translate: -120% 0;
  }
  60%,100% {
    translate: 260% 0;
  }
}
```

### React

```tsx
// @ts-nocheck
import { useEffect, useRef } from "react";

const css = `
.pt-metal {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg);
  container-type: size;
  isolation: isolate;
}

.pt-metal>* {
  opacity: var(--o);
}

.pt-metal {
  background: linear-gradient(180deg,color-mix(in srgb,var(--c1) 55%,#16181c),var(--c2) 48%,color-mix(in srgb,var(--c1) 70%,#16181c) 52%,color-mix(in srgb,var(--c1) 40%,#0e0f12))!important;
}

.pt-metal i {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg,rgba(255,255,255,.07) 0 1px,transparent 1px 3px,rgba(0,0,0,.08) 3px 4px),repeating-linear-gradient(0deg,rgba(255,255,255,.05) 0 1px,transparent 1px 7px);
  background-size: 100% calc(4px * var(--d)),100% calc(7px * var(--d));
}

.pt-metal b {
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: 0;
  width: 45%;
  background: linear-gradient(90deg,transparent,color-mix(in srgb,var(--c3) 20%,rgba(255,255,255,.6)),transparent);
  transform: skewX(-20deg);
  filter: blur(10px);
  mix-blend-mode: overlay;
  animation: pt-metal-s calc(5s / var(--k)) ease-in-out infinite;
}

@keyframes pt-metal-s {
  0% {
    translate: -120% 0;
  }
  60%,100% {
    translate: 260% 0;
  }
}

`;

export default function PatternMetal() {
  const ref = useRef(null);
  return (
    <>
      <style>{css}</style>
      <div
        ref={ref}
        className="pt-metal"
        style={{
          "--c1": "#9aa4b2",
          "--c2": "#d7dde5",
          "--c3": "#8ec5ff",
          "--k": 1,
          "--d": 1,
          "--o": 1,
          "--bg": "#05060a",
          "--fg": "#ffffff",
          "--blend": "screen",
          minHeight: "100vh",
        }}
      >
        <i></i><b></b>
      </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 “Brushed metal” block (Backgrounds) from AIMRAN Library to my project.

## What it is
A brushed aluminum texture with a streak of light that slides across it every few seconds.

## Chosen settings
- Color 1: #9aa4b2
- Color 2: #d7dde5
- Color 3: #8ec5ff
- Speed: 1x (from 0.2 to 3x)
- Density / scale: 1x (from 0.5 to 2x)
- Opacity: 1 (from 0.2 to 1)

## 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
// @ts-nocheck
import { useEffect, useRef } from "react";

const css = `
.pt-metal {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg);
  container-type: size;
  isolation: isolate;
}

.pt-metal>* {
  opacity: var(--o);
}

.pt-metal {
  background: linear-gradient(180deg,color-mix(in srgb,var(--c1) 55%,#16181c),var(--c2) 48%,color-mix(in srgb,var(--c1) 70%,#16181c) 52%,color-mix(in srgb,var(--c1) 40%,#0e0f12))!important;
}

.pt-metal i {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg,rgba(255,255,255,.07) 0 1px,transparent 1px 3px,rgba(0,0,0,.08) 3px 4px),repeating-linear-gradient(0deg,rgba(255,255,255,.05) 0 1px,transparent 1px 7px);
  background-size: 100% calc(4px * var(--d)),100% calc(7px * var(--d));
}

.pt-metal b {
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: 0;
  width: 45%;
  background: linear-gradient(90deg,transparent,color-mix(in srgb,var(--c3) 20%,rgba(255,255,255,.6)),transparent);
  transform: skewX(-20deg);
  filter: blur(10px);
  mix-blend-mode: overlay;
  animation: pt-metal-s calc(5s / var(--k)) ease-in-out infinite;
}

@keyframes pt-metal-s {
  0% {
    translate: -120% 0;
  }
  60%,100% {
    translate: 260% 0;
  }
}

`;

export default function PatternMetal() {
  const ref = useRef(null);
  return (
    <>
      <style>{css}</style>
      <div
        ref={ref}
        className="pt-metal"
        style={{
          "--c1": "#9aa4b2",
          "--c2": "#d7dde5",
          "--c3": "#8ec5ff",
          "--k": 1,
          "--d": 1,
          "--o": 1,
          "--bg": "#05060a",
          "--fg": "#ffffff",
          "--blend": "screen",
          minHeight: "100vh",
        }}
      >
        <i></i><b></b>
      </div>
    </>
  );
}
```

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