Skip to content

Commit

Permalink
added responsiveness and good canvas outlining
Browse files Browse the repository at this point in the history
Fixed the canvas structure for mobile devices also
  • Loading branch information
ashish4kmax authored Apr 3, 2024
1 parent 4191f42 commit 9e0265c
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,31 @@
.my-element {
font-size: 10px;
}

/* Adjust canvas container width for screens less than 426px wide */
#canvas-container {
margin-left: 7%;
width: 85%;
/* Adjust the width as needed */
padding: 10px;
/* Add padding */
box-sizing: border-box;
/* Include padding in the width calculation */
}

/* Adjust canvas size for mobile devices */
canvas {
width: 100%;
/* Make canvas width 100% of its container */
height: auto;
/* Let the height adjust automatically */
}

#score {
font-size: 20px;
text-align: center;
/* Center align the score */
}
}


Expand Down Expand Up @@ -570,4 +595,4 @@ <h3>Snake Leaderboard</h3>

</body>

</html>
</html>

0 comments on commit 9e0265c

Please sign in to comment.