interactive-hit-areas
millionco/skills · Agent Skill
Используйте, когда интерактивные элементы с визуальным расстоянием между ними требуют наведения или клика для ответа во всей области без мертвых зон.
Перейти к установке ↓Обзор
| Автор | |
|---|---|
| Репозиторий | millionco/skills ↗ |
| Папка скилла | interactive-hit-areas |
| Звёзды | 34 |
| Форки | 2 |
| Файлы | 1 |
| Лицензия | MIT |
| Обновлён | 30 июня 2026 г. |
| Ссылки | Исходник скилла ↗ · Репозиторий ↗ |
Проверка Mozgi
Что мы нашли в файлах скилла. Подробности — по подписке.
Установка
Скилл — это папка с файлом SKILL.md. Выберите своего агента и скопируйте команды в терминал (macOS, Linux или Git Bash на Windows) в корне проекта.
Скопируйте промпт и вставьте в Claude, Codex или другого ассистента: он сам проверит скилл и подключит его.
Установи мне скилл «interactive-hit-areas» с mozgi.io (https://mozgi.io/skills/millionco-interactive-hit-areas/). 1. Скачай архив: https://mozgi.io/skills/millionco-interactive-hit-areas/download Если не скачивается — возьми папку скилла из исходника: https://github.com/millionco/skills/tree/main/skills/interactive-hit-areas 2. Прочитай SKILL.md и остальные файлы. Проверь, что скилл безопасен: нет скрытых команд, отправки данных наружу или скриптов, которые делают не то, что описано. Если что-то подозрительно — остановись и скажи мне. 3. Положи папку «interactive-hit-areas» в папку скиллов своего агента: .claude/skills/ для Claude Code, .agents/skills/ для Codex, .cursor/skills/ для Cursor, .gemini/skills/ для Gemini CLI. В проекте — внутри проекта, иначе в домашней папке (~/.claude/skills/ и т. п.). 4. Убедись, что получилось <папка скиллов>/interactive-hit-areas/SKILL.md. 5. Коротко расскажи, что умеет этот скилл, и предложи попробовать его на моей задаче. Если какой-то шаг не можешь сделать сам — подскажи, что нажать или ввести.
git clone --depth 1 --branch main https://github.com/millionco/skills.git /tmp/skills mkdir -p .claude/skills cp -r /tmp/skills/skills/interactive-hit-areas .claude/skills/interactive-hit-areas
Перезапустите Claude Code — скилл появится в списке, вызвать вручную: /interactive-hit-areas. Для всех проектов сразу — папка ~/.claude/skills.
git clone --depth 1 --branch main https://github.com/millionco/skills.git /tmp/skills mkdir -p .agents/skills cp -r /tmp/skills/skills/interactive-hit-areas .agents/skills/interactive-hit-areas
Codex ищет скиллы в .agents/skills от текущей папки до корня репозитория; вызвать вручную — /skills или $interactive-hit-areas. Для всех проектов — ~/.agents/skills.
git clone --depth 1 --branch main https://github.com/millionco/skills.git /tmp/skills mkdir -p .cursor/skills cp -r /tmp/skills/skills/interactive-hit-areas .cursor/skills/interactive-hit-areas
Cursor подхватит скилл при запуске; вызвать вручную — «/» в чате агента. Cursor также читает .claude/skills и .agents/skills. Для всех проектов — ~/.cursor/skills.
git clone --depth 1 --branch main https://github.com/millionco/skills.git /tmp/skills mkdir -p .gemini/skills cp -r /tmp/skills/skills/interactive-hit-areas .gemini/skills/interactive-hit-areas
Gemini CLI сам предложит включить скилл, когда задача подходит, — вы подтверждаете. Для всех проектов — ~/.gemini/skills.
Просмотрите SKILL.md и сопутствующие файлы перед установкой. Клик по файлу — предпросмотр.
Содержимое SKILL.md
Оригинальный текст автора · только чтениеInteractive Hit Areas
Separate the hit area (where pointer events land) from the visual area (what the user sees). Bugs happen when spacing is built so that the gap between items has no event handler — the pointer falls into a dead zone and hover/click does nothing or flickers.
The core rule
Visual spacing between interactive siblings must live INSIDE each hit target, never BETWEEN them.
- WRONG: spacing via
gap,space-x, ormarginbetween the interactive elements. The space is empty DOM — no handler — so it's dead. - RIGHT: interactive elements sit flush (no gap), each filling its full slot and carrying the handler; the visual element inside is made narrower/inset (padding,
max-width, or a centered child) so it still *looks* spaced.
Result: the entire region is a continuous strip of live targets, but it looks identical to the spaced design.
Symptom & detection
- Symptom: moving the pointer slowly between two items, the highlight blinks off in the space between them, or you must aim directly at the small visual element to trigger it.
- Detect: sweep the cursor horizontally/vertically across the whole component. If the active/hover state ever drops out while still inside the component's bounds, you have dead zones.
- The bigger the visual gap, the bigger the dead zone — so "nice airy spacing" makes it worse.
The fix (general)
1. Identify the repeating slot (one item's full share of the axis — its *pitch*).
2. Make the interactive container fill that whole slot, flush against its neighbors (remove gap/space-*/margin between siblings; use flex-1/equal grid tracks).
3. Put the handler (onMouseEnter, onClick, :hover) on that full-slot container.
4. Recreate the visual spacing *inside*: center a narrower visual element (max-width, fixed width + items-center), or use padding on the container around full-bleed content. Padding is part of the element, so it stays a live target; margin/gap is not.
React / Tailwind specifics
- Replace
gap-Nbetween hover/click items withgap-0(flush) and move the spacing inside each item (padding, or a centered child withmax-w-[Npx]). - Keep sibling rows that must stay column-aligned (e.g. bars and their labels/icons) on the same gap setting — if one row is flush and another has
gap, their centers drift apart. Flush +flex-1on both keeps centers aligned. - For lists/menus: put vertical rhythm as
py-*on each row, not asspace-y-*/gap-*between rows, when the whole row strip should be clickable. - Accessibility tie-in: this is also how you hit the 24–44px minimum target size — grow the hit area with padding while keeping the glyph small.
Worked example (bar chart)
Spaced bars where hovering anywhere over a bar's column highlights it:
// Container: flush columns, NO gap — the whole width is live.
<div className="absolute inset-0 flex items-stretch">
{bars.map((bar, i) => (
<div
key={bar.id}
// flex-1 = one full slot/pitch; full height = hover above the bar too
className="flex flex-1 flex-col items-center justify-end"
onMouseEnter={() => setHovered(i)}
onMouseLeave={() => setHovered(null)}
style={{ opacity: hovered !== null && hovered !== i ? 0.4 : 1 }}
>
<span>{bar.value}</span>
{/* visual spacing comes from the narrower CENTERED bar, not a gap */}
<div className="w-full" style={{ maxWidth: 37, height: bar.value * UNIT }} />
</div>
))}
</div>
Anti-pattern that caused the bug: flex ... gap-2 with w-full bars. The bars touched their slots, so the only spacing was the 8px gap between columns — and that gap was dead to the pointer.
When gaps between items ARE fine
Dead zones only matter when you want "anywhere in the region targets the nearest item." If items are meant to be discrete and the space between them is genuinely inert (e.g. cards on a page, unrelated buttons), gap is correct — don't force flush layouts everywhere. Apply this skill when the design intends a continuous interactive band with visual separation.
Вопросы и ответы
Что делает скилл interactive-hit-areas?
Используйте, когда интерактивные элементы с визуальным расстоянием между ними требуют наведения или клика для ответа во всей области без мертвых зон.
Как установить interactive-hit-areas?
Откройте блок «Установка» на этой странице и выберите своего агента — Claude Code, Codex, Cursor или Gemini CLI: там готовые команды, которые копируют папку скилла в нужное место. Либо скопируйте промпт из вкладки «Через ассистента» — ассистент сам проверит и подключит скилл.
С какими нейросетями работает interactive-hit-areas?
Скиллы — это обычные инструкции в Markdown (формат Agent Skills), поэтому interactive-hit-areas подходит любому агенту, который читает SKILL.md: Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode и другие. Модель загружает инструкции только когда задача подходит под описание скилла.
Скилл interactive-hit-areas бесплатный?
Скилл опубликован автором millionco в открытом доступе под лицензией MIT. Сам скилл ничего не стоит — вы платите только своему провайдеру нейросети за использованные токены.
Безопасно ли устанавливать скиллы?
Скилл — это инструкции, которые агент будет выполнять, поэтому перед установкой прочитайте SKILL.md и сопутствующие файлы. Скрипты из папки скилла запускаются только если их запустит агент — следите за тем, что он делает, и не давайте лишних прав.
Чем скилл отличается от MCP-сервера или плагина?
MCP-сервер и плагин дают модели новые инструменты — код, который выполняется и возвращает результат. Скилл даёт знания и порядок действий: как подходить к задаче, какие шаги делать и как выглядит хороший результат. Ему не нужен сервер или ключ API.