nouns image background
This commit is contained in:
parent
324e057a93
commit
88bb71c73f
|
@ -152,9 +152,8 @@ router.get('/nouns/:word.png', async (req, res) => {
|
||||||
const canvas = createCanvas(width, height);
|
const canvas = createCanvas(width, height);
|
||||||
const context = canvas.getContext('2d');
|
const context = canvas.getContext('2d');
|
||||||
|
|
||||||
context.fillStyle = '#fff';
|
const bg = await loadImage('static/bg.png');
|
||||||
context.fillRect(0, 0, width, height);
|
context.drawImage(bg, 0, 0, width, height);
|
||||||
context.fillStyle = '#000';
|
|
||||||
|
|
||||||
context.font = 'bold 64pt Quicksand';
|
context.font = 'bold 64pt Quicksand';
|
||||||
context.fillText(base, width / 2 - context.measureText(base).width / 2, 120);
|
context.fillText(base, width / 2 - context.measureText(base).width / 2, 120);
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 28 KiB |
Reference in New Issue