TweenMax+svg实现火柴燃烧动画效果代码
代码语言:html
所属分类:动画
代码描述:TweenMax+svg实现火柴燃烧动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> body { background-color: #212121; } #match { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); } .goToDemo { display: block; position: absolute; top: 30px; left: 50%; transform: translateX(-50%); color: #fff; text-decoration: none; text-transform: uppercase; padding: 10px 15px; border: 1px #fff solid; opacity: 0.7; transition: all 0.3s linear; } .goToDemo:hover { background: #fff; color: #212121; opacity: 1; } </style> </head> <body> <svg id="match" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/" x="0px" y="0px" width="94.5px" height="177.7px" viewBox="0 0 94.5 177.7" enable-background="new 0 0 94.5 177.7" xml:space="preserve"> <defs> <clipPath id="matchStickMask"> <rect id="matchMask" fill="#ffffff" x="0" y="71" width="96.2" height="106.7"/> </clipPath> </defs> <g id="Match"> <path id="flame5" class="flame" fill="#F5CD08" d="M2.2,119.1c0,0,1.5,5.5,5.4,3.1c6-3.6-4.5-10-0.7-16.8C4.5,106.1,0.3,109.4,2.2,119.1z"/> <path id="flame3" class="flame" fill="#F5CD08" d="M19.2,132.1c0,0-24.4-4.6-16.7-24.6s16.7-17.8,11.4-28.7c-4.5-9.3-2.9-11.9-0.8-15.6 c4.6-8.3,1.5-12.6,0.8-16.1c3,1.3,5.5,3.4,6.6,5.5c1.3,4.3,0.8,8.5-1.3,13.8s3.1,5.5,6.1,2.5s3.1-2.9,4.8-5.3 c2.7,2.5,2.3,5.5,3.4,8.1c1.6,3.9,2.4,6.9,0,13.7c-2.4,6.9,9.3,13.2,7.2,20.3S39.7,132.1,19.2,132.1z"/> <path id="flame2" class="flame" fill="#F5CD08" d="M25.9,53.9c0,0,1,3.8,3.7,2.2c4.1-2.5-3.1-6.9-0.5-11.5C27.5,45,24.6,47.2,25.9,53.9z"/> <path id="flame1" class="flame" fill="#F5CD08" d="M14.3,6.6c0,0,0.7,2.6,2.6,1.5c2.9-1.7-2.2-4.8-0.3-8.1C15.4,0.3,13.4,1.9,14.3,6.6z"/> <g id="matchStick" clip-path="url(#matchStickMask)"> <g id="matchBody"> <rect x="52.5" y="109.3" transform="matrix(0.7071 -0.7.........完整代码请登录后点击上方下载按钮下载查看
网友评论0