AnimationsX

Water fill button animation

Y
Created by YoussefAhmed

Fills the button with a little wave effect.

Embed

<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/youssefahmed2017/animationsx-registry@main/animations/water-fill-button-animation.css">

CSS

.animate-target {
  position: relative;
  padding: 12px 32px;
  border: 2px solid #6366f1;
  background: transparent;
  color: #6366f1;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  transition: color 0.4s ease;
  border-radius: 8px;
  z-index: 0;
}

.animate-target::before {
  content: '';
  position: absolute;
  bottom: -10px;
  left: -50%;
  width: 200%;
  height: 200%;
  background: #6366f1;
  border-radius: 40% 40% 0 0 / 20px 20px 0 0;
  transform: translateY(100%);
  transition: transform 0.5s ease;
  animation: wave 2s linear infinite;
  z-index: -1;
}

.animate-target:hover {
  color: white;
}

.animate-target:hover::before {
  transform: translateY(0%);
}

@keyframes wave {
  0% { left: -50%; }
  100% { left: 0%; }
}

Comments (1)

Sign in to leave a comment.