JSFiddle - React, Tailwind, and code Playground
by Haze32
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Lava Lamp</title>
<style>
/* Reset */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
/* Container */
body, .container {
height: 100vh;
width: 100vw;
background: green;
overflow: hidden;
}
.container {
position: relative;
filter: url("#goo");
}
/* Blob Shape */
.particle {
position: absolute;
width: 100px;
height: 100px;
top: -20%;
left: 30%;
animation: blobMove 10s ease-in-out infinite;
filter: url("#goo");
}
/* Animation */
@keyframes blobMove {
0% {
top: 100%;
left: 10%;
}
25% {
top: 40%;
left: 30%;
}
50% {
top: 10%;
left: 50%;
}
75% {
top: 40%;
left: 70%;
}
100% {
top: 100%;
left: 90%;
}
}
</style>
</head>
<body>
<div class="container">
<!-- Blob-like SVG particles -->
<svg class="particle" viewBox="0 0 100 100">
<path d="M50,5 Q60,18 70,30 T90,60 Q85,75 50,95 Q15,75 10,60 Q30,45 40,30 T50,5" fill="#FF4500"></path>
</svg>
<!-- SVG filter for gooey effect -->
<svg>
<defs>
<filter id="goo">
<feGaussianBlur in="SourceGraphic" stdDeviation="10" />
<feColorMatrix mode="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 18 -7" />
<feComposite in2="SourceGraphic" operator="in" />
</filter>
</defs>
</svg>
</div>
</body>
</html>