survivors: only displaying the controls if we are on mobile

adding method to detect if mobile
This commit is contained in:
Sheldan
2025-09-08 22:52:10 +02:00
parent 681ba1b632
commit add005d963
2 changed files with 21 additions and 7 deletions

View File

@@ -7,6 +7,10 @@ export function fillDot(position: Vector, size: number, color: string, ctx: Canv
ctx.fill();
}
export function isMobile() {
return /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);
}
export function drawDot(position: Vector, size: number, color: string, ctx: CanvasRenderingContext2D) {
ctx.beginPath();
ctx.strokeStyle = color;