Skip to content

background

aa-hover="block" and aa-hover="curve" add a colour layer that slides in from whichever edge of the host the cursor crossed. The library injects the moving panel — a <span> for block, an <svg> with a morphing path for curve — and removes it on dispose.

Hover effects are skipped on touch-only devices via (hover: hover) so iOS / Android don’t fire stuck animations on tap.

VariantWhat it does
blockSolid colour panel slides in from the cursor’s edge
curveSame idea, but the leading edge is a soft curved wave

Add a space-separated flag to constrain which edge the panel enters from. With no flag (all), the closest of the four edges to the cursor is used.

FlagWhat it does
(none)all — closest of top / bottom / left / right
verticalonly top or bottom, picked by cursor Y
horizontalonly left or right, picked by cursor X
top / bottom / left / rightalways that edge, regardless of cursor

Examples: aa-hover="block", aa-hover="curve vertical", aa-hover="block top".

AttributeDefaultNotes
aa-hover(required)block or curve, plus optional direction flag
aa-colorcurrentColorFill colour of the injected panel
aa-durationglobal defaultSeconds. Falls back to the duration passed to init() (default 0.6).
aa-delay0Seconds before the enter animation starts
aa-easeglobal defaultAny GSAP-compatible ease. Falls back to the ease passed to init() (default power4.out).
  • block — a <span aa-hover-bg="block"> absolutely positioned to fill the host. The host gets position: relative + overflow: hidden if it doesn’t already have them.
  • curve — an <svg aa-hover-bg="curve" viewBox="0 0 100 100" preserveAspectRatio="none"> containing a single <path> that morphs between a degenerate edge-pinned shape and full coverage. Same host treatment as block.

If you want hover-driven changes to anything else on the element (text colour, border, scale), do that in CSS using :hover — the lib intentionally keeps its scope to the injected layer.

Direction modes side by side. Hover from the corner you want to see the panel come in from.

Same direction modes, swapped for curve. The leading edge bows slightly past the host before settling.

A row layout where the panel comes in from whichever edge the cursor crossed. Pair with :hover styles in CSS for text-colour swaps.

Same list, but each row hovers with a curved wave instead of a flat panel.