div+css实现鼠标跟随水滴汇集动画效果代码

代码语言:html

所属分类:动画

代码描述:div+css实现鼠标跟随水滴汇集动画效果代码

代码标签: 跟随 水滴 汇集 动画 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <style>
        body {
      background: #000;
      height: 100vh;
      overflow: hidden;
      cursor: pointer;
    }
    
    .attention {
      position: absolute;
      z-index: 999;
      top: 50%;
      left: 50%;
      color: #fff;
      font-size: 20px;
      font-weight: light;
      font-family: 'Quicksand', sans-serif;
      letter-spacing: 10px;
      white-space: nowrap;
      transform: translate(-50%, -50%);
      pointer-events: none;
      animation: attention 8000ms linear forwards, fade 8000ms linear forwards;
    }
    
    .container {
      position: relative;
      display: grid;
      grid-template-rows: repeat(10, 10vh);
      grid-template-columns: repeat(20, 5vw);
    }
    
    .trigger:nth-child(1):hover ~ .monitor .ball {
      top: 5%;
      left: 2.5%;
    }
    .trigger:nth-child(2):hover ~ .monitor .ball {
      top: 5%;
      left: 7.5%;
    }
    .trigger:nth-child(3):hover ~ .monitor .ball {
      top: 5%;
      left: 12.5%;
    }
    .trigger:nth-child(4):hover ~ .monitor .ball {
      top: 5%;
      left: 17.5%;
    }
    .trigger:nth-child(5):hover ~ .monitor .ball {
      top: 5%;
      left: 22.5%;
    }
    .trigger:nth-child(6):hover ~ .monitor .ball {
      top: 5%;
      left: 27.5%;
    }
    .trigger:nth-child(7):hover ~ .monitor .ball {
      top: 5%;
      left: 32.5%;
    }
    .trigger:nth-child(8):hover ~ .monitor .ball {
      top: 5%;
      left: 37.5%;
    }
    .trigger:nth-child(9):hover ~ .monitor .ball {
      top: 5%;
      left: 42.5%;
    }
    .trigger:nth-child(10):hover ~ .monitor .ball {
      top: 5%;
      left: 47.5%;
    }
    .trigger:nth-child(11):hover ~ .monitor .ball {
      top: 5%;
      left: 52.5%;
    }
    .trigger:nth-child(12):hover ~ .monitor .ball {
      top: 5%;
      left: 57.5%;
    }
    .trigger:nth-child(13):hover ~ .monitor .ball {
      top: 5%;
      left: 62.5%;
    }
    .trigger:nth-child(14):hover ~ .monitor .ball {
      top: 5%;
      left: 67.5%;
    }
    .trigger:nth-child(15):hover ~ .monitor .ball {
      top: 5%;
      left: 72.5%;
    }
    .trigger:nth-child(16):hover ~ .monitor .ball {
      top: 5%;
      left: 77.5%;
    }
    .trigger:nth-child(17):hover ~ .monitor .ball {
      top: 5%;
      left: 82.5%;
    }
    .trigger:nth-child(18):hover ~ .monitor .ball {
      top: 5%;
      left: 87.5%;
    }
    .trigger:nth-child(19):hover ~ .monitor .ball {
      top: 5%;
      left: 92.5%;
    }
    .trigger:nth-child(20):hover ~ .monitor .ball {
      top: 5%;
      left: 97.5%;
    }
    .trigger:nth-child(21):hover ~ .monitor .ball {
      top: 15%;
      left: 2.5%;
    }
    .trigger:nth-child(22):hover ~ .monitor .ball {
      top: 15%;
      left: 7.5%;
    }
    .trigger:nth-child(23):hover ~ .monitor .ball {
      top: 15%;
      left: 12.5%;
    }
    .trigger:nth-child(24):hover ~ .monitor .ball {
      top: 15%;
      left: 17.5%;
    }
    .trigger:nth-child(25):hover ~ .monitor .ball {
      top: 15%;
      left: 22.5%;
    }
    .trigger:nth-child(26):hover ~ .monitor .ball {
      top: 15%;
      left: 27.5%;
    }
    .trigger:nth-child(27):hover ~ .monitor .ball {
      top: 15%;
      left: 32.5%;
    }
    .trigger:nth-child(28):hover ~ .monitor .ball {
      top: 15%;
      left: 37.5%;
    }
    .trigger:nth-child(29):hover ~ .monitor .ball {
      top: 15%;
      left: 42.5%;
    }
    .trigger:nth-child(30):hover ~ .monitor .ball {
      top: 15%;
      left: 47.5%;
    }
    .trigger:nth-child(31):hover ~ .monitor .ball {
      top: 15%;
      left: 52.5%;
    }
    .trigger:nth-child(32):hover ~ .monitor .ball {
      top: 15%;
      left: 57.5%;
    }
    .trigger:nth-child(33):hover ~ .monitor .ball {
      top: 15%;
      left: 62.5%;
    }
    .trigger:nth-child(34):hover ~ .monitor .ball {
      top: 15%;
      left: 67.5%;
    }
    .trigger:nth-child(35):hover ~ .monitor .ball {
      top: 15%;
      left: 72.5%;
    }
    .trigger:nth-child(36):hover ~ .monitor .ball {
      top: 15%;
      left: 77.5%;
    }
    .trigger:nth-child(37):hover ~ .monitor .ball {
      top: 15%;
      left: 82.5%;
    }
    .trigger:nth-child(38):hover ~ .monitor .ball {
      top: 15%;
      left: 87.5%;
    }
    .trigger:nth-child(39):hover ~ .monitor .ball {
      top: 15%;
      left: 92.5%;
    }
    .trigger:nth-child(40):hover ~ .monitor .ball {
      top: 15%;
      left: 97.5%;
    }
    .trigger:nth-child(41):hover ~ .monitor .ball {
      top: 25%;
      left: 2.5%;
    }
    .trigger:nth-child(42):hover ~ .monitor .ball {
      top: 25%;
      left: 7.5%;
    }
    .trigger:nth-child(43):hover ~ .monitor .ball {
      top: 25%;
      left: 12.5%;
    }
    .trigger:nth-child(44):hover ~ .monitor .ball {
      top: 25%;
      left: 17.5%;
    }
    .trigger:nth-child(45):hover ~ .monitor .ball {
      top: 25%;
      left: 22.5%;
    }
    .trigger:nth-child(46):hover ~ .monitor .ball {
      top: 25%;
      left: 27.5%;
    }
    .trigger:nth-child(47):hover ~ .monitor .ball {
      top: 25%;
      left: 32.5%;
    }
    .trigger:nth-child(48):hover ~ .monitor .ball {
      top: 25%;
      left: 37.5%;
    }
    .trigger:nth-child(49):hover ~ .monitor .ball {
      top: 25%;
      left: 42.5%;
    }
    .trigger:nth-child(50):hover ~ .monitor .ball {
      top: 25%;
      left: 47.5%;
    }
    .trigger:nth-child(51):hover ~ .monitor .ball {
      top: 25%;
      left: 52.5%;
    }
    .trigger:nth-child(52):hover ~ .monitor .ball {
      top: 25%;
      left: 57.5%;
    }
    .trigger:nth-child(53):hover ~ .monitor .ball {
      top: 25%;
      left: 62.5%;
    }
    .trigger:nth-child(54):hover ~ .monitor .ball {
      top: 25%;
      left: 67.5%;
    }
    .trigger:nth-child(55):hover ~ .monitor .ball {
      top: 25%;
      left: 72.5%;
    }
    .trigger:nth-child(56):hover ~ .monitor .ball {
      top: 25%;
      left: 77.5%;
    }
    .trigger:nth-child(57):hover ~ .monitor .ball {
      top: 25%;
      left: 82.5%;
    }
    .trigger:nth-child(58):hover ~ .monitor .ball {
      top: 25%;
      left: 87.5%;
    }
    .trigger:nth-child(59):hover ~ .monitor .ball {
      top: 25.........完整代码请登录后点击上方下载按钮下载查看

网友评论0