Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
  <div class="content">
    <div class="mainball">13231
      <ul class="itemwrap">
       
        
      </ul>
    </div>
  </div>
</body>
</html>
 
.content{
  margin-top: 100px;
}
.mainball {
  margin: 70px auto;
  background: #0AF135;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  line-height: 150px;
  text-align: center;
  position: relative;
}
.itemwrap {
  padding: 0;
  margin: 0;
  list-style: none;
  position: absolute;
  top: -75px;
  left: -75px;
  border: 150px solid rgba(190, 20, 20, 0);
  border-radius: 50%;
}
.itemwrap li {
  position: absolute;
  top: -120px;
  left: -5px;
  transform-origin: 5px 120px;
}
.item {
  width: 10px;
  height: 30px;
  background: #FFF;
}
  
 
var fragment = document.createDocumentFragment();
var itemnum = 36
var deg = 360 / itemnum
var r=23
var g=89
var b=9
for(var i=0;i<itemnum;i++){
  var item = document.createElement('div')
  item.className = "item"
  var bgcolor = 'rgb('+ (r+2*i)+','+(g+i)+','+b*i+')'
  item.style.background = bgcolor
  var li = document.createElement('li')
  var curdeg = deg * i
  if(curdeg>120 & curdeg<240)
    {
      li.style.display='none'
    }
  li.style.transform=`rotate(${curdeg}deg)`
  li.appendChild(item)
  fragment.appendChild(li)
}
var itemwrap = document.querySelector('.itemwrap')
itemwrap.appendChild(fragment)
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers