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="M.........完整代码请登录后点击上方下载按钮下载查看
网友评论0