css实现万圣节巫婆施法动画效果代码

代码语言:html

所属分类:布局界面

代码描述:css实现万圣节巫婆施法动画效果代码

代码标签: 巫婆 施法 动画 效果

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

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

<head>
    <meta charset="UTF-8">
    <style>
        html,
    body {
      height: 100%;
      width: 100%;
      overflow: hidden;
      padding: 0;
      margin: 0;
    }
    
    body {
      background: #500d78;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    
    html {
      box-sizing: border-box;
    }
    
    *,
    *:before,
    *:after {
      box-sizing: inherit;
    }
    
    * {
      position: absolute;
    }
    
    *:before,
    *:after {
      content: "";
      position: absolute;
    }
    
    .container {
      width: 820px;
      height: 620px;
      overflow: hidden;
    }
    
    .shelf-one,
    .shelf-two,
    .shelf-three {
      width: 220px;
      height: 20px;
      top: 220px;
      right: 50px;
      z-index: 3;
    }
    
    .shelf-one .shelf:after {
      width: 30%;
      height: 100%;
      background-color: #8f65a9;
      border-radius: 0px 50px 0 0;
      bottom: 0;
      opacity: 0.1;
      z-index: 3;
    }
    .shelf-one .shelf:before {
      width: 90%;
      height: 100%;
      background-color: #8f65a9;
      border-radius: 0px 100px 0 0;
      bottom: 0;
      opacity: 0.1;
      z-index: 2;
    }
    
    .shelf-two {
      top: 340px;
    }
    .shelf-two .shelf:after {
      width: 15%;
      height: 100%;
      background-color: #8f65a9;
      border-radius: 0px 100% 0 0;
      bottom: 0;
      opacity: 0.4;
      z-index: 3;
    }
    .shelf-two .shelf:before {
      width: 70%;
      height: 100%;
      background-color: #8f65a9;
      border-radius: 0px 40px 0 0;
      bottom: 0;
      z-index: 2;
      opacity: 0.2;
    }
    
    .shelf-three {
      top: 460px;
    }
    .shelf-three .shelf:after {
      width: 27%;
      height: 100%;
      background-color: #8f65a9;
      border-radius: 0px 5px 0 0;
      bottom: 0;
      opacity: 0.4;
      z-index: 3;
    }
    .shelf-three .shelf:before {
      width: 80%;
      height: 100%;
      background-color: #8f65a9;
      border-radius: 0px 5px 0 0;
      bottom: 0;
      opacity: 0.2;
      z-index: 2;
    }
    
    .shelf {
      width: 220px;
      height: 20px;
      top: 0px;
      right: 0px;
      z-index: 2;
    }
    .shelf .base {
      width: 100%;
      height: 100%;
      border-radius: 2px;
      background-color: #3a0956;
    }
    .shelf .shelf-hooks {
      background-color: #1c0526;
      background: linear-gradient(to right, #3a0956 0%, #3a0956 50%, #1c0526 50%, #1c0526 100%);
      right: 15px;
      height: 20px;
      width: 14px;
      z-index: -1;
      top: 100%;
      border-radius: 0 0 5px 5px;
    }
    .shelf .shelf-hooks:after {
      width: 100%;
      height: 100%;
      right: 176px;
      background: linear-gradient(to right, #500d78 0%, #500d78 50%, #1c0526 50%, #1c0526 100%);
      border-radius: 0 0 5px 5px;
    }
    
    .bottle {
      -webkit-transform-origin: bottom center;
              transform-origin: bottom center;
    }
    .bottle .bowl {
      width: 100%;
      height: 100%;
      border-radius: 50%;
      background-color: #E6EFF2;
      overflow: hidden;
    }
    .bottle .bowl:after {
      background-color: #A8DCEA;
    }
    .bottle .bowl-in {
      width: 88%;
      height: 88%;
      left: 6%;
      bottom: 6%;
      border-radius: 50%;
      overflow: hidden;
      z-index: 2;
    }
    .bottle .liquid {
      width: 100%;
      height: 70%;
      bottom: 0;
      background-color: #500d78;
    }
    .bottle .liquid:after {
      background-color: #3a0956;
    }
    .bottle .liquid .bottle-bubble {
      border-radius: 20px;
      width: 5px;
      height: 5px;
      top: 14px;
      left: 2px;
      background-color: #6c11a1;
      z-index: 2;
    }
    .bottle .liquid .bottle-bubble:nth-child(2) {
      top: 3px;
      left: 10px;
      width: 7px;
      height: 7px;
    }
    .bottle .liquid .bottle-bubble:nth-child(3) {
      top: 6px;
      left: 25px;
      width: 5px;
      height: 5px;
    }
    .bottle .liquid .bottle-bubble:nth-child(4) {
      top: 17px;
      left: 30px;
      width: 5px;
      height: 5px;
    }
    .bottle .liquid .bottle-bubble:nth-child(5) {
      top: -4px;
      left: 30px;
      width: 8px;
      height: 8px;
      background-color: #3a0956;
    }
    .bottle .bottle-reflection {
      opacity: 0.5;
      border-radius: 0px 0px 0px 50px;
      border: 6px solid #feffff;
      border-top: 0;
      border-right: 0;
      width: 18px;
      height: 18px;
      bottom: 5px;
      left: 5px;
      z-index: 10;
    }
    .bottle .bottle-reflection:after {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background-color: #feffff;
      bottom: 10px;
      left: -6px;
      box-shadow: 15px 16px #feffff;
    }
    
    .bottle-1 {
      bottom: 20px;
      left: 35%;
      width: 50px;
      height: 50px;
      -webkit-transform: scale(0.8);
              transform: scale(0.8);
    }
    .bottle-1 *:after {
      width: 50%;
      height: 100%;
      right: 0;
    }
    .bottle-1 .bottle-neck {
      width: 12px;
      height: 20px;
      top: -16px;
      left: 19px;
      background-color: #E6EFF2;
    }
    .bottle-1 .bottle-neck:after {
      background-color: #A8DCEA;
    }
    .bottle-1 .bottle-neck:before {
      background-color: #feffff;
      height: 80%;
      width: 30%;
      left: 12%;
      border-radius: 3px;
      z-index: 2;
      opacity: 0.5;
    }
    .bottle-1 .bottle-top {
      width: 24px;
      height: 7px;
      top: -23px;
      left: 13px;
      border-radius: 5px;
      background-color: #E6EFF2;
    }
    .bottle-1 .bottle-top:after {
      background-color: #A8DCEA;
      border-radius: 0 5px 5px 0;
    }
    
    .crystal-ball {
      left: 10px;
      bottom: 20px;
      width: 60px;
      height: 60px;
    }
    .crystal-ball .stand {
      z-index: 2;
      width: 50px;
      left: 5px;
      height: 10px;
      border-radius: 3px;
      background-color: #E6EFF2;
      background: linear-gradient(to right, #E6EFF2 0%, #E6EFF2 50%, #A8DCEA 50%, #A8DCEA 100%);
      bottom: 0;
    }
    .crystal-ball .stand:after {
      width: 40px;
      left: 5px;
      height: 7px;
      border-radius: 2px;
      bottom: 9px;
      background: linear-gradient(to right, #A8DCEA 0%, #A8DCEA 50%, #92BFCC 50%, #92BFCC 100%);
    }
    .crystal-ball .ball {
      border-radius: 50%;
      width: 56px;
      height: 56px;
      left: 2px;
      top: -6px;
      background-color: #f495f0;
      overflow: hidden;
    }
    .crystal-ball .ball:after {
      width: 50%;
      height: 100%;
      right: 0;
      background-color: #f175eb;
    }
    .crystal-ball .ball .ball-highlight {
      opacity: 0.5;
      border-radius: 0px 0px 0px 50px;
      border: 6px solid #feffff;
      border-top: 0;
      border-right: 0;
      width: 18px;
      height: 18px;
      bottom: 10px;
      left: 7px;
      z-index: 10;
    }
    .crystal-ball .ball .ball-highlight:after {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background-color: #feffff;
      bottom: 10px;
      left: -6px;
      box-shadow: 15px 16px #feffff;
    }
    
    .drippings {
      width: 30px;
      height: 12px;
      background-color: #3EBCBC;
      left: 58%;
      border-radius: 3px;
      top: -1px;
      z-index: 15;
    }
    .drippings:after {
      width: 8px;
      height: 18px;
      border-radius: 3px;
      background-color: #3EBCBC;
      top: 8px;
      right: 0px;
    }
    .drippings .drip {
      width: 8px;
      height: 12px;
      border-radius: 3px;
      background-color: #3EBCBC;
      top: 10px;
      right: 0px;
      -webkit-animation: drip 5s ease-in infinite;
              animation: drip 5s ease-in infinite;
    }
    
    .bottle-3 {
      -webkit-transform-origin: bottom right;
              transform-origin: bottom right;
      bottom: 70px;
      left: 73%;
      width: 50px;
      height: 50px;
      -webkit-transform: rotate(-90deg);
              transform: rotate(-90deg);
    }
    .bottle-3 *:after {
      width: 50%;
      height: 100%;
      right: 0;
    }
    .bottle-3 .bowl {
      width: 80%;
      height: 80%;
      left: 0px;
      border-radius: 5px;
      background-color: #E6EFF2;
      overflow: hidden;
    }
    .bottle-3 .bowl:after {
      background-color: #A8DCEA;
      width: 20%;
    }
    .bottle-3 .bowl:before {
      z-index: 3;
      width: 20px;
      height: 8px;
      border-radius: 10px;
      background-color: #feffff;
      opacity: 0.4;
      left: 5px;
      top: 6px;
    }
    .bottle-3 .bowl .bowl-in {
      border-radius: 5px;
    }
    .bottle-3 .bowl .liquid {
      height: 100%;
      width: 38%;
      bottom: 0;
      left: 0;
      background-color: #3EBCBC;
      z-index: 2;
    }
    .bottle-3 .bowl .liquid:after {
      background-color: #3EBCBC;
    }
    .bottle-3 .bottle-neck {
      width: 10px;
      height: 10px;
      top: -10px;
      left: 15px;
      background-color: #E6EFF2;
    }
    .bottle-3 .bottle-neck:after {
      background-color: #A8DCEA;
    }
    .bottle-3 .bottle-top {
      width: 14px;
      height: 7px;
      top: -16px;
      left: 13px;
      border-radius: 5px;
      background-color: #E6EFF2;
    }
    .bottle-3 .bottle-top:after {
      background-color: #A8DCEA;
      border-radius: 0 5px 5px 0;
    }
    
    .skull {
      width: 60px;
      height: 60px;
      bottom: 100%;
      right: 12%;
    }
    .skull .head {
      width: 100%;
      height: 100%;
      border-radius: 30px 30px 18px 18px;
      background-color: #feffff;
      overflow: hidden;
    }
    .skull .head .skull-stain {
      width: 40px;
      height: 20px;
      left: -2px;
      top: -5px;
      border-radius: 10px;
      background-color: #3EBCBC;
      -webkit-transform: skewX(-10deg);
              transform: skewX(-10deg);
    }
    .skull .head .skull-stain:before {
      width: 10px;
      height: 20px;
      border-radius: 5px;
      background-color: #3EBCBC;
      top: 12px;
      left: 6px;
    }
    .skull .head:before {
      width: 50%;
      height: 100%;
      right: 0;
      background-color: rgba(20, 1, 30, 0.15);
    }
    .skull .eye {
      left: 15%;
      top: 37%;
      background-color: #14011e;
      width: 17px;
      height: 24px;
      border-radius: 20px;
      -webkit-transform: rotate(20deg);
              transform: rotate(20deg);
    }
    .skull .eye:after {
      background-color: #ee8228;
      width: 8px;
      height: 8px;
      border-radius: 10px;
      top: 8px;
      left: 4px;
      box-shadow: 0 0 2px #ee8228, 0 0 6px #ee8228;
      -webkit-animation: eyes 15s linear infinite;
              animation: eyes 15s linear infinite;
    }
    .skull .eye:nth-child(2) {
      left: auto;
      right: 15%;
      -webkit-transform: rotate(-20deg);
         .........完整代码请登录后点击上方下载按钮下载查看

网友评论0