# `ixfx-swipe`

A touch-friendly swipe/nudge component. User taps and drags to generate a value in range [-1, 1]. Value is emitted only on pointer release.

```html
<ixfx-swipe></ixfx-swipe>
```

```js
const swipe = document.querySelector('ixfx-swipe');
swipe.addEventListener('input', e => {
  console.log(e.detail.value); // -1 to 1
});
```

### Properties / attributes

| Attribute / Property   | Type     | Default | Description                                |
|-----------------------|----------|---------|--------------------------------------------|
| `barSpacing`          | `number` | `20`    | Center-to-center pixel distance between bars |
| `barWidth`            | `number` | `14`    | Pixel width of each bar                    |
| `debounceMs`          | `number` | `200`   | Pause after release before retraction begins |
| `retractDurationMs`   | `number` | `400`   | Spring-back animation duration in ms        |

### Events

| Event   | Detail               | Description                                 |
|---------|----------------------|---------------------------------------------|
| `input` | `{ value: number }`  | Fired on pointer release with drag value (-1 to 1) |

### CSS custom properties

| Property            | Default              | Description                      |
|---------------------|----------------------|----------------------------------|
| `--swipe-color-a`   | `var(--surface-4)`   | Fill color for even-indexed bars |
| `--swipe-color-b`   | `var(--surface-5)`   | Fill color for odd-indexed bars  |
| `--swipe-border-color` | `var(--border)`    | Border color                     |

### Usage notes

- A full drag across the component width equals ±1
- Value is emitted as `input` only on `pointerup` (not during drag)
- Spring-back animation uses cubic ease-out: `1 - (1 - t)³`
- Touch-action is set to `none` for reliable touch handling