1
I’m trying to create a circle with bars inside that accompanies the edge of the circle, I’m hours breaking head with this.
Here’s the code I took all day to make, but that’s not it yet,
$(function(){
var left = 50,
rotate = 0,
top = 0,
tX = 0,
tY = 100;
for (var i = 0; i <= 32; i++) {
var li = $('<li>',{class:'bar_'+i});
li.css({
'left': left+'%',
'top': '0',
'transform': "translateY(-"+tY+"%) translateX("+tX+"px) rotate("+rotate+"deg)",
'margin-top':top
});
top += 5.46875;
rotate += 2.8125;
left += 1.5625;
tX += 1.5625;
tY -= 1.5625;
$('.circle').append(li);
}
})
ul.circle { width: 310px; height: 350px; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background-color: #aaa;
border-radius: 100%; }
ul.circle li { position: absolute; width: 3px; height: 100px; background-color: #60f; list-style: none; box-sizing: border-box;
border: none; margin-left: -1.5px; }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<ul class="circle">
</ul>
I want the purple bar to follow the edge of the circle ... ta tried everything, I even thought about doing everything only in css, but I will use 128 bars of this, so styling 128 bars n goes from the right kkk, I wait, hug!
Why do you want to do it using
<ul>
and<li>
?– Leandro Angelo
vdd does not have one because, I just thought it best to use both to manipulate the <li> with jquery
– Robert Junio
I don’t understand the way you want the bars to follow the circle.
– Sam
Dude, what I want to do is like this: http://prntscr.com/ifsf6k,
– Robert Junio
Only in html, jquery and css, I know it’s possible, but I still haven’t figured out how, I’ve been all over the net for something to help me, but I haven’t found anything
– Robert Junio
But what is the manipulation you want with this code? wouldn’t it be more practical to use a svg, canvas or a real image?
– Leandro Angelo
I thought about it, I know nothing about canvas or svg, I’m thinking I’ll have to do it with pure css msm, Poq n think anything
– Robert Junio