Fix score visibility on some devices Thanks TayTay.

This commit is contained in:
Ritchie Cunningham 2025-08-23 17:13:26 +01:00
parent f48501a3e6
commit 98a2dc9d50
2 changed files with 24 additions and 24 deletions

4
dist/index.html vendored
View File

@ -7,11 +7,13 @@
<link rel="stylesheet" href="style.css"> <link rel="stylesheet" href="style.css">
</head> </head>
<body> <body>
<div id="main-container">
<div id="score-container"> <div id="score-container">
<div id="score-actions">
<h2>Score: <span id="score">0</span></h2> <h2>Score: <span id="score">0</span></h2>
<button id="save-score">Save Score</button> <button id="save-score">Save Score</button>
</div> </div>
<div id="main-container"> </div>
<div id="slap-container"> <div id="slap-container">
<img src="ryan.jpg" alt="Slap Me" id="slap-image"> <img src="ryan.jpg" alt="Slap Me" id="slap-image">
</div> </div>

38
dist/style.css vendored
View File

@ -1,26 +1,24 @@
body { body {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center;
align-items: center; align-items: center;
height: 100vh;
margin: 0; margin: 0;
background-color: #121212; background-color: #121212;
overflow: hidden; /* Hide the hand when it's off-screen. */
} }
#main-container { #main-container {
display: flex; display: flex;
align-items: flex-start; flex-direction: column;
align-items: center;
} }
#slap-container { #slap-container {
position: relative; position: relative;
margin-right: 20px;
} }
#slap-image { #slap-image {
width: 400px; width: 100%;
max-width: 400px;
height: auto; height: auto;
border: 2px solid #f0f0f0; border: 2px solid #f0f0f0;
border-radius: 10px; border-radius: 10px;
@ -49,13 +47,16 @@ body {
color: #FFD700; /* Gold. */ color: #FFD700; /* Gold. */
font-size: 36px; font-size: 36px;
text-shadow: 2px 2px 4px #000000; text-shadow: 2px 2px 4px #000000;
text-align: center;
margin-bottom: 20px; margin-bottom: 20px;
} }
#score-actions {
display: flex;
align-items: center;
justify-content: center;
}
#save-score { #save-score {
display: block;
margin: 10px auto 0;
padding: 10px 20px; padding: 10px 20px;
border: 2px solid #FFD700; border: 2px solid #FFD700;
border-radius: 5px; border-radius: 5px;
@ -64,6 +65,7 @@ body {
font-size: 18px; font-size: 18px;
cursor: pointer; cursor: pointer;
transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out;
margin-left: 20px;
} }
#save-score:hover { #save-score:hover {
@ -76,6 +78,7 @@ body {
background-color: rgba(0, 0, 0, 0.5); background-color: rgba(0, 0, 0, 0.5);
padding: 10px; padding: 10px;
border-radius: 10px; border-radius: 10px;
margin-top: 20px;
} }
#modal-overlay { #modal-overlay {
@ -146,13 +149,8 @@ body {
} }
@media (max-width: 768px) { @media (max-width: 768px) {
#main-container {
flex-direction: column;
align-items: center;
}
#slap-image { #slap-image {
width: 80vw; /* 80% of the viewport width. */ width: 80vw;
} }
#leaderboard-container { #leaderboard-container {
@ -161,12 +159,12 @@ body {
overflow-y: auto; overflow-y: auto;
} }
#save-score {
padding: 15px 30px;
font-size: 24px;
}
#score-container { #score-container {
font-size: 24px; font-size: 24px;
} }
#save-score {
padding: 10px 15px;
font-size: 18px;
}
} }