【问题标题】:CSS Filter blur and contrast for gooey effectCSS过滤器模糊和对比度的粘性效果
【发布时间】:2019-11-03 12:38:57
【问题描述】:

在这个example 中,粘糊糊的效果似乎不适用于css 过滤器。我使用了filter: blur(10px) contrast(30);,但它只显示模糊效果。我希望结果是粘糊糊的。

【问题讨论】:

    标签: html css svg css-filters


    【解决方案1】:

    这是可以做到的:filter: blur(10px) contrast(30);。您需要将background:white; 添加到容器中。此外,您需要在容器的限制和圆圈之间留出一些额外的空间,所以我添加了padding:100px;

    body {
      width: 100vw; height: 100vh;
      display: grid;
      place-items: center;
    }
    .container {
      display: flex;
      flex-direction: column;
      background:white;
      padding:100px;
      filter: blur(15px) contrast(30);  
    }
    
    .circle {
      width: 100px; height: 100px;
      background-color: red;
      /* border-radius: 100%;*/
    }
    
    .circle-1 {
      border-radius: 50%;
      /* top: 50px;
         border: 5px solid black;*/
      transform: translateY(20px);
    }
    .circle-2 {
     border-radius: 95% 5% 70% 30% / 52% 30% 70% 48% ;
       transform: rotateY(-180deg);
    }
    <div class="container">
      <div class="circle circle-1"></div>
    <div class="circle circle-2"></div>
    </div>

    请阅读文章:The Gooey Effect - Lucas Bebber

    【讨论】:

    • 感谢您提供有趣的答案和有用的链接。
    • 感谢您的回答。我想我错误地在 codepen 上编辑了相同的链接。很抱歉;)
    【解决方案2】:

    好吧,您链接的页面不再有效,但如果我猜对了,您应该使用透明背景色!类似background-image: &lt;image&gt;, rgba(&lt;color&gt;, &lt;transparency&gt;);

    【讨论】:

      猜你喜欢
      • 2017-03-17
      • 1970-01-01
      • 2015-12-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-04-16
      • 2016-10-07
      • 2021-11-09
      相关资源
      最近更新 更多