Skip to content

Commit

Permalink
chore: improved mobile responsiveness
Browse files Browse the repository at this point in the history
  • Loading branch information
sojijr committed Feb 5, 2024
1 parent 4f41b81 commit ccde5a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function drawTextWithLineBreaks(lines, x, y, fontSize, lineHeight) {
}

function drawText() {
var fontSize = Math.min(30, window.innerWidth / 25); // Adjust font size based on screen width
var fontSize = Math.min(30, window.innerWidth / 24); // Adjust font size based on screen width
var lineHeight = 8;

context.font = fontSize + "px Comic Sans MS";
Expand Down Expand Up @@ -202,7 +202,7 @@ function drawText() {


if (window.innerWidth < 600) {
drawTextWithLineBreaks(["and I can't wait to spend all the time in", "the world to share that love with you!"], canvas.width / 2, (canvas.height/2 + 70), fontSize, lineHeight);
drawTextWithLineBreaks(["and I can't wait to spend all the time in", "the world to share that love with you!"], canvas.width / 2, (canvas.height/2 + 60), fontSize, lineHeight);
} else {
context.fillText("and I can't wait to spend all the time in the world to share that love with you!", canvas.width/2, (canvas.height/2 + 50));
}
Expand Down

0 comments on commit ccde5a2

Please sign in to comment.