From 58de9ebf3c38ca352ade7c4a5a42c7df018ea5d3 Mon Sep 17 00:00:00 2001 From: parsaa74 Date: Fri, 11 Oct 2024 17:07:27 +0330 Subject: [PATCH] Adjust canvas resolution to fit browser window - Modified index.html to remove fixed dimensions - Updated main.js to use windowWidth and windowHeight - Implemented windowResized() function for dynamic resizing --- index.html | 10 ++++++++-- main.js | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index ae8fce7..850db63 100644 --- a/index.html +++ b/index.html @@ -6,9 +6,15 @@ Post-Pandemic Loneliness + -

Post-Pandemic Loneliness Simulator

-

Click to add people. Watch how they interact (or don't) in a post-pandemic world.

+ \ No newline at end of file diff --git a/main.js b/main.js index d31c46b..873c82d 100644 --- a/main.js +++ b/main.js @@ -71,6 +71,6 @@ function displayLonelinessMetric() { fill(0); textSize(16); - text(`Loneliness Score: ${lonelinessScore.toFixed(2)}`, width / 2, 20); - text(`People: ${people.length}`, width / 2, 40); + text(`Loneliness Score: ${lonelinessScore.toFixed(2)}`, width / 2, height - 40); + text(`People: ${people.length}`, width / 2, height - 20); } \ No newline at end of file