Friday, October 10, 2025
HomeCSSanimation - CSS Lava Lamp Clip-path

animation – CSS Lava Lamp Clip-path


So I’m attempting to make a “clip-path lava lamp” impact. my physique has an animated gradient and a bit with a white background. within the part is a lava impact. the lava is inexperienced proper now however I am attempting to make it a clip-path on the part so I can see via the white background of the part and see the gradient. I do not wish to add the gradient to the lava as a result of the animation does not line up and it seems to be unhealthy. is that this potential?


<part class="content material">
<div class="lamp">
    <div class="lava">
      <div class="blob"></div>
      <div class="blob"></div>
      <div class="blob"></div>
      <div class="blob"></div>
      <div class="blob"></div>
      <div class="blob"></div>
      <div class="blob"></div>
      <div class="blob"></div>
      <div class="blob prime"></div>
      <div class="blob backside"></div>
      
    </div>
</div>

<svg>
  <defs>
    <filter id="goo">
      <feGaussianBlur in="SourceGraphic" stdDeviation="10" consequence="blur" />
      <feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 18 -7" consequence="goo" />
      <feBlend in="SourceGraphic" in2="goo" />
    </filter>
  </defs>
</svg>

<h1 class="">attempting to make the purple lava a clip-path. </h1>
<p class="">so i can see the gradient background behind the white part</p>
  
</part>
physique {
  background: linear-gradient(-45deg, #E26373, #0098C3, #359F68);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
    transition: all .3s ease-in-out;
  peak:100vh;
}
part.content material {
  place: relative;
 peak:80vh
}
.lamp { background:white;
  place: absolute;
  prime: 50%;
  left: 50%;
  rework: translate(-50%, -50%);
  peak: 100%;
  overflow: hidden;
  width: 100vw;
  min-width: 100vw;
  z-index: -1;
  peak: 100%;
}

.lava {
  filter: url("#goo");
  place: absolute;
  peak: 100%;
  width: 100%;
  prime: 0;
  left: 0;
}

.blob {
  border-radius: 50%;
  place: absolute;
  background: purple; 
}

.blob.prime {
  border-radius: 50%;
  width: 100%;
  peak: 4%;
  prime: -3%;
  left: 0;
}
.blob.backside {
  border-radius: 50%;
  width: 110%;
  peak: 4%;
  backside: -3%;
  left: -50px;
}
.blob:nth-child(1) {
  width: 200px;
  peak: 200px;
  left: 35%;
  backside: -15%;

  animation: wobble 4s ease-in-out alternate infinite,
    blob-one ease-in-out 13s infinite;
}
.blob:nth-child(2) {
  width: 230px;
  peak: 230px;
  proper: 24%;
  backside: -65%;

  animation: wobble 5s ease-in-out alternate infinite,
    blob-two ease-in-out 22s infinite;
}
.blob:nth-child(3) {
  width: 150px;
  peak: 150px;
  backside: -15%;
  left: 34%;

  animation: wobble 6s ease-in-out alternate infinite,
    blob-three ease-in-out 16s infinite;
}
.blob:nth-child(4) {
  width: 135px;
  peak: 135px;
  backside: -19%;
  left: 30%;

  animation: wobble 7s ease-in-out alternate infinite,
    blob-four ease-in-out 12s infinite;
}
.blob:nth-child(4) {
  width: 35px;
  peak: 35px;
  backside: -19%;
  left: 30%;
  animation: wobble 8s ease-in-out alternate infinite,
    blob-four ease-in-out 12s infinite;
}
.blob:nth-child(5) {
  width: 55px;
  peak: 55px;
  backside: -25%;
  left: 34%;
  animation: wobble 9s ease-in-out alternate infinite,
    blob-five ease-in-out 32s infinite;
}
.blob:nth-child(6) {
  width: 35px;
  peak: 35px;
  backside: -25%;
  proper: 34%;
  animation: wobble 10s ease-in-out alternate infinite,
    blob-six ease-in-out 12s infinite;
}
.blob:nth-child(7) {
  width: 235px;
  peak: 35px;
  backside: -85%;
  proper: 40%;
  animation: wobble 11s ease-in-out alternate infinite,
    blob-seven ease-in-out 32s infinite;
}
@keyframes blob-one {
  0%,
  100% {
    rework: translatey(0);
  }
  50% {
    rework: translatey(-700%);
  }
}

@keyframes blob-two {
  0%,
  100% {
    rework: translatey(0);
  }
  50% {
    rework: translatey(-420%);
  }
}

@keyframes blob-three {
  0%,
  100% {
    rework: translatey(0);
  }
  50% {
    rework: translatey(-305%);
  }
}
@keyframes blob-four {
  0%,
  100% {
    rework: translatey(0);
  }
  50% {
    rework: translatey(-605%);
  }
}
@keyframes blob-five {
  0%,
  100% {
    rework: translatey(0);
  }
  50% {
    rework: translatey(-700%);
  }
}
@keyframes blob-six {
  0%,
  100% {
    rework: translatey(0);
  }
  50% {
    rework: translatey(-700%);
  }
}
@keyframes blob-seven {
  0%,
  100% {
    rework: translatey(0);
  }
  50% {
    rework: translatey(-300%);
  }
}

@keyframes wobble {
  50% {
    border-radius: 42% 58% 70% 30% / 45% 45% 55% 55%;
  }
  100% {
    border-radius: 38% 52% 75% 36% / 50% 40% 50% 60%;
  }
}






.backGrade {
    background: linear-gradient(-45deg, #E26373, #0098C3, #359F68);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
    transition: all .3s ease-in-out;
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

https://jsfiddle.web/Haze32/7zvfxa4s/1/

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments