# Electric car charging card

> A dashboard card with a segmented LCD battery and a charge limit you drag or set with the arrow keys.

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

## Where to use it

Car apps show charging as a bar of glowing segments, and this card follows that language. Twenty CSS grid cells fill to the current level, the ones up to the limit pulse in sequence, and a native range input moves the limit marker and recalculates the finish time. It works for EV apps, smart home panels, energy dashboards and IoT demos.

The main color is the LCD glow, the second the dark panel. Change the current level and the charging rate in the script, and the time and segments follow.

## Code

### HTML

```html
<article class="uvq07-ev"><header><span class="pl" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 3v4M15 3v4M7 7h10v3a5 5 0 0 1-10 0zM12 15v6"/></svg></span><div><h3>My car · Garage</h3><p class="cs"><i></i>Charging at 7.4 kW</p></div></header><div class="rd"><p class="pc"><b>68</b><span>%</span></p><p class="km"><b>342</b> km</p></div><div class="bt" aria-hidden="true"><i class="f" style="--i:0"></i><i class="f" style="--i:1"></i><i class="f" style="--i:2"></i><i class="f" style="--i:3"></i><i class="f" style="--i:4"></i><i class="f" style="--i:5"></i><i class="f" style="--i:6"></i><i class="f" style="--i:7"></i><i class="f" style="--i:8"></i><i class="f" style="--i:9"></i><i class="f" style="--i:10"></i><i class="f" style="--i:11"></i><i class="f" style="--i:12"></i><i class="ch" style="--i:13"></i><i class="ch" style="--i:14"></i><i class="ch" style="--i:15"></i><i class="x" style="--i:16"></i><i class="x" style="--i:17"></i><i class="x" style="--i:18"></i><i class="x" style="--i:19"></i></div><label class="lm"><span>Charge limit</span><output>80 %</output><input type="range" min="50" max="100" step="5" value="80"></label><p class="ft">Fully charged at <b>23:53</b></p></article>
```

### CSS

