svg+css实现女孩风中长发飘飘动画效果代码
代码语言:html
所属分类:动画
代码描述:svg+css实现女孩风中长发飘飘动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> @-webkit-keyframes large-wave { from { -webkit-transform: rotate(0deg); } to { -webkit-transform: rotate(-15deg); } } @-webkit-keyframes medium-wave { from { -webkit-transform: rotate(0deg); } to { -webkit-transform: rotate(-12deg); } } @-webkit-keyframes small-wave { from { -webkit-transform: rotate(0deg); } to { -webkit-transform: rotate(-10deg); } } @keyframes large-wave { from { transform: rotate(0deg); } to { transform: rotate(-15deg); } } @keyframes medium-wave { from { transform: rotate(0deg); } to { transform: rotate(-12deg); } } @keyframes small-wave { from { transform: rotate(0deg); } to { transform: rotate(-10deg); } } .top { -webkit-animation: large-wave 5s infinite alternate; animation: large-wave 5s infinite alternate; } .middle { -webkit-animation: medium-wave 5.5s infinite alternate; animation: medium-wave 5.5s infinite alternate; } .bottom { -webkit-animation: small-wave 6s infinite alternate; animation: small-wave 6s infinite alternate; } @-webkit-keyframes dash { from { stroke-dashoffset: 1000; } to { stroke-dashoffset: 0; } } @keyframes dash { from { stroke-dashoffset: 1000; } to { stroke-dashoffset: 0; } } .wind { stroke-dasharray: 100; opacity: 0.25; -webkit-animation: dash 35s linear infinite; animation: dash 35s linear infinite; } html, body { min-height: 100%; position: relative; } a { position: absolute; bottom: 1em; right: 0; } </style> </head> <body> <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 800 400"> <defs> <symbol id="wind-one" viewBox="-10 -10 220 100" preserveAspectRatio="none"> <path fill="none" stroke="#0A6463" stroke-miterlimit="10" d="M198.36,63.26c-16.89-13.33-36.29-25.2-85.14-3.35 S5.9,85.45,0.39,38.61S50.27-7.5,60.57,14.63s-1.76,40.88-18.98,34.01S24.87,17.44,42.12,27.6"/> </symbol> <symbol id="wind-two" viewBox="-10 -10 220 100" preserveAspectRatio="none"> <path fill="none" stroke="#0A6463" stroke-miterlimit="10" d="M126.18,5.53C67.68-4.05,10.55-3.91,1.37,28.27 s30.53,47.04,41.45,42.04s21.94-15.4,16.15-28.88s-31.06-7-31.51,0S23.82,54.15,35,54.55"/> </symbol> <symbol id="wind-three" viewBox="-10 -10 220 100" preserveAspectRatio="none"> <path fill="none" stroke="#0A6463" stroke-miterlimit="10" d="M166.93,65.99c-16.84-8.37-57.49,2.93-73.86,6.55 S11.32,99.15,0.95,41.63C-2.49,22.5,3.78,10.82,13.74,4.87c20-11.92,54.9-0.71,56.08,19.88c1.77,30.86-29.6,38.59-42.23,13.86 c-8.94-17.5,21.22-15.44,15.86-4.22"/> </symbol> <symbol id="hair-bottom" viewBox="40 320 500 400"> <path fill="#FFFFFF" d="M470.25,367.38c37.15,8.98,41.59,17.87,47.17,36.74C523,423,533.68,479.73,378.34,520.12s-280.07-13.8-312.46-72.96S46.96,346.05,46.96,346.05s5,73.89,67.55,95.75C209,474.81,332.67,334.12,470.25,367.38z"/> <path fill="none" d="M462.41,372.75c39.75,8.75,50.35,24.11,41.07,56.59s-127.7,77.97-174.21,82.32s-103.4,26.04-202.46-12.43"/> <path fill="none" d="M475.65,381.69c12.82,4.52,23.19,13.66,23.21,25.85c0.02,17.46-10.46,26.92-36.45,41.21C407,479.22,310.11,512.77,229,510.46S91.1,477.34,91.1,477.34"/> <path fill="none" d="M475.5,385.78c13.42,11.31,14.75,12.73,16.25,18.35c1.5,5.62,4.44,9.88-7.78,18.88c-12.22,9-142.01,59.25-201.86,65.5s-160.71-1.29-190.22-32.3s-39.49-38.81-45.98-85.13c-1.16-8.32,0.42-22.56,0.42-22.56"/> <path fill="none" d="M457.56,378.11C383,385,225.5,460.82,167.59,460.73c-57.91-0.1-88.33-27.57-99.19-44.47s-19.47-28.15-21.43-70.2"/> <path fill="none" d="M459.98,391.54c-72.98,13.13-188.56,84.44-242.75,84.02c-54.2-0.43-80.09,4.09-137.66-31.56"/> </symbol> <symbol id="hair-middle" viewBox="40 320 500 400"> <path fill="#FFFFFF" d="M484.53,402.8c-1.77,19.51-82.62,62.35-104.5,68.09c-21.88,5.74-88.75,18.2-135.89-19.01s-49.18-74.04-86.83-79.13s-42.8,0.53-42.8,0.53s22.5-16.02,62.49-5.82c39.99,10.2,36.97,21.87,70.99,23.99c51.65,3.22,125.63-57.1,169.13-47.78C460.63,352.98,487.39,371.26,484.53,402.8z"/> <path fill="none" d="M458.78,423c-33.11-0.34-47.46,7.3-83.62,22.65C339,461,286.55,453.21,238.93,430.23c-23.26-11.23-35.83-21.27-35.83-21.27c25.42,25.82,62.29,51.65,120.02,52.83s97.65-14.74,125.98-33.12"/> <path fill="none" d="M440,393.75c-25.42,30.6-54.21,47.76-98.33,46.32s-76.35-6.83-111.01-23.12s-40.56-25.4-40.56-25.4"/> <path fill="none" d="M455.46,384c-33.19,0.66-78.63,39.84-106.79,42.65c-28.16,2.81-84.06,3.34-129.31-22.25c-18.64-10.54-38.79-22.04-38.79-22.04"/> <path fill="none" d="M465,384c-50.32-21.39-90.41-7.14-124.04,13.26s-89.44,11.9-137.87-7.83c-48.43-19.73-31.51-21.63-86.14-18.37"/> <path fill="none" d="M468.37,380.3c-100.7-39.3-160.13,10.83-189.91,16.43c-29.79,5.6-100.44-22.65-122.09-28.66c-9.7-2.69-35.19,1.71-35.19,1.71"/> </symbol> <symbol id="body" viewBox="40 320 500 400"> <path fill="#CB42A4" d="M437.5,629.45c1.44,22.42,9.09,41.22,9.09,41.22h9.91c0,0-2.29-34.04,0.94-40.36S437.5,629.45,437.5,629.45z"/> <path fill="#CB42A4" d="M464.38,629.12c2.62,9.25,4.89,26.79,3,38.42c4.61,0.77,9.88,1.34,9.88,1.34s0.88-8.22,1.62-10.88c0.59-2.1,2.88-15.38,2.88-19.88S481,627.25,481,627.25L464.38,629.12z"/> <ellipse transform="matrix(0.9582 -0.2862 0.2862 0.9582 -110.5383 139.1237)" fill="#FBD6B1" cx="420.65" cy="447.7" rx="5.96" ry="5.5"/> <ellipse transform="matrix(0.9636 0.2675 -0.2675 0.9636 136.1582 -115.0723)" fill="#FBD6B1" cx="490.38" cy="442.15" rx="7.14" ry="6.17"/> <ellipse transform="matrix(0.8409 0.5413 -0.5413 0.8409 379.3112 -127.7332)" fill="#FBD6B1" cx="406.87" cy="581.15" rx="10.16" ry="12.53"/> <ellipse transform="matrix(0.8865 -.........完整代码请登录后点击上方下载按钮下载查看
网友评论0