* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
#main {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100vh;
background-color: black;
position: relative;
}
.circle {
width: 100px;
height: 100px;
border-radius: 50%;
background-color: #fff;
position: absolute;
transition: transform 0.5s ease;
mix-blend-mode: screen;
/* Эффект слияния */
}
.circle+.circle {
animation: 3s anim alternate infinite;
}
@keyframes anim {
0% {
transform: translateX(100px);
}
100% {
transform: translateX(-100px);
}
}
#main {
position: relative;
}
#main::before {
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: radial-gradient(circle, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.4));
pointer-events: none;
}
<main id="main">
<div class="circle" id="a"></div>
<div class="circle" id="b"></div>
</main>
这就是我想要得到的效果

我记得有一个类似的解决方案,使用
filter某种基于blur()其他东西的黑客技术。我发现了一个类似的,这些“别的东西”竟然是
contrast()。我不知道这种效果是如何发生的,我假设
blur()它创建了“接触”部分,这些部分contrast()被“强化”到视觉上看起来像一个“实体”图形的程度。一般来说,这是一个基于此 hack 的类似动画:
该解决方案有一个重大问题:
- 无法在背景或图形上充分使用一些“杂色”,最好仅使用对比色。
但似乎这可以以某种方式用作面具,例如🤔
PS:看看这个问题的其他解决方案会很有趣。
如果没有人提出任何建议并且时机成熟,我将为这个问题举办一场竞赛:)
The Gooey Effect一文有一个使用svg滤镜的示例实现,它比对比的示例更实用。