So I'm trying to achieve so called gooey effect with css filter blur and contrast properties. However for some reason contrast doesn't work ? Any ideas why ?
I'm pasting my HTML and CSS below.
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<div class="liquid">
<div class="left">
</div>
<div class="right">
</div>
</div>
</div>
</body>
</html>
SCSS:
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
.container {
height: 100vh;
width: 100vw;
display: flex;
justify-content: center;
align-items: center;
}
.liquid {
display: flex;
filter: contrast(20);
.left,
.right {
width: 80px;
height: 80px;
background-color: black;
border-radius: 50%;
filter: blur(10px);
}
.left {
animation: anim-1 2s infinite linear;
}
.right {
animation: anim-2 2s infinite linear;
}
}
@keyframes anim-1 {
0% {
transform: translateX(50%);
}
50% {
transform: translateX(0%);
}
100% {
transform: translateX(50%);
}
}
@keyframes anim-2 {
0% {
transform: translateX(-50%);
}
50% {
transform: translateX(0%);
}
100% {
transform: translateX(-50%);
}
}
Try putting contrast on the same line that the blur filter is, separated by a space between properties: