mirror of
https://github.com/Discreetly/frontend.git
synced 2026-01-08 20:38:04 -05:00
drawing coming soon
This commit is contained in:
@@ -48,10 +48,8 @@
|
||||
lastEpoch: currentEpoch,
|
||||
messagesSent: 0
|
||||
};
|
||||
console.debug('MessagesLeft() resetting epoch for room', roomId);
|
||||
return userMessageLimit;
|
||||
} else {
|
||||
console.debug('MessagesLeft() returning messages left for room', roomId);
|
||||
return userMessageLimit - $rateLimitStore[roomId].messagesSent;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,9 +9,8 @@
|
||||
// Resize function
|
||||
function resizeCanvas() {
|
||||
const parent = canvas.parentElement;
|
||||
console.log(parent);
|
||||
const parentWidth = parent!.clientWidth;
|
||||
const parentHeight = parent!.clientHeight;
|
||||
const parentHeight = parent!.clientHeight - 150;
|
||||
console.log(parentWidth, parentHeight);
|
||||
let height, width;
|
||||
|
||||
@@ -25,6 +24,7 @@
|
||||
|
||||
canvas.width = width;
|
||||
canvas.height = height;
|
||||
console.log(canvas.height, canvas.width);
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
@@ -32,6 +32,20 @@
|
||||
ctx = canvas.getContext('2d')!;
|
||||
resizeCanvas();
|
||||
window.addEventListener('resize', resizeCanvas);
|
||||
canvas.addEventListener('click', function (event) {
|
||||
const rect = canvas.getBoundingClientRect();
|
||||
const x = event.clientX - rect.left;
|
||||
const y = event.clientY - rect.top;
|
||||
});
|
||||
|
||||
ctx.font = '30px Arial'; // Set font size and type
|
||||
ctx.textAlign = 'center'; // Horizontal alignment
|
||||
ctx.textBaseline = 'middle'; // Vertical alignment
|
||||
|
||||
const centerX = canvas.width / 2;
|
||||
const centerY = canvas.height / 2;
|
||||
ctx.fillStyle = '#fa5f5f'; // Text color
|
||||
ctx.fillText('Drawing Coming soon', centerX, centerY); // Draw text
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user