css布局实现一个悬浮打火机生火打开动画效果代码

代码语言:html

所属分类:悬停

代码描述:css布局实现一个悬浮打火机生火打开动画效果代码

代码标签: 一个 悬浮 打火机 生火 打开 动画 效果

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

<!DOCTYPE html>
<html>

<head>

  <meta charset="UTF-8">

    <style>
@charset "UTF-8";
body {
  background: #cccccc;
}

:before, :after {
  position: absolute;
  content: "";
}

.playground {
  position: relative;
  width: 140px;
  height: 400px;
  left: 50%;
  margin-left: -70px;
}

.flame {
  opacity: 0;
  position: absolute;
  bottom: 60%;
  left: 42%;
  width: 14px;
  height: 70px;
  background-color: white;
  border-radius: 100% 100% 0 0;
  box-shadow: 0 0 20px #FFFEF0, 0 0 20px #FFFEE6, 0 0 20px #fefcc9,  10px -10px 30px #feec85,  -20px -20px 40px #ffae34,  20px -40px 50px #ec760c,  -20px -60px 60px #cd4606,  0 -80px 70px #973716,  10px -90px 80px #451b0e;
  animation: flame 3s infinite linear;
}

.lighterBody {
  position: absolute;
  width: 140px;
  height: 130px;
  top: 200px;
  left: 0;
  background: linear-gradient(to right, #959595 0%, #0d0d0d 46%, #010101 50%, #0a0a0a 53%, #4e4e4e 76%, #383838 87%, #1b1b1b 100%);
  border-radius: 2% 2% 8% 8%;
  box-shadow: inset 0 0 5px 5px #333333;
}
.lighterBody:before {
  width: 47px;
  height: 47px;
  top: -50px;
  left: 42px;
  border-radius: 6% 6% 0 0;
  background: linear-gradient(to right, #f5f6f6 0%, #dbdce2 21%, #b8bac6 49%, #dddfe3 80%, #f5f6f6 100%);
  content: " • • • • • • • • •";
  color: #e6e6e6;
  font-size: 20px;
  letter-spacing: 2px;
  line-height: 16px;
  text-shadow: 0 0 5px black;
  padding-top: 3px;
  padding-left: 4px;
}
.lighterBody:after {
  width: 33px;
  height: 33px;
  background: radial-gradient(ellipse at center, #7d7e7d 0%, #0e0e0e 100%);
  border-radius: 100%;
  top: -33px;
  left: 6px;
  box-shadow: inset 0 0 1px 2px gray;
}

.playground:hover .flame {
  opacity: 1;
  transition: 0.4s linear;
}

.playground:hover .lid {
  animation: lidOff 0.3s linear;
  animation-fill-mode: forwards;
}

.hover {
  text-align: center;
  margin-top: 30%;
  font-family: 'Sonsie One.........完整代码请登录后点击上方下载按钮下载查看

网友评论0