# Compass rose orientation filter

> A parchment compass with eight sectors: mark which way the home faces and the needle swings over with a spring.

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

## Where to use it

Orientation matters when people look for homes, terraces or solar panels, and a compass shows it better than a list of words. Eight checkbox wedges are clipped into a circle on a parchment dial with a degree ring, and each pick fills its sector from the centre while the needle turns by the shortest route.

The first colour fills the chosen sectors and the needle tip, the second sets the parchment. Keep the cardinal words short in other languages, and also show the selected orientations beside the results as plain text.

## Code

### HTML

```html
<fieldset class="uvq05-cp"><legend>Orientation</legend><div class="rs"><div class="dl"><label style="--i:0"><input type="checkbox" aria-label="North"><span class="w"></span></label><label style="--i:1"><input type="checkbox" aria-label="Northeast"><span class="w"></span></label><label style="--i:2"><input type="checkbox" aria-label="East" checked><span class="w"></span></label><label style="--i:3"><input type="checkbox" aria-label="Southeast" checked><span class="w"></span></label><label style="--i:4"><input type="checkbox" aria-label="South" checked><span class="w"></span></label><label style="--i:5"><input type="checkbox" aria-label="Southwest"><span class="w"></span></label><label style="--i:6"><input type="checkbox" aria-label="West"><span class="w"></span></label><label style="--i:7"><input type="checkbox" aria-label="Northwest"><span class="w"></span></label></div><svg class="st" viewBox="0 0 100 100" aria-hidden="true"><path d="M50 50L60 40L50 4L40 40z" fill="#7a5a2a"/><path d="M50 50L60 60L50 96L40 60z" fill="#7a5a2a"/><path d="M50 50L60 40L96 50L60 60z" fill="#a9844a"/><path d="M50 50L40 40L4 50L40 60z" fill="#a9844a"/><path d="M50 50l6-6 18-18-24 12zM50 50l6 6 18 18-24-12zM50 50l-6 6-18 18 24-12zM50 50l-6-6-18-18 24 12z" fill="#c9a86a" opacity=".8"/></svg><span class="cd cn" aria-hidden="true">North</span><span class="cd ce" aria-hidden="true">East</span><span class="cd cs" aria-hidden="true">South</span><span class="cd cw" aria-hidden="true">West</span><span class="nd" aria-hidden="true"></span><span class="hub" aria-hidden="true"></span></div><p class="ct"><span>Orientations:</span> <span class="n"></span></p></fieldset>
```

### CSS

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

.uvq05-cp {
  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: 13em;
  counter-reset: uvq05-cp;
}

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

.uvq05-cp .rs {
  position: relative;
  width: 12.5em;
  height: 12.5em;
  margin: 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle,transparent 60%,rgba(122,90,42,.12)),var(--c2);
  box-shadow: inset 0 0 0 .45em color-mix(in srgb,var(--c2) 80%,#7a5a2a),inset 0 0 0 .5em rgba(0,0,0,.25),0 1em 2em -1em rgba(0,0,0,.55);
  --a: 90deg;
}

