Instead of having divs as points you can use svg elements. Alternatively you can use the divs.
I'm calculating the position of the points on the main circle and using the coords of those points to draw the arcs.
You may try to redraw the lines using the coordinates of the points
Please read the comments in the code.
var SVG_NS = "http://www.w3.org/2000/svg";
var svg = document.querySelector("svg");
let points = [];
let arcs = [];
let c = { x: 265, y: 265 };// the center of the main circle
let r = 263;// the radius of the main circle
let n = 5;//number of points
let step = (2 * Math.PI) / n;// angle between each point
class Point {
constructor(i) {
this.p = {};
this.p.cx = c.x + r * Math.cos(i);
this.p.cy = c.y + r * Math.sin(i);
this.p.r = 5;
this.p.fill = "red";
this.el = drawSVGelmt(this.p, "circle", circles);
}
}
//create and push a new point on the points array
for (let i = -Math.PI / 2; i < (3 * Math.PI) / 2; i += step) {
points.push(new Point(i));
}
for (let i = 0; i < points.length; i++) {
let _i = i + 1 < points.length ? i + 1 : 0;
let d = `M${points[i].p.cx},${points[i].p.cy}
A${r}, ${r}, 0 0 1 ${points[_i].p.cx},${points[_i].p.cy}z`;
let o = { d: d, fill: "skyBlue" };
//create a new arc and push it to the arcs array for latter use
arcs.push(drawSVGelmt(o, "path", arcsgroup));
}
//a function to draw a new svg element and append it to a parent
function drawSVGelmt(o, tag, parent) {
let elmt = document.createElementNS(SVG_NS, tag);
for (let name in o) {
if (o.hasOwnProperty(name)) {
elmt.setAttributeNS(null, name, o[name]);
}
}
parent.appendChild(elmt);
return elmt;
}
svg{border:solid}
<svg width="530" height="530" viewBox="-5 -5 540 540" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M265 529C410.803 529 529 410.803 529 265C529 119.197 410.803 1 265 1C119.197 1 1 119.197 1 265C1 410.803 119.197 529 265 529Z" stroke="#f00" />
<path d="M265 1L13.96 183.4" stroke="#DDD7E3" stroke-miterlimit="10"/>
<path d="M265 1L109.84 478.6" stroke="#DDD7E3" stroke-miterlimit="10"/>
<path d="M265 1L420.16 478.6" stroke="#DDD7E3" stroke-miterlimit="10"/>
<path d="M109.84 478.6L13.96 183.4" stroke="#DDD7E3" stroke-miterlimit="10"/>
<path d="M265 1L516.04 183.4" stroke="#DDD7E3" stroke-miterlimit="10"/>
<path d="M420.16 478.6L516.04 183.4" stroke="#DDD7E3" stroke-miterlimit="10"/>
<path d="M420.16 478.6L13.96 183.4" stroke="#DDD7E3" stroke-miterlimit="10"/>
<path d="M516.04 183.4H13.96" stroke="#DDD7E3" stroke-miterlimit="10"/>
<path d="M516.04 183.4L109.84 478.6" stroke="#DDD7E3" stroke-miterlimit="10"/>
<path d="M420.16 478.6H109.84" stroke="#DDD7E3" stroke-miterlimit="10"/>
<g id="arcsgroup"></g>
<g id="circles"></g>
</svg>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…