css+jquery实现星球大战光剑打开关闭动画带音效效果代码

代码语言:html

所属分类:动画

代码描述:css+jquery实现星球大战光剑打开关闭动画带音效效果代码

代码标签: 光剑 打开 关闭 动画 音效 效果

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


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

<head>

 
<meta charset="UTF-8">

 
 
<style>
body {
  background: black;
}
/* Helmet */
.border {
  border: 1px solid #222;
}
.hidden {
  display: none;
}
.helmet {
  width: 400px;
  height: 500px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.helmet__top {
  position: absolute;
  z-index: 2;
  display: block;
  top: 50px;
  width: 20px;
  height: 170px;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  border-bottom-left-radius: 80% 20%;
  border-bottom-right-radius: 80% 20%;
}
.helmet__top:before,
.helmet__top:after {
  content: '';
  display: block;
  position: absolute;
  width: 130px;
  height: 150px;
  top: 5px;
  z-index: -1;
}
.helmet__top:before {
  right: 0;
  border-top-left-radius: 130px;
  background: linear-gradient(to right, gray, #333, #222 100px, #222 110px, gray 112px, gray 115px, #222 116px);
}
.helmet__top:after {
  left: 10px;
  border-top-right-radius: 130px;
  background: linear-gradient(to right, #222, #222 9px, gray 9px, gray 10px, #222 12px, black 60px);
}
.helmet__front {
  position: absolute;
  z-index: 5;
  display: block;
  top: 175px;
  width: 20px;
  height: 40px;
}
.helmet__front:before,
.helmet__front:after {
  content: '';
  display: block;
  position: absolute;
  width: 135px;
  height: 60px;
  background: #222;
  -webkit-clip-path: polygon(140px 40px, 75px 30px, 40px 40px, 20px 48px, 5px 60px, 10px 40px, 40px 15px, 75px 2px, 100px 3px, 125px 10px, 140px 20px);
          clip-path: polygon(140px 40px, 75px 30px, 40px 40px, 20px 48px, 5px 60px, 10px 40px, 40px 15px, 75px 2px, 100px 3px, 125px 10px, 140px 20px);
}
.helmet__front:before {
  right: 12px;
}
.helmet__front:after {
  left: 14px;
  transform: rotateY(180deg);
}
.helmet__back {
  position: absolute;
  z-index: 1;
  top: 200px;
  width: 400px;
  height: 250px;
  border-bottom: 1px solid #333;
  border-bottom-left-radius: 80% 20%;
  border-bottom-right-radius: 80% 20%;
  -webkit-clip-path: polygon(20% 0%, 82% 0%, 102% 100%, -2% 100%);
          clip-path: polygon(20% 0%, 82% 0%, 102% 100%, -2% 100%);
  background: linear-gradient(75deg, transparent, transparent 340px, #333 370px, black 380px), linear-gradie.........完整代码请登录后点击上方下载按钮下载查看

网友评论0