.uvq05-cp .rs::before {
  content: "";
  position: absolute;
  inset: .5em;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(90,64,32,.6) 0 .7deg,transparent .7deg 7.5deg);
  -webkit-mask: radial-gradient(farthest-side,transparent calc(100% - .45em),#000 calc(100% - .45em + 1px));
  mask: radial-gradient(farthest-side,transparent calc(100% - .45em),#000 calc(100% - .45em + 1px));
  pointer-events: none;
}

.uvq05-cp .dl {
  position: absolute;
  inset: 1em;
  border-radius: 50%;
  overflow: hidden;
}

.uvq05-cp label {
  position: absolute;
  inset: 0;
  transform: rotate(calc(var(--i) * 45deg));
  clip-path: polygon(50% 50%,29.3% 0,70.7% 0);
  cursor: pointer;
}

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

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

.uvq05-cp .w {
  position: absolute;
  inset: 0;
  background: rgba(122,90,42,.05);
  transition: background calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq05-cp label:nth-of-type(even) .w {
  background: rgba(122,90,42,.11);
}

.uvq05-cp label:hover .w {
  background: color-mix(in srgb,var(--c1) 22%,transparent);
}

.uvq05-cp input:checked+.w {
  background: radial-gradient(circle,transparent 0 21%,color-mix(in srgb,var(--c1) 82%,transparent) 21.5%);
  animation: uvq05-cpw calc(0.45s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq05-cp input:focus-visible+.w {
  background: color-mix(in srgb,var(--c1) 40%,transparent);
}

.uvq05-cp input:checked:focus-visible+.w {
  background: radial-gradient(circle,transparent 0 21%,color-mix(in srgb,var(--c1) 70%,#000) 21.5%);
}

.uvq05-cp .rs:has(input:focus-visible) {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq05-cp label:active .w {
  opacity: .8;
}

.uvq05-cp .st {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5.4em;
  height: 5.4em;
  margin: -2.7em;
  pointer-events: none;
  opacity: .9;
}

.uvq05-cp .cd {
  position: absolute;
  z-index: 1;
  font-size: .52em;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #4a3418;
  pointer-events: none;
}

.uvq05-cp .cn {
  top: 2.6em;
  left: 50%;
  translate: -50% 0;
}

.uvq05-cp .cs {
  bottom: 2.6em;
  left: 50%;
  translate: -50% 0;
}

.uvq05-cp .ce {
  right: 2.3em;
  top: 50%;
  translate: 0 -50%;
}

.uvq05-cp .cw {
  left: 2.3em;
  top: 50%;
  translate: 0 -50%;
}

.uvq05-cp .nd {
  position: absolute;
  left: 50%;
  top: 50%;
  width: .55em;
  height: 6em;
  margin: -3em 0 0 -.275em;
  background: linear-gradient(var(--c1) 50%,#2f2f31 50%);
  clip-path: polygon(50% 0,100% 50%,50% 100%,0 50%);
  transform: rotate(var(--a));
  transition: transform calc(0.9s / var(--k)) cubic-bezier(.34,1.56,.64,1);
  pointer-events: none;
  filter: drop-shadow(0 .1em .1em rgba(0,0,0,.3));
}

.uvq05-cp .hub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: .8em;
  height: .8em;
  margin: -.4em;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%,#fff3c4,#b8862b 60%,#6b4a14);
  pointer-events: none;
}

.uvq05-cp .ct {
  margin: .8em 0 0;
  font-size: .8em;
  text-align: center;
  color: color-mix(in srgb,var(--fg) 58%,transparent);
}

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

@keyframes uvq05-cpw {
  from {
    transform: scale(.4);
  }
}

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

### JavaScript

```js
document.querySelectorAll(".uvq05-cp").forEach(el => {
  const rs=el.querySelector(".rs"),ins=[...el.querySelectorAll("input")];let a=90;
const aim=t=>{a+=((t-a)%360+540)%360-180;rs.style.setProperty("--a",a+"deg")};
ins.forEach((n,i)=>n.addEventListener("change",()=>{if(n.checked)aim(i*45);else{const on=ins.findIndex(x=>x.checked);aim(on<0?0:on*45)}}));
const f=ins.findIndex(x=>x.checked);a=f<0?0:f*45;rs.style.setProperty("--a",a+"deg")
});
```

### 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-cp {
  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: 13em;
  counter-reset: uvq05-cp;
}

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

.uvq05-cp .rs {
  position: relative;
  width: 12.5em;
  height: 12.5em;
  margin: 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle,transparent 60%,rgba(122,90,42,.12)),var(--c2);
  box-shadow: inset 0 0 0 .45em color-mix(in srgb,var(--c2) 80%,#7a5a2a),inset 0 0 0 .5em rgba(0,0,0,.25),0 1em 2em -1em rgba(0,0,0,.55);
  --a: 90deg;
}

.uvq05-cp .rs::before {
  content: "";
  position: absolute;
  inset: .5em;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(90,64,32,.6) 0 .7deg,transparent .7deg 7.5deg);
  -webkit-mask: radial-gradient(farthest-side,transparent calc(100% - .45em),#000 calc(100% - .45em + 1px));
  mask: radial-gradient(farthest-side,transparent calc(100% - .45em),#000 calc(100% - .45em + 1px));
  pointer-events: none;
}

.uvq05-cp .dl {
  position: absolute;
  inset: 1em;
  border-radius: 50%;
  overflow: hidden;
}

.uvq05-cp label {
  position: absolute;
  inset: 0;
  transform: rotate(calc(var(--i) * 45deg));
  clip-path: polygon(50% 50%,29.3% 0,70.7% 0);
  cursor: pointer;
}

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

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

.uvq05-cp .w {
  position: absolute;
  inset: 0;
  background: rgba(122,90,42,.05);
  transition: background calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq05-cp label:nth-of-type(even) .w {
  background: rgba(122,90,42,.11);
}

.uvq05-cp label:hover .w {
  background: color-mix(in srgb,var(--c1) 22%,transparent);
}

.uvq05-cp input:checked+.w {
  background: radial-gradient(circle,transparent 0 21%,color-mix(in srgb,var(--c1) 82%,transparent) 21.5%);
  animation: uvq05-cpw calc(0.45s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq05-cp input:focus-visible+.w {
  background: color-mix(in srgb,var(--c1) 40%,transparent);
}

.uvq05-cp input:checked:focus-visible+.w {
  background: radial-gradient(circle,transparent 0 21%,color-mix(in srgb,var(--c1) 70%,#000) 21.5%);
}

.uvq05-cp .rs:has(input:focus-visible) {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq05-cp label:active .w {
  opacity: .8;
}

.uvq05-cp .st {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5.4em;
  height: 5.4em;
  margin: -2.7em;
  pointer-events: none;
  opacity: .9;
}

.uvq05-cp .cd {
  position: absolute;
  z-index: 1;
  font-size: .52em;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #4a3418;
  pointer-events: none;
}

.uvq05-cp .cn {
  top: 2.6em;
  left: 50%;
  translate: -50% 0;
}

.uvq05-cp .cs {
  bottom: 2.6em;
  left: 50%;
  translate: -50% 0;
}

.uvq05-cp .ce {
  right: 2.3em;
  top: 50%;
  translate: 0 -50%;
}

.uvq05-cp .cw {
  left: 2.3em;
  top: 50%;
  translate: 0 -50%;
}

.uvq05-cp .nd {
  position: absolute;
  left: 50%;
  top: 50%;
  width: .55em;
  height: 6em;
  margin: -3em 0 0 -.275em;
  background: linear-gradient(var(--c1) 50%,#2f2f31 50%);
  clip-path: polygon(50% 0,100% 50%,50% 100%,0 50%);
  transform: rotate(var(--a));
  transition: transform calc(0.9s / var(--k)) cubic-bezier(.34,1.56,.64,1);
  pointer-events: none;
  filter: drop-shadow(0 .1em .1em rgba(0,0,0,.3));
}

.uvq05-cp .hub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: .8em;
  height: .8em;
  margin: -.4em;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%,#fff3c4,#b8862b 60%,#6b4a14);
  pointer-events: none;
}

.uvq05-cp .ct {
  margin: .8em 0 0;
  font-size: .8em;
  text-align: center;
  color: color-mix(in srgb,var(--fg) 58%,transparent);
}

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

@keyframes uvq05-cpw {
  from {
    transform: scale(.4);
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq05-cp,.uvq05-cp *,.uvq05-cp *::before,.uvq05-cp *::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 rs=el.querySelector(".rs"),ins=[...el.querySelectorAll("input")];let a=90;
const aim=t=>{a+=((t-a)%360+540)%360-180;rs.style.setProperty("--a",a+"deg")};
ins.forEach((n,i)=>n.addEventListener("change",()=>{if(n.checked)aim(i*45);else{const on=ins.findIndex(x=>x.checked);aim(on<0?0:on*45)}}));
const f=ins.findIndex(x=>x.checked);a=f<0?0:f*45;rs.style.setProperty("--a",a+"deg")
}

export default function FCompassRose() {
  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": "#c2410c",
          "--c2": "#fbf3df",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <fieldset className="uvq05-cp"><legend>Orientation</legend><div className="rs"><div className="dl"><label style={{ "--i": "0" } as CSSProperties}><input type="checkbox" aria-label="North" /><span className="w"></span></label><label style={{ "--i": "1" } as CSSProperties}><input type="checkbox" aria-label="Northeast" /><span className="w"></span></label><label style={{ "--i": "2" } as CSSProperties}><input type="checkbox" aria-label="East" checked={true} /><span className="w"></span></label><label style={{ "--i": "3" } as CSSProperties}><input type="checkbox" aria-label="Southeast" checked={true} /><span className="w"></span></label><label style={{ "--i": "4" } as CSSProperties}><input type="checkbox" aria-label="South" checked={true} /><span className="w"></span></label><label style={{ "--i": "5" } as CSSProperties}><input type="checkbox" aria-label="Southwest" /><span className="w"></span></label><label style={{ "--i": "6" } as CSSProperties}><input type="checkbox" aria-label="West" /><span className="w"></span></label><label style={{ "--i": "7" } as CSSProperties}><input type="checkbox" aria-label="Northwest" /><span className="w"></span></label></div><svg className="st" viewBox="0 0 100 100" aria-hidden="true"><path d="M50 50L60 40L50 4L40 40z" fill="#7a5a2a" /><path d="M50 50L60 60L50 96L40 60z" fill="#7a5a2a" /><path d="M50 50L60 40L96 50L60 60z" fill="#a9844a" /><path d="M50 50L40 40L4 50L40 60z" fill="#a9844a" /><path d="M50 50l6-6 18-18-24 12zM50 50l6 6 18 18-24-12zM50 50l-6 6-18 18 24-12zM50 50l-6-6-18-18 24 12z" fill="#c9a86a" opacity=".8" /></svg><span className="cd cn" aria-hidden="true">North</span><span className="cd ce" aria-hidden="true">East</span><span className="cd cs" aria-hidden="true">South</span><span className="cd cw" aria-hidden="true">West</span><span className="nd" aria-hidden="true"></span><span className="hub" aria-hidden="true"></span></div><p className="ct"><span>Orientations:</span> <span className="n"></span></p></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 “Compass rose orientation filter” block (Filters) from AIMRAN Library to my project.

## What it is
A parchment compass with eight sectors: mark which way the home faces and the needle swings over with a spring.

## Chosen settings
- Main color: #c2410c
- Secondary color: #fbf3df
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Orientación"

## 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-cp {
  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: 13em;
  counter-reset: uvq05-cp;
}

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

.uvq05-cp .rs {
  position: relative;
  width: 12.5em;
  height: 12.5em;
  margin: 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle,transparent 60%,rgba(122,90,42,.12)),var(--c2);
  box-shadow: inset 0 0 0 .45em color-mix(in srgb,var(--c2) 80%,#7a5a2a),inset 0 0 0 .5em rgba(0,0,0,.25),0 1em 2em -1em rgba(0,0,0,.55);
  --a: 90deg;
}

.uvq05-cp .rs::before {
  content: "";
  position: absolute;
  inset: .5em;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(90,64,32,.6) 0 .7deg,transparent .7deg 7.5deg);
  -webkit-mask: radial-gradient(farthest-side,transparent calc(100% - .45em),#000 calc(100% - .45em + 1px));
  mask: radial-gradient(farthest-side,transparent calc(100% - .45em),#000 calc(100% - .45em + 1px));
  pointer-events: none;
}

.uvq05-cp .dl {
  position: absolute;
  inset: 1em;
  border-radius: 50%;
  overflow: hidden;
}

.uvq05-cp label {
  position: absolute;
  inset: 0;
  transform: rotate(calc(var(--i) * 45deg));
  clip-path: polygon(50% 50%,29.3% 0,70.7% 0);
  cursor: pointer;
}

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

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

.uvq05-cp .w {
  position: absolute;
  inset: 0;
  background: rgba(122,90,42,.05);
  transition: background calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq05-cp label:nth-of-type(even) .w {
  background: rgba(122,90,42,.11);
}

.uvq05-cp label:hover .w {
  background: color-mix(in srgb,var(--c1) 22%,transparent);
}

.uvq05-cp input:checked+.w {
  background: radial-gradient(circle,transparent 0 21%,color-mix(in srgb,var(--c1) 82%,transparent) 21.5%);
  animation: uvq05-cpw calc(0.45s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq05-cp input:focus-visible+.w {
  background: color-mix(in srgb,var(--c1) 40%,transparent);
}

.uvq05-cp input:checked:focus-visible+.w {
  background: radial-gradient(circle,transparent 0 21%,color-mix(in srgb,var(--c1) 70%,#000) 21.5%);
}

.uvq05-cp .rs:has(input:focus-visible) {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq05-cp label:active .w {
  opacity: .8;
}

.uvq05-cp .st {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5.4em;
  height: 5.4em;
  margin: -2.7em;
  pointer-events: none;
  opacity: .9;
}

.uvq05-cp .cd {
  position: absolute;
  z-index: 1;
  font-size: .52em;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #4a3418;
  pointer-events: none;
}

.uvq05-cp .cn {
  top: 2.6em;
  left: 50%;
  translate: -50% 0;
}

.uvq05-cp .cs {
  bottom: 2.6em;
  left: 50%;
  translate: -50% 0;
}

.uvq05-cp .ce {
  right: 2.3em;
  top: 50%;
  translate: 0 -50%;
}

.uvq05-cp .cw {
  left: 2.3em;
  top: 50%;
  translate: 0 -50%;
}

.uvq05-cp .nd {
  position: absolute;
  left: 50%;
  top: 50%;
  width: .55em;
  height: 6em;
  margin: -3em 0 0 -.275em;
  background: linear-gradient(var(--c1) 50%,#2f2f31 50%);
  clip-path: polygon(50% 0,100% 50%,50% 100%,0 50%);
  transform: rotate(var(--a));
  transition: transform calc(0.9s / var(--k)) cubic-bezier(.34,1.56,.64,1);
  pointer-events: none;
  filter: drop-shadow(0 .1em .1em rgba(0,0,0,.3));
}

.uvq05-cp .hub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: .8em;
  height: .8em;
  margin: -.4em;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%,#fff3c4,#b8862b 60%,#6b4a14);
  pointer-events: none;
}

.uvq05-cp .ct {
  margin: .8em 0 0;
  font-size: .8em;
  text-align: center;
  color: color-mix(in srgb,var(--fg) 58%,transparent);
}

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

@keyframes uvq05-cpw {
  from {
    transform: scale(.4);
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq05-cp,.uvq05-cp *,.uvq05-cp *::before,.uvq05-cp *::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 rs=el.querySelector(".rs"),ins=[...el.querySelectorAll("input")];let a=90;
const aim=t=>{a+=((t-a)%360+540)%360-180;rs.style.setProperty("--a",a+"deg")};
ins.forEach((n,i)=>n.addEventListener("change",()=>{if(n.checked)aim(i*45);else{const on=ins.findIndex(x=>x.checked);aim(on<0?0:on*45)}}));
const f=ins.findIndex(x=>x.checked);a=f<0?0:f*45;rs.style.setProperty("--a",a+"deg")
}

export default function FCompassRose() {
  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": "#c2410c",
          "--c2": "#fbf3df",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <fieldset className="uvq05-cp"><legend>Orientation</legend><div className="rs"><div className="dl"><label style={{ "--i": "0" } as CSSProperties}><input type="checkbox" aria-label="North" /><span className="w"></span></label><label style={{ "--i": "1" } as CSSProperties}><input type="checkbox" aria-label="Northeast" /><span className="w"></span></label><label style={{ "--i": "2" } as CSSProperties}><input type="checkbox" aria-label="East" checked={true} /><span className="w"></span></label><label style={{ "--i": "3" } as CSSProperties}><input type="checkbox" aria-label="Southeast" checked={true} /><span className="w"></span></label><label style={{ "--i": "4" } as CSSProperties}><input type="checkbox" aria-label="South" checked={true} /><span className="w"></span></label><label style={{ "--i": "5" } as CSSProperties}><input type="checkbox" aria-label="Southwest" /><span className="w"></span></label><label style={{ "--i": "6" } as CSSProperties}><input type="checkbox" aria-label="West" /><span className="w"></span></label><label style={{ "--i": "7" } as CSSProperties}><input type="checkbox" aria-label="Northwest" /><span className="w"></span></label></div><svg className="st" viewBox="0 0 100 100" aria-hidden="true"><path d="M50 50L60 40L50 4L40 40z" fill="#7a5a2a" /><path d="M50 50L60 60L50 96L40 60z" fill="#7a5a2a" /><path d="M50 50L60 40L96 50L60 60z" fill="#a9844a" /><path d="M50 50L40 40L4 50L40 60z" fill="#a9844a" /><path d="M50 50l6-6 18-18-24 12zM50 50l6 6 18 18-24-12zM50 50l-6 6-18 18 24-12zM50 50l-6-6-18-18 24 12z" fill="#c9a86a" opacity=".8" /></svg><span className="cd cn" aria-hidden="true">North</span><span className="cd ce" aria-hidden="true">East</span><span className="cd cs" aria-hidden="true">South</span><span className="cd cw" aria-hidden="true">West</span><span className="nd" aria-hidden="true"></span><span className="hub" aria-hidden="true"></span></div><p className="ct"><span>Orientations:</span> <span className="n"></span></p></fieldset>
      </div>
    </>
  );
}
```

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