JSFiddle - React, Tailwind, and code Playground

by linzoey

JavaScript

var draw = SVG().addTo('body').size(1080, 1920)


const starPoints = [];
for (let i = 0; i < 10; i++) {
  const radius = i % 2 === 0 ? 75 : 35;
  const angle = (i * Math.PI) / 5;
  const x = 200 + radius * Math.cos(angle);
  const y = 200 + radius * Math.sin(angle);
  starPoints.push(x, y);
}

let star = draw.polygon(starPoints).fill('none').stroke({ width: 2, color: 'black' }).rotate(125);