利用css实现泡泡动画效果

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>泡泡</title>
  <style>
    body{
      background-color: #000;
    }
    .bubble{
      width: 150px;
      height: 150px;
      position: absolute;
      left: 100px;
      top:100px;
      background: transparent;
      border-radius: 50%;
      border: 1px solid #6aa2cc;
      box-shadow: inset 0 0 10px #fff;
      z-index: 99;
      animation: animateT 6s linear infinite alternate;
    }
    .bubble::after{
      content: '';
      position: absolute;
      width: 100%;
      height: 100%;
      border-radius: 50%;
      transform: scale(0.95);
      background: 
      radial-gradient(transparent,transparent,#b0c7a494);
      
    }
    @keyframes animateT {
    0% {
      transform:translateX(7%) translateY(50%);;
    }
    25% {
        transform:translateX(74%) translateY(176%);
      }
    50% {
        transform:translateX(150%) translateY(0%);
    }
    75% {
        transform: translateX(75%) translateY(75%);
    }
    100%{
        transform: translateX(0%) translateY(30%);
    }
  }
 

  </style>
</head>
<body>
  <div class="bubble"></div>
  
</body>
</html>

猜你喜欢

转载自blog.csdn.net/weixin_45371730/article/details/126638447