mirror of
				https://github.com/kevinveenbirkenbach/roulette-wheel.git
				synced 2025-11-04 02:58:01 +00:00 
			
		
		
		
	readme & set width/height of canvas & code format
This commit is contained in:
		@@ -1,5 +1,5 @@
 | 
			
		||||
# roulette-wheel
 | 
			
		||||
 | 
			
		||||
[](https://app.netlify.com/sites/heuristic-jepsen-6c6fd2/deploys)
 | 
			
		||||
## Description
 | 
			
		||||
 | 
			
		||||
Application used for entertainment. It helps to decide if we are not determined what should we choose, do or eat etc. 
 | 
			
		||||
 
 | 
			
		||||
@@ -5,7 +5,7 @@
 | 
			
		||||
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
 | 
			
		||||
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
 | 
			
		||||
    <title>Roulette wheel</title>
 | 
			
		||||
    <script type="module" src="scripts/bundle.js"></script>
 | 
			
		||||
    <script type="module" src="dist/scripts/bundle.js"></script>
 | 
			
		||||
    <link rel="stylesheet" href="app.css" />
 | 
			
		||||
  </head>
 | 
			
		||||
  <body>
 | 
			
		||||
@@ -26,7 +26,7 @@
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="roulette-wheel">
 | 
			
		||||
      <div class="winner"></div>
 | 
			
		||||
      <canvas></canvas>
 | 
			
		||||
      <canvas width="800px" height="750px"></canvas>
 | 
			
		||||
    </div>
 | 
			
		||||
    <footer>
 | 
			
		||||
      <div hidden="true" class="icons-authors">
 | 
			
		||||
 
 | 
			
		||||
@@ -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