# Save button with floppy disk

> Type and an unsaved dot appears; save with the floppy or Ctrl+S and the metal shutter slides while the drive light blinks.

- Category: [Microinteractions](https://library.aimran.es/components/microinteractions)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/uv-mi27-floppy-save
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

Saving is one of the most repeated actions in any editor, and this block turns it into a small piece of nostalgia. The button is a 3.5 inch floppy drawn in CSS: on save the metal shutter slides, the disk dips as if entering a drive and a green light blinks. It suits note apps, settings panels and document editors.

Typing marks the file as unsaved with an amber dot, and Ctrl+S or Cmd+S saves from anywhere inside the block. Change the main color for the disk plastic and the secondary for the light, and keep the timestamp so people know when they last saved.

## Code

### HTML

```html
<div class="uvq15-fdd"><header><span class="fn">notas-reunion.txt</span><span class="ss"><i></i><b class="st">Saved</b></span></header><textarea rows="3" aria-label="Notes" spellcheck="false">Review the budget with Laura and send the plans before Thursday.</textarea><footer><button type="button" class="dk"><span class="sh" aria-hidden="true"></span><span class="lb">Save</span></button><div class="dr"><span class="led" aria-hidden="true"></span><span class="hk"><kbd>Ctrl</kbd> + <kbd>S</kbd></span><time class="tm">12:00</time></div></footer><p class="sr" aria-live="polite"></p></div>
```

### CSS

```css
.uvq15-fdd {
  --c1: #1d4ed8;
  --c2: #22c55e;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq15-fdd {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  border-radius: 1.3em;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 10%,transparent),0 1.4em 2.6em -1.8em rgba(0,0,0,.35);
  width: 19em;
  padding: 1em;
}

.uvq15-fdd header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6em;
  margin-bottom: .6em;
}

.uvq15-fdd .fn {
  font: 600 .8em ui-monospace,"SF Mono",Menlo,monospace;
}

.uvq15-fdd .ss {
  display: flex;
  align-items: center;
  gap: .35em;
  font-size: .72em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq15-fdd .ss i {
  width: .6em;
  height: .6em;
  border-radius: 50%;
  background: var(--c2);
  transition: background calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq15-fdd.dt .ss i {
  background: #f59e0b;
  animation: uvq15-fdd-p calc(1.2s / var(--k)) ease-in-out infinite;
}

@keyframes uvq15-fdd-p {
  50% {
    opacity: .35;
  }
}

.uvq15-fdd textarea {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: .7em .8em;
  border: 0;
  border-radius: .7em;
  resize: none;
  font: inherit;
  font-size: .85em;
  line-height: 1.45;
  color: inherit;
  background: color-mix(in srgb,var(--fg) 6%,transparent);
  outline: 0;
  box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--fg) 10%,transparent);
}

.uvq15-fdd textarea:focus-visible {
  box-shadow: inset 0 0 0 2px var(--c1);
}

.uvq15-fdd footer {
  display: flex;
  align-items: center;
  gap: .9em;
  margin-top: .9em;
}

.uvq15-fdd .dk {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  flex: none;
  width: 4.4em;
  height: 4.4em;
  border-radius: .3em;
  background: linear-gradient(160deg,color-mix(in srgb,var(--c1) 80%,#fff),var(--c1) 45%,color-mix(in srgb,var(--c1) 70%,#000));
  clip-path: polygon(0 0,88% 0,100% 12%,100% 100%,0 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
  transition: transform .15s cubic-bezier(.25,.1,.25,1);
}

.uvq15-fdd .dk:hover {
  transform: translateY(-2px) rotate(-2deg);
}

.uvq15-fdd .dk:active {
  transform: scale(.95);
}

.uvq15-fdd .dk:focus-visible {
  outline: 0;
  box-shadow: inset 0 0 0 3px #fff,0 0 0 3px var(--c1);
}

.uvq15-fdd .sh {
  position: absolute;
  top: 0;
  left: 1.05em;
  width: 2.3em;
  height: 1.55em;
  border-radius: 0 0 .15em .15em;
  background: linear-gradient(90deg,#94a3b8,#f1f5f9 40%,#cbd5e1 60%,#94a3b8);
}

.uvq15-fdd .sh::after {
  content: "";
  position: absolute;
  top: .25em;
  right: .35em;
  width: .5em;
  height: 1em;
  border-radius: .1em;
  background: #334155;
}

.uvq15-fdd .lb {
  position: absolute;
  left: .45em;
  right: .45em;
  bottom: 0;
  height: 2.1em;
  display: grid;
  place-items: center;
  border-radius: .2em .2em 0 0;
  font-size: .58em;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 .3em;
  color: #1e293b;
  background: repeating-linear-gradient(transparent 0 .55em,#cbd5e1 .55em .6em) 0 .5em/100% 100% no-repeat,#f8fafc;
}

.uvq15-fdd.sv .sh {
  animation: uvq15-fdd-sh calc(1s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq15-fdd.sv .dk {
  animation: uvq15-fdd-dk calc(1s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

@keyframes uvq15-fdd-sh {
  20%,70% {
    transform: translateX(1.1em);
  }
}

@keyframes uvq15-fdd-dk {
  15% {
    transform: translateY(.3em) scale(.97);
  }
  30%,70% {
    transform: translateY(.15em);
  }
}

.uvq15-fdd .dr {
  flex: 1;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: .25em .5em;
  font-size: .75em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq15-fdd .led {
  position: relative;
  width: .7em;
  height: .7em;
  border-radius: 50%;
  background: color-mix(in srgb,var(--c2) 25%,#334155);
  box-shadow: inset 0 1px 1px rgba(0,0,0,.4);
}

.uvq15-fdd .led::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--c2);
  box-shadow: 0 0 .6em var(--c2);
  opacity: 0;
}

.uvq15-fdd.sv .led::after {
  animation: uvq15-fdd-l calc(0.16s / var(--k)) linear 6;
}

@keyframes uvq15-fdd-l {
  0%,49% {
    opacity: 1;
  }
  50%,100% {
    opacity: 0;
  }
}

.uvq15-fdd kbd {
  padding: .1em .4em;
  border-radius: .3em;
  font: inherit;
  font-weight: 700;
  color: var(--fg);
  background: color-mix(in srgb,var(--fg) 6%,transparent);
  box-shadow: inset 0 -1px 0 color-mix(in srgb,var(--fg) 10%,transparent);
}

.uvq15-fdd .tm {
  grid-column: 2;
  font-variant-numeric: tabular-nums;
}

.uvq15-fdd .sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (prefers-reduced-motion:reduce) {
  .uvq15-fdd,.uvq15-fdd *,.uvq15-fdd *::before,.uvq15-fdd *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
```

### JavaScript

```js
document.querySelectorAll(".uvq15-fdd").forEach(el => {
  const k=parseFloat(getComputedStyle(el).getPropertyValue("--k"))||1,rm=matchMedia("(prefers-reduced-motion:reduce)").matches;const ta=el.querySelector("textarea"),dk=el.querySelector(".dk"),st=el.querySelector(".st"),tm=el.querySelector(".tm"),sr=el.querySelector(".sr");let busy=false,dirty=false,t1=0;
const hm=()=>{const d=new Date();return String(d.getHours()).padStart(2,"0")+":"+String(d.getMinutes()).padStart(2,"0")};tm.textContent=hm();
const mark=()=>{el.classList.add("dt");st.textContent="Unsaved"};
ta.addEventListener("input",()=>{dirty=true;if(!busy)mark()});
const save=()=>{if(busy)return;busy=true;dirty=false;el.classList.remove("dt","sv");void el.offsetWidth;el.classList.add("sv");st.textContent="Saving…";
t1=setTimeout(()=>{busy=false;el.classList.remove("sv");tm.textContent=hm();if(dirty){mark();return}st.textContent="Saved";sr.textContent="Document saved"},(rm?150:1000)/k)};
dk.addEventListener("click",save);
el.addEventListener("keydown",e=>{if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()==="s"){e.preventDefault();save()}});return()=>clearTimeout(t1)
});
```

### React

```tsx
// @ts-nocheck: setup() es JavaScript del DOM sin tipos, el mismo de la pestaña JS.
import { useEffect, useRef, type CSSProperties } from "react";

const css = `
.uvq15-fdd {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  border-radius: 1.3em;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 10%,transparent),0 1.4em 2.6em -1.8em rgba(0,0,0,.35);
  width: 19em;
  padding: 1em;
}

