gsap+svg实现星球大战飞船追击动画效果代码
代码语言:html
所属分类:动画
代码描述:gsap+svg实现星球大战飞船追击动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> body { font-family: "proxima-nova", sans-serif; padding: 0; margin: 0; display: flex; min-height: 100vh; background-image: linear-gradient( 230deg, rgba(27, 24, 31, 1) 21.2%, rgba(50, 4, 89, 1) 84.8% ); overflow: hidden; flex-direction: column; justify-content: center; align-items: center; } #demo { overflow: visible; max-width: 96vw; max-height: 60vh; } #letters { fill: #ffe81f; } #flightPath { stroke: none; } #planet { position: absolute; left: -20vw; top: 10vh; z-index: -1; opacity: 0.2; width: 75vw; height: auto; } </style> </head> <body > <img id="planet" src="//repo.bfw.wiki/bfwrepo/icon/62731fbb8319e.webp" /> <svg id="demo" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 900 400" > <g id="battle"> <path id="flightPath" fill="none" stroke="#010101" stroke-miterlimit="10" d="M450,200L347.6,302.3c-56.5,56.5-148.2,56.5-204.7,0 c0,0,0,0,0,0l0,0c-56.5-56.5-56.5-148.2,0-204.7l0,0c56.5-56.5,148.2-56.5,204.7,0L450,200l102.4,102.3 c61.9,61.9,153.5,51.2,204.7,0l0,0c56.5-56.5,56.5-148.2,0-204.7l0,0c-56.5-56.5-148.2-56.5-204.7,0L450,200z"/> <g id="fighter"> <path fill="#E5E5E5" stroke="#3A3B3A" stroke-width="0.4802" stroke-miterlimit="20" d="M-12.8,34v-0.6l26.1-0.6h0.1 c0,0,0.1,0,0.1,0s0.1,0,0.1-0.1c0,0,0,0,0.1,0c0,0,0-0.1,0.1-0.1l0-0.1c0,0,0-0.1,0-0.1v-0.2c0,0,0-0.1,0-0.1c0,0,0-0.1,0-0.1 l-0.1-0.1c0,0-0.1,0-0.1-0.1c0,0,0,0-0.1,0c0,0-0.1,0-0.1,0h-0.1l-26.1-0.6v-0.6c0-0.3-0.2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.1-0.1,0.2-0.2,0.2-0.4v0h3.5l3.5,17c0,0.1,0,0.1,0,0.2l0.3,1.5h-2.5 c-0.1,0-0.2,0.1-0.2,0.2c0,0,0,0,0,0v2.6c0,0.1,0.1,0.2,0.2,0.2c0,0,0,0,0,0h13.4v0.2c0,0.3,0.2,0.5,0.5,0.5h1.3 C-13,34.4-12.8,34.3-12.8,34C-12.8,34-12.8,34-12.8,34z"/> <polygon fill="#E5E5E5" stroke="#3A3B3A" stroke-width="0.4802" stroke-miterlimit="20" points="-12.8,-32.4 -6.6,-32.3 -12.8,-32.2 "/> <rect x="-14.1" y="-33.5" fill="#E5E5E5" stroke="#3A3B3A" stroke-width="0.4802" stroke-miterlimit="20" width="0.4" height="2.5"/> <rect x="-33.5" y="-11" fill="#989898" stroke="#3A3B3A" stroke-width="0.4802" stroke-miterlimit="20" width="8" height="2.4"/> <path fill="#7C1D16" stroke="#3A3B3A" stroke-width="0.4802" stroke-miterlimit="20" d="M-25.5-13v1.1H-29l1-4.9h11.6v3.4H-25 C-25.3-13.6-25.5-13.4-25.5-13C-25.5-13.1-25.5-13.1-25.5-13z"/> <rect x="-24.5" y="-12.5" fill="#E5E5E5" stroke="#3A3B3A" stroke-width="0.4802" stroke-miterlimit="20" width="6.9" height="5.3"/> <rect x="-16.7" y="-12.5" fill="#E5E5E5" stroke="#3A3B3A" stroke-width="0.4802" stroke-miterlimit="20" width="3.1" height="5.3"/> <path fill="#E5E5E5" stroke="#3A3B3A" stroke-width="0.4802" stroke-miterlimit="20" d="M-25.5-6.7H-30l0.2-1h4.3L-25.5-6.7 C-25.5-6.7-25.5-6.7-25.5-6.7z"/> <polygon fill="#E5E5E5" stroke="#3A3B3A" stroke-width="0.4802" stroke-miterlimit="20" points="-16.4,-17.9 -27.8,-17.9 -25.1,-30.6 -16.4,-30.6 -16.4,-17.9 "/> <path fill="#B4B4B4" stroke="#3A3B3A" stroke-width="0.4802" stroke-miterlimit="20" d="M-23.5-31.6h-4.3v-1.2h12.7v1.2H-23.5z"/> <polygon fill="#989898" stroke="#3A3B3A" stroke-width="0.4802" stroke-miterlimit="20" points="-34.4,-11.5 -34.4,-8.1 -37.5,-8.6 -37.5,-11.1 "/> <polygon fill="#E5E5E5" stroke="#3A3B3A" stroke-width="0.4802" stroke-miterlimit="20" points="-16.3,30.6 -25.1,30.6 -27.7,17.9 -16.3,17.9 -16.3,30.6 "/> <rect x="-33.5" y="8.6" fill="#989898" stroke="#3A3B3A" stroke-width="0.4802" stroke-miterlimit="20" width="8" height="2.4"/> <path fill="#E5E5E5" stroke="#3A3B3A" stroke-width="0.4802" stroke-miterlimit="20" d="M-16.6,7.2h3.2v5.3h-3.1L-16.6,7.2 L-16.6,7.2z"/> <rect x="-24.5" y="7.2" fill="#E5E5E5" stroke="#3A3B3A" stroke-width="0.4802" stroke-miterlimit="20" width="6.9" height="5.3"/> <path fill="#7C1D16" stroke="#3A3B3A" stroke-width="0.4802" stroke-miterlimit="20" d="M-29,12h3.4V13c0,0.3,0.2,0.5,0.5,0.5h8.7 v3.4h-11.6L-29,12z"/> <path fill="#7C1D16" stroke="#3A3B3A" stroke-width="0.4802" stroke-miterlimit="20" d="M-4.6,4.5L6.5,2.6l0.2,0H17v0 c0,0.1,0.1,0.3,0.2,0.4l0,0l-33.........完整代码请登录后点击上方下载按钮下载查看
网友评论0