div+css实现包卷饼煎饼动画效果代码

代码语言:html

所属分类:动画

代码描述:div+css实现包卷饼煎饼动画效果代码,点击鼠标看效果。

代码标签: div css 卷饼 煎饼 动画

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

<!DOCTYPE html>
<html lang="en" >
<head>
  <meta charset="UTF-8">
<style>
    body {
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at center, #a9cfbe, #99c6b2);
}
body input {
  width: 300px;
  height: 125px;
  position: absolute;
  left: calc(50% - 150px);
  top: calc(50% - 62.5px);
  z-index: 9;
  opacity: 0;
}
body input:checked ~ .wrap .wrapper {
  transform: translateX(175px);
}
body input:checked ~ .wrap .beans {
  -webkit-animation: beanroll 2.5s ease-in-out 1 forwards;
          animation: beanroll 2.5s ease-in-out 1 forwards;
  opacity: 0;
}
body input:checked ~ .wrap .beans:before {
  box-shadow: 10px 5px #826343, 5px -10px #826343, 12px -7px #826343, 20px -20px #826343, 17px -22px #826343, 30px -17px #826343, 27px -22px #826343, 13px -80px #826343, 24px -40px #826343, 10px -15px #93704c, 30px -82px #93704c, 35px -82px #93704c, 70px -72px #826343, 60px -52px #826343;
}
body input:checked ~ .wrap .beans:after {
  -webkit-clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
}
body input:checked ~ .wrap .tortilla {
  -webkit-animation: rollup 2.5s ease-in-out 1 forwards;
          animation: rollup 2.5s ease-in-out 1 forwards;
}
body input:checked ~ .wrap .tortilla .roll {
  -webkit-animation: rollup2 2.5s ease-in-out 1 forwards;
          animation: rollup2 2.5s ease-in-out 1 forwards;
}
body input:checked ~ .wrap .cheese, body input:checked ~ .wrap .lettuce, body input:checked ~ .wrap .tomatoes {
  -webkit-animation: beanroll 2.5s ease-in-out 1 forwards;
          animation: beanroll 2.5s ease-in-out 1 forwards;
}
body input:checked ~ .wrap .cheese .shred, body input:checked ~ .wrap .lettuce .shred, body input:checked ~ .wrap .tomatoes .shred {
  -webkit-animation: cheesedrop 2.5s ease-out 1 forwards;
          animation: cheesedrop 2.5s ease-out 1 forwards;
}
body input:checked ~ .wrap .cheese .tomato, body input:checked ~ .wrap .lettuce .tomato, body input:checked ~ .wrap .tomatoes .tomato {
  -webkit-animation: grow 2.5s ease-out 1 forwards;
          animation: grow 2.5s ease-out 1 forwards;
}
body input:checked ~ .wrap .lettuce .shred {
  -webkit-animation: lettucedrop 2.5s ease-out 1 forwards;
          animation: lettucedrop 2.5s ease-out 1 forwards;
}
body .wrap {
  width: 300px;
  height: 125px;
  border-radius: 75px;
  box-shadow: 0 0 0 1px #ccc, 0 0 30px 1px #78b499;
  background: #fff;
  position: relative;
}
body .wrap .wrapper {
  width: 110px;
  height: 110px;
  position: absolute;
  left: 7.5px;
  top: 7.5px;
  transform: translateX(0);
  transition: 1.5s ease-in-out;
  transition-delay: 1.25s;
}
body .wrap .wrapper .cheese {
  max-width: 65%;
}
body .wrap .wrapper .cheese, body .wrap .wrapper .lettuce, body .wrap .wrapper .tomatoes {
  width: 80%;
  height: 80%;
  z-index: 1;
  position: absolute;
  border-radius: 100%;
  top: 10%;
  left: 10%;
  overflow: hidden;
}
body .wrap .wrapper .cheese .tomato, body .wrap .wrapper .lettuce .tomato, body .wrap .wrapper .tomatoes .tomato {
  position: absolute;
  width: 20px;
  height: 20px;
  background: radial-gradient(ci.........完整代码请登录后点击上方下载按钮下载查看

网友评论0