gsap+svg实现火苗燃烧动画效果代码
代码语言:html
所属分类:动画
代码描述:gsap+svg实现火苗燃烧动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> body { font-family: sans-serif; width: 100%; height: 100vh; display: flex; justify-content: space-around; } svg { width: 80px; max-height: 90%; } </style> </head> <body> <!-- partial:index.partial.html --> <svg class="fire" viewBox="0 -20 120 240"> <defs> <linearGradient id="fire-gradient-basic" x1="0%" y1="0%" x2="0%" y2="100%"> <stop stop-color="#ffb200" offset="0.2" /> <stop stop-color="#dc0000" offset="1" /> </linearGradient> <linearGradient id="fire-gradient-red" x1="0%" y1="0%" x2="0%" y2="100%"> <stop stop-color="#ffb200" offset="0" /> <stop stop-color="#dc0000" offset="0.9" /> </linearGradient> <linearGradient id="fire-gradient-yellow" x1="0%" y1="0%" x2="0%" y2="100%"> <stop stop-color="#ffb200" offset="0.3" /> <stop stop-color="#dc0000" offset="1" /> </linearGradient> </defs> <g stroke-width="0.5" stroke-opacity="0.5"> <path class="spark" fill="#ffd700" stroke="#ff0" d="M13 90c-8,-10 -6,-14 -5,-21 3,-3 0,-7 -2,-19 8,11 18,12 7,40l0 0z"></path> <path class="spark" fill="#ffd700" stroke="#ff0" d="M36 45c8,-10 6,-14 5,-21 -3,-3 0,-7 2,-19 -8,11 -18,12 -7,40l0 0z"></path> <path class="spark" fill="#ffd700" stroke="#ff0" d="M63 48c8,-10 6,-14 5,-21 -3,-3 0,-7 2,-19 -8,11 -18,12 -7,40l0 0z"></path> <path class="spark" fill="#ffd700" stroke="#ff0" d="M83 80c-8,-10 -6,-14 -5,-21 3,-3 0,-7 -2,-19 8,11 18,12 7,40l0 0z"></path> <path class="spark" fill="#ffd700" stroke="#ff0" d="M94 126c8,-10 6,-14 5,-21 -3,-3 0,-7 2,-19 -8,11 -18,12 -7,40l0 0z"></path> <path class="flame" fill="url(#fire-gradient-basic)" stroke="#ff0" d="M46 50c1,13 -15,26 -13,44 0,11 -4,-17 -2,-26 -1,-8 -3,-16 -9,-21 8,42 -28,33 -5,88 -4,-2 -8,-4 -12,-7 4,13 9,21 15,28 9,9 21,13 39,16 13,4 28,2 38,-6 10,-7 15,-19 12,-34 -3,6 -7.........完整代码请登录后点击上方下载按钮下载查看
网友评论0