Skip to content

Commit 9516527

Browse files
Update index.html
1 parent b86bbf7 commit 9516527

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

index.html

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@
238238
/*
239239
Godel's Gauntlet is an impossible game due to self-referencing of the player's position.
240240
You must win by contradicting the coded rules of the game and changing the source code.
241-
(Or for the lazy peek at the source code.) This game is a playful take on Godel's incompleteness
242-
theorems. To join my semi-secret math hacker club, please dm me the answer to the following riddle:
241+
(Or for the lazy peek at the source code.) To join my semi-secret math hacker club,
242+
please dm me the answer to the following riddle:
243243
244244
When you measure how I rise over time, you are just measuring me, what am I?
245245
*/
@@ -256,14 +256,25 @@
256256
}, 1000);
257257
}
258258

259+
// Get canvas width
260+
var canvasWidth = canvas.width;
261+
262+
// Calculate font size based on canvas width
263+
var welcomeFontSize = canvasWidth * 0.05; // Adjust the multiplier to get a suitable font size
264+
var instructionFontSize = canvasWidth * 0.03; // Adjust the multiplier to get a suitable font size
265+
266+
// Ensure the font size is not too small or too large
267+
welcomeFontSize = Math.max(Math.min(welcomeFontSize, 36), 18); // limit the font size between 18px and 36px
268+
instructionFontSize = Math.max(Math.min(instructionFontSize, 24), 12); // limit the font size between 12px and 24px
269+
259270
// Draw the welcome text
260271
ctx.fillStyle = "#AA6C39"; // or any color you prefer
261-
ctx.font = "36px Arial"; // size and font face
272+
ctx.font = welcomeFontSize + "px Arial"; // size and font face
262273
ctx.textAlign = "center"; // alignment
263274
ctx.fillText("Welcome to Gödel's Gauntlet", canvas.width/2, 110); // text and position
264275

265276
// Draw the instruction text
266-
ctx.font = "24px Arial"; // size and font face
277+
ctx.font = instructionFontSize + "px Arial"; // size and font face
267278
ctx.textAlign = "center"; // alignment
268279
ctx.fillStyle = "#7E909A"; // or any color you prefer
269280
ctx.fillText("Click to move the circle towards the keyhole", canvas.width/2, 150); // text and position

0 commit comments

Comments
 (0)