div+css实现拖动控制头发长度效果代码
代码语言:html
所属分类:拖放
代码描述:div+css实现拖动控制头发长度效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> @charset "UTF-8"; body { display: grid; place-content: center; height: 100vh; --br: #7e671c; --dbr: #1d1f20; --p: #f5eace; --t: rgba(255, 255, 255, 0.001); background: radial-gradient(circle at center, #f7faf9 100px, #c1d7cc); } #wrap { display: flex; align-items: flex-start; justify-content: flex-start; height: 400px; width: 200px; transform: translate(-25px, 25px); } #wrap #face { width: 140px; height: 225px; background: var(--p); z-index: 0; position: absolute; left: 70px; top: 20px; box-shadow: inset 0 -2px 10px rgba(0, 0, 0, 0.5); border-radius: 300px; } #wrap #face .ear { position: absolute; width: 30px; height: 45px; background: radial-gradient(circle at right, rgba(0, 0, 0, 0.25) 10px, var(--t) 12.5px), var(--p); box-shadow: inset 2px 0px 7.5px rgba(0, 0, 0, 0.5); top: 125px; z-index: 999; left: -7.5px; border-radius: 50px 0 0 50px; -webkit-mask: linear-gradient(to left, var(--t) 5px, #000 10px); } #wrap #face:before, #wrap #face:after { content: ""; position: absolute; width: 100%; height: 100%; top: 0; left: 0; border-radius: inherit; background: radial-gradient(circle at center, var(--br) 0.5px, var(--t) 0.5px) 0px 0px/5px 5px, radial-gradient(circle at center, var(--br) 0.5px, var(--t) 0.5px) 2.5px 2.5px/5px 5px; -webkit-mask: radial-gradient(circle at top right, var(--t) 175px, #000 50px); } #wrap #face:after { -webkit-mask: linear-gradient(to bottom, #000 40px, var(--t) 40px); } #wrap #face .glasses { content: ""; position: absolute; width: 100px; height: 75px; right: -5px; top: 75px; filter: drop-shadow(0 4px 0 #000) drop-shadow(-1px 0 0 #000) drop-shadow(-2px 0 0 #000); z-index: 2; } #wrap #face .glasses:after { content: ""; position: absolute; width: 50px; height: 5px; background: #000; left: -50px; top: 0; } #wrap #face .glasses:before { content: ""; position: absolute; width: 100%; height: 100%; top: 0; left: 0; background: linear-gradient(to bottom, #000 5px, var(--t) 5px), linear-gradient(to right, #c6ffdd, #fbd786, #f7797d, #fbd786, #c6ffdd, #fbd786, #f7797d, #fbd786, #c6ffdd) 0px 100%/200% 100% no-repeat; animation: shine 10s linear infinite; clip-path: polygon(0 0, 100% 0, 100% 66%, 83% 42%, 53% 69%, 0 42%); } @keyframes shine { to { background-position: 100% 100%; } } #wrap #face .nose { position: absolute; width: 25px; height: 40px; right: 0px; top: 112.5px; } #wrap #face .nose:before { content: ""; position: absolute; width: 100%; height: 100%; top: 0; left: 0; border-radius: 0 0 100px 100p.........完整代码请登录后点击上方下载按钮下载查看
网友评论0