css+svg实现猫与狗的爱情表白动画效果代码

代码语言:html

所属分类:表白

代码描述:采用css结合svg实现猫与狗的暧昧一线牵表白动画效果代码

代码标签: 爱情 表白

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

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

<head>
    <meta charset="UTF-8">
    <style>
        body {
      overflow: hidden;
      background: #0c2987;
    }
    
    .table-line {
      width: 4vh;
      max-width: 0.4rem;
      height: 100vh;
      background-color: #c45c75;
      position: absolute;
    }
    
    .table-line:nth-child(0) {
      left: 0%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(40deg);
      bottom: -50%;
    }
    
    .table-line:nth-child(1) {
      left: 3.5%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(-60deg);
      bottom: -100%;
    }
    
    .table-line:nth-child(2) {
      left: 7%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(40deg);
      bottom: -50%;
    }
    
    .table-line:nth-child(3) {
      left: 10.5%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(-60deg);
      bottom: -100%;
    }
    
    .table-line:nth-child(4) {
      left: 14%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(40deg);
      bottom: -50%;
    }
    
    .table-line:nth-child(5) {
      left: 17.5%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(-60deg);
      bottom: -100%;
    }
    
    .table-line:nth-child(6) {
      left: 21%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(40deg);
      bottom: -50%;
    }
    
    .table-line:nth-child(7) {
      left: 24.5%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(-60deg);
      bottom: -100%;
    }
    
    .table-line:nth-child(8) {
      left: 28%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(40deg);
      bottom: -50%;
    }
    
    .table-line:nth-child(9) {
      left: 31.5%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(-60deg);
      bottom: -100%;
    }
    
    .table-line:nth-child(10) {
      left: 35%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(40deg);
      bottom: -50%;
    }
    
    .table-line:nth-child(11) {
      left: 38.5%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(-60deg);
      bottom: -100%;
    }
    
    .table-line:nth-child(12) {
      left: 42%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(40deg);
      bottom: -50%;
    }
    
    .table-line:nth-child(13) {
      left: 45.5%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(-60deg);
      bottom: -100%;
    }
    
    .table-line:nth-child(14) {
      left: 49%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(40deg);
      bottom: -50%;
    }
    
    .table-line:nth-child(15) {
      left: 52.5%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(-60deg);
      bottom: -100%;
    }
    
    .table-line:nth-child(16) {
      left: 56%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(40deg);
      bottom: -50%;
    }
    
    .table-line:nth-child(17) {
      left: 59.5%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(-60deg);
      bottom: -100%;
    }
    
    .table-line:nth-child(18) {
      left: 63%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(40deg);
      bottom: -50%;
    }
    
    .table-line:nth-child(19) {
      left: 66.5%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(-60deg);
      bottom: -100%;
    }
    
    .table-line:nth-child(20) {
      left: 70%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(40deg);
      bottom: -50%;
    }
    
    .table-line:nth-child(21) {
      left: 73.5%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(-60deg);
      bottom: -100%;
    }
    
    .table-line:nth-child(22) {
      left: 77%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(40deg);
      bottom: -50%;
    }
    
    .table-line:nth-child(23) {
      left: 80.5%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(-60deg);
      bottom: -100%;
    }
    
    .table-line:nth-child(24) {
      left: 84%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(40deg);
      bottom: -50%;
    }
    
    .table-line:nth-child(25) {
      left: 87.5%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(-60deg);
      bottom: -100%;
    }
    
    .table-line:nth-child(26) {
      left: 91%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(40deg);
      bottom: -50%;
    }
    
    .table-line:nth-child(27) {
      left: 94.5%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(-60deg);
      bottom: -100%;
    }
    
    .table-line:nth-child(28) {
      left: 98%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(40deg);
      bottom: -50%;
    }
    
    .table-line:nth-child(29) {
      left: 101.5%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(-60deg);
      bottom: -100%;
    }
    
    .table-line:nth-child(30) {
      left: 105%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(40deg);
      bottom: -50%;
    }
    
    .table-line:nth-child(31) {
      left: 108.5%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(-60deg);
      bottom: -100%;
    }
    
    .table-line:nth-child(32) {
      left: 112%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(40deg);
      bottom: -50%;
    }
    
    .table-line:nth-child(33) {
      left: 115.5%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(-60deg);
      bottom: -100%;
    }
    
    .table-line:nth-child(34) {
      left: 119%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(40deg);
      bottom: -50%;
    }
    
    .table-line:nth-child(35) {
      left: 122.5%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(-60deg);
      bottom: -100%;
    }
    
    .table-line:nth-child(36) {
      left: 126%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(40deg);
      bottom: -50%;
    }
    
    .table-line:nth-child(37) {
      left: 129.5%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(-60deg);
      bottom: -100%;
    }
    
    .table-line:nth-child(38) {
      left: 133%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(40deg);
      bottom: -50%;
    }
    
    .table-line:nth-child(39) {
      left: 136.5%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(-60deg);
      bottom: -100%;
    }
    
    .table-line:nth-child(40) {
      left: 140%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(40deg);
      bottom: -50%;
    }
    
    .table-line:nth-child(41) {
      left: 143.5%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(-60deg);
      bottom: -100%;
    }
    
    .table-line:nth-child(42) {
      left: 147%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(40deg);
      bottom: -50%;
    }
    
    .table-line:nth-child(43) {
      left: 150.5%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(-60deg);
      bottom: -100%;
    }
    
    .table-line:nth-child(44) {
      left: 154%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(40deg);
      bottom: -50%;
    }
    
    .table-line:nth-child(45) {
      left: 157.5%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(-60deg);
      bottom: -100%;
    }
    
    .table-line:nth-child(46) {
      left: 161%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(40deg);
      bottom: -50%;
    }
    
    .table-line:nth-child(47) {
      left: 164.5%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(-60deg);
      bottom: -100%;
    }
    
    .table-line:nth-child(48) {
      left: 168%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(40deg);
      bottom: -50%;
    }
    
    .table-line:nth-child(49) {
      left: 171.5%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(-60deg);
      bottom: -100%;
    }
    
    .table-line:nth-child(50) {
      left: 175%;
      margin-left: -10rem;
      margin-top: -10rem;
      transform: rotate(40deg);
      bottom: -50%;
    }
    
    .tramp,
    .lady {
      position: absolute;
      height: 100vh;
      transform: translate(-50%, -50%);
      top: 50%;
      z-index: 10;
    }
    
    .lady {
      left: 70%;
      transform-origin: 0% 50%;
      animation: lady-animation 4s infinite;
    }
    
    @keyframes lady-animation {
      0% {
        transform: rotate(5deg) translate(-50%, -50%);
      }
      20% {
        transform: rotate(0deg) translate(-50%, -50%);
      }
      50% {
        transform: rotate(0deg) translate(-50%, -50%);
      }
      100% {
        transform: rotate(5deg) translate(-50%, -50%);
      }
    }
    @keyframes tramp-animation {
      10% {
        transform: rotate(-2deg) translate(-50%, -50%);
      }
      20% {
        transform: rotate(0deg) translate(-50%, -50%);
      }
      80% {
        transform: rotate(0deg) translate(-50%, -50%);
      }
    }
    .tramp {
      left: 30%;
      transform-origin: 0% 50%;
      animation: tramp-animation 4s infinite;
    }
    
    .table {
      position: absolute;
      background-color: #dadce8;
      width: 100vw;
      height: 27vh;
      bottom: 0;
      left: 0;
      overflow: hidden;
      z-index: 25;
    }
    
    .semi-circle {
   .........完整代码请登录后点击上方下载按钮下载查看

网友评论0