纯css布局实现猜球动画效果代码

代码语言:html

所属分类:动画

代码描述:纯css布局实现猜球动画效果代码,把球放在三个杯子里面,更换位置,看看你能猜到球在哪个杯子里面,比眼神的时候到了

代码标签: 实现 猜球 动画 效果

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


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

<head>

  <meta charset="UTF-8">
  

  
  
  
  
<style>
*, *::before, *::after {
  padding: 0;
  margin: 0 auto;
  box-sizing: border-box;
}

body {
  background-image: -webkit-gradient(linear, left top, left bottom, from(#cde), color-stop(50%, #fff), color-stop(50%, #fafafa), to(#ddd));
  background-image: linear-gradient(#cde, #fff 50%, #fafafa 50%, #ddd);
  color: #fff;
  min-height: 100vh;
  display: -webkit-box;
  display: flex;
  -webkit-box-pack: center;
          justify-content: center;
  -webkit-box-align: center;
          align-items: center;
}

.cups {
  position: relative;
  width: 200px;
  height: 120px;
}

.cup {
  position: absolute;
  top: 25px;
  width: 60px;
  height: 120px;
  -webkit-transform: translateX(-50%);
          transform: translateX(-50%);
  -webkit-transform-origin: center -100%;
          transform-origin: center -100%;
}
.cup:nth-child(1) {
  -webkit-animation: cupA 8s infinite ease-in-out;
          animation: cupA 8s infinite ease-in-out;
}
.cup:nth-child(1) .shadow {
  -webkit-animation: shadow 8s infinite ease-in-out;
          animation: shadow 8s infinite ease-in-out;
}
.cup:nth-child(1) .ball_shadow {
  -webkit-animation: ball 32s -24s infinite ease-in-out;
          animation: ball 32s -24s infinite ease-in-out;
}
.cup:nth-child(1) .ball {
  -webkit-animation: ball 32s -24s infinite ease-in-out;
          animation: ball 32s -24s infinite ease-in-out;
}
.cup:nth-child(1) .tin {
  -webkit-animation: tin 8s infinite ease-in-out;
          animation: tin 8s infinite ease-in-out;
}
.cup:nth-child(2) {
  -webkit-animation: cupB 8s infinite ease-in-out;
          animation: cupB 8s infinite ease-in-out;
}
.........完整代码请登录后点击上方下载按钮下载查看

网友评论0