mirror of
https://github.com/kevinveenbirkenbach/roulette-wheel.git
synced 2025-09-10 12:17:16 +02:00
readme & set width/height of canvas & code format
This commit is contained in:
@@ -31,17 +31,11 @@ const footerEl = document.querySelector("footer")!;
|
||||
const authorsEl = document.getElementsByClassName(
|
||||
"icons-authors"
|
||||
)[0]! as HTMLDivElement;
|
||||
const canvasWrapper = document.getElementsByClassName(
|
||||
"roulette-wheel"
|
||||
)[0]! as HTMLDivElement;
|
||||
|
||||
const audio = new Audio("/static/roulette-wheel.mp3");
|
||||
|
||||
const ctx = canvasEl.getContext("2d")!;
|
||||
|
||||
canvasEl.width = canvasWrapper.offsetWidth;
|
||||
canvasEl.height = canvasWrapper.offsetHeight;
|
||||
|
||||
const MAXIMUM_SIZE = 16;
|
||||
const ROTATIONS = 20;
|
||||
const ANIMATION_FPS = 60;
|
||||
@@ -212,8 +206,7 @@ function drawRouletteWheel(angle: number) {
|
||||
ctx.lineTo(X_CENTER, Y_CENTER);
|
||||
console.log(outerHeight);
|
||||
console.log(outerWidth);
|
||||
if (outerWidth < 1280) ctx.font = "bold 10px verdana, sans-serif";
|
||||
else ctx.font = "bold 24px verdana, sans-serif";
|
||||
ctx.font = "bold 24px verdana, sans-serif";
|
||||
ctx.arc(
|
||||
X_CENTER,
|
||||
Y_CENTER,
|
||||
|
Reference in New Issue
Block a user