div+css布局实现方块人效果代码
代码语言:html
所属分类:布局界面
代码描述:div+css布局实现方块人效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
* {
box-sizing: border-box;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
scroll-behavior: smooth;
}
html,
body {
height: 100%;
overflow: hidden;
}
body {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
align-items: center;
margin: 0;
background: #1e1e1e;
background: linear-gradient(0deg, #1e1e1e 50%, #222 70%, #333);
}
/* ///////////////////// */
img {
position: absolute;
z-index: -1;
opacity: 1;
opacity: 0;
width: 700px;
translate: 130px -60px;
}
.soldier {
position: relative;
width: 200px;
height: 360px;
@media screen and (max-width: 600px) {
&:nth-child(1) {
display: none;
}
}
@media screen and (max-width: 400px) {
&:nth-child(3) {
display: none;
}
}
&::before {
content: "";
display: block;
width: 50%;
height: 22px;
background: #000;
box-shadow: 0 0 0 8px #e94d6c88;
position: absolute;
bottom: 0;
left: 0;
right: 0;
margin: auto;
filter: blur(16px);
border-radius: 100%;
}
.head {
position: absolute;
left: 0;
right: 0;
margin: auto;
width: 74%;
height: 46%;
height: 164px;
border-radius: 44% 44% 50% 50%;
box-shadow: 0 5px 8px -4px #000a, 0 -3px 2px -1px #fff2,
inset 6px 6px 3px -2px #fff5, inset 0 2px 3px 2px #fff6,
inset 0 8px 4px 10px #e94d6c, inset 0 12px 2px 7px #fff,
inset 0 12px 0 10px #691324, inset 0 14px 8px 16px #000,
inset 0 42px 12px 16px #0003, inset 0 -32px 24px 16px #000c;
background: repeating-linear-gradient(
0deg,
#888 0px,
#888 1px,
transparent 3px,
transparent 4px
),
repeating-linear-gradient(90deg, #888 0px, #888 1px, #ccc 3px, #ccc 4px);
&::before,
&::after {
content: "";
display: block;
position: absolute;
left: 0;
right: 0;
margin: auto;
width: 78%;
height: 10%;
border-radius: 100%;
box-shadow: inset 0 -4px 3px -3px #fff5, 0 8px 4px -4px #0005;
top: 64%;
}
&::after {
top: 68%;
box-shadow: inset 0 -6px 2px -4px #aaa3, 0 6px 4px -4px #0003;
}
.square,
.circle {
position: absolute;
left: 0;
right: 0;
top: 30%;
margin: auto;
width: 44%;
height: 36%;
border: 10px solid #fff;
mix-blend-mode: overlay;
}
.circle {
width: 48%;
height: 40%;
border-radius: 100%;
}
.triangle {
position: absolute;
left: 0;
right: 0;
top: 30%;
margin: auto;
width: 48%;
height: 42%;
mix-blend-mode: overlay;
background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg id='Layer_1' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 221.1 181.04'%3E%3Cpath d='m111.42,21.99c-30.24,49.13-60.49,98.26-90.73,147.39,60-.46,120-.92,180-1.39-29.76-48.67-59.51-97.33-89.27-146Z' style='fill: none; stroke:%23fff; stroke-miterlimit:10; stroke-width:28px;'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-size: contain;
}
}
.body {
width: 42%;
height: 38%;
position: absolute;
bottom: 22%;
left: 0;
right: 0;
margin: auto;
border-radius: 100px;
background: #fc91a2;
box-shadow: inset -4px 2px 6px -2px #0006, inset 2px 4px 6px 2px #fff6,
inset 0 -22px 22px -20px #000, inset 0 0 18px 20px #f94b64;
.zip-down {
width: 12px;
height: 84%;
background: linear-gradient(
90deg,
#333 0%,
transparent 16%,
transparent 36%,
#333 50%,
transparent 64%,
transparent 84%,
#333 100%
),
linear-gradient(#000, #888 60%, #888 70%, #000);
position: absolute;
left: 0;
right: 0;
margin: auto;
box-shadow: -3px 0 3px -3px #fffb, 3px 0 3px -3px #fffb;
}
.pocket {
position: absolute;
left: 56%;
right: 0;
margin: auto;
top: 30%;
width: 24px;
height: 24px;
box-shadow: inset 0 2px 2px -1px #fffa, inset 0 -3px 1px -1px #0002,
0 -2px 3px -1px #0001, 0 2px 2px 0px #0006;
border-radius: 3px;
&::before {
content: "";
display: block;
width: 108%;
height: 50%;
position: absolute;
left: -4%;
box-shadow: 0 2.4px 1px -0.3px #0006;
}
&::after {
content: "";
display: block;
width: 8px;
height: 8px;
position: absolute;
top: 2px;
left: 0;
right: 0;
margin: auto;
border-radius: 100px;
box-shadow: inset 0 2.4px 0.6px -0.3px #fff6, 0 2.4px 0.6px -0.3px #0006;
}
}
.belt {
position: absolute;
left: 0;
ri.........完整代码请登录后点击上方下载按钮下载查看
网友评论0