div+css实现细蜡烛火苗燃烧动画效果代码

代码语言:html

所属分类:动画

代码描述:div+css实现细蜡烛火苗燃烧动画效果代码

代码标签: div css 蜡烛 火苗 燃烧 动画

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

<!DOCTYPE html>
<html lang="en" >
<head>
  <meta charset="UTF-8">
<style>
    body {
  background: #111;
  display: flex;
  margin: 0;
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.candle {
  width: 34px;
  margin: 30px auto 0 auto;
  position: relative;
  height: 80%;
  align-self: flex-end;
  -webkit-animation: blink 0.1s infinite;
          animation: blink 0.1s infinite;
}

.wick {
  position: absolute;
  width: 6px;
  height: 50px;
  background: #23161a;
  top: 110px;
  left: 50%;
  transform: translateX(-50%) skewX(2deg);
  border-radius: 10%;
  box-shadow: 0 0 2px 0px black;
}
.wick:before {
  content: "";
  position: absolute;
  width: 0;
  left: 50%;
  height: 10px;
  box-shadow: 0 -14px 10px 8px white, 0 -10px 10px 8px rgba(255, 215, 0, 0.7), 0 -3px 10px 8px rgba(255, 106, 0, 0.7), 0 6px 3px 4px black;
}
.wick:after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0px;
  height: 0px;
  box-shadow: 0 5px 2px 3px gold, 0 20px 2px 14px gold, 0 -6px 4px 5px rgba(98, 33, 27, 0.8), 0 0px 1px 4px rgba(255, 106, 0, 0.7), 0 0px 3px 4px #ff6a00, 0 5px 3px 4px gold;
}

.flame {
  width: 20px;
  height: 150px;
  margin: 0px auto;
  position: relative;
  -webkit-animation: move 3s infinite, move-left 3s infinite;
          animation: move 3s infinite, move-left 3s infinite;
  transform-origin: 50% 90%;
}
.flame .top {
  width: 20px;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  background: white;
  border-top-left-radius: 500%;
  border-bottom-left-radius: 50px;
  border-top-right-radius: 500%;
  border-bottom-right-radius: 50px;
  transform: skewY(-10deg);
  box-shadow: 0 0px 0px 3px white, 0 -20px 1px 4px white, 0 -25px 2px 3px gold, 0 -30px 5px 4px #ff6a00, 0 0px 150px 10px #ff6a00, 0 -10px 2px 4px white, 0 -5px 3px 3px white;
  -webkit-animation: flame-up 4s infinite;
          animation: flame-up 4s infinite;
}
.flame .shadows {
  position: absolute;
  left: 50%;
  top: 0;
  width: 1px;
  height: 60px;
  border-radius: 50%;
  box-shadow: 0 5px 20px 15px gold, 0 0px 100px 20px #ff6a00, 0 15px 50px 15px #ff6a00, 5px 30px 5px 13px #ff6a00, 5px 50px 5px 13px #ff6a00, 0 75px 50px 30px black;
}
.flame .bottom {
  transform: scale(0.9);
  position: absolute;
  bottom: 6px;
  left: 9px;
  width: 1px;
  height: 8px;
  border-radius: 1%;
  background: #2c2b39;
  box-shadow: 0 6px 10px 12px .........完整代码请登录后点击上方下载按钮下载查看

网友评论0