div+css实现一个会眨眼睛的黏土人物形象代码
代码语言:html
所属分类:布局界面
代码描述:div+css实现一个会眨眼睛的黏土人物形象代码
代码标签: div css 会 眨眼睛 黏土 人物 形象 代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> /* Drawing inspired by the cartoon on this tweet: https://twitter.com/charca/status/1845577967180947875 */ body { overflow: clip; } article { --center: 45%; /* colors */ --shirt: #e4ce61; --skin: #ddb88e; --feature: #333; --hair: #ee9247; --pants: #6ca1ba; /* color alternative */ /* --shirt: #c83; --skin: #753; --feature: #333; --hair: #321; --pants: #696; */ /* color alternative */ /* --shirt: #eee; --skin: #fdb; --feature: #333; --hair: #c9c; --pants: #369; */ font-size: 1vmin; position: absolute; bottom: 0; left: 50%; transform: translate(-50%, 0%); width: 80em; aspect-ratio: 1; overflow: hidden; } article *, article *::before, article *::after { position: absolute; box-sizing: border-box; } .pants { width: 30%; height: 20%; bottom: 0; left: var(--center); transform: translate(-50%); border-radius: 40% / 120% 120% 0 0; box-shadow: inset 0 1em 1em #0003; background: linear-gradient(182deg, #0003 30%, #0000 40%), linear-gradient(85deg, #ffffff18, #0000 60%, #0002 90%, #0001 0, #0000) 60% 0 / 12% 100% no-repeat, linear-gradient(90deg,#0001, #0000, #0001 40%, #0002 50%, #0003), var(--pants); } .shirt-back { left: var(--center); top: 52%; width: 15%; height: 20%; background: var(--shirt); box-shadow: inset 0 0 0.25em var(--shirt), inset 0 0 0 9em #0003; translate:-50% 0; } .shirt { width: var(--center); height: 35%; bottom: 14%; left: var(--center); transform: translate(-50%); -webkit-mask: radial-gradient(20% 10% at 50% 0, #0000 90%, #000 0); mask: radial-gradient(20% 10% at 50% 0, #0000 90%, #000 0); &::before { content: ""; width: 100%; height: 100%; box-shadow: inset 0 -1em 2em #0001; border-radius: 100% / 100% 100% 20% 20%; -webkit-mask: radial-gradient(54% 80% at 10% 60%, #0000 70%, #000 0) 0 0 / 55% 100% no-repeat, radial-gradient(54% 80% at 90% 60%, #0000 70%, #000 0) 100% 0 / 55% 100% no-repeat; mask: radial-gradient(54% 80% at 10% 60%, #0000 70%, #000 0) 0 0 / 55% 100% no-repeat, radial-gradient(54% 80% at 90% 60%, #0000 70%, #000 0) 100% 0 / 55% 100% no-repeat; background: radial-gradient(6% 25% at 76% 0, #00000018 50%, #0000), radial-gradient(40% 30% at 50% 25%, var(--shirt), #fff0), radial-gradient(farthest-side at 0 0, #0000 20%, #0001), radial-gradient(54% 80% at 10% 75%, #fff4 30%, #0000) 0 0 / 55% 100% no-repeat, radial-gradient(54% 80% at 10% 75%, var(--shirt) 60%, #0000) 0 0 / 55% 100% no-repeat, radial-gradient(54% 80% at 90% 75%, #0002 50%, #0000) 100% 0 / 55% 100% no-repeat, linear-gradient(#0000, #00000008 40%, #00000008 60%, #0000) 100% 0 / 80% 100% no-repeat, radial-gradient(150% 80% at 0% 100%, #0000 20%, #0000000a 60%, #0000) 100% 0 / 100% 100% no-repeat, var(--shirt); } } .shirt-arm { --x: ; width: 17%; height: 17%; top: 54.75%; left: calc(var(--center) - 24%); border-radius: 110% 0 0 0; clip-path: polygon(0 0, 100% 0, 100% 50%, 50% 90%, 0 40%); transform: rotate(-16deg); box-shadow: inset 1em 0.4em 1em #fff2; background: var(--x) radial-gradient(120% 110% at 0 10%, #0000 65%, #0003), linear-gradient(-45deg, #0002, #0000 50%) var(--shirt); & ~ & { --x: linear-gradient(#00000017 0 0),; transform: scaleX(-1) rotate(-16deg); left: calc(var(--center) + 7%); box-shadow: none; } } .arm { --a: 195deg; --x: #fff3; width: 20%; height: 50%; top: 60%; left: calc(var(--center) - 25.5%); transform: rotate(10deg); border-radius: 50% /100% 0 0 100%; -webkit-mask: radial-gradient(60% 70% at 90% 60%, #0000 99%, #000); mask: radial-gradient(60% 70% at 90% 60%, #0000 99%, #000); box-shadow: inset -4em 7em 1em #0002, inset 0.5em 0.5em 0.5em #0001, inset 1em 1em 1em var(--x); background: linear-gradient(var(--a), #a004, #0000 25%), radial-gradient(90% 80% at 90% 60%, #0002 75%, #0001 85%, #0000), var(--skin); & ~ & { --a: 198deg; --x: #0001; left: calc(var(.........完整代码请登录后点击上方下载按钮下载查看
网友评论0