AI CSS Animations

Blur Others Text Hover Effect

A stack of big words where pointing at one blurs and dims the rest. The :has() selector reacts only when a word is hovered, so the gaps between words never dim the list.

Also known as: blur siblings on hover, dim other items on hover, focus hover effect css.

Design Build Launch

HTML

<div class="hfx-text-sibling-blur">
  <span>Design</span>
  <span>Build</span>
  <span>Launch</span>
</div>

CSS

.hfx-text-sibling-blur {
  --c: var(--hfx-color, #3b82f6);
  font-size: calc(var(--hfx-size, 16px) * 2);
  font-family: system-ui, sans-serif;
  font-weight: 800;
  line-height: 1.15;
  cursor: default;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;}
.hfx-text-sibling-blur span {
  transition: filter 0.35s ease, opacity 0.35s ease, color 0.35s ease,
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.hfx-text-sibling-blur:has(span:hover) span:not(:hover) {
  filter: blur(0.05em);
  opacity: 0.35;
}
.hfx-text-sibling-blur span:hover {
  color: var(--c);
  transform: translateX(0.2em);
}

@media (prefers-reduced-motion: reduce) {
  .hfx-text-sibling-blur, .hfx-text-sibling-blur *, .hfx-text-sibling-blur::before, .hfx-text-sibling-blur::after, .hfx-text-sibling-blur *::before, .hfx-text-sibling-blur *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

Customizing this snippet

  • Color: set --hfx-color on the element or a parent. Currently previewing #3b82f6.
  • Base size: set --hfx-size. Every other dimension is in em, so the whole thing scales together. Currently previewing 16px.
  • Speed: change the duration on the transition or animation shorthand. Staggered delays are relative, so they keep their rhythm.
  • Reduced motion: the rule at the end of the CSS turns the motion off for people who asked their OS for less of it. Keep it.

Similar hover effects