js+css实现万圣节多个背景动画选择效果代码

代码语言:html

所属分类:背景

代码描述:js+css实现万圣节多个背景动画选择效果代码

代码标签: 多个 背景 动画 选择 效果

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

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">



    <style>
        @import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@800&family=Gamja+Flower&family=Lakki+Reddy&family=Nosifer&family=Rock+Salt&family=Sniglet:wght@800&family=Sue+Ellen+Francisco&family=Walter+Turncoat&display=swap");
        * {
          margin: 0;
          padding: 0;
          box-sizing: border-box;
        }
        * ::-moz-selection {
          color: #f09328;
        }
        * ::selection {
          color: #f09328;
        }
        
        body {
          height: 100vh;
          overflow: hidden;
          position: relative;
          display: flex;
          flex-flow: column nowrap;
          align-items: center;
          justify-content: space-between;
          background: radial-gradient(circle at 50% 70%, white 0, white 10rem, #632c90 10.1rem, #632c90 20rem, #532881 20.1rem, #532881 30rem, #3d2673 30.1rem, #3d2673 40rem, #272163 40.1rem) no-repeat center center fixed;
          -webkit-background-size: cover;
          -moz-background-size: cover;
          -o-background-size: cover;
          background-size: cover;
          font-family: "Lakki Reddy", cursive;
          font-size: 2rem;
          line-height: 3.5rem;
          color: #f0f7ff;
          text-align: center;
        }
        body a {
          color: inherit;
          text-decoration: none;
        }
        
        .container {
          position: relative;
          height: 100%;
          max-width: 58.125rem;
          display: flex;
          flex-flow: column nowrap;
          align-items: center;
          justify-content: space-between;
        }
        
        .bats {
          position: fixed;
          width: 58.125rem;
          height: 100%;
          fill: transparent;
        }
        .bats #bat-2 {
          fill: #022136;
          transform-origin: 50% 50%;
        }
        .bats #bat-3 {
          fill: #022136;
          transform-origin: 50% 50%;
        }
        .bats #bat-4 {
          fill: #022136;
          transform-origin: 50% 50%;
        }
        .bats #bat-5 {
          fill: #022136;
          transform-origin: 50% 50%;
        }
        .bats #bat-6 {
          fill: #022136;
          transform-origin: 50% 50%;
        }
        .bats #bat-7 {
          fill: #022136;
          transform-origin: 50% 50%;
        }
        .bats #bat-2 {
          x: 10%;
          y: 10%;
          transform: rotate(-10deg) scale(0.45);
          filter: opacity(0.75);
        }
        .bats #bat-3 {
          x: 30%;
          y: 30%;
          transform: rotate(10deg) scale(0.35);
          filter: opacity(0.55);
        }
        .bats #bat-4 {
          x: 90%;
          y: -10%;
          transform: rotate(-20deg) scale(0.55);
          filter: opacity(0.95);
        }
        .bats #bat-5 {
          x: 70%;
          y: 5%;
          transform: rotate(20deg) scale(0.45);
          filter: opacity(0.75);
        }
        .bats #bat-6 {
          x: 0%;
          y: 55%;
          transform: rotate(20deg) scale(0.25);
          filter: opacity(0.35);
        }
        .bats #bat-7 {
          x: 60%;
          y: 60%;
          transform: rotate(-20deg) scale(0.25);
          filter: opacity(0.15);
        }
        
        .sky {
          position: absolute;
          top: 10%;
          display: flex;
          flex-flow: column wrap;
          align-items: center;
          justify-content: center;
        }
        .sky .title.orange {
          color: #f09328;
          font-size: 4rem;
          line-height: 4rem;
        }
        
        .ground {
          display: flex;
          flex-flow: column nowrap;
          align-items: center;
          justify-content: flex-end;
          width: 100%;
          height: 100%;
        }
        .ground__wave {
          fill: #022136;
          font-size: 4.5rem;
        }
        .ground__wave svg {
          width: 100vw;
          height: 100%;
          overflow: visible;
        }
        .ground #ground__group {
          transform-origin: 50% 50%;
          transform: translate3d(0, 0, 0);
          backface-visibility: hidden;
          perspective: 1000px;
          animation: ghost 5s infinite linear alternate;
        }
        @keyframes ghost {
          0% {
            transform: translate(0, -30%);
            filter: blur(0.5rem);
            opacity: 0;
          }
          100% {
            transform: translate(0, -10%);
            opacity: 0.2;
          }
        }
        @keyframes ghoul {
          0% {
            transform: translate(0, 70%) rotate(25deg);
          }
          70% {
            transform: translate(0, 0);
          }
        }
        @keyframes marshmallow {
          0% {
.........完整代码请登录后点击上方下载按钮下载查看

网友评论0