# Weekday activity heatmap filter

> A twelve-week activity grid where you tick which days count and their rows light up in a wave.

- Category: [Filters](https://library.aimran.es/components/filters)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/uv-f-heat-weekdays
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

Analytics dashboards, gyms and booking tools often need to filter by weekday, and seeing the data while you choose helps. Each row is a checkbox label holding twelve cells whose shade comes from the activity level, and switching a day on colours its row with a staggered wave. Two presets select weekdays or the weekend.

The first colour covers low and medium levels and the second marks the busiest cells, so a teal and lime pair reads well. Feed real counts into the level classes, and keep the counter next to the presets.

## Code

### HTML

```html
<fieldset class="uvq05-hm"><legend>Active days</legend><div class="gd"><label><input type="checkbox" checked><span class="d">Monday</span><span class="cs" aria-hidden="true"><i class="l0" style="--n:0"></i><i class="l3" style="--n:1"></i><i class="l0" style="--n:2"></i><i class="l1" style="--n:3"></i><i class="l3" style="--n:4"></i><i class="l2" style="--n:5"></i><i class="l3" style="--n:6"></i><i class="l2" style="--n:7"></i><i class="l1" style="--n:8"></i><i class="l2" style="--n:9"></i><i class="l0" style="--n:10"></i><i class="l2" style="--n:11"></i></span></label><label><input type="checkbox" checked><span class="d">Tuesday</span><span class="cs" aria-hidden="true"><i class="l2" style="--n:0"></i><i class="l0" style="--n:1"></i><i class="l1" style="--n:2"></i><i class="l0" style="--n:3"></i><i class="l0" style="--n:4"></i><i class="l2" style="--n:5"></i><i class="l0" style="--n:6"></i><i class="l2" style="--n:7"></i><i class="l1" style="--n:8"></i><i class="l2" style="--n:9"></i><i class="l1" style="--n:10"></i><i class="l1" style="--n:11"></i></span></label><label><input type="checkbox" checked><span class="d">Wednesday</span><span class="cs" aria-hidden="true"><i class="l1" style="--n:0"></i><i class="l0" style="--n:1"></i><i class="l1" style="--n:2"></i><i class="l0" style="--n:3"></i><i class="l0" style="--n:4"></i><i class="l1" style="--n:5"></i><i class="l0" style="--n:6"></i><i class="l0" style="--n:7"></i><i class="l3" style="--n:8"></i><i class="l1" style="--n:9"></i><i class="l3" style="--n:10"></i><i class="l3" style="--n:11"></i></span></label><label><input type="checkbox" checked><span class="d">Thursday</span><span class="cs" aria-hidden="true"><i class="l0" style="--n:0"></i><i class="l1" style="--n:1"></i><i class="l2" style="--n:2"></i><i class="l3" style="--n:3"></i><i class="l3" style="--n:4"></i><i class="l2" style="--n:5"></i><i class="l2" style="--n:6"></i><i class="l3" style="--n:7"></i><i class="l2" style="--n:8"></i><i class="l1" style="--n:9"></i><i class="l2" style="--n:10"></i><i class="l1" style="--n:11"></i></span></label><label><input type="checkbox" checked><span class="d">Friday</span><span class="cs" aria-hidden="true"><i class="l2" style="--n:0"></i><i class="l3" style="--n:1"></i><i class="l3" style="--n:2"></i><i class="l4" style="--n:3"></i><i class="l4" style="--n:4"></i><i class="l3" style="--n:5"></i><i class="l3" style="--n:6"></i><i class="l3" style="--n:7"></i><i class="l1" style="--n:8"></i><i class="l4" style="--n:9"></i><i class="l2" style="--n:10"></i><i class="l1" style="--n:11"></i></span></label><label><input type="checkbox"><span class="d">Saturday</span><span class="cs" aria-hidden="true"><i class="l3" style="--n:0"></i><i class="l2" style="--n:1"></i><i class="l1" style="--n:2"></i><i class="l1" style="--n:3"></i><i class="l4" style="--n:4"></i><i class="l3" style="--n:5"></i><i class="l3" style="--n:6"></i><i class="l3" style="--n:7"></i><i class="l2" style="--n:8"></i><i class="l4" style="--n:9"></i><i class="l3" style="--n:10"></i><i class="l1" style="--n:11"></i></span></label><label><input type="checkbox"><span class="d">Sunday</span><span class="cs" aria-hidden="true"><i class="l1" style="--n:0"></i><i class="l2" style="--n:1"></i><i class="l2" style="--n:2"></i><i class="l4" style="--n:3"></i><i class="l2" style="--n:4"></i><i class="l2" style="--n:5"></i><i class="l1" style="--n:6"></i><i class="l2" style="--n:7"></i><i class="l4" style="--n:8"></i><i class="l4" style="--n:9"></i><i class="l4" style="--n:10"></i><i class="l1" style="--n:11"></i></span></label></div><div class="ft"><button type="button" data-p="0">Weekdays</button><button type="button" data-p="1">Weekend</button><p class="ct"><span class="n"></span> <span>of 7 days</span></p></div></fieldset>
```

### CSS

```css
.uvq05-hm {
  --c1: #0f766e;
  --c2: #a3e635;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq05-hm {
  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;
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
  width: 19em;
  counter-reset: uvq05-hm;
}

.uvq05-hm legend {
  padding: 0;
  margin: 0 0 .8em;
  font-weight: 700;
}

.uvq05-hm .gd {
  display: grid;
  gap: .15em;
}

.uvq05-hm label {
  position: relative;
  display: flex;
  align-items: center;
  gap: .5em;
  padding: .14em .3em;
  border-radius: .4em;
  cursor: pointer;
  transition: background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq05-hm label:hover {
  background: color-mix(in srgb,var(--fg) 6%,transparent);
}

.uvq05-hm input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.uvq05-hm input:checked {
  counter-increment: uvq05-hm;
}

.uvq05-hm .d {
  display: flex;
  align-items: center;
  gap: .45em;
  width: 6.2em;
  font-size: .72em;
  font-weight: 600;
  color: color-mix(in srgb,var(--fg) 58%,transparent);
  transition: color calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq05-hm .d::before {
  content: "";
  flex: none;
  width: .85em;
  height: .85em;
  border-radius: .22em;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb,var(--fg) 22%,transparent);
  background: center/70% no-repeat;
  transition: background-color calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),box-shadow calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq05-hm input:checked+.d {
  color: var(--fg);
}

.uvq05-hm input:checked+.d::before {
  background-color: var(--c1);
  box-shadow: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.uvq05-hm input:focus-visible+.d {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
  border-radius: .2em;
}

.uvq05-hm .cs {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(12,1fr);
  gap: .18em;
}

.uvq05-hm .cs i {
  aspect-ratio: 1;
  border-radius: .22em;
  transition: background calc(0.35s / var(--k)) cubic-bezier(.25,.1,.25,1);
  transition-delay: calc(var(--n) * 0.025s / var(--k));
}

.uvq05-hm .l0 {
  background: color-mix(in srgb,var(--fg) 5%,transparent);
}

.uvq05-hm .l1 {
  background: color-mix(in srgb,var(--fg) 8%,transparent);
}

.uvq05-hm .l2 {
  background: color-mix(in srgb,var(--fg) 11%,transparent);
}

.uvq05-hm .l3 {
  background: color-mix(in srgb,var(--fg) 14%,transparent);
}

.uvq05-hm .l4 {
  background: color-mix(in srgb,var(--fg) 17%,transparent);
}

.uvq05-hm label:has(input:checked) .l0 {
  background: color-mix(in srgb,var(--c1) 16%,transparent);
}

.uvq05-hm label:has(input:checked) .l1 {
  background: color-mix(in srgb,var(--c1) 42%,transparent);
}

.uvq05-hm label:has(input:checked) .l2 {
  background: color-mix(in srgb,var(--c1) 72%,transparent);
}

.uvq05-hm label:has(input:checked) .l3 {
  background: color-mix(in srgb,var(--c2) 45%,var(--c1));
}

.uvq05-hm label:has(input:checked) .l4 {
  background: var(--c2);
}

.uvq05-hm .ft {
  display: flex;
  align-items: center;
  gap: .4em;
  margin-top: .8em;
}

.uvq05-hm .ft button {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: .42em .75em;
  border-radius: 2em;
  font-size: .72em;
  font-weight: 700;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb,var(--fg) 22%,transparent);
  transition: box-shadow calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),transform calc(0.3s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq05-hm .ft button:hover {
  box-shadow: inset 0 0 0 1.5px var(--c1);
}

.uvq05-hm .ft button:active {
  transform: scale(.94);
}

.uvq05-hm .ft button:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq05-hm .ct {
  margin: 0 0 0 auto;
  font-size: .72em;
  color: color-mix(in srgb,var(--fg) 58%,transparent);
}

.uvq05-hm .n::before {
  content: counter(uvq05-hm);
  font-weight: 800;
  color: var(--fg);
}

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

### JavaScript

```js
document.querySelectorAll(".uvq05-hm").forEach(el => {
  el.querySelectorAll(".ft button").forEach(b=>b.addEventListener("click",()=>{const we=b.dataset.p==="1";el.querySelectorAll("input").forEach((i,k)=>{i.checked=we?k>4:k<5})}))
});
```

### 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 = `
.uvq05-hm {
  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;
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
  width: 19em;
  counter-reset: uvq05-hm;
}

.uvq05-hm legend {
  padding: 0;
  margin: 0 0 .8em;
  font-weight: 700;
}

.uvq05-hm .gd {
  display: grid;
  gap: .15em;
}

.uvq05-hm label {
  position: relative;
  display: flex;
  align-items: center;
  gap: .5em;
  padding: .14em .3em;
  border-radius: .4em;
  cursor: pointer;
  transition: background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq05-hm label:hover {
  background: color-mix(in srgb,var(--fg) 6%,transparent);
}

.uvq05-hm input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.uvq05-hm input:checked {
  counter-increment: uvq05-hm;
}

.uvq05-hm .d {
  display: flex;
  align-items: center;
  gap: .45em;
  width: 6.2em;
  font-size: .72em;
  font-weight: 600;
  color: color-mix(in srgb,var(--fg) 58%,transparent);
  transition: color calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq05-hm .d::before {
  content: "";
  flex: none;
  width: .85em;
  height: .85em;
  border-radius: .22em;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb,var(--fg) 22%,transparent);
  background: center/70% no-repeat;
  transition: background-color calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),box-shadow calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq05-hm input:checked+.d {
  color: var(--fg);
}

.uvq05-hm input:checked+.d::before {
  background-color: var(--c1);
  box-shadow: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.uvq05-hm input:focus-visible+.d {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
  border-radius: .2em;
}

.uvq05-hm .cs {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(12,1fr);
  gap: .18em;
}

.uvq05-hm .cs i {
  aspect-ratio: 1;
  border-radius: .22em;
  transition: background calc(0.35s / var(--k)) cubic-bezier(.25,.1,.25,1);
  transition-delay: calc(var(--n) * 0.025s / var(--k));
}

.uvq05-hm .l0 {
  background: color-mix(in srgb,var(--fg) 5%,transparent);
}

.uvq05-hm .l1 {
  background: color-mix(in srgb,var(--fg) 8%,transparent);
}

.uvq05-hm .l2 {
  background: color-mix(in srgb,var(--fg) 11%,transparent);
}

.uvq05-hm .l3 {
  background: color-mix(in srgb,var(--fg) 14%,transparent);
}

.uvq05-hm .l4 {
  background: color-mix(in srgb,var(--fg) 17%,transparent);
}

.uvq05-hm label:has(input:checked) .l0 {
  background: color-mix(in srgb,var(--c1) 16%,transparent);
}

.uvq05-hm label:has(input:checked) .l1 {
  background: color-mix(in srgb,var(--c1) 42%,transparent);
}

.uvq05-hm label:has(input:checked) .l2 {
  background: color-mix(in srgb,var(--c1) 72%,transparent);
}

.uvq05-hm label:has(input:checked) .l3 {
  background: color-mix(in srgb,var(--c2) 45%,var(--c1));
}

.uvq05-hm label:has(input:checked) .l4 {
  background: var(--c2);
}

.uvq05-hm .ft {
  display: flex;
  align-items: center;
  gap: .4em;
  margin-top: .8em;
}

.uvq05-hm .ft button {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: .42em .75em;
  border-radius: 2em;
  font-size: .72em;
  font-weight: 700;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb,var(--fg) 22%,transparent);
  transition: box-shadow calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),transform calc(0.3s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq05-hm .ft button:hover {
  box-shadow: inset 0 0 0 1.5px var(--c1);
}

.uvq05-hm .ft button:active {
  transform: scale(.94);
}

.uvq05-hm .ft button:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq05-hm .ct {
  margin: 0 0 0 auto;
  font-size: .72em;
  color: color-mix(in srgb,var(--fg) 58%,transparent);
}

.uvq05-hm .n::before {
  content: counter(uvq05-hm);
  font-weight: 800;
  color: var(--fg);
}

@media (prefers-reduced-motion:reduce) {
  .uvq05-hm,.uvq05-hm *,.uvq05-hm *::before,.uvq05-hm *::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) {
  el.querySelectorAll(".ft button").forEach(b=>b.addEventListener("click",()=>{const we=b.dataset.p==="1";el.querySelectorAll("input").forEach((i,k)=>{i.checked=we?k>4:k<5})}))
}

export default function FHeatWeekdays() {
  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": "#0f766e",
          "--c2": "#a3e635",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <fieldset className="uvq05-hm"><legend>Active days</legend><div className="gd"><label><input type="checkbox" checked={true} /><span className="d">Monday</span><span className="cs" aria-hidden="true"><i className="l0" style={{ "--n": "0" } as CSSProperties}></i><i className="l3" style={{ "--n": "1" } as CSSProperties}></i><i className="l0" style={{ "--n": "2" } as CSSProperties}></i><i className="l1" style={{ "--n": "3" } as CSSProperties}></i><i className="l3" style={{ "--n": "4" } as CSSProperties}></i><i className="l2" style={{ "--n": "5" } as CSSProperties}></i><i className="l3" style={{ "--n": "6" } as CSSProperties}></i><i className="l2" style={{ "--n": "7" } as CSSProperties}></i><i className="l1" style={{ "--n": "8" } as CSSProperties}></i><i className="l2" style={{ "--n": "9" } as CSSProperties}></i><i className="l0" style={{ "--n": "10" } as CSSProperties}></i><i className="l2" style={{ "--n": "11" } as CSSProperties}></i></span></label><label><input type="checkbox" checked={true} /><span className="d">Tuesday</span><span className="cs" aria-hidden="true"><i className="l2" style={{ "--n": "0" } as CSSProperties}></i><i className="l0" style={{ "--n": "1" } as CSSProperties}></i><i className="l1" style={{ "--n": "2" } as CSSProperties}></i><i className="l0" style={{ "--n": "3" } as CSSProperties}></i><i className="l0" style={{ "--n": "4" } as CSSProperties}></i><i className="l2" style={{ "--n": "5" } as CSSProperties}></i><i className="l0" style={{ "--n": "6" } as CSSProperties}></i><i className="l2" style={{ "--n": "7" } as CSSProperties}></i><i className="l1" style={{ "--n": "8" } as CSSProperties}></i><i className="l2" style={{ "--n": "9" } as CSSProperties}></i><i className="l1" style={{ "--n": "10" } as CSSProperties}></i><i className="l1" style={{ "--n": "11" } as CSSProperties}></i></span></label><label><input type="checkbox" checked={true} /><span className="d">Wednesday</span><span className="cs" aria-hidden="true"><i className="l1" style={{ "--n": "0" } as CSSProperties}></i><i className="l0" style={{ "--n": "1" } as CSSProperties}></i><i className="l1" style={{ "--n": "2" } as CSSProperties}></i><i className="l0" style={{ "--n": "3" } as CSSProperties}></i><i className="l0" style={{ "--n": "4" } as CSSProperties}></i><i className="l1" style={{ "--n": "5" } as CSSProperties}></i><i className="l0" style={{ "--n": "6" } as CSSProperties}></i><i className="l0" style={{ "--n": "7" } as CSSProperties}></i><i className="l3" style={{ "--n": "8" } as CSSProperties}></i><i className="l1" style={{ "--n": "9" } as CSSProperties}></i><i className="l3" style={{ "--n": "10" } as CSSProperties}></i><i className="l3" style={{ "--n": "11" } as CSSProperties}></i></span></label><label><input type="checkbox" checked={true} /><span className="d">Thursday</span><span className="cs" aria-hidden="true"><i className="l0" style={{ "--n": "0" } as CSSProperties}></i><i className="l1" style={{ "--n": "1" } as CSSProperties}></i><i className="l2" style={{ "--n": "2" } as CSSProperties}></i><i className="l3" style={{ "--n": "3" } as CSSProperties}></i><i className="l3" style={{ "--n": "4" } as CSSProperties}></i><i className="l2" style={{ "--n": "5" } as CSSProperties}></i><i className="l2" style={{ "--n": "6" } as CSSProperties}></i><i className="l3" style={{ "--n": "7" } as CSSProperties}></i><i className="l2" style={{ "--n": "8" } as CSSProperties}></i><i className="l1" style={{ "--n": "9" } as CSSProperties}></i><i className="l2" style={{ "--n": "10" } as CSSProperties}></i><i className="l1" style={{ "--n": "11" } as CSSProperties}></i></span></label><label><input type="checkbox" checked={true} /><span className="d">Friday</span><span className="cs" aria-hidden="true"><i className="l2" style={{ "--n": "0" } as CSSProperties}></i><i className="l3" style={{ "--n": "1" } as CSSProperties}></i><i className="l3" style={{ "--n": "2" } as CSSProperties}></i><i className="l4" style={{ "--n": "3" } as CSSProperties}></i><i className="l4" style={{ "--n": "4" } as CSSProperties}></i><i className="l3" style={{ "--n": "5" } as CSSProperties}></i><i className="l3" style={{ "--n": "6" } as CSSProperties}></i><i className="l3" style={{ "--n": "7" } as CSSProperties}></i><i className="l1" style={{ "--n": "8" } as CSSProperties}></i><i className="l4" style={{ "--n": "9" } as CSSProperties}></i><i className="l2" style={{ "--n": "10" } as CSSProperties}></i><i className="l1" style={{ "--n": "11" } as CSSProperties}></i></span></label><label><input type="checkbox" /><span className="d">Saturday</span><span className="cs" aria-hidden="true"><i className="l3" style={{ "--n": "0" } as CSSProperties}></i><i className="l2" style={{ "--n": "1" } as CSSProperties}></i><i className="l1" style={{ "--n": "2" } as CSSProperties}></i><i className="l1" style={{ "--n": "3" } as CSSProperties}></i><i className="l4" style={{ "--n": "4" } as CSSProperties}></i><i className="l3" style={{ "--n": "5" } as CSSProperties}></i><i className="l3" style={{ "--n": "6" } as CSSProperties}></i><i className="l3" style={{ "--n": "7" } as CSSProperties}></i><i className="l2" style={{ "--n": "8" } as CSSProperties}></i><i className="l4" style={{ "--n": "9" } as CSSProperties}></i><i className="l3" style={{ "--n": "10" } as CSSProperties}></i><i className="l1" style={{ "--n": "11" } as CSSProperties}></i></span></label><label><input type="checkbox" /><span className="d">Sunday</span><span className="cs" aria-hidden="true"><i className="l1" style={{ "--n": "0" } as CSSProperties}></i><i className="l2" style={{ "--n": "1" } as CSSProperties}></i><i className="l2" style={{ "--n": "2" } as CSSProperties}></i><i className="l4" style={{ "--n": "3" } as CSSProperties}></i><i className="l2" style={{ "--n": "4" } as CSSProperties}></i><i className="l2" style={{ "--n": "5" } as CSSProperties}></i><i className="l1" style={{ "--n": "6" } as CSSProperties}></i><i className="l2" style={{ "--n": "7" } as CSSProperties}></i><i className="l4" style={{ "--n": "8" } as CSSProperties}></i><i className="l4" style={{ "--n": "9" } as CSSProperties}></i><i className="l4" style={{ "--n": "10" } as CSSProperties}></i><i className="l1" style={{ "--n": "11" } as CSSProperties}></i></span></label></div><div className="ft"><button type="button" data-p="0">Weekdays</button><button type="button" data-p="1">Weekend</button><p className="ct"><span className="n"></span> <span>of 7 days</span></p></div></fieldset>
      </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 “Weekday activity heatmap filter” block (Filters) from AIMRAN Library to my project.

## What it is
A twelve-week activity grid where you tick which days count and their rows light up in a wave.

## Chosen settings
- Main color: #0f766e
- Secondary color: #a3e635
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Días con actividad"

## 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 = `
.uvq05-hm {
  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;
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
  width: 19em;
  counter-reset: uvq05-hm;
}

.uvq05-hm legend {
  padding: 0;
  margin: 0 0 .8em;
  font-weight: 700;
}

.uvq05-hm .gd {
  display: grid;
  gap: .15em;
}

.uvq05-hm label {
  position: relative;
  display: flex;
  align-items: center;
  gap: .5em;
  padding: .14em .3em;
  border-radius: .4em;
  cursor: pointer;
  transition: background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq05-hm label:hover {
  background: color-mix(in srgb,var(--fg) 6%,transparent);
}

.uvq05-hm input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.uvq05-hm input:checked {
  counter-increment: uvq05-hm;
}

.uvq05-hm .d {
  display: flex;
  align-items: center;
  gap: .45em;
  width: 6.2em;
  font-size: .72em;
  font-weight: 600;
  color: color-mix(in srgb,var(--fg) 58%,transparent);
  transition: color calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq05-hm .d::before {
  content: "";
  flex: none;
  width: .85em;
  height: .85em;
  border-radius: .22em;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb,var(--fg) 22%,transparent);
  background: center/70% no-repeat;
  transition: background-color calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),box-shadow calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq05-hm input:checked+.d {
  color: var(--fg);
}

.uvq05-hm input:checked+.d::before {
  background-color: var(--c1);
  box-shadow: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.uvq05-hm input:focus-visible+.d {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
  border-radius: .2em;
}

.uvq05-hm .cs {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(12,1fr);
  gap: .18em;
}

.uvq05-hm .cs i {
  aspect-ratio: 1;
  border-radius: .22em;
  transition: background calc(0.35s / var(--k)) cubic-bezier(.25,.1,.25,1);
  transition-delay: calc(var(--n) * 0.025s / var(--k));
}

.uvq05-hm .l0 {
  background: color-mix(in srgb,var(--fg) 5%,transparent);
}

.uvq05-hm .l1 {
  background: color-mix(in srgb,var(--fg) 8%,transparent);
}

.uvq05-hm .l2 {
  background: color-mix(in srgb,var(--fg) 11%,transparent);
}

.uvq05-hm .l3 {
  background: color-mix(in srgb,var(--fg) 14%,transparent);
}

.uvq05-hm .l4 {
  background: color-mix(in srgb,var(--fg) 17%,transparent);
}

.uvq05-hm label:has(input:checked) .l0 {
  background: color-mix(in srgb,var(--c1) 16%,transparent);
}

.uvq05-hm label:has(input:checked) .l1 {
  background: color-mix(in srgb,var(--c1) 42%,transparent);
}

.uvq05-hm label:has(input:checked) .l2 {
  background: color-mix(in srgb,var(--c1) 72%,transparent);
}

.uvq05-hm label:has(input:checked) .l3 {
  background: color-mix(in srgb,var(--c2) 45%,var(--c1));
}

.uvq05-hm label:has(input:checked) .l4 {
  background: var(--c2);
}

.uvq05-hm .ft {
  display: flex;
  align-items: center;
  gap: .4em;
  margin-top: .8em;
}

.uvq05-hm .ft button {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: .42em .75em;
  border-radius: 2em;
  font-size: .72em;
  font-weight: 700;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb,var(--fg) 22%,transparent);
  transition: box-shadow calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),transform calc(0.3s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq05-hm .ft button:hover {
  box-shadow: inset 0 0 0 1.5px var(--c1);
}

.uvq05-hm .ft button:active {
  transform: scale(.94);
}

.uvq05-hm .ft button:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq05-hm .ct {
  margin: 0 0 0 auto;
  font-size: .72em;
  color: color-mix(in srgb,var(--fg) 58%,transparent);
}

.uvq05-hm .n::before {
  content: counter(uvq05-hm);
  font-weight: 800;
  color: var(--fg);
}

@media (prefers-reduced-motion:reduce) {
  .uvq05-hm,.uvq05-hm *,.uvq05-hm *::before,.uvq05-hm *::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) {
  el.querySelectorAll(".ft button").forEach(b=>b.addEventListener("click",()=>{const we=b.dataset.p==="1";el.querySelectorAll("input").forEach((i,k)=>{i.checked=we?k>4:k<5})}))
}

export default function FHeatWeekdays() {
  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": "#0f766e",
          "--c2": "#a3e635",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <fieldset className="uvq05-hm"><legend>Active days</legend><div className="gd"><label><input type="checkbox" checked={true} /><span className="d">Monday</span><span className="cs" aria-hidden="true"><i className="l0" style={{ "--n": "0" } as CSSProperties}></i><i className="l3" style={{ "--n": "1" } as CSSProperties}></i><i className="l0" style={{ "--n": "2" } as CSSProperties}></i><i className="l1" style={{ "--n": "3" } as CSSProperties}></i><i className="l3" style={{ "--n": "4" } as CSSProperties}></i><i className="l2" style={{ "--n": "5" } as CSSProperties}></i><i className="l3" style={{ "--n": "6" } as CSSProperties}></i><i className="l2" style={{ "--n": "7" } as CSSProperties}></i><i className="l1" style={{ "--n": "8" } as CSSProperties}></i><i className="l2" style={{ "--n": "9" } as CSSProperties}></i><i className="l0" style={{ "--n": "10" } as CSSProperties}></i><i className="l2" style={{ "--n": "11" } as CSSProperties}></i></span></label><label><input type="checkbox" checked={true} /><span className="d">Tuesday</span><span className="cs" aria-hidden="true"><i className="l2" style={{ "--n": "0" } as CSSProperties}></i><i className="l0" style={{ "--n": "1" } as CSSProperties}></i><i className="l1" style={{ "--n": "2" } as CSSProperties}></i><i className="l0" style={{ "--n": "3" } as CSSProperties}></i><i className="l0" style={{ "--n": "4" } as CSSProperties}></i><i className="l2" style={{ "--n": "5" } as CSSProperties}></i><i className="l0" style={{ "--n": "6" } as CSSProperties}></i><i className="l2" style={{ "--n": "7" } as CSSProperties}></i><i className="l1" style={{ "--n": "8" } as CSSProperties}></i><i className="l2" style={{ "--n": "9" } as CSSProperties}></i><i className="l1" style={{ "--n": "10" } as CSSProperties}></i><i className="l1" style={{ "--n": "11" } as CSSProperties}></i></span></label><label><input type="checkbox" checked={true} /><span className="d">Wednesday</span><span className="cs" aria-hidden="true"><i className="l1" style={{ "--n": "0" } as CSSProperties}></i><i className="l0" style={{ "--n": "1" } as CSSProperties}></i><i className="l1" style={{ "--n": "2" } as CSSProperties}></i><i className="l0" style={{ "--n": "3" } as CSSProperties}></i><i className="l0" style={{ "--n": "4" } as CSSProperties}></i><i className="l1" style={{ "--n": "5" } as CSSProperties}></i><i className="l0" style={{ "--n": "6" } as CSSProperties}></i><i className="l0" style={{ "--n": "7" } as CSSProperties}></i><i className="l3" style={{ "--n": "8" } as CSSProperties}></i><i className="l1" style={{ "--n": "9" } as CSSProperties}></i><i className="l3" style={{ "--n": "10" } as CSSProperties}></i><i className="l3" style={{ "--n": "11" } as CSSProperties}></i></span></label><label><input type="checkbox" checked={true} /><span className="d">Thursday</span><span className="cs" aria-hidden="true"><i className="l0" style={{ "--n": "0" } as CSSProperties}></i><i className="l1" style={{ "--n": "1" } as CSSProperties}></i><i className="l2" style={{ "--n": "2" } as CSSProperties}></i><i className="l3" style={{ "--n": "3" } as CSSProperties}></i><i className="l3" style={{ "--n": "4" } as CSSProperties}></i><i className="l2" style={{ "--n": "5" } as CSSProperties}></i><i className="l2" style={{ "--n": "6" } as CSSProperties}></i><i className="l3" style={{ "--n": "7" } as CSSProperties}></i><i className="l2" style={{ "--n": "8" } as CSSProperties}></i><i className="l1" style={{ "--n": "9" } as CSSProperties}></i><i className="l2" style={{ "--n": "10" } as CSSProperties}></i><i className="l1" style={{ "--n": "11" } as CSSProperties}></i></span></label><label><input type="checkbox" checked={true} /><span className="d">Friday</span><span className="cs" aria-hidden="true"><i className="l2" style={{ "--n": "0" } as CSSProperties}></i><i className="l3" style={{ "--n": "1" } as CSSProperties}></i><i className="l3" style={{ "--n": "2" } as CSSProperties}></i><i className="l4" style={{ "--n": "3" } as CSSProperties}></i><i className="l4" style={{ "--n": "4" } as CSSProperties}></i><i className="l3" style={{ "--n": "5" } as CSSProperties}></i><i className="l3" style={{ "--n": "6" } as CSSProperties}></i><i className="l3" style={{ "--n": "7" } as CSSProperties}></i><i className="l1" style={{ "--n": "8" } as CSSProperties}></i><i className="l4" style={{ "--n": "9" } as CSSProperties}></i><i className="l2" style={{ "--n": "10" } as CSSProperties}></i><i className="l1" style={{ "--n": "11" } as CSSProperties}></i></span></label><label><input type="checkbox" /><span className="d">Saturday</span><span className="cs" aria-hidden="true"><i className="l3" style={{ "--n": "0" } as CSSProperties}></i><i className="l2" style={{ "--n": "1" } as CSSProperties}></i><i className="l1" style={{ "--n": "2" } as CSSProperties}></i><i className="l1" style={{ "--n": "3" } as CSSProperties}></i><i className="l4" style={{ "--n": "4" } as CSSProperties}></i><i className="l3" style={{ "--n": "5" } as CSSProperties}></i><i className="l3" style={{ "--n": "6" } as CSSProperties}></i><i className="l3" style={{ "--n": "7" } as CSSProperties}></i><i className="l2" style={{ "--n": "8" } as CSSProperties}></i><i className="l4" style={{ "--n": "9" } as CSSProperties}></i><i className="l3" style={{ "--n": "10" } as CSSProperties}></i><i className="l1" style={{ "--n": "11" } as CSSProperties}></i></span></label><label><input type="checkbox" /><span className="d">Sunday</span><span className="cs" aria-hidden="true"><i className="l1" style={{ "--n": "0" } as CSSProperties}></i><i className="l2" style={{ "--n": "1" } as CSSProperties}></i><i className="l2" style={{ "--n": "2" } as CSSProperties}></i><i className="l4" style={{ "--n": "3" } as CSSProperties}></i><i className="l2" style={{ "--n": "4" } as CSSProperties}></i><i className="l2" style={{ "--n": "5" } as CSSProperties}></i><i className="l1" style={{ "--n": "6" } as CSSProperties}></i><i className="l2" style={{ "--n": "7" } as CSSProperties}></i><i className="l4" style={{ "--n": "8" } as CSSProperties}></i><i className="l4" style={{ "--n": "9" } as CSSProperties}></i><i className="l4" style={{ "--n": "10" } as CSSProperties}></i><i className="l1" style={{ "--n": "11" } as CSSProperties}></i></span></label></div><div className="ft"><button type="button" data-p="0">Weekdays</button><button type="button" data-p="1">Weekend</button><p className="ct"><span className="n"></span> <span>of 7 days</span></p></div></fieldset>
      </div>
    </>
  );
}
```

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