```css
.uvq07-ev {
  --c1: #3ddc84;
  --c2: #0f1613;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq07-ev {
  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;
  width: 17em;
  padding: 1.2em;
  border-radius: 1.4em;
  color: #e9f3ee;
  background: radial-gradient(120% 80% at 100% 0%,color-mix(in srgb,var(--c1) 14%,transparent),transparent 60%),var(--c2);
  box-shadow: 0 1.4em 2.4em -1.4em rgba(0,0,0,.7),inset 0 0 0 1px rgba(255,255,255,.07);
}

.uvq07-ev header {
  display: flex;
  align-items: center;
  gap: .7em;
}

.uvq07-ev .pl {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.3em;
  height: 2.3em;
  border-radius: .7em;
  color: var(--c1);
  background: color-mix(in srgb,var(--c1) 14%,transparent);
}

.uvq07-ev .pl svg {
  width: 1.3em;
  height: 1.3em;
}

.uvq07-ev h3 {
  margin: 0;
  font-size: .95em;
  font-weight: 700;
}

.uvq07-ev .cs {
  display: flex;
  align-items: center;
  gap: .4em;
  margin: .15em 0 0;
  font-size: .72em;
  color: rgba(233,243,238,.6);
}

.uvq07-ev .cs i {
  width: .45em;
  height: .45em;
  border-radius: 50%;
  background: var(--c1);
  box-shadow: 0 0 .5em var(--c1);
  animation: uvq07-ev-p calc(1.4s / var(--k)) ease-in-out infinite;
}

.uvq07-ev .rd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 1em 0 .6em;
  font-family: ui-monospace,"SF Mono",Menlo,Consolas,monospace;
}

.uvq07-ev .rd p {
  margin: 0;
}

.uvq07-ev .pc {
  color: var(--c1);
  text-shadow: 0 0 .6em color-mix(in srgb,var(--c1) 60%,transparent);
}

.uvq07-ev .pc b {
  font-size: 2.6em;
  font-weight: 600;
  letter-spacing: -.04em;
  line-height: 1;
}

.uvq07-ev .pc span {
  font-size: 1.1em;
}

.uvq07-ev .km {
  font-size: .85em;
  color: rgba(233,243,238,.7);
}

.uvq07-ev .km b {
  font-size: 1.3em;
  color: #e9f3ee;
}

.uvq07-ev .bt {
  position: relative;
  display: grid;
  grid-template-columns: repeat(20,1fr);
  gap: .16em;
  height: 1.7em;
  padding: .22em;
  border-radius: .45em;
  background: rgba(0,0,0,.35);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}

.uvq07-ev .bt i {
  border-radius: .12em;
  background: rgba(255,255,255,.07);
  transition: background calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq07-ev .bt i.f {
  background: var(--c1);
  box-shadow: 0 0 .4em color-mix(in srgb,var(--c1) 50%,transparent);
}

.uvq07-ev .bt i.ch {
  animation: uvq07-ev-c calc(1.6s / var(--k)) ease-in-out infinite;
  animation-delay: calc(var(--i) * calc(0.1s / var(--k)));
}

.uvq07-ev .bt i.x {
  background: repeating-linear-gradient(135deg,rgba(255,255,255,.08) 0 2px,transparent 2px 4px);
}

.uvq07-ev .bt::after {
  content: "";
  position: absolute;
  top: -.3em;
  bottom: -.3em;
  left: calc(.22em + (100% - .44em) * var(--l,.8));
  width: 2px;
  margin-left: -1px;
  border-radius: 1px;
  background: #fff;
  transition: left calc(0.3s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq07-ev .lm {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: .4em .6em;
  margin-top: 1.1em;
  font-size: .8em;
}

.uvq07-ev .lm span {
  color: rgba(233,243,238,.7);
}

.uvq07-ev .lm output {
  font-family: ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  font-weight: 700;
}

.uvq07-ev input {
  grid-column: 1/-1;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 1.7em;
  margin: 0;
  background: transparent;
  cursor: pointer;
  border-radius: .4em;
}

.uvq07-ev input::-webkit-slider-runnable-track {
  height: .4em;
  border-radius: 1em;
  background: linear-gradient(90deg,var(--c1) var(--fp,60%),rgba(255,255,255,.14) 0);
}

.uvq07-ev input::-moz-range-track {
  height: .4em;
  border-radius: 1em;
  background: linear-gradient(90deg,var(--c1) var(--fp,60%),rgba(255,255,255,.14) 0);
}

.uvq07-ev input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 1.3em;
  height: 1.3em;
  margin-top: -.45em;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 .3em color-mix(in srgb,var(--c1) 35%,transparent);
  transition: transform calc(0.2s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq07-ev input::-moz-range-thumb {
  width: 1.3em;
  height: 1.3em;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 .3em color-mix(in srgb,var(--c1) 35%,transparent);
}

.uvq07-ev input:active::-webkit-slider-thumb {
  transform: scale(1.15);
}

.uvq07-ev input:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq07-ev .ft {
  margin: .8em 0 0;
  font-size: .78em;
  color: rgba(233,243,238,.65);
}

.uvq07-ev .ft b {
  font-family: ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  color: #e9f3ee;
}

@keyframes uvq07-ev-c {
  50% {
    background: color-mix(in srgb,var(--c1) 55%,transparent);
  }
}

@keyframes uvq07-ev-p {
  50% {
    opacity: .35;
  }
}

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

### JavaScript

```js
document.querySelectorAll(".uvq07-ev").forEach(el => {
  const r=el.querySelector("input"),o=el.querySelector("output"),bt=el.querySelector(".bt"),seg=[...bt.children],tm=el.querySelector(".ft b");const C=68;
const up=()=>{const l=+r.value;o.textContent=l+" %";bt.style.setProperty("--l",String(l/100));r.style.setProperty("--fp",((l-50)/50*100)+"%");
seg.forEach((s,i)=>{const p=(i+1)*5;s.className=p<=C?"f":p-5<l?"ch":"x"});
const t=22*60+40+Math.max(0,Math.round((l-C)*6.1));tm.textContent=String(Math.floor(t/60)%24).padStart(2,"0")+":"+String(t%60).padStart(2,"0")};
r.addEventListener("input",up);up()
});
```

### 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 = `
.uvq07-ev {
  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;
  width: 17em;
  padding: 1.2em;
  border-radius: 1.4em;
  color: #e9f3ee;
  background: radial-gradient(120% 80% at 100% 0%,color-mix(in srgb,var(--c1) 14%,transparent),transparent 60%),var(--c2);
  box-shadow: 0 1.4em 2.4em -1.4em rgba(0,0,0,.7),inset 0 0 0 1px rgba(255,255,255,.07);
}

