css3基于transform和animation属性绘制卡通木柴燃烧的篝火动画场景特效。
使用方法
1、head引入css文件
<link type="text/css" href="css/style.css" rel="stylesheet" />2、body引入HTML代码
<div class="stage"> <div class="campfire"> <div class="sparks"> <div class="spark"></div> <div class="spark"></div> <div class="spark"></div> <div class="spark"></div> <div class="spark"></div> <div class="spark"></div> <div class="spark"></div> <div class="spark"></div> </div> <div class="logs"> <div class="log"> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> </div> <div class="log"> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> </div> <div class="log"> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> </div> <div class="log"> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> </div> <div class="log"> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> </div> <div class="log"> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> </div> <div class="log"> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> <div class="streak"></div> </div> </div> <div class="sticks"> <div class="stick"></div> <div class="stick"></div> <div class="stick"></div> <div class="stick"></div> </div> <div class="fire"> <div class="fire__red"> <div class="flame"></div> <div class="flame"></div> <div class="flame"></div> <div class="flame"></div> <div class="flame"></div> <div class="flame"></div> <div class="flame"></div> </div> <div class="fire__orange"> <div class="flame"></div> <div class="flame"></div> <div class="flame"></div> <div class="flame"></div> <div class="flame"></div> <div class="flame"></div> <div class="flame"></div> </div> <div class="fire__yellow"> <div class="flame"></div> <div class="flame"></div> <div class="flame"></div> <div class="flame"></div> <div class="flame"></div> </div> <div class="fire__white"> <div class="flame"></div> <div class="flame"></div> <div class="flame"></div> <div class="flame"></div> <div class="flame"></div> <div class="flame"></div> <div class="flame"></div> </div> </div> </div> </div>