毛玻璃效果

复制代码
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="try.css">
    <title>Document</title>
</head>
<body>
    <div class="container">
        <div class="loader one">
            <span></span>
            <span></span>
        </div>
        <div class="loader two">
            <span></span>
            <span></span>
        </div>
    </div>
</body>
</html>
复制代码
复制代码
*
{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body
{
  display: flex;
  background: #eafdff;
}
.container
{
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.container .loader
{
  position: relative;
  width: 150px;
  height: 150px;
  margin: 100px;
}
.container .loader.one span
{
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #5989ff;
  border-radius: 50%;
  animation: animate ease-in-out 2s infinite;
}
.container .loader.one span:nth-child(2)
{
  left: 50%;
  background: rgba(56, 109, 241, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation-delay: -1s;
}
@keyframes animate
{
  0%,100%
  {
    transform: translateX(-80px);
  }
  50%
  {
    transform: translateX(80px);
  }
}
/* add shadow */
/* :before 为伪类,::before 为伪元素 */
.container .loader.one span:before,
.container .loader.two span:nth-child(1):before
{
  content: '';
  position: absolute;
  width: 100%;
  height: 40px;
  bottom: -50px;
  border-radius: 50%;
  background: radial-gradient(rgba(0,0,0,0.4),transparent,transparent);
}
.container .loader.two span:nth-child(1)
{
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  bottom: 10px;
  background: rgba(233,30,99,0.05);
  border-radius: 50%;
  backdrop-filter: blur(10px);
}
.container .loader.two span:nth-child(2)
{
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  z-index: -1;
  overflow: hidden;
  animation: rotate 1s linear infinite;
}
@keyframes rotate
{
  0%
  {
    transform: rotate(0deg);
  }
  100%
  {
    transform: rotate(360deg);
  }
}
.container .loader.two span:nth-child(2)::before{
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  left: -50%;
  top: -50%;
  background: aquamarine;
}
复制代码

 

posted @   树叶本子  阅读(27)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 如何调用 DeepSeek 的自然语言处理 API 接口并集成到在线客服系统
· 【译】Visual Studio 中新的强大生产力特性
· 2025年我用 Compose 写了一个 Todo App
点击右上角即可分享
微信分享提示