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%;
      left: 92.5%;
    }
    .trigger:nth-child(60):hover ~ .monitor .ball {
      top: 25%;
      left: 97.5%;
    }
    .trigger:nth-child(61):hover ~ .monitor .ball {
      top: 35%;
      left: 2.5%;
    }
    .trigger:nth-child(62):hover ~ .monitor .ball {
      top: 35%;
      left: 7.5%;
    }
    .trigger:nth-child(63):hover ~ .monitor .ball {
      top: 35%;
      left: 12.5%;
    }
    .trigger:nth-child(64):hover ~ .monitor .ball {
      top: 35%;
      left: 17.5%;
    }
    .trigger:nth-child(65):hover ~ .monitor .ball {
      top: 35%;
      left: 22.5%;
    }
    .trigger:nth-child(66):hover ~ .monitor .ball {
      top: 35%;
      left: 27.5%;
    }
    .trigger:nth-child(67):hover ~ .monitor .ball {
      top: 35%;
      left: 32.5%;
    }
    .trigger:nth-child(68):hover ~ .monitor .ball {
      top: 35%;
      left: 37.5%;
    }
    .trigger:nth-child(69):hover ~ .monitor .ball {
      top: 35%;
      left: 42.5%;
    }
    .trigger:nth-child(70):hover ~ .monitor .ball {
      top: 35%;
      left: 47.5%;
    }
    .trigger:nth-child(71):hover ~ .monitor .ball {
      top: 35%;
      left: 52.5%;
    }
    .trigger:nth-child(72):hover ~ .monitor .ball {
      top: 35%;
      left: 57.5%;
    }
    .trigger:nth-child(73):hover ~ .monitor .ball {
      top: 35%;
      left: 62.5%;
    }
    .trigger:nth-child(74):hover ~ .monitor .ball {
      top: 35%;
      left: 67.5%;
    }
    .trigger:nth-child(75):hover ~ .monitor .ball {
      top: 35%;
      left: 72.5%;
    }
    .trigger:nth-child(76):hover ~ .monitor .ball {
      top: 35%;
      left: 77.5%;
    }
    .trigger:nth-child(77):hover ~ .monitor .ball {
      top: 35%;
      left: 82.5%;
    }
    .trigger:nth-child(78):hover ~ .monitor .ball {
      top: 35%;
      left: 87.5%;
    }
    .trigger:nth-child(79):hover ~ .monitor .ball {
      top: 35%;
      left: 92.5%;
    }
    .trigger:nth-child(80):hover ~ .monitor .ball {
      top: 35%;
      left: 97.5%;
    }
    .trigger:nth-child(81):hover ~ .monitor .ball {
      top: 45%;
      left: 2.5%;
    }
    .trigger:nth-child(82):hover ~ .monitor .ball {
      top: 45%;
      left: 7.5%;
    }
    .trigger:nth-child(83):hover ~ .monitor .ball {
      top: 45%;
      left: 12.5%;
    }
    .trigger:nth-child(84):hover ~ .monitor .ball {
      top: 45%;
      left: 17.5%;
    }
    .trigger:nth-child(85):hover ~ .monitor .ball {
      top: 45%;
      left: 22.5%;
    }
    .trigger:nth-child(86):hover ~ .monitor .ball {
      top: 45%;
      left: 27.5%;
    }
    .trigger:nth-child(87):hover ~ .monitor .ball {
      top: 45%;
      left: 32.5%;
    }
    .trigger:nth-child(88):hover ~ .monitor .ball {
      top: 45%;
      left: 37.5%;
    }
    .trigger:nth-child(89):hover ~ .monitor .ball {
      top: 45%;
      left: 42.5%;
    }
    .trigger:nth-child(90):hover ~ .monitor .ball {
      top: 45%;
      left: 47.5%;
    }
    .trigger:nth-child(91):hover ~ .monitor .ball {
      top: 45%;
      left: 52.5%;
    }
    .trigger:nth-child(92):hover ~ .monitor .ball {
      top: 45%;
      left: 57.5%;
    }
    .trigger:nth-child(93):hover ~ .monitor .ball {
      top: 45%;
      left: 62.5%;
    }
    .trigger:nth-child(94):hover ~ .monitor .ball {
      top: 45%;
      left: 67.5%;
    }
    .trigger:nth-child(95):hover ~ .monitor .ball {
      top: 45%;
      left: 72.5%;
    }
    .trigger:nth-child(96):hover ~ .monitor .ball {
      top: 45%;
      left: 77.5%;
    }
    .trigger:nth-child(97):hover ~ .monitor .ball {
      top: 45%;
      left: 82.5%;
    }
    .trigger:nth-child(98):hover ~ .monitor .ball {
      top: 45%;
      left: 87.5%;
    }
    .trigger:nth-child(99):hover ~ .monitor .ball {
      top: 45%;
      left: 92.5%;
    }
    .trigger:nth-child(100):hover ~ .monitor .ball {
      top: 45%;
      left: 97.5%;
    }
    .trigger:nth-child(101):hover ~ .monitor .ball {
      top: 55%;
      left: 2.5%;
    }
    .trigger:nth-child(102):hover ~ .monitor .ball {
      top: 55%;
      left: 7.5%;
    }
    .trigger:nth-child(103):hover ~ .monitor .ball {
      top: 55%;
      left: 12.5%;
    }
    .trigger:nth-child(104):hover ~ .monitor .ball {
      top: 55%;
      left: 17.5%;
    }
    .trigger:nth-child(105):hover ~ .monitor .ball {
      top: 55%;
      left: 22.5%;
    }
    .trigger:nth-child(106):hover ~ .monitor .ball {
      top: 55%;
      left: 27.5%;
    }
    .trigger:nth-child(107):hover ~ .monitor .ball {
      top: 55%;
      left: 32.5%;
    }
    .trigger:nth-child(108):hover ~ .monitor .ball {
      top: 55%;
      left: 37.5%;
    }
    .trigger:nth-child(109):hover ~ .monitor .ball {
      top: 55%;
      left: 42.5%;
    }
    .trigger:nth-child(110):hover ~ .monitor .ball {
      top: 55%;
      left: 47.5%;
    }
    .trigger:nth-child(111):hover ~ .monitor .ball {
      top: 55%;
      left: 52.5%;
    }
    .trigger:nth-child(112):hover ~ .monitor .ball {
      top: 55%;
      left: 57.5%;
    }
    .trigger:nth-child(113):hover ~ .monitor .ball {
      top: 55%;
      left: 62.5%;
    }
    .trigger:nth-child(114):hover ~ .monitor .ball {
      top: 55%;
      left: 67.5%;
    }
    .trigger:nth-child(115):hover ~ .monitor .ball {
      top: 55%;
      left: 72.5%;
    }
    .trigger:nth-child(116):hover ~ .monitor .ball {
      top: 55%;
      left: 77.5%;
    }
    .trigger:nth-child(117):hover ~ .monitor .ball {
      top: 55%;
      left: 82.5%;
    }
    .trigger:nth-child(118):hover ~ .monitor .ball {
      top: 55%;
      left: 87.5%;
    }
    .trigger:nth-child(119):hover ~ .monitor .ball {
      top: 55%;
      left: 92.5%;
    }
    .trigger:nth-child(120):hover ~ .monitor .ball {
      top: 55%;
      left: 97.5%;
    }
    .trigger:nth-child(121):hover ~ .monitor .ball {
      top: 65%;
      left: 2.5%;
    }
    .trigger:nth-child(122):hover ~ .monitor .ball {
      top: 65%;
      left: 7.5%;
    }
    .trigger:nth-child(123):hover ~ .monitor .ball {
      top: 65%;
      left: 12.5%;
    }
    .trigger:nth-child(124):hover ~ .monitor .ball {
      top: 65%;
      left: 17.5%;
    }
    .trigger:nth-child(125):hover ~ .monitor .ball {
      top: 65%;
      left: 22.5%;
    }
    .trigger:nth-child(126):hover ~ .monitor .ball {
      top: 65%;
      left: 27.5%;
    }
    .trigger:nth-child(127):hover ~ .monitor .ball {
      top: 65%;
      left: 32.5%;
    }
    .trigger:nth-child(128):hover ~ .monitor .ball {
      top: 65%;
      left: 37.5%;
    }
    .trigger:nth-child(129):hover ~ .monitor .ball {
      top: 65%;
      left: 42.5%;
    }
    .trigger:nth-child(130):hover ~ .monitor .ball {
      top: 65%;
      left: 47.5%;
    }
    .trigger:nth-child(131):hover ~ .monitor .ball {
      top: 65%;
      left: 52.5%;
    }
    .trigger:nth-child(132):hover ~ .monitor .ball {
      top: 65%;
      left: 57.5%;
    }
    .trigger:nth-child(133):hover ~ .monitor .ball {
      top: 65%;
      left: 62.5%;
    }
    .trigger:nth-child(134):hover ~ .monitor .ball {
      top: 65%;
      left: 67.5%;
    }
    .trigger:nth-child(135):hover ~ .monitor .ball {
      top: 65%;
      left: 72.5%;
    }
    .trigger:nth-child(136):hover ~ .monitor .ball {
      top: 65%;
      left: 77.5%;
    }
    .trigger:nth-child(137):hover ~ .monitor .ball {
      top: 65%;
      left: 82.5%;
    }
    .trigger:nth-child(138):hover ~ .monitor .ball {
      top: 65%;
      left: 87.5%;
    }
    .trigger:nth-child(139):hover ~ .monitor .ball {
      top: 65%;
      left: 92.5%;
    }
    .trigger:nth-child(140):hover ~ .monitor .ball {
      top: 65%;
      left: 97.5%;
    }
    .trigger:nth-child(141):hover ~ .monitor .ball {
      top: 75%;
      left: 2.5%;
    }
    .trigger:nth-child(142):hover ~ .monitor .ball {
      top: 75%;
      left: 7.5%;
    }
    .trigger:nth-child(143):hover ~ .monitor .ball {
      top: 75%;
      left: 12.5%;
    }
    .trigger:nth-child(144):hover ~ .monitor .ball {
      top: 75%;
      left: 17.5%;
    }
    .trigger:nth-child(145):hover ~ .monitor .ball {
      top: 75%;
      left: 22.5%;
    }
    .trigger:nth-child(146):hover ~ .monitor .ball {
      top: 75%;
      left: 27.5%;
    }
    .trigger:nth-child(147):hover ~ .monitor .ball {
      top: 75%;
      left: 32.5%;
    }
    .trigger:nth-child(148):hover ~ .monitor .ball {
      top: 75%;
      left: 37.5%;
    }
    .trigger:nth-child(149):hover ~ .monitor .ball {
      top: 75%;
      left: 42.5%;
    }
    .trigger:nth-child(150):hover ~ .monitor .ball {
      top: 75%;
      left: 47.5%;
    }
    .trigger:nth-child(151):hover ~ .monitor .ball {
      top: 75%;
      left: 52.5%;
    }
    .trigger:nth-child(152):hover ~ .monitor .ball {
      top: 75%;
      left: 57.5%;
    }
    .trigger:nth-child(153):hover ~ .monitor .ball {
      top: 75%;
      left: 62.5%;
    }
    .trigger:nth-child(154):hover ~ .monitor .ball {
      top: 75%;
      left: 67.5%;
    }
    .trigger:nth-child(155):hover ~ .monitor .ball {
      top: 75%;
      left: 72.5%;
    }
    .trigger:nth-child(156):hover ~ .monitor .ball {
      top: 75%;
      left: 77.5%;
    }
    .trigger:nth-child(157):hover ~ .monitor .ball {
      top: 75%;
      left: 82.5%;
    }
    .trigger:nth-child(158):hover ~ .monitor .ball {
      top: 75%;
      left: 87.5%;
    }
    .trigger:nth-child(159):hover ~ .monitor .ball {
      top: 75%;
      left: 92.5%;
    }
    .trigger:nth-child(160):hover ~ .monitor .ball {
      top: 75%;
      left: 97.5%;
    }
    .trigger:nth-child(161):hover ~ .monitor .ball {
      top: 85%;
      left: 2.5%;
    }
    .trigger:nth-child(162):hover ~ .monitor .ball {
      top: 85%;
      left: 7.5%;
    }
    .trigger:nth-child(163):hover ~ .monitor .ball {
      top: 85%;
      left: 12.5%;
    }
    .trigger:nth-child(164):hover ~ .monitor .ball {
      top: 85%;
      left: 17.5%;
    }
    .trigger:nth-child(165):hover ~ .monitor .ball {
      top: 85%;
      left: 22.5%;
    }
    .trigger:nth-child(166):hover ~ .monitor .ball {
      top: 85%;
      left: 27.5%;
    }
    .trigger:nth-child(167):hover ~ .monitor .ball {
      top: 85%;
      left: 32.5%;
    }
    .trigger:nth-child(168):hover ~ .monitor .ball {
      top: 85%;
      left: 37.5%;
    }
    .trigger:nth-child(169):hover ~ .monitor .ball {
      top: 85%;
      left: 42.5%;
    }
    .trigger:nth-child(170):hover ~ .monitor .ball {
      top: 85%;
      left: 47.5%;
    }
    .trigger:nth-child(171):hover ~ .monitor .ball {
      top: 85%;
      left: 52.5%;
    }
    .trigger:nth-child(172):hover ~ .monitor .ball {
      top: 85%;
      left: 57.5%;
    }
    .trigger:nth-child(173):hover ~ .monitor .ball {
      top: 85%;
      left: 62.5%;
    }
    .trigger:nth-child(174):hover ~ .monitor .ball {
      top: 85%;
      left: 67.5%;
    }
    .trigger:nth-child(175):hover ~ .monitor .ball {
      top: 85%;
      left: 72.5%;
    }
    .trigger:nth-child(176):hover ~ .monitor .ball {
      top: 85%;
      left: 77.5%;
    }
    .trigger:nth-child(177):hover ~ .monitor .ball {
      top: 85%;
      left: 82.5%;
    }
    .trigger:nth-child(178):hover ~ .monitor .ball {
      top: 85%;
      left: 87.5%;
    }
    .trigger:nth-child(179):hover ~ .monitor .ball {
      top: 85%;
      left: 92.5%;
    }
    .trigger:nth-child(180):hover ~ .monitor .ball {
      top: 85%;
      left: 97.5%;
    }
    .trigger:nth-child(181):hover ~ .monitor .ball {
      top: 95%;
      left: 2.5%;
    }
    .trigger:nth-child(182):hover ~ .monitor .ball {
      top: 95%;
      left: 7.5%;
    }
    .trigger:nth-child(183):hover ~ .monitor .ball {
      top: 95%;
      left: 12.5%;
    }
    .trigger:nth-child(184):hover ~ .monitor .ball {
      top: 95%;
      left: 17.5%;
    }
    .trigger:nth-child(185):hover ~ .monitor .ball {
      top: 95%;
      left: 22.5%;
    }
    .trigger:nth-child(186):hover ~ .monitor .ball {
      top: 95%;
      left: 27.5%;
    }
    .trigger:nth-child(187):hover ~ .monitor .ball {
      top: 95%;
      left: 32.5%;
    }
    .trigger:nth-child(188):hover ~ .monitor .ball {
      top: 95%;
      left: 37.5%;
    }
    .trigger:nth-child(189):hover ~ .monitor .ball {
      top: 95%;
      left: 42.5%;
    }
    .trigger:nth-child(190):hover ~ .monitor .ball {
      top: 95%;
      left: 47.5%;
    }
    .trigger:nth-child(191):hover ~ .monitor .ball {
      top: 95%;
      left: 52.5%;
    }
    .trigger:nth-child(192):hover ~ .monitor .ball {
      top: 95%;
      left: 57.5%;
    }
    .trigger:nth-child(193):hover ~ .monitor .ball {
      top: 9.........完整代码请登录后点击上方下载按钮下载查看

网友评论0