svg+css实现万圣节扮鬼化妆女孩效果代码
代码语言:html
所属分类:动画
代码描述:svg+css实现万圣节扮鬼化妆女孩效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> body { position: relative; width: 100vw; background: #B0BEC5; text-align: center; } .wrap { position: relative; width: 600px; height: 600px; margin: 50px auto; border-radius: 50%; } svg { position: absolute; top: 0; left: 0; right: 0; bottom: 0; width: 252px; height: 388px; margin: auto; overflow: visible; } .wrap_inner { position: absolute; top: 0; left: 0; right: 0; bottom: 0; margin: auto; transition: all 0.5s; } .wrap_inner:nth-child(2) { background: radial-gradient(circle at 50% 50%, #C5CAE9, #b0bec5 70%); } .wrap_inner:nth-child(3) { background: radial-gradient(circle at 50% 50%, #B2EBF2, #b0bec5 70%); } .wrap_inner:nth-child(4) { background: radial-gradient(circle at 50% 50%, #F0F4C3, #b0bec5 70%); } .wrap_inner:nth-child(5) { background: radial-gradient(circle at 50% 50%, #D7CCC8, #b0bec5 70%); } body .wrap_inner:nth-child(2), .effect3 .wrap_inner:nth-child(2), .effect5 .wrap_inner:nth-child(2), .effect7 .wrap_inner:nth-child(2) { -webkit-clip-path: polygon(0% 0%, 50% 0%, 50% 50%, 0% 50%); clip-path: polygon(0% 0%, 50% 0%, 50% 50%, 0% 50%); } body .wrap_inner:nth-child(3), .effect3 .wrap_inner:nth-child(3), .effect5 .wrap_inner:nth-child(3), .effect7 .wrap_inner:nth-child(3) { -webkit-clip-path: polygon(50% 0%, 100% 0%, 100% 50%, 50% 50%); clip-path: polygon(50% 0%, 100% 0%, 100% 50%, 50% 50%); } body .wrap_inner:nth-child(4), .effect3 .wrap_inner:nth-child(4), .effect5 .wrap_inner:nth-child(4), .effect7 .wrap_inner:nth-child(4) { -webkit-clip-path: polygon(50% 50%, 100% 50%, 100% 100%, 50% 100%); clip-path: polygon(50% 50%, 100% 50%, 100% 100%, 50% 100%); } body .wrap_inner:nth-child(5), .effect3 .wrap_inner:nth-child(5), .effect5 .wrap_inner:nth-child(5), .effect7 .wrap_inner:nth-child(5) { -webkit-clip-path: polygon(0% 50%, 50% 50%, 50% 100%, 0% 100%); clip-path: polygon(0% 50%, 50% 50%, 50% 100%, 0% 100%); } .effect2 .wrap_inner:nth-child(2) { -webkit-clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%); clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%); } .effect2 .wrap_inner:nth-child(3) { -webkit-clip-path: polygon(100% 0%, 100% 0%, 100% 100%, 100% 100%); clip-path: polygon(100% 0%, 100% 0%, 100% 100%, 100% 100%); } .effect2 .wrap_inner:nth-child(4) { -webkit-clip-path: polygon(100% 100%, 100% 100%, 100% 100%, 100% 100%); clip-path: polygon(100% 100%, 100% 100%, 100% 100%, 100% 100%); } .effect2 .wrap_inner:nth-child(5) { -webkit-clip-path: polygon(0% 100%, 100% 100%, 100% 100%, 0% 100%); clip-path: polygon(0% 100%, 100% 100%, 100% 100%, 0% 100%); } .effect4 .wrap_inner:nth-child(2) { -webkit-clip-path: polygon(0% 0%, 0% 0%, 0% 100%, 0% 100%); clip-path: polygon(0% 0%, 0% 0%, 0% 100%, 0% 100%); } .effect4 .wrap_inner:nth-child(3) { -webkit-clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%); clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%); } .effect4 .wrap_inner:nth-child(4) { -webkit-clip-path: polygon(0% 100%, 100% 100%, 100% 100%, 0% 100%); clip-path: polygon(0% 100%, 100% 100%, 100% 100%, 0% 100%); } .effect4 .wrap_inner:nth-child(5) { -webkit-clip-path: polygon(0% 100%, 0% 100%, 0% 100%, 0% 100%); clip-path: polygon(0% 100%, 0% 100%, 0% 100%, 0% 100%); } .effect6 .wrap_inner:nth-child(2) { -webkit-clip-path: polygon(0% 0%, 0% 0%, 0% 0%, 0% 0%); clip-path: polygon(0% 0%, 0% 0%, 0% 0%, 0% 0%); } .effect6 .wrap_inner:nth-child(3) { -webkit-clip-path: polygon(0% 0%, 100% 0%, 100% 0%, 0% 0%); clip-path: polygon(0% 0%, 100% 0%, 100% 0%, 0% 0%); } .effect6 .wrap_inner:nth-child(4) { -webkit-clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%); clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%); } .effect6 .wrap_inner:nth-child(5) { -webkit-clip-path: polygon(0% 0%, 0% 0%, 0% 100%, 0% 100%); clip-path: polygon(0% 0%, 0% 0%, 0% 100%, 0% 100%); } .effect8 .wrap_inner:nth-child(2) { -webkit-clip-path: polygon(0% 0%, 100% 0%, 100% 0%, 0% 0%); clip-path: polygon(0% 0%, 100% 0%, 100% 0%, 0% 0%); } .effect8 .wrap_inner:nth-child(3) { -webkit-clip-path: polygon(100% 0%, 100% 0%, 100% 0%, 100% 0%); clip-path: polygon(100% 0%, 100% 0%, 100% 0%, 100% 0%); } .effect8 .wrap_inner:nth-child(4) { -webkit-clip-path: polygon(100% 0%, 100% 0%, 100% 100%, 100% 100%); clip-path: polygon(100% 0%, 100% 0%, 100% 100%, 100% 100%); } .effect8 .wrap_inner:nth-child(5) { -webkit-clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%); clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%); } .bucket { transform-origin: 40px 207px; animation: ani_bucket 1.7s linear infinite; } @keyframes ani_bucket { 0% { transform: rotate(0deg); } 8% { transform: rotate(35deg); } 24% { transform: rotate(-35deg); } 40% { transform: rotate(35deg); } 58% { transform: rotate(-15deg); } 66% { transform: rotate(0deg); } } .switch { position: relative; z-index: 2; height: 35px; margin-top: 25px; padding: 0 15px; background: #B72327; outline: none; border: none; border-radius: 20px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: #fff; text-transform: uppercase; font-weight: bold; white-space: nowrap; font-size: 14px; line-height: 35px; cursor: pointer; } .switch:hover { background: #8c1b1e; } </style> </head> <body> <div class="wrap"> <div class="wrap_inner"> <svg xmlns="http://www.w3.org/2000/svg" width="251.7" height="386.5"><path fill="#212120" d="M196.5 123.3c0-38.1-30.9-69.1-69.1-69.1s-69 31-69 69.1v114c0 6.3 4.5 11.4 9.9 11.4h118.4c5.5 0 9.9-5.1 9.9-11.4V133.7c0-1.2-.1-8-.1-10.4z"/><circle fill="#FBE081" cx="125.9" cy="125.8" r="59.8"/><path fill="#212120" d="M69.8 98.5l120.1.1-19.1-22.4-48.6-17.1L86.5 74z"/><path fill="#664A9E" d="M140 278h-28.1c-5.5 0-9.9-4.5-9.9-9.9v-64.2c0-5.5 4.5-9.9 9.9-9.9H140c5.5 0 9.9 4.5 9.9 9.9v64.2c0 5.4-4.5 9.9-9.9 9.9z"/><path fill="#212121" d="M118.4 283.9h-12.5c-2.2 0-4 1.8-4 4v94.3c0 2.2 1.8 4 4 4h12.6c2.2 0 4-1.8 4-4v-94.3c-.1-2.2-1.9-4-4.1-4zM145.2 283.9h-10.6c-2.8 0-5 2.3-5 5v92.3c0 2.8 2.3 5 5 5h10.6c2.8 0 5-2.3 5-5v-92.3c0-2.7-2.2-5-5-5z"/><path fill="none" stroke="#212121" stroke-width="3" stroke-miterlimit="10" d="M102.5 165.7c9.3 5.2 24 9.7 39.6 0"/><circle fill="#FFF" cx="152.2" cy="128.6" r="22.6"/><circle fill="#212120" cx="152.2" cy="129.2" r="19.7"/><g class="bucket"><path fill="none" stroke="#5E4138" stroke-width="5" stroke-miterlimit="10" d="M40.8 201.6c-9.7 0-17.7 7.8-17.7 17.7v35.2h35.3v-35.2c0-9.8-7.8-17.7-17.6-17.7z"/><path fill="#3F2723" d="M65.7 241H15.9c-5.5 0-10 4.5-10 10 0 0-1.3 13.1 0 17.2 2.6 8.4 11.9 25 19.6 29.1 6.8 3.6 24.2 3.7 31 0 7.7-4.1 16.7-20.8 19.2-29.1 1.2-4.1 0-17.2 0-17.2 0-5.5-4.5-10-10-10z"/><circle fill="#FBE081" cx="41" cy="208.4" r="18.6"/></g><circle fill="#FFF" cx="97.8" cy="128.6" r="22.6"/><circle fill="#212120" cx="97.8" cy="129.2" r="19.7"/></svg> </div> <div class="wrap_inner"> <svg xmlns="http://www.w3.org/2000/svg" width="251.7" height="386.5"><path fill="#E0E1E0" d="M201.6 120.9c0-40.3-33.1-73-73.8-73S54 80.6 54 120.9v180.5c0 6.6 4.8 12.1 10.6 12.1h126.5c5.8 0 10.6-5.4 10.6-12.1V131.9c0-1.2-.1-8.5-.1-11z"/><path fill="#2D67B1" d="M196.8 123.5c0-38.1-30.9-69.1-69.1-69.1s-69 31-69 69.1v114c0 6.3 4.5 11.4 9.9 11.4H187c5.5 0 9.9-5.1 9.9-11.4V133.9c0-1.2-.1-8-.1-10.4z"/><circle fill="#72B3E2" cx="126.2" cy="126" r="59.8"/><path fill="#2D67B1" d="M70.1 98.7l47.4-9 72.7 9.1-19.1-22.4-48.6-17.1-35.7 14.9z"/><path fill="#FAFAFA" d="M140.3 278.2h-28.1c-5.5 0-9.9-4.5-9.9-9.9v-64.2c0-5.5 4.5-9.9 9.9-9.9h28.1c5.5 0 9.9 4.5 9.9 9.9v64.2c0 5.4-4.5 9.9-9.9 9.9z"/><path fill="#212121" d="M118.7 284.1h-12.5c-2.2 0-4 1.8-4 4v94.3c0 2.2 1.8 4 4 4h12.6c2.2 0 4-1.8 4-4v-94.3c-.1-2.2-1.9-4-4.1-4z"/><path fill="#E0E1E0" d="M112.3 373.6c-2.9 0-5.3-2.4-5.3-5.3v-73.2c0-2.9 2.4-5.3 5.3-5.3s5.3 2.4 5.3 5.3v73.1c0 3-2.4 5.4-5.3 5.4z"/><path fill="#72B3E2" d="M145.5 284.1h-10.6c-2.8 0-5 2.3-5 5v92.3c0 2.8 2.3 5 5 5h10.6c2.8 0 5-2.3 5-5v-92.3c0-2.7-2.2-5-5-5z"/><ellipse fill="#2D67B1" cx="95.7" cy="128.8" rx="24.4" ry="24.4"/><ellipse fill="#4890CD" cx="154.6" cy="128.8" rx="24.4" ry="24.4"/><path fill="none" stroke="#B62427" stroke-width="3" stroke-miterlimit="10" d="M102.8 165.9c9.3 5.2 24 9.7 39.6 0"/><circle fill="#4890CD" cx="97.9" cy="128.8" r="22.6"/><circle fill="#FFF" cx="152.5" cy="128.8" r="22.6"/><circle fill="#212120" cx="152.5" cy="129.4" r="19.7"/><path fill="#E0E1E0" d="M118.7 368.9h-12.5c-2.2 0-4 1.8-4 4v9.6c0 2.2 1.8 4 4 4h12.6c2.2 0 4-1.8 4-4v-9.6c-.1-2.2-1.9-4-4.1-4z"/><path fill="#212121" d="M146.5 368.9h-12.6c-2.2 0-4 1.8-4 4v9.6c0 2.2 1.8 4 4 4h12.6c2.2 0 4-1.8 4-4v-9.6c0-2.2-1.8-4-4-4z"/><path fill="none" stroke="#2B67B1" stroke-width="3" stroke-miterlimit="10" d="M152.5 172.4s4.1-12.7 18.3-18.7M98.3 172.4s-4.1-12.7-18.3-18.7"/><path fill="#8BC249" d="M98 92.7c-5.5 0-9.8 4.5-9.8 9.8v23.2c0 5.5 4.5 9.8 9.8 9.8 5.5 0 9.8-4.5 9.8-9.8v-23.1c0-5.4-4.4-9.9-9.8-9.9z"/><path fill="#8BC249" d="M101.3 109.6H95c-5.5 0-9.9-4.5-9.9-9.9v-7.4c0-5.5 4.5-9.9 9.9-9.9h6.3c5.5 0 9.9 4.5 9.9 9.9v7.4c0 5.4-4.5 9.9-9.9 9.9z"/><ellipse fill="#FFF" cx="89.9" cy="93" rx="7" ry="7.5"/><ellipse fill="#212120" cx="89.9" cy="93" rx="5.2" ry="5.6"/><ellipse fill="#FFF" cx="105.8" cy="93" rx="7" ry="7.5"/><ellipse fill="#212120" cx="105.8" cy="93" rx="5.2" ry="5.6"/><path fill="#FFF" d="M91.7 102.1h4.8v6.7h-4.8zM98.7 102.1h4.8v6.7h-4.8z"/><path fill="#E0E1E0" d="M71.3 76.2L97 57.8l29.8-7.7 27.8 6 31.4 24 6.3 11z"/><circle fill="#2D67B1" cx="167" cy="73" r="10"/><circle fill="#2D67B1" cx="142.4" cy="66.2" r="10"/><circle fill="#2D67B1" cx="112.9" cy="64.5" r="10"/><circle fill="#2D67B1" cx="86.6" cy="70.1" r="10"/><path fill="#FAFAFA" d="M89.2 364.5h16l19.5-99-22.4 1.5z"/><path fill="#FAFAFA" d="M150.2 268.3l13.5 96h-35.9L114 286l8.8-21.5z"/><path fill="#212121" d="M117.3 241.2h-9.5c-2.8 0-5-2.3-5-5v-12c0-2.8 2.3-5 5-5h9.5c2.8 0 5 2.3 5 5v12c0 2.8-2.3 5-5 5z"/><path fill="#E0E1E0" d="M102.8 222.2h19.5v6.3h-19.5zM102.8 231.2h19.5v6.3h-19.5z"/><g class="bucket"><path fill="#FFF" d="M61.2 257.2H20.9v-37.7c0-11.1 9.1-20.2 20.2-20.2s20.1 9.1 20.1 20.2v37.7zm-35.3-5h30.3v-32.7c0-8.4-6.8-15.2-15.1-.........完整代码请登录后点击上方下载按钮下载查看
网友评论0