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