div+css实现蜡烛燃烧动画效果代码
代码语言:html
所属分类:动画
代码描述:div+css实现蜡烛燃烧动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
html, body {
height: 100vh;
background: #000;
overflow: hidden;
}
.g-candle {
position: absolute;
width: 400px;
margin: 0 auto;
height: 400px;
}
.g-body {
position: relative;
width: 100px;
height: 300px;
margin: 280px auto;
background: linear-gradient(230deg, #ca9800, #573903, black 70%);
z-index: 1;
}
.g-body::before {
position: absolute;
content: "";
width: 100px;
height: 40px;
border-radius: 50%;
box-sizing: border-box;
top: -20px;
background: radial-gradient(#a46800, #5c3104 45%, #905602 100%);
}
.g-body::after {
position: absolute;
content: "";
width: 4px;
height: 48px;
background: #fff;
left: 50%;
top: -22px;
transform: translate(-50%, -50%);
border-radius: 50% 50% 0 0;
background: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.8) 60%, #fff);
opacity: 0.7;
filter: blur(1px);
}
.g-fire-box {
position: absolute;
top: 97px;
left: 50%;
width: 80px;
height: 200px;
transform: translate(-50%, -50%);
filter: blur(2px) contrast(20);
}
.g-fire {
position: absolute;
top: 30px;
left: 50%;
border-radius: 45%;
box-sizing: border-box;
border: 120px solid #000;
border-bottom: 120px solid transparent;
transform: translate(-50%, 0) scaleX(0.45);
background-color: #761b00;
}
.g-ball {
position: absolute;
top: 60px;
transform: translate(0, 0);
background: #fa8763;
border-radius: 50%;
z-index: -1;
mix-blend-mode: screen;
}
.g-ball:nth-child(0) {
width: 31px;
height: 31px;
radius: 50% 50%;
left: calc(45px - 55px);
}
.g-ball:nth-child(0) {
animation: movetop 1s linear -0.57s infinite;
}
.g-ball:nth-child(1) {
width: 13px;
height: 13px;
radius: 50% 50%;
left: calc(33px - 55px);
}
.g-ball:nth-child(1) {
animation: movetop 1s linear -2.712s infinite;
}
.g-ball:nth-child(2) {
width: 41px;
height: 41px;
radius: 50% 50%;
left: calc(43px - 55px);
}
.g-ball:nth-child(2) {
animation: movetop 1s linear -1.291s infinite;
}
.g-ball:nth-child(3) {
width: 28px;
height: 28px;
radius: 50% 50%;
left: calc(25px - 55px);
}
.g-ball:nth-child(3) {
animation: movetop 1s linear -2.422s infinite;
}
.g-ball:nth-child(4) {
width: 39px;
height: 39px;
radius: 50% 50%;
left: calc(48px - 55px);
}
.g-ball:nth-child(4) {
animation: movetop 1s linear -0.817s infinite;
}
.g-ball:nth-child(5) {
width: 30px;
height: 30px;
radius: 50% 50%;
left: calc(2px - 55px);
}
.g-ball:nth-child(5) {
animation: movetop 1s linear -0.028s infinite;
}
.g-ball:nth-child(6) {
width: 30px;
height: 30px;
radius: 50% 50%;
left: calc(37px - 55px);
}
.g-ball:nth-child(6) {
animation: movetop 1s linear -2.838s infinite;
}
.g-ball:nth-child(7) {
width: 7px;
height: 7px;
radius: 50% 50%;
left: calc(7px - 55px);
}
.g-ball:nth-child(7) {
animation: movetop 1s linear -2.127s infinite;
}
.g-ball:nth-child(8) {
width: 25px;
height: 25px;
radius: 50% 50%;
left: calc(47px - 55px);
}
.g-ball:nth-child(8) {
animation: movetop 1s linear -1.119s infinite;
}
.g-ball:nth-child(9) {
width: 11px;
height: 11px;
radius: 50% 50%;
left: calc(38px - 55px);
}
.g-ball:nth-child(9) {
animation: movetop 1s linear -0.436s infinite;
}
.g-ball:nth-child(10) {
width: 50px;
height: 50px;
radius: 50% 50%;
left: calc(70px - 55px);
}
.g-ball:nth-child(10) {
animation: movetop 1s linear -2.152s infinite;
}
.g-ball:nth-child(11) {
width: 39px;
height: 39px;
radius: 50% 50%;
left: calc(46px - 55px);
}
.g-ball:nth-child(11) {
animation: movetop 1s linear -2.181s infinite;
}
.g-ball:nth-child(12) {
width: 27px;
height: 27px;
radius: 50% 50%;
left: calc(49px - 55px);
}
.g-ball:nth-child(12) {
animation: movetop 1s linear -2.823s infinite;
}
.g-ball:nth-child(13) {
width: 9px;
height: 9px;
radius: 50% 50%;
left: calc(38px - 55px);
}
.g-ball:nth-child(13) {
animation: movetop 1s linear -1.751s infinite;
}
.g-ball:nth-child(14) {
width: 5px;
height: 5px;
radius: 50% 50%;
left: calc(48px - 55px);
}
.g-ball:nth-child(14) {
animation: movetop 1s linear -2.617s infinite;
}
.g-ball:nth-child(15) {
width: 21px;
height: 21px;
radius: 50% 50%;
left: calc(51px - 55px);
}
.g-ball:nth-child(15) {
animation: movetop 1s linear -1.916s infinite;
}
.g-ball:nth-child(16) {
width: 37px;
height: 37px;
radius: 50% 50%;
left: calc(53px - 55px);
}
.g-ball:nth-child(16) {
animation: movetop 1s linear -1.431s infinite;
}
.g-ball:nth-child(17) {
width: 50px;
height: 50px;
radius: 50% 50%;
left: calc(23px - 55px);
}
.g-ball:nth-child(17) {
animation: movetop 1s linear -1.886s infinite;
}
.g-ball:nth-child(18) {
width: 21px;
height: 21px;
radius: 50% 50%;
left: calc(2px - 55px);
}
.g-ball:nth-child(18) {
animation: movetop 1s linear -0.397s infinite;
}
.g-ball:nth-child(19) {
width: 49px;
height: 49px;
radius: 50% 50%;
left: calc(10px - 55px);
}
.g-ball:nth-child(19) {
animation: movetop 1s linear -2.832s infinite;
}
.g-ball:nth-child(20) {
width: 14px;
height: 14px;
radius: 50% 50%;
left: calc(58px - 55px);
}
.g-ball:nth-child(20) {
animation: movetop 1s linear -2.467s infinite;
}
.g-ball:nth-child(21) {
width: 16px;
height: 16px;
radius: 50% 50%;
left: calc(25px - 55px);
}
.g-ball:nth-child(21) {
animation: movetop 1s linear -1.376s infinite;
}
.g-ball:nth-child(22) {
width: 40px;
height: 40px;
radius: 50% 50%;
left: calc(60px - 55px);
}
.g-ball:nth-child(22) {
animation: movetop 1s linear -0.811s infinite;
}
.g-ball:nth-child(23) {
width: 23px;
height: 23px;
radius: 50% 50%;
left: calc(6px - 55px);
}
.g-ball:nth-child(23) {
animation: movetop 1s linear -0.406s infinite;
}
.g-ball:nth-child(24) {
width: 37px;
height: 37px;
radius: 50% 50%;
left: calc(5px - 55px);
}
.g-ball:nth-child(24) {
animation: movetop 1s linear -2.53s infinite;
}
.g-ball:nth-child(25) {
width: 40px;
height: 40px;
radius: 50% 50%;
left: calc(16px - 55px);
}
.g-ball:nth-child(25) {
animation: movetop 1s linear -1.394s infinite;
}
.g-ball:nth-child(26) {
width: 6px;
height: 6px;
radius: 50% 50%;
left: calc(7px - 55px);
}
.g-ball:nth-child(26) {
animation: movetop 1s linear -1.29s infinite;
}
.g-ball:nth-child(27) {
width: 26px;
height: 26px;
radius: 50% 50%;
left: calc(10px - 55px);
}
.g-ball:nth-child(27) {
animation: movetop 1s linear -2.812s infinite;
}
.g-ball:nth-child(28) {
width: 34px;
height: 34px;
radius: 50% 50%;
left: calc(2px - 55px);
}
.g-ball:nth-child(28) {
animation: movetop 1s linear -2.197s infinite;
}
.g-ball:nth-child(29) {
width: 23px;
height: 23px;
radius: 50% 50%;
left: calc(8px - 55px);
}
.g-ball:nth-child(29) {
animation: movetop 1s linear -2.295s infinite;
}
.g-ball:nth-child(30) {
width: 32px;
height: 32px;
radius: 50% 50%;
left: calc(11px - 55px);
}
.g-ball:nth-child(30) {
animation: movetop 1s linear -0.838s infinite;
}
.g-ball:nth-child(31) {
width: 2px;
height: 2px;
radius: 50% 50%;
left: calc(20px - 55px);
}
.g-ball:nth-child(31) {
animation: movetop 1s linear -1.336s infinite;
}
.g-ball:nth-child(32) {
width: 36px;
height: 36px;
radius: 50% 50%;
left: calc(35px - 55px);
}
.g-ball:nth-child(32) {
animation: movetop 1s linear -0.7s infinite;
}
.g-ball:nth-child(33) {
width: 26px;
height: 26px;
radius: 50% 50%;
left: calc(46px - 55px);
}
.g-ball:nth-child(33) {
animation: movetop 1s linear -0.239s infinite;
}
.g-ball:nth-child(34) {
width: 44px;
height: 44px;
radius: 50% 50%;
left: calc(31px - 55px);
}
.g-ball:nth-child(34) {
animation: movetop 1s linear -0.193s infinite;
}
.g-ball:nth-child(35) {
width: 5px;
height: 5px;
radius: 50% 50%;
left: calc(48px - 55px);
}
.g-ball:nth-child(35) {
animation: movetop 1s linear -1.575s infinite;
}
.g-ball:nth-child(36) {
width: 43px;
height: 43px;
radius: 50% 50%;
left: calc(53px - 55px);
}
.g-ball:nth-child(36) {
animation: movetop 1s linear -2.663s infinite;
}
.g-ball:nth-child(37) {
width: 18px;
height: 18px;
radius: 50% 50%;
left: calc(67px - 55px);
}
.g-ball:nth-child(37) {
animation: movetop 1s linear -2.404s infinite;
}
.g-ball:nth-child(38) {
width: 7px;
height: 7px;
radius: 50% 50%;
left: calc(46px - 55px);
}
.g-ball:nth-child(38) {
animation: movetop 1s linear -1.088s infinite;
}
.g-ball:nth-child(39) {
width: 50px;
height: 50px;
radius: 50% 50%;
left: calc(19px - 55px);
}
.g-ball:nth-child(39) {
animation: movetop 1s linear -0.296s infinite;
}
.g-ball:nth-child(40) {
width: 24px;
height: 24px;
radius: 50% 50%;
left: calc(5px - 55px);
}
.g-ball:nth-child(40) {
animation: movetop 1s linear -2.802s infinite;
}
.g-ball:nth-child(41) {
width: 4px;
height: 4px;
radius: 50% 50%;
left: calc(25px - 55px);
}
.g-ball:nth-child(41) {
animation: movetop 1s linear -1.501s infinite;
}
.g-ball:nth-child(42) {
width: 44px;
height: 44px;
radius: 50% 50%;
left: calc(13px - 55px);
}
.g-ball:nth-child(42) {
animation: movetop 1s linear -0.606s infinite;
}
.g-ball:nth-child(43) {
width: 8px;
height: 8px;
radius: 50% 50%;
left: calc(15px - 55px);
}
.g-ball:nth-child(43) {
animation: movetop 1s linear -0.501s infinite;
}
.g-ball:nth-child(44) {
width: 32px;
height: 32px;
radius: 50% 50%;
left: calc(57px - 55px);
}
.g-ball:nth-child(44) {
animation: movetop 1s linear -1.807s infinite;
}
.g-ball:nth-child(45) {
width: 30px;
height: 30px;
radius: 50% 50%;
left: calc(47px - 55px);
}
.g-ball:nth-child(45) {
animation: movetop 1s linear -1.072s infinite;
}
.g-ball:nth-child(46) {
width: 29px;
height: 29px;
radius: 50% 50%;
left: calc(56px - 55px);
}
.g-ball:nth-child(46) {
animation: movetop 1s linear -2.646s infinite;
}
.g-ball:nth-child(47) {
width: 38px;
height: 38px;
radius: 50% 50%;
left: calc(61px - 55px);
}
.g-ball:nth-child(47) {
animation: movetop 1s linear -0.797s infinite;
}
.g-ball:nth-child(48) {
width: 43px;
height: 43px;
radius: 50% 50%;
left: calc(38px - 55px);
}
.g-ball:nth-child(48) {
animation: movetop 1s linear -1.646s infinite;
}
.g-ball:nth-child(49) {
width: 6px;
height: 6px;
radius: 50% 50%;
left: calc(1px - 55px);
}
.g-ball:nth-child(49) {
animation: movetop 1s linear -2.019s infinite;
}
.g-ball:nth-child(50) {
width: 40px;
height: 40px;
radius: 50% 50%;
left: calc(51px - 55px);
}
.g-ball:nth-child(50) {
animation: movetop 1s linear -0.118s infinite;
}
.g-ball:nth-child(51) {
width: 29px;
height: 29px;
radius: 50% 50%;
left: calc(34px - 55px);
}
.g-ball:nth-child(51) {
animation: movetop 1s linear -2.508s infinite;
}
.g-ball:nth-child(52) {
width: 21px;
height: 21px;
radius: 50% 50%;
left: calc(9px - 55px);
}
.g-ball:nth-child(52) {
animation: movetop 1s linear -1.076s infinite;
}
.g-ball:nth-child(53) {
width: 10px;
height: 10px;
radius: 50% 50%;
left: calc(43px - 55px);
}
.g-ball:nth-child(53) {
animation: movetop 1s linear -1.414s infinite;
}
.g-ball:nth-child(54) {
width: 45px;
height: 45px;
radius: 50% 50%;
left: calc(36px - 55px);
}
.g-ball:nth-child(54) {
animation: movetop 1s linear -0.938s infinite;
}
.g-ball:nth-child(55) {
width: 8px;
height: 8px;
radius: 50% 50%;
left: calc(66px - 55px);
}
.g-ball:nth-child(55) {
animation: movetop 1s linear -2.879s infinite;
}
.g-ball:nth-child(56) {
width: 25px;
height: 25px;
radius: 50% 50%;
left: calc(66px - 55px);
}
.g-ball:nth-child(56) {
animation: movetop 1s linear -1.581s infinite;
}
.g-ball:nth-child(57) {
width: 40px;
height: 40px;
radius: 50% 50%;
left: calc(51px - 55px);
}
.g-ball:nth-child(57) {
animation: movetop 1s linear -1.906s infinite;
}
.g-ball:nth-child(58) {
width: 43px;
height: 43px;
radius: 50% 50%;
left: calc(1px - 55px);
}
.g-ball:nth-child(58) {
animation: movetop 1s linear -1.319s infinite;
}
.g-ball:nth-child(59) {
width: 39px;
height: 39px;
radius: 50% 50%;
left: calc(31px - 55px);
}
.g-ball:nth-child(59) {
animation: movetop 1s linear -0.59s infinite;
}
.g-ball:nth-child(60) {
width: 41px;
height: 41px;
radius: 50% 50%;
left: calc(42px - 55px);
}
.g-ball:nth-child(60) {
animation: movetop 1s linear -2.113s infinite;
}
.g-ball:nth-child(61) {
width: 34px;
height: 34px;
radius: 50% 50%;
left: calc(63px - 55px);
}
.g-ball:nth-child(61) {
animation: movetop 1s linear -1.889s infinite;
}
.g-ball:nth-child(62) {
width: 41px;
height: 41px;
radius: 50% 50%;
left: calc(34px - 55px);
}
.g-ball:nth-child(62) {
animation: movetop 1s linear -0.95s infinite;
}
.g-ball:nth-child(63) {
width: 26px;
height: 26px;
radius: 50% 50%;
left: calc(3px - 55px);
}
.g-ball:nth-child(63) {
animation: movetop 1s linear -1.477s infinite;
}
.g-ball:nth-child(64) {
width: 47px;
height: 47px;
radius: 50% 50%;
left: calc(15px - 55px);
}
.g-ball:nth-child(64) {
animation: movetop 1s linear -0.252s infinite;
}
.g-ball:nth-child(65) {
width: 45px;
height: 45px;
radius: 50% 50%;
left: calc(36px - 55px);
}
.g-ball:nth-child(65) {
animation: movetop 1s linear -0.616s infinite;
}
.g-ball:nth-child(66) {
width: 24px;
height: 24px;
radius: 50% 50%;
left: calc(10px - 55px);
}
.g-ball:nth-child(66) {
animation: movetop 1s linear -1.23s infinite;
}
.g-ball:nth-child(67) {
width: 39px;
height: 39px;
radius: 50% 50%;
left: calc(26px - 55px);
}
.g-ball:nth-child(67) {
animation: movetop 1s linear -2.512s infinite;
}
.g-ball:nth-child(68) {
width: 24px;
height: 24px;
radius: 50% 50%;
left: calc(11px - 55px);
}
.g-ball:nth-child(68) {
animation: movetop 1s linear -1.859s infinite;
}
.g-ball:nth-child(69) {
width: 37px;
height: 37px;
radius: 50% 50%;
left: calc(3px - 55px);
}
.g-ball:nth-child(69) {
animation: movetop 1s linear -1.943s infinite;
}
.g-ball:nth-child(70) {
width: 3px;
height: 3px;
radius: 50% 50%;
left: calc(67px - 55px);
}
.g-ball:nth-child(70) {
animation: movetop 1s linear -0.797s infinite;
}
.g-ball:nth-child(71) {
width: 15px;
height: 15px;
radius: 50% 50%;
left: calc(55px - 55px);
}
.g-ball:nth-child(71) {
animation: movetop 1s linear -1.342s infinite;
}
.g-ball:nth-child(72) {
width: 2px;
height: 2px;
radius: 50% 50%;
left: calc(67px - 55px);
}
.g-ball:nth-child(72) {
animation: movetop 1s linear -1.307s infinite;
}
.g-ball:nth-child(73) {
width: 50px;
height: 50px;
radius: 50% 50%;
left: calc(30px - 55px);
}
.g-ball:nth-child(73) {
animation: movetop 1s linear -0.835s infinite;
}
.g-ball:nth-child(74) {
width: 20px;
height: 20px;
radius: 50% 50%;
left: calc(51px - 55px);
}
.g-ball:nth-child(74) {
animation: movetop 1s linear -0.22s infinite;
}
.g-ball:nth-child(75) {
width: 12px;
height: 12px;
radius: 50% 50%;
left: calc(11px - 55px);
}
.g-ball:nth-child(75) {
animation: movetop 1s linear -1.1s infinite;
}
.g-ball:nth-child(76) {
width: 7px;
height: 7px;
radius: 50% 50%;
left: calc(49px - 55px);
}
.g-ball:nth-child(76) {
animation: movetop 1s linear -2.631s infinite;
}
.g-ball:nth-child(77) {
width: 5px;
height: 5px;
radius: 50% 50%;
left: calc(67px - 55px);
}
.g-ball:nth-child(77) {
animation: movetop 1s linear -0.789s infinite;
}
.g-ball:nth-child(78) {
width: 38px;
height: 38px;
radius: 50% 50%;
left: calc(3px - 55px);
}
.g-ball:nth-child(78) {
animation: movetop 1s linear -0.031s infinite;
}
.g-ball:nth-child(79) {
width: 3px;
height: 3px;
radius: 50% 50%;
left: calc(7px - 55px);
}
.g-ball:nth-child(79) {
animation: movetop 1s linear -2.237s infinite;
}
.g-ball:nth-child(80) {
width: 37px;
height: 37px;
radius: 50% 50%;
left: calc(56px - 55px);
}
.g-ball:nth-child(80) {
animation: movetop 1s linear -1.927s infinite;
}
.g-ball:nth-child(81) {
width: 23px;
height: 23px;
radius: 50% 50%;
left: calc(12px - 55px);
}
.g-ball:nth-child(81) {
animation: movetop 1s linear -2.391s infinite;
}
.g-ball:nth-child(82) {
width: 4px;
height: 4px;
radius: 50% 50%;
left: calc(20px - 55px);
}
.g-ball:nth-child(82) {
animation: movetop 1s linear -0.828s infinite;
}
.g-ball:nth-child(83) {
width: 7px;
height: 7px;
radius: 50% 50%;
left: cal.........完整代码请登录后点击上方下载按钮下载查看
网友评论0