canv.ctx.save();
canv.ctx.translate(centerX, centerY);
let startAngle = 0;
for (let j = 0; j < text.length; j++) {
const charWid = canv.ctx.measureText(text[j]).width;
const textHeight = /* укажите высоту текста */;
const angle = (charWid / (this.data.diameter / 2 - textHeight)) * clockwise;
startAngle += angle / 2;
const x = Math.cos(startAngle) * (this.data.diameter / 2 - textHeight / 2);
const y = -Math.sin(startAngle) * (this.data.diameter / 2 - textHeight / 2);
drawnPoints.push({ x, y, symbol: text[j] });
canv.ctx.rotate(angle);
canv.ctx.fillText(text[j], x, y);
startAngle += angle;
}
canv.ctx.restore();
drawnPoints.forEach(point => {
canv.ctx.fillStyle = "yellow";
canv.ctx.beginPath();
canv.ctx.arc(point.x, point.y, 5, 0, 2 * Math.PI);
canv.ctx.fill();
});
(function() {
'use strict';
let timerId;
let timer = () => {
try {
const element = document.querySelector('.Tag-module_content__uLsTI');
if (element) {
const text = element.textContent;
if (text.slice(0, -1) < (-53)) {
buy("ActionAnimatedSmallButtonZone_container__Gxja8 ActionAnimatedSmallButtonZone_desktop___1slH ActionAnimatedSmallButtonZone_type-cart__1GcmO");
setTimeout(buy1, 100);
setTimeout(buy2, 100);
console.log("Сработало");
setTimeout(clsmenu, 30000);
setTimeout(rel, 35000);
timerId = setTimeout(timer, 45000);
} else {
rel();
alert(text);
timerId = setTimeout(timer, 1500);
}
} else {
rel();
console.log("Элемент не найден, повторная проверка через 1500 мс");
timerId = setTimeout(timer, 1500);
}
} catch (error) {
console.error("Произошла ошибка:", error);
timerId = setTimeout(timer, 1500); // Повторная проверка через 1500 мс
}
}
timerId = setTimeout(timer, 300);
})();