.uvq07-ev header {
  display: flex;
  align-items: center;
  gap: .7em;
}

.uvq07-ev .pl {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.3em;
  height: 2.3em;
  border-radius: .7em;
  color: var(--c1);
  background: color-mix(in srgb,var(--c1) 14%,transparent);
}

.uvq07-ev .pl svg {
  width: 1.3em;
  height: 1.3em;
}

.uvq07-ev h3 {
  margin: 0;
  font-size: .95em;
  font-weight: 700;
}

.uvq07-ev .cs {
  display: flex;
  align-items: center;
  gap: .4em;
  margin: .15em 0 0;
  font-size: .72em;
  color: rgba(233,243,238,.6);
}

.uvq07-ev .cs i {
  width: .45em;
  height: .45em;
  border-radius: 50%;
  background: var(--c1);
  box-shadow: 0 0 .5em var(--c1);
  animation: uvq07-ev-p calc(1.4s / var(--k)) ease-in-out infinite;
}

.uvq07-ev .rd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 1em 0 .6em;
  font-family: ui-monospace,"SF Mono",Menlo,Consolas,monospace;
}

.uvq07-ev .rd p {
  margin: 0;
}

.uvq07-ev .pc {
  color: var(--c1);
  text-shadow: 0 0 .6em color-mix(in srgb,var(--c1) 60%,transparent);
}

.uvq07-ev .pc b {
  font-size: 2.6em;
  font-weight: 600;
  letter-spacing: -.04em;
  line-height: 1;
}

.uvq07-ev .pc span {
  font-size: 1.1em;
}

.uvq07-ev .km {
  font-size: .85em;
  color: rgba(233,243,238,.7);
}

.uvq07-ev .km b {
  font-size: 1.3em;
  color: #e9f3ee;
}

.uvq07-ev .bt {
  position: relative;
  display: grid;
  grid-template-columns: repeat(20,1fr);
  gap: .16em;
  height: 1.7em;
  padding: .22em;
  border-radius: .45em;
  background: rgba(0,0,0,.35);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}