.uvq15-fdd header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6em;
  margin-bottom: .6em;
}

.uvq15-fdd .fn {
  font: 600 .8em ui-monospace,"SF Mono",Menlo,monospace;
}

.uvq15-fdd .ss {
  display: flex;
  align-items: center;
  gap: .35em;
  font-size: .72em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq15-fdd .ss i {
  width: .6em;
  height: .6em;
  border-radius: 50%;
  background: var(--c2);
  transition: background calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq15-fdd.dt .ss i {
  background: #f59e0b;
  animation: uvq15-fdd-p calc(1.2s / var(--k)) ease-in-out infinite;
}

@keyframes uvq15-fdd-p {
  50% {
    opacity: .35;
  }
}

.uvq15-fdd textarea {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: .7em .8em;
  border: 0;
  border-radius: .7em;
  resize: none;
  font: inherit;
  font-size: .85em;
  line-height: 1.45;
  color: inherit;
  background: color-mix(in srgb,var(--fg) 6%,transparent);
  outline: 0;
  box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--fg) 10%,transparent);
}

.uvq15-fdd textarea:focus-visible {
  box-shadow: inset 0 0 0 2px var(--c1);
}

.uvq15-fdd footer {
  display: flex;
  align-items: center;
  gap: .9em;
  margin-top: .9em;
}

