interactive-hit-areas
millionco/skills · Agent Skill
Utilizzare quando gli elementi interattivi con una distanza visiva tra loro richiedono l'hover o il click per rispondere in tutta l'area senza zone morte.
Vai all'installazione ↓Panoramica
| Autore | |
|---|---|
| Repository | millionco/skills ↗ |
| Cartella dello skill | interactive-hit-areas |
| Stelle | 34 |
| Fork | 2 |
| File inclusi | 1 |
| Licenza | MIT |
| Aggiornato | 30 giugno 2026 |
| Link | Sorgente dello skill ↗ · Repository ↗ |
Verifica Mozgi
Cosa abbiamo trovato nei file dello skill. I dettagli con l’abbonamento.
Installazione
Uno skill è una cartella con un file SKILL.md. Scegli il tuo agente ed esegui i comandi in un terminale (macOS, Linux o Git Bash su Windows) dalla radice del progetto.
Incolla il prompt in Claude, Codex o un altro assistente: controllerà lo skill e lo installerà.
Install the “interactive-hit-areas” skill from mozgi.io (https://mozgi.io/skills/millionco-interactive-hit-areas/) for me. 1. Download the archive: https://mozgi.io/skills/millionco-interactive-hit-areas/download If it fails, take the skill folder from the source: https://github.com/millionco/skills/tree/main/skills/interactive-hit-areas 2. Read SKILL.md and the other files. Check the skill is safe: no hidden commands, no sending data elsewhere, no scripts doing something other than described. If anything looks suspicious, stop and tell me. 3. Put the “interactive-hit-areas” folder into your agent's skills folder: .claude/skills/ for Claude Code, .agents/skills/ for Codex, .cursor/skills/ for Cursor, .gemini/skills/ for Gemini CLI. Inside the project if we are in one, otherwise in the home folder (~/.claude/skills/ etc.). 4. Make sure <skills folder>/interactive-hit-areas/SKILL.md exists. 5. Briefly tell me what this skill does and offer to try it on my task. If you cannot do a step yourself, tell me what to click or type.
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
Riavvia Claude Code: lo skill compare nell'elenco; per richiamarlo a mano usa /interactive-hit-areas. Per tutti i progetti: ~/.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 cerca gli skill in .agents/skills dalla cartella corrente fino alla radice del repo; richiamalo con /skills o $interactive-hit-areas. Per tutti i progetti: ~/.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 carica lo skill all'avvio; richiamalo con “/” nella chat Agent. Cursor legge anche .claude/skills e .agents/skills. Per tutti i progetti: ~/.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 propone di attivare lo skill quando il compito corrisponde: tu confermi. Per tutti i progetti: ~/.gemini/skills.
Leggi SKILL.md e i file correlati prima di installare. Clicca un file per l'anteprima.
Contenuto di SKILL.md
Testo originale dell'autore · sola letturaInteractive 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.
Domande frequenti
Che cosa fa lo skill interactive-hit-areas?
Utilizzare quando gli elementi interattivi con una distanza visiva tra loro richiedono l'hover o il click per rispondere in tutta l'area senza zone morte.
Come si installa interactive-hit-areas?
Apri il blocco “Installazione” in questa pagina e scegli il tuo agente — Claude Code, Codex, Cursor o Gemini CLI — per i comandi pronti che copiano la cartella dello skill nel posto giusto. Oppure copia il prompt dalla scheda “Con l'assistente” e lascia che sia l'assistente a controllare e installare lo skill.
Con quali modelli AI funziona interactive-hit-areas?
Gli skill sono semplici istruzioni in Markdown (formato Agent Skills), quindi interactive-hit-areas funziona con qualsiasi agente che legge SKILL.md: Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode e altri. Il modello carica le istruzioni solo quando il compito corrisponde alla descrizione dello skill.
interactive-hit-areas è gratuito?
Lo skill è pubblicato apertamente da millionco con licenza MIT. Lo skill in sé non costa nulla: paghi solo il tuo fornitore AI per i token usati.
È sicuro installare gli skill?
Uno skill è un insieme di istruzioni che il tuo agente seguirà: leggi SKILL.md e i file correlati prima di installarlo. Gli script nella cartella dello skill vengono eseguiti solo se li esegue l'agente: controlla cosa fa e non concedere permessi superflui.
In cosa differisce uno skill da un server MCP o da un plugin?
Un server MCP o un plugin danno al modello nuovi strumenti: codice che viene eseguito e restituisce un risultato. Uno skill fornisce conoscenza e metodo: come affrontare il compito, quali passi seguire e com'è un buon risultato. Non servono server né chiavi API.