Hover✨ Premium

Filter Animated

A @keyframes continuously animates hue-rotate, saturate and brightness in a loop on hover — the element's hues cycle through 360°; will-change: filter speeds up rendering. No JavaScript.

CSSFilterGPU

Updated

This effect is part of Effect.Labs — 840 vanilla effects, some free, some premium. Hover has 48 effects, including 5 free. Explore the category →

3 usage examples

Navigation links — topbar of a design app — Filter Animated example 1

① Navigation links — topbar of a design app

WhenFive navigation links in the topbar of a design app; on hover each link animates in hue to signal it is active, without changing typography or adding an underline.
WhyColour animation on a navigation link gives an immediate, consistent visual response within the indigo-violet theme of the interface, without cluttering the topbar.
SettingsButtons auto×32 px, border-radius 8 px, transparent background at rest, indigo-violet gradient on hover, hue looping on active background. In the capture, the hover state is forced on the first two links via the .k356-demo-active class (links sit in the topbar, outside the capture mouse trajectory).
Main CTA button — hero of a music streaming site — Filter Animated example 2

② Main CTA button — hero of a music streaming site

WhenA 'Start for free' button centred in the hero; on hover, hues cycle in a loop to underline the movement and energy associated with music.
WhyA CTA button whose background rotates through hues draws the eye and visually conveys the idea of musical flow, without extra text animation or icons.
SettingsButton 220×52 px, border-radius 12 px, indigo-violet gradient, hue-rotate 360° on hover, scale 1.05.
Application shortcut grid — SaaS dashboard — Filter Animated example 3

③ Application shortcut grid — SaaS dashboard

WhenSix module icons (Analytics, Emails, Forms…) in a 3×2 grid in a dashboard; each icon animates in hue on hover with its own base colour.
WhyHue animation differentiates modules visually and signals the interaction possibility on each shortcut without a classic hover background.
SettingsIcons 72×72 px, border-radius 14 px, per-module gradient via CSS variable, hue-rotate 360° on hover.

How it works

The .fx-0356-root root centers a .hover-box.hover-filter-animated block of 200 × 200 px on a #0a0a0f background. The element has a base indigo-violet gradient and declares will-change: filter to prepare the GPU for filter rendering.

On hover (or focus), the fx0356-filterAnim animation starts in an infinite loop (animation: 3s linear infinite). Over three steps it rotates hue-rotate from 0° to 360°, pulses saturate from 1 to 1.4 then 1.2, and brightness from 1 to 1.15 then 1.05: hues cycle through the entire spectrum while saturation pulses slightly. The element simultaneously scales up by scale(1.05). On hover-out, the transition: .4s property smooths the return to rest.

The fx0356- prefix on the animation name prevents collisions. Measured in Chromium 151: looping animation visible, two copies on a page — only the hovered one animates. Rendering note: hue-rotate cycles the hues of a fixed gradient; perceived color depends on the base gradient.

Accessibility

  • Reduced motion: under prefers-reduced-motion: reduce, the animation is disabled and the scale cancelled; on hover the element shows a fixed filter: brightness(1.15) saturate(1.2) — the change is visible without continuous motion.
  • Keyboard: the element is a natively focusable <button>. The :focus-visible rule triggers the same hue animation; an indigo outline marks the focus state.
  • Content: CSS filters affect the entire element including text. On light base colors, verify that text stays readable in all hue-rotate phases.
  • Touch: the first touch triggers the filter loop; it stays active until the next touch.

Browser compatibility

Pure CSS (@keyframes, filter, hue-rotate, saturate, brightness, will-change, :focus-visible, prefers-reduced-motion), no JavaScript. Measured in Chromium 151: filter animation visible, two independent copies. filter available from Chrome 18, Firefox 35, Safari 9.1.

Chrome 60+✓ Full (measured)
Firefox 55+✓ Full
Safari 9.1+✓ Full
Edge 79+✓ Full (Chromium engine)
Mobile iOS 9.3+✓ Full
Android Chrome 60+✓ Full (Chromium engine)

Without filter (very old browsers), the element stays at its base state on hover. Without will-change, filters work but may be less smooth on old hardware.

The code

HTML structure to paste into your page (the CSS + JS come with your purchase):

index.html — structure
<div class="fx-0356-root">
  <button class="hover-box hover-filter-animated" type="button">
    <span>…</span>
  </button>
</div>

One-time payment, no subscription — the code is yours forever

Customize

Options passed to the API or data-* attributes:

Option / propertyDefaultEffect
Base gradient (CSS — background of .hover-filter-animated) linear-gradient(135deg, #6366f1, #8b5cf6) The base color determines the spectrum traversed by hue-rotate. A red-orange gradient (#ef4444, #f97316) rotates toward green-cyan; a blue gradient rotates toward green-red. Test on an image for photo effects.
Loop duration (CSS — animation: 3s linear infinite) 3 s per full rotation 6s gives a slow, contemplative rotation; 1s makes it very fast. Keep linear for a steady rotation.
Hue-rotate range (CSS — from 0deg to 360deg) Full rotation Limit to 120deg to stay within a close color range; 360deg covers the full spectrum.
Scale on hover (CSS — transform: scale(1.05)) 5% enlargement Switch to scale(1) to disable the enlargement if the filter animation alone is sufficient.
Exit transition (CSS — transition: .4s) 400 ms .2s for an abrupt return; .8s for a gradual one.

FAQ

Yes. Put the image as background-image or embed an inside .hover-filter-animated. The filter animation applies to all content of the element, including images.
On a recent mobile, will-change: filter offloads rendering to the GPU and the animation is generally smooth. On a budget mobile, increase the duration or disable the scale to reduce load.
Replace the keyframe steps with hue-rotate values that stay within your palette: if your base color is at 220° (blue-indigo), a hue-rotate of 0° to 30° stays in nearby blues. Use a color wheel tool to identify the angles.