.uvq15-fdd .dk {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  flex: none;
  width: 4.4em;
  height: 4.4em;
  border-radius: .3em;
  background: linear-gradient(160deg,color-mix(in srgb,var(--c1) 80%,#fff),var(--c1) 45%,color-mix(in srgb,var(--c1) 70%,#000));
  clip-path: polygon(0 0,88% 0,100% 12%,100% 100%,0 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
  transition: transform .15s cubic-bezier(.25,.1,.25,1);
}

.uvq15-fdd .dk:hover {
  transform: translateY(-2px) rotate(-2deg);
}

.uvq15-fdd .dk:active {
  transform: scale(.95);
}

.uvq15-fdd .dk:focus-visible {
  outline: 0;
  box-shadow: inset 0 0 0 3px #fff,0 0 0 3px var(--c1);
}

.uvq15-fdd .sh {
  position: absolute;
  top: 0;
  left: 1.05em;
  width: 2.3em;
  height: 1.55em;
  border-radius: 0 0 .15em .15em;
  background: linear-gradient(90deg,#94a3b8,#f1f5f9 40%,#cbd5e1 60%,#94a3b8);
}

.uvq15-fdd .sh::after {
  content: "";
  position: absolute;
  top: .25em;
  right: .35em;
  width: .5em;
  height: 1em;
  border-radius: .1em;
  background: #334155;
}

.uvq15-fdd .lb {
  position: absolute;
  left: .45em;
  right: .45em;
  bottom: 0;
  height: 2.1em;
  display: grid;
  place-items: center;
  border-radius: .2em .2em 0 0;
  font-size: .58em;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 .3em;
  color: #1e293b;
  background: repeating-linear-gradient(transparent 0 .55em,#cbd5e1 .55em .6em) 0 .5em/100% 100% no-repeat,#f8fafc;
}

.uvq15-fdd.sv .sh {
  animation: uvq15-fdd-sh calc(1s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq15-fdd.sv .dk {
  animation: uvq15-fdd-dk calc(1s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

@keyframes uvq15-fdd-sh {
  20%,70% {
    transform: translateX(1.1em);
  }
}

@keyframes uvq15-fdd-dk {
  15% {
    transform: translateY(.3em) scale(.97);
  }
  30%,70% {
    transform: translateY(.15em);
  }
}

.uvq15-fdd .dr {
  flex: 1;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: .25em .5em;
  font-size: .75em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq15-fdd .led {
  position: relative;
  width: .7em;
  height: .7em;
  border-radius: 50%;
  background: color-mix(in srgb,var(--c2) 25%,#334155);
  box-shadow: inset 0 1px 1px rgba(0,0,0,.4);
}

.uvq15-fdd .led::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--c2);
  box-shadow: 0 0 .6em var(--c2);
  opacity: 0;
}

.uvq15-fdd.sv .led::after {
  animation: uvq15-fdd-l calc(0.16s / var(--k)) linear 6;
}

@keyframes uvq15-fdd-l {
  0%,49% {
    opacity: 1;
  }
  50%,100% {
    opacity: 0;
  }
}

.uvq15-fdd kbd {
  padding: .1em .4em;
  border-radius: .3em;
  font: inherit;
  font-weight: 700;
  color: var(--fg);
  background: color-mix(in srgb,var(--fg) 6%,transparent);
  box-shadow: inset 0 -1px 0 color-mix(in srgb,var(--fg) 10%,transparent);
}

.uvq15-fdd .tm {
  grid-column: 2;
  font-variant-numeric: tabular-nums;
}

.uvq15-fdd .sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (prefers-reduced-motion:reduce) {
  .uvq15-fdd,.uvq15-fdd *,.uvq15-fdd *::before,.uvq15-fdd *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
`;

// Interacción en JavaScript del DOM: la misma que en la pestaña JS.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function setup(el: any) {
  const k=parseFloat(getComputedStyle(el).getPropertyValue("--k"))||1,rm=matchMedia("(prefers-reduced-motion:reduce)").matches;const ta=el.querySelector("textarea"),dk=el.querySelector(".dk"),st=el.querySelector(".st"),tm=el.querySelector(".tm"),sr=el.querySelector(".sr");let busy=false,dirty=false,t1=0;
const hm=()=>{const d=new Date();return String(d.getHours()).padStart(2,"0")+":"+String(d.getMinutes()).padStart(2,"0")};tm.textContent=hm();
const mark=()=>{el.classList.add("dt");st.textContent="Unsaved"};
ta.addEventListener("input",()=>{dirty=true;if(!busy)mark()});
const save=()=>{if(busy)return;busy=true;dirty=false;el.classList.remove("dt","sv");void el.offsetWidth;el.classList.add("sv");st.textContent="Saving…";
t1=setTimeout(()=>{busy=false;el.classList.remove("sv");tm.textContent=hm();if(dirty){mark();return}st.textContent="Saved";sr.textContent="Document saved"},(rm?150:1000)/k)};
dk.addEventListener("click",save);
el.addEventListener("keydown",e=>{if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()==="s"){e.preventDefault();save()}});return()=>clearTimeout(t1)
}

export default function Mi27FloppySave() {
  const ref = useRef<HTMLDivElement>(null);

  useEffect(() => {
    const el = ref.current?.firstElementChild;
    return el ? setup(el) : undefined;
  }, []);

  return (
    <>
      <style>{css}</style>
      <div
        ref={ref} style={{
          "--c1": "#1d4ed8",
          "--c2": "#22c55e",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq15-fdd"><header><span className="fn">notas-reunion.txt</span><span className="ss"><i></i><b className="st">Saved</b></span></header><textarea rows={3} aria-label="Notes" spellCheck="false">Review the budget with Laura and send the plans before Thursday.</textarea><footer><button type="button" className="dk"><span className="sh" aria-hidden="true"></span><span className="lb">Save</span></button><div className="dr"><span className="led" aria-hidden="true"></span><span className="hk"><kbd>Ctrl</kbd> + <kbd>S</kbd></span><time className="tm">12:00</time></div></footer><p className="sr" aria-live="polite"></p></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 “Save button with floppy disk” block (Microinteractions) from AIMRAN Library to my project.

## What it is
Type and an unsaved dot appears; save with the floppy or Ctrl+S and the metal shutter slides while the drive light blinks.

## Chosen settings
- Main color: #1d4ed8
- Secondary color: #22c55e
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Guardar"

## 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: setup() es JavaScript del DOM sin tipos, el mismo de la pestaña JS.
import { useEffect, useRef, type CSSProperties } from "react";

const css = `
.uvq15-fdd {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  border-radius: 1.3em;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 10%,transparent),0 1.4em 2.6em -1.8em rgba(0,0,0,.35);
  width: 19em;
  padding: 1em;
}

.uvq15-fdd header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6em;
  margin-bottom: .6em;
}

.uvq15-fdd .fn {
  font: 600 .8em ui-monospace,"SF Mono",Menlo,monospace;
}

.uvq15-fdd .ss {
  display: flex;
  align-items: center;
  gap: .35em;
  font-size: .72em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq15-fdd .ss i {
  width: .6em;
  height: .6em;
  border-radius: 50%;
  background: var(--c2);
  transition: background calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq15-fdd.dt .ss i {
  background: #f59e0b;
  animation: uvq15-fdd-p calc(1.2s / var(--k)) ease-in-out infinite;
}

@keyframes uvq15-fdd-p {
  50% {
    opacity: .35;
  }
}

.uvq15-fdd textarea {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: .7em .8em;
  border: 0;
  border-radius: .7em;
  resize: none;
  font: inherit;
  font-size: .85em;
  line-height: 1.45;
  color: inherit;
  background: color-mix(in srgb,var(--fg) 6%,transparent);
  outline: 0;
  box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--fg) 10%,transparent);
}

.uvq15-fdd textarea:focus-visible {
  box-shadow: inset 0 0 0 2px var(--c1);
}

.uvq15-fdd footer {
  display: flex;
  align-items: center;
  gap: .9em;
  margin-top: .9em;
}

.uvq15-fdd .dk {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  flex: none;
  width: 4.4em;
  height: 4.4em;
  border-radius: .3em;
  background: linear-gradient(160deg,color-mix(in srgb,var(--c1) 80%,#fff),var(--c1) 45%,color-mix(in srgb,var(--c1) 70%,#000));
  clip-path: polygon(0 0,88% 0,100% 12%,100% 100%,0 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
  transition: transform .15s cubic-bezier(.25,.1,.25,1);
}

.uvq15-fdd .dk:hover {
  transform: translateY(-2px) rotate(-2deg);
}

.uvq15-fdd .dk:active {
  transform: scale(.95);
}

.uvq15-fdd .dk:focus-visible {
  outline: 0;
  box-shadow: inset 0 0 0 3px #fff,0 0 0 3px var(--c1);
}

.uvq15-fdd .sh {
  position: absolute;
  top: 0;
  left: 1.05em;
  width: 2.3em;
  height: 1.55em;
  border-radius: 0 0 .15em .15em;
  background: linear-gradient(90deg,#94a3b8,#f1f5f9 40%,#cbd5e1 60%,#94a3b8);
}

.uvq15-fdd .sh::after {
  content: "";
  position: absolute;
  top: .25em;
  right: .35em;
  width: .5em;
  height: 1em;
  border-radius: .1em;
  background: #334155;
}

.uvq15-fdd .lb {
  position: absolute;
  left: .45em;
  right: .45em;
  bottom: 0;
  height: 2.1em;
  display: grid;
  place-items: center;
  border-radius: .2em .2em 0 0;
  font-size: .58em;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 .3em;
  color: #1e293b;
  background: repeating-linear-gradient(transparent 0 .55em,#cbd5e1 .55em .6em) 0 .5em/100% 100% no-repeat,#f8fafc;
}

.uvq15-fdd.sv .sh {
  animation: uvq15-fdd-sh calc(1s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq15-fdd.sv .dk {
  animation: uvq15-fdd-dk calc(1s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

@keyframes uvq15-fdd-sh {
  20%,70% {
    transform: translateX(1.1em);
  }
}

@keyframes uvq15-fdd-dk {
  15% {
    transform: translateY(.3em) scale(.97);
  }
  30%,70% {
    transform: translateY(.15em);
  }
}

.uvq15-fdd .dr {
  flex: 1;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: .25em .5em;
  font-size: .75em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq15-fdd .led {
  position: relative;
  width: .7em;
  height: .7em;
  border-radius: 50%;
  background: color-mix(in srgb,var(--c2) 25%,#334155);
  box-shadow: inset 0 1px 1px rgba(0,0,0,.4);
}

.uvq15-fdd .led::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--c2);
  box-shadow: 0 0 .6em var(--c2);
  opacity: 0;
}

.uvq15-fdd.sv .led::after {
  animation: uvq15-fdd-l calc(0.16s / var(--k)) linear 6;
}

@keyframes uvq15-fdd-l {
  0%,49% {
    opacity: 1;
  }
  50%,100% {
    opacity: 0;
  }
}

.uvq15-fdd kbd {
  padding: .1em .4em;
  border-radius: .3em;
  font: inherit;
  font-weight: 700;
  color: var(--fg);
  background: color-mix(in srgb,var(--fg) 6%,transparent);
  box-shadow: inset 0 -1px 0 color-mix(in srgb,var(--fg) 10%,transparent);
}

.uvq15-fdd .tm {
  grid-column: 2;
  font-variant-numeric: tabular-nums;
}

.uvq15-fdd .sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (prefers-reduced-motion:reduce) {
  .uvq15-fdd,.uvq15-fdd *,.uvq15-fdd *::before,.uvq15-fdd *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
`;

// Interacción en JavaScript del DOM: la misma que en la pestaña JS.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function setup(el: any) {
  const k=parseFloat(getComputedStyle(el).getPropertyValue("--k"))||1,rm=matchMedia("(prefers-reduced-motion:reduce)").matches;const ta=el.querySelector("textarea"),dk=el.querySelector(".dk"),st=el.querySelector(".st"),tm=el.querySelector(".tm"),sr=el.querySelector(".sr");let busy=false,dirty=false,t1=0;
const hm=()=>{const d=new Date();return String(d.getHours()).padStart(2,"0")+":"+String(d.getMinutes()).padStart(2,"0")};tm.textContent=hm();
const mark=()=>{el.classList.add("dt");st.textContent="Unsaved"};
ta.addEventListener("input",()=>{dirty=true;if(!busy)mark()});
const save=()=>{if(busy)return;busy=true;dirty=false;el.classList.remove("dt","sv");void el.offsetWidth;el.classList.add("sv");st.textContent="Saving…";
t1=setTimeout(()=>{busy=false;el.classList.remove("sv");tm.textContent=hm();if(dirty){mark();return}st.textContent="Saved";sr.textContent="Document saved"},(rm?150:1000)/k)};
dk.addEventListener("click",save);
el.addEventListener("keydown",e=>{if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()==="s"){e.preventDefault();save()}});return()=>clearTimeout(t1)
}

export default function Mi27FloppySave() {
  const ref = useRef<HTMLDivElement>(null);

  useEffect(() => {
    const el = ref.current?.firstElementChild;
    return el ? setup(el) : undefined;
  }, []);

  return (
    <>
      <style>{css}</style>
      <div
        ref={ref} style={{
          "--c1": "#1d4ed8",
          "--c2": "#22c55e",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq15-fdd"><header><span className="fn">notas-reunion.txt</span><span className="ss"><i></i><b className="st">Saved</b></span></header><textarea rows={3} aria-label="Notes" spellCheck="false">Review the budget with Laura and send the plans before Thursday.</textarea><footer><button type="button" className="dk"><span className="sh" aria-hidden="true"></span><span className="lb">Save</span></button><div className="dr"><span className="led" aria-hidden="true"></span><span className="hk"><kbd>Ctrl</kbd> + <kbd>S</kbd></span><time className="tm">12:00</time></div></footer><p className="sr" aria-live="polite"></p></div>
      </div>
    </>
  );
}
```

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