请马上登录,朋友们都在花潮里等着你哦:)
您需要 登录 才可以下载或查看,没有账号?立即注册
x
<style>
#ma {
width: 200px;
height: 200px;
left: calc(50% - 100px);
top: calc(50% - 100px);
hadow(2px 2px 8px gray);
position: absolute;
}
.son {
inset: 0 0 50% 0;
background: currentColor;
clip-path: polygon(80% 0,100% 0,100% 40%,50% 100%,80% 0);
transform-origin: 50% 100%;
transform: rotate(var(--a));
position: absolute;
--a: 0deg;
}
</style>
<div id="ma">
<div class="son"></div>
</div>
<script>
let tt = 12;
Array.from({length: tt}).forEach((d,k) => {
d = document.createElement('div');
d.classList.add('son');
d.style.cssText += `
color: #${Math.random().toString(16).substring(2,8)};
--a: ${360/tt*k}deg;
`;
ma.appendChild(d);
});
</script>
|