最近需要做了一个云台控制的样式 大概效果输入下:
所需要的图标是这样式儿的: (网上找了好几篇文章没有图标 特别是icon.png是正三角形)
图片可以在这里下载:https://www.iconfont.cn/(阿里巴巴矢量图标库)
感觉自己找图标比较麻烦的话就可以直接到这里下载我的demo
地址:https://download.csdn.net/download/laolu123456789/16682318
具体test.html代码如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>八方向云台控制器</title>
<style>
.pie {
position: relative;
/* margin: 20px auto; */
padding: 0;
width: 324px;
height: 324px;
border-radius: 50%;
list-style: none;
overflow: hidden;
background:url('bg.png') no-repeat center center / 100% 100%;
}
.center{
position: absolute;
width: 120px;
height: 120px;
top: 102px;
left: 102px;
border-radius: 50%;
background: url('paly.png') no-repeat center center / 60% 60%;
}
.pie2{
position: absolute;
margin: 20px auto;
left: 35px;
}
.slice {
overflow: hidden;
position: absolute;
top: 0;
right: 0;
width: 50%;
height: 50%;
transform-origin: 0% 100%;
}
.slice-one {
transform: rotate(-22.5deg) skewY(-45deg);
}
.slice-one img{
transform: skewY(45deg) rotate(22.5deg);
margin-top: 100px;
margin-left: 30px;
}
.slice-two {
transform: rotate(22.5deg) skewY(-45deg);
}
.slice-two img{
transform: skewY(45deg) rotate(22.5deg);
margin-top: 100px;
margin-left: 30px;
}
.slice-three {
transform: rotate(67.5deg) skewY(-45deg);
}
.slice-three img{
transform: skewY(45deg) rotate(22.5deg);
margin-top: 100px;
margin-left: 30px;
}
.slice-four {
transform: rotate(112.5deg) skewY(-45deg);
}
.slice-four img{
transform: skewY(45deg) rotate(22.5deg);
margin-top: 100px;
margin-left: 30px;
}
.slice-five {
transform: rotate(157.5deg) skewY(-45deg);
}
.slice-five img{
transform: skewY(45deg) rotate(22.5deg);
margin-top: 100px;
margin-left: 30px;
}
.slice-six {
transform: rotate(202.5deg) skewY(-45deg);
}
.slice-six img{
transform: skewY(45deg) rotate(22.5deg);
margin-top: 100px;
margin-left: 30px;
}
.slice-seven {
transform: rotate(247.5deg) skewY(-45deg);
}
.slice-seven img{
transform: skewY(45deg) rotate(22.5deg);
margin-top: 100px;
margin-left: 30px;
}
.slice-eight {
transform: rotate(292.5deg) skewY(-45deg);
}
.slice-eight img{
transform: skewY(45deg) rotate(22.5deg);
margin-top: 100px;
margin-left: 30px;
}
</style>
</head>
<body>
<div class='pie'>
<li class='slice-one slice'><img style="height: 30px;" src="icon.png" alt=""></li>
<li class='slice-two slice'> <img style="height: 30px;" src="icon.png" alt=""></li>
<li class='slice-three slice'> <img style="height: 30px;" src="icon.png" alt=""></li>
<li class='slice-four slice'> <img style="height: 30px;" src="icon.png" alt=""></li>
<li class='slice-five slice'><img style="height: 30px;" src="icon.png" alt=""> </li>
<li class='slice-six slice'> <img style="height: 30px;" src="icon.png" alt=""></li>
<li class='slice-seven slice'><img style="height: 30px;" src="icon.png" alt=""> </li>
<li class='slice-eight slice'> <img style="height: 30px;" src="icon.png" alt=""></li>
<div class="center"></div>
</div>
<div class='pie2'>
<div>
<img style="height: 50px; margin: 0 50px 0 0;" src="scene+.png" alt="">
<img style="height: 50px; margin: 0 50px 0 0;" src="focal+.png" alt="">
<img style="height: 50px; margin: 0 0 0 0;" src="aperture-.png" alt="">
</div>
<div>
<img style="height: 50px; margin: 0 50px 0 0;" src="scene-.png" alt="">
<img style="height: 50px; margin: 0 50px 0 0;" src="focal-.png" alt="">
<img style="height: 50px; margin: 0 0 0 0;" src="aperture+.png" alt="">
</div>
</div>
</body>
</html>
最后参考地址是:https://blog.csdn.net/m0_46538057/article/details/110039599#comments_15910648