我不擅长数学和几何,所以如果有人可以帮助我创建以下形状,我会很高兴:
所以基本上形状存在于 3 个矩形中,我让前两个与变换矩阵完美配合,但我无法让最后一个与形状匹配(参见上面的链接以获取 img)
HTML
<div class="shape">
<div class="shape-rect-one"></div>
<div class="shape-rect-two"></div>
<div class="shape-rect-three"></div>
</div>
CSS
.shape {
perspective: 1000px;
}
.shape div {
width: 100px;
height: 100px;
opacity: 0.4;
background-color: #333;
}
.shape-rect-one {
z-index: 100;
transform: matrix(1, -0.40, 0, 1, 0, 0);
-webkit-transform: matrix(1, -0.40, 0, 1, 0, 0);
}
.shape-rect-two {
z-index: 200;
transform: matrix(1, -0.40, 0, 1, 0, 0);
-webkit-transform: matrix(1, 0.40, 0, 1, 0, 0);
}
.shape-rect-three {
z-index: 300;
}