.uvq07-ev .bt i {
  border-radius: .12em;
  background: rgba(255,255,255,.07);
  transition: background calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq07-ev .bt i.f {
  background: var(--c1);
  box-shadow: 0 0 .4em color-mix(in srgb,var(--c1) 50%,transparent);
}

.uvq07-ev .bt i.ch {
  animation: uvq07-ev-c calc(1.6s / var(--k)) ease-in-out infinite;
  animation-delay: calc(var(--i) * calc(0.1s / var(--k)));
}

.uvq07-ev .bt i.x {
  background: repeating-linear-gradient(135deg,rgba(255,255,255,.08) 0 2px,transparent 2px 4px);
}

.uvq07-ev .bt::after {
  content: "";
  position: absolute;
  top: -.3em;
  bottom: -.3em;
  left: calc(.22em + (100% - .44em) * var(--l,.8));
  width: 2px;
  margin-left: -1px;
  border-radius: 1px;
  background: #fff;
  transition: left calc(0.3s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq07-ev .lm {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: .4em .6em;
  margin-top: 1.1em;
  font-size: .8em;
}

.uvq07-ev .lm span {
  color: rgba(233,243,238,.7);
}

.uvq07-ev .lm output {
  font-family: ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  font-weight: 700;
}

.uvq07-ev input {
  grid-column: 1/-1;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 1.7em;
  margin: 0;
  background: transparent;
  cursor: pointer;
  border-radius: .4em;
}

.uvq07-ev input::-webkit-slider-runnable-track {
  height: .4em;
  border-radius: 1em;
  background: linear-gradient(90deg,var(--c1) var(--fp,60%),rgba(255,255,255,.14) 0);
}

.uvq07-ev input::-moz-range-track {
  height: .4em;
  border-radius: 1em;
  background: linear-gradient(90deg,var(--c1) var(--fp,60%),rgba(255,255,255,.14) 0);
}

.uvq07-ev input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 1.3em;
  height: 1.3em;
  margin-top: -.45em;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 .3em color-mix(in srgb,var(--c1) 35%,transparent);
  transition: transform calc(0.2s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq07-ev input::-moz-range-thumb {
  width: 1.3em;
  height: 1.3em;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 .3em color-mix(in srgb,var(--c1) 35%,transparent);
}

.uvq07-ev input:active::-webkit-slider-thumb {
  transform: scale(1.15);
}

.uvq07-ev input:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq07-ev .ft {
  margin: .8em 0 0;
  font-size: .78em;
  color: rgba(233,243,238,.65);
}

.uvq07-ev .ft b {
  font-family: ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  color: #e9f3ee;
}

@keyframes uvq07-ev-c {
  50% {
    background: color-mix(in srgb,var(--c1) 55%,transparent);
  }
}

@keyframes uvq07-ev-p {
  50% {
    opacity: .35;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq07-ev,.uvq07-ev *,.uvq07-ev *::before,.uvq07-ev *::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 r=el.querySelector("input"),o=el.querySelector("output"),bt=el.querySelector(".bt"),seg=[...bt.children],tm=el.querySelector(".ft b");const C=68;
const up=()=>{const l=+r.value;o.textContent=l+" %";bt.style.setProperty("--l",String(l/100));r.style.setProperty("--fp",((l-50)/50*100)+"%");
seg.forEach((s,i)=>{const p=(i+1)*5;s.className=p<=C?"f":p-5<l?"ch":"x"});
const t=22*60+40+Math.max(0,Math.round((l-C)*6.1));tm.textContent=String(Math.floor(t/60)%24).padStart(2,"0")+":"+String(t%60).padStart(2,"0")};
r.addEventListener("input",up);up()
}

export default function CardEvCharge() {
  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": "#3ddc84",
          "--c2": "#0f1613",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <article className="uvq07-ev"><header><span className="pl" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M9 3v4M15 3v4M7 7h10v3a5 5 0 0 1-10 0zM12 15v6" /></svg></span><div><h3>My car · Garage</h3><p className="cs"><i></i>Charging at 7.4 kW</p></div></header><div className="rd"><p className="pc"><b>68</b><span>%</span></p><p className="km"><b>342</b> km</p></div><div className="bt" aria-hidden="true"><i className="f" style={{ "--i": "0" } as CSSProperties}></i><i className="f" style={{ "--i": "1" } as CSSProperties}></i><i className="f" style={{ "--i": "2" } as CSSProperties}></i><i className="f" style={{ "--i": "3" } as CSSProperties}></i><i className="f" style={{ "--i": "4" } as CSSProperties}></i><i className="f" style={{ "--i": "5" } as CSSProperties}></i><i className="f" style={{ "--i": "6" } as CSSProperties}></i><i className="f" style={{ "--i": "7" } as CSSProperties}></i><i className="f" style={{ "--i": "8" } as CSSProperties}></i><i className="f" style={{ "--i": "9" } as CSSProperties}></i><i className="f" style={{ "--i": "10" } as CSSProperties}></i><i className="f" style={{ "--i": "11" } as CSSProperties}></i><i className="f" style={{ "--i": "12" } as CSSProperties}></i><i className="ch" style={{ "--i": "13" } as CSSProperties}></i><i className="ch" style={{ "--i": "14" } as CSSProperties}></i><i className="ch" style={{ "--i": "15" } as CSSProperties}></i><i className="x" style={{ "--i": "16" } as CSSProperties}></i><i className="x" style={{ "--i": "17" } as CSSProperties}></i><i className="x" style={{ "--i": "18" } as CSSProperties}></i><i className="x" style={{ "--i": "19" } as CSSProperties}></i></div><label className="lm"><span>Charge limit</span><output>80 %</output><input type="range" min="50" max="100" step="5" value="80" /></label><p className="ft">Fully charged at <b>23:53</b></p></article>
      </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 “Electric car charging card” block (Cards) from AIMRAN Library to my project.

## What it is
A dashboard card with a segmented LCD battery and a charge limit you drag or set with the arrow keys.

## Chosen settings
- Main color: #3ddc84
- Secondary color: #0f1613
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Mi coche · Garaje"

## 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 = `
.uvq07-ev {
  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;
  width: 17em;
  padding: 1.2em;
  border-radius: 1.4em;
  color: #e9f3ee;
  background: radial-gradient(120% 80% at 100% 0%,color-mix(in srgb,var(--c1) 14%,transparent),transparent 60%),var(--c2);
  box-shadow: 0 1.4em 2.4em -1.4em rgba(0,0,0,.7),inset 0 0 0 1px rgba(255,255,255,.07);
}

.uvq07-ev header {
  display: flex;
  align-items: center;
  gap: .7em;
}

.uvq07-ev .pl {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.3em;
  height: 2.3em;
  border-radius: .7em;
  color: var(--c1);
  background: color-mix(in srgb,var(--c1) 14%,transparent);
}

.uvq07-ev .pl svg {
  width: 1.3em;
  height: 1.3em;
}

.uvq07-ev h3 {
  margin: 0;
  font-size: .95em;
  font-weight: 700;
}

.uvq07-ev .cs {
  display: flex;
  align-items: center;
  gap: .4em;
  margin: .15em 0 0;
  font-size: .72em;
  color: rgba(233,243,238,.6);
}

.uvq07-ev .cs i {
  width: .45em;
  height: .45em;
  border-radius: 50%;
  background: var(--c1);
  box-shadow: 0 0 .5em var(--c1);
  animation: uvq07-ev-p calc(1.4s / var(--k)) ease-in-out infinite;
}

.uvq07-ev .rd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 1em 0 .6em;
  font-family: ui-monospace,"SF Mono",Menlo,Consolas,monospace;
}

.uvq07-ev .rd p {
  margin: 0;
}

.uvq07-ev .pc {
  color: var(--c1);
  text-shadow: 0 0 .6em color-mix(in srgb,var(--c1) 60%,transparent);
}

.uvq07-ev .pc b {
  font-size: 2.6em;
  font-weight: 600;
  letter-spacing: -.04em;
  line-height: 1;
}

.uvq07-ev .pc span {
  font-size: 1.1em;
}

.uvq07-ev .km {
  font-size: .85em;
  color: rgba(233,243,238,.7);
}

.uvq07-ev .km b {
  font-size: 1.3em;
  color: #e9f3ee;
}

.uvq07-ev .bt {
  position: relative;
  display: grid;
  grid-template-columns: repeat(20,1fr);
  gap: .16em;
  height: 1.7em;
  padding: .22em;
  border-radius: .45em;
  background: rgba(0,0,0,.35);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}

.uvq07-ev .bt i {
  border-radius: .12em;
  background: rgba(255,255,255,.07);
  transition: background calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq07-ev .bt i.f {
  background: var(--c1);
  box-shadow: 0 0 .4em color-mix(in srgb,var(--c1) 50%,transparent);
}

.uvq07-ev .bt i.ch {
  animation: uvq07-ev-c calc(1.6s / var(--k)) ease-in-out infinite;
  animation-delay: calc(var(--i) * calc(0.1s / var(--k)));
}

.uvq07-ev .bt i.x {
  background: repeating-linear-gradient(135deg,rgba(255,255,255,.08) 0 2px,transparent 2px 4px);
}

.uvq07-ev .bt::after {
  content: "";
  position: absolute;
  top: -.3em;
  bottom: -.3em;
  left: calc(.22em + (100% - .44em) * var(--l,.8));
  width: 2px;
  margin-left: -1px;
  border-radius: 1px;
  background: #fff;
  transition: left calc(0.3s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq07-ev .lm {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: .4em .6em;
  margin-top: 1.1em;
  font-size: .8em;
}

.uvq07-ev .lm span {
  color: rgba(233,243,238,.7);
}

.uvq07-ev .lm output {
  font-family: ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  font-weight: 700;
}

.uvq07-ev input {
  grid-column: 1/-1;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 1.7em;
  margin: 0;
  background: transparent;
  cursor: pointer;
  border-radius: .4em;
}

.uvq07-ev input::-webkit-slider-runnable-track {
  height: .4em;
  border-radius: 1em;
  background: linear-gradient(90deg,var(--c1) var(--fp,60%),rgba(255,255,255,.14) 0);
}

.uvq07-ev input::-moz-range-track {
  height: .4em;
  border-radius: 1em;
  background: linear-gradient(90deg,var(--c1) var(--fp,60%),rgba(255,255,255,.14) 0);
}

.uvq07-ev input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 1.3em;
  height: 1.3em;
  margin-top: -.45em;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 .3em color-mix(in srgb,var(--c1) 35%,transparent);
  transition: transform calc(0.2s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq07-ev input::-moz-range-thumb {
  width: 1.3em;
  height: 1.3em;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 .3em color-mix(in srgb,var(--c1) 35%,transparent);
}

.uvq07-ev input:active::-webkit-slider-thumb {
  transform: scale(1.15);
}

.uvq07-ev input:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq07-ev .ft {
  margin: .8em 0 0;
  font-size: .78em;
  color: rgba(233,243,238,.65);
}

.uvq07-ev .ft b {
  font-family: ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  color: #e9f3ee;
}

@keyframes uvq07-ev-c {
  50% {
    background: color-mix(in srgb,var(--c1) 55%,transparent);
  }
}

@keyframes uvq07-ev-p {
  50% {
    opacity: .35;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq07-ev,.uvq07-ev *,.uvq07-ev *::before,.uvq07-ev *::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 r=el.querySelector("input"),o=el.querySelector("output"),bt=el.querySelector(".bt"),seg=[...bt.children],tm=el.querySelector(".ft b");const C=68;
const up=()=>{const l=+r.value;o.textContent=l+" %";bt.style.setProperty("--l",String(l/100));r.style.setProperty("--fp",((l-50)/50*100)+"%");
seg.forEach((s,i)=>{const p=(i+1)*5;s.className=p<=C?"f":p-5<l?"ch":"x"});
const t=22*60+40+Math.max(0,Math.round((l-C)*6.1));tm.textContent=String(Math.floor(t/60)%24).padStart(2,"0")+":"+String(t%60).padStart(2,"0")};
r.addEventListener("input",up);up()
}

export default function CardEvCharge() {
  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": "#3ddc84",
          "--c2": "#0f1613",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <article className="uvq07-ev"><header><span className="pl" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M9 3v4M15 3v4M7 7h10v3a5 5 0 0 1-10 0zM12 15v6" /></svg></span><div><h3>My car · Garage</h3><p className="cs"><i></i>Charging at 7.4 kW</p></div></header><div className="rd"><p className="pc"><b>68</b><span>%</span></p><p className="km"><b>342</b> km</p></div><div className="bt" aria-hidden="true"><i className="f" style={{ "--i": "0" } as CSSProperties}></i><i className="f" style={{ "--i": "1" } as CSSProperties}></i><i className="f" style={{ "--i": "2" } as CSSProperties}></i><i className="f" style={{ "--i": "3" } as CSSProperties}></i><i className="f" style={{ "--i": "4" } as CSSProperties}></i><i className="f" style={{ "--i": "5" } as CSSProperties}></i><i className="f" style={{ "--i": "6" } as CSSProperties}></i><i className="f" style={{ "--i": "7" } as CSSProperties}></i><i className="f" style={{ "--i": "8" } as CSSProperties}></i><i className="f" style={{ "--i": "9" } as CSSProperties}></i><i className="f" style={{ "--i": "10" } as CSSProperties}></i><i className="f" style={{ "--i": "11" } as CSSProperties}></i><i className="f" style={{ "--i": "12" } as CSSProperties}></i><i className="ch" style={{ "--i": "13" } as CSSProperties}></i><i className="ch" style={{ "--i": "14" } as CSSProperties}></i><i className="ch" style={{ "--i": "15" } as CSSProperties}></i><i className="x" style={{ "--i": "16" } as CSSProperties}></i><i className="x" style={{ "--i": "17" } as CSSProperties}></i><i className="x" style={{ "--i": "18" } as CSSProperties}></i><i className="x" style={{ "--i": "19" } as CSSProperties}></i></div><label className="lm"><span>Charge limit</span><output>80 %</output><input type="range" min="50" max="100" step="5" value="80" /></label><p className="ft">Fully charged at <b>23:53</b></p></article>
      </div>
    </>
  );
}
```

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