|
|
@ -30,30 +30,30 @@ module.exports = class Podium {
|
|
|
|
ctx.drawImage(image2, 96, 236, 225, 225);
|
|
|
|
ctx.drawImage(image2, 96, 236, 225, 225);
|
|
|
|
ctx.drawImage(image3, 853, 236, 225, 225);
|
|
|
|
ctx.drawImage(image3, 853, 236, 225, 225);
|
|
|
|
ctx.drawImage(background, 0, 0, 1173, 686);
|
|
|
|
ctx.drawImage(background, 0, 0, 1173, 686);
|
|
|
|
let maxWidth = 20
|
|
|
|
let maxWidth = 80;
|
|
|
|
if (name1.length > 5) maxWidth = 150;
|
|
|
|
if (name1.length > 5) maxWidth = 150;
|
|
|
|
if (name1.length > 10) maxWidth = 250;
|
|
|
|
if (name1.length > 10) maxWidth = 250;
|
|
|
|
if (name1.length > 20) maxWidth = 350;
|
|
|
|
if (name1.length > 20) maxWidth = 350;
|
|
|
|
ctx.textAlign = 'center';
|
|
|
|
ctx.textAlign = 'center';
|
|
|
|
ctx.font = applyText(canvas, name1, 80, maxWidth, "Comic Sans MS");
|
|
|
|
ctx.font = applyText(canvas, name1, 80, maxWidth, "Comic Sans MS");
|
|
|
|
ctx.fillStyle = `#513d34`
|
|
|
|
ctx.fillStyle = `#513d34`;
|
|
|
|
ctx.fillText(name1, 580, 575)
|
|
|
|
ctx.fillText(name1, 580, 575);
|
|
|
|
maxWidth = 80
|
|
|
|
maxWidth = 80;
|
|
|
|
if (name2.length > 5) maxWidth = 150;
|
|
|
|
if (name2.length > 5) maxWidth = 150;
|
|
|
|
if (name2.length > 10) maxWidth = 180;
|
|
|
|
if (name2.length > 10) maxWidth = 180;
|
|
|
|
if (name2.length > 20) maxWidth = 240;
|
|
|
|
if (name2.length > 20) maxWidth = 240;
|
|
|
|
ctx.textAlign = 'center';
|
|
|
|
ctx.textAlign = 'center';
|
|
|
|
ctx.font = applyText(canvas, name2, 50, maxWidth, "Comic Sans MS");
|
|
|
|
ctx.font = applyText(canvas, name2, 50, maxWidth, "Comic Sans MS");
|
|
|
|
ctx.fillStyle = `#513d34`
|
|
|
|
ctx.fillStyle = `#513d34`;
|
|
|
|
ctx.fillText(name2, 210, 540)
|
|
|
|
ctx.fillText(name2, 210, 540);
|
|
|
|
maxWidth = 80
|
|
|
|
maxWidth = 80;
|
|
|
|
if (name3.length > 5) maxWidth = 150;
|
|
|
|
if (name3.length > 5) maxWidth = 150;
|
|
|
|
if (name3.length > 10) maxWidth = 180;
|
|
|
|
if (name3.length > 10) maxWidth = 180;
|
|
|
|
if (name3.length > 20) maxWidth = 240;
|
|
|
|
if (name3.length > 20) maxWidth = 240;
|
|
|
|
ctx.textAlign = 'center';
|
|
|
|
ctx.textAlign = 'center';
|
|
|
|
ctx.font = applyText(canvas, name3, 50, maxWidth, "Comic Sans MS");
|
|
|
|
ctx.font = applyText(canvas, name3, 50, maxWidth, "Comic Sans MS");
|
|
|
|
ctx.fillStyle = `#513d34`
|
|
|
|
ctx.fillStyle = `#513d34`;
|
|
|
|
ctx.fillText(name3, 970, 540)
|
|
|
|
ctx.fillText(name3, 970, 540);
|
|
|
|
return canvas.toBuffer();
|
|
|
|
return canvas.toBuffer();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|