Enhance game settings UI with improved button styles and icons; update difficulty and mode selection logic to show relevant information dynamically.

This commit is contained in:
Ronnie 2025-05-27 21:44:37 -04:00
parent fc229f0ca6
commit 88937d85a6
3 changed files with 307 additions and 72 deletions

View file

@ -74,32 +74,148 @@ h3 {
gap: 1rem;
justify-content: center;
flex-wrap: wrap;
margin-bottom: 20px;
width: 100%;
}
button {
padding: 10px 20px;
border: none;
.difficulty-btn, .mode-btn {
width: 100%;
padding: 12px 20px 12px 18px;
border: 2px solid rgba(255, 255, 255, 0.1);
border-radius: 12px;
cursor: pointer;
font-size: 1rem;
transition: all 0.3s ease;
background: rgba(255, 255, 255, 0.1);
background: rgba(255, 255, 255, 0.05);
color: #fff;
border: 1px solid rgba(255, 255, 255, 0.1);
font-weight: 500;
transition: all 0.3s ease;
display: flex;
align-items: center;
justify-content: flex-start;
gap: 12px;
font-size: 1.05rem;
}
button:hover {
background: rgba(255, 255, 255, 0.15);
.difficulty-btn i, .mode-btn i {
font-size: 1.15rem;
opacity: 0.85;
margin-right: 2px;
margin-left: 2px;
display: flex;
align-items: center;
}
.difficulty-btn[data-difficulty="easy"] i {
color: #4ecca3;
}
.difficulty-btn[data-difficulty="medium"] i {
color: #fbbf24;
}
.difficulty-btn[data-difficulty="hard"] i {
color: #f87171;
}
.mode-btn[data-mode="levels"] i {
color: #60a5fa;
}
.mode-btn[data-mode="endless"] i {
color: #60a5fa;
}
.difficulty-btn:hover, .mode-btn:hover {
transform: translateY(-2px);
border-color: rgba(96, 165, 250, 0.3);
background: rgba(255, 255, 255, 0.1);
}
.difficulty-btn.active, .mode-btn.active {
background: #60a5fa;
color: #0f172a;
box-shadow: 0 4px 12px rgba(96, 165, 250, 0.3);
color: #fff;
border-color: transparent;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
transform: translateY(-2px);
}
.difficulty-btn[data-difficulty="easy"].active {
background: linear-gradient(135deg, #4ecca3, #34d399);
}
.difficulty-btn[data-difficulty="medium"].active {
background: linear-gradient(135deg, #fbbf24, #f59e0b);
}
.difficulty-btn[data-difficulty="hard"].active {
background: linear-gradient(135deg, #f87171, #ef4444);
}
.mode-btn[data-mode="levels"].active {
background: linear-gradient(135deg, #60a5fa, #3b82f6);
}
.mode-btn[data-mode="endless"].active {
background: linear-gradient(135deg, #60a5fa, #3b82f6);
}
.difficulty-btn.active i, .mode-btn.active i {
color: #fff;
opacity: 1;
}
/* Remove the old ::after pseudo-elements */
.difficulty-btn::after, .mode-btn::after {
display: none;
}
.difficulty-info, .mode-info {
margin-top: 15px;
font-size: 0.9rem;
color: #94a3b8;
text-align: center;
padding: 12px;
border-radius: 12px;
background: rgba(255, 255, 255, 0.05);
border: 1px solid rgba(255, 255, 255, 0.1);
transition: all 0.3s ease;
}
.info-text {
display: none;
padding: 8px;
border-radius: 8px;
background: rgba(255, 255, 255, 0.05);
margin: 5px 0;
transition: all 0.3s ease;
line-height: 1.5;
}
.difficulty-btn.active + .difficulty-info .info-text,
.mode-btn.active + .mode-info .info-text {
display: block;
animation: fadeIn 0.3s ease forwards;
}
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(-10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* Add icons to buttons */
.difficulty-btn::after, .mode-btn::after {
content: '';
display: inline-block;
width: 16px;
height: 16px;
margin-left: 8px;
background-size: contain;
background-repeat: no-repeat;
vertical-align: middle;
opacity: 0.7;
}
.start-btn {
@ -195,16 +311,13 @@ button:hover {
padding: 25px;
border-radius: 20px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
width: 350px;
width: 600px;
opacity: 0;
visibility: hidden;
transform: translateY(10px);
transition: all 0.3s ease;
margin-top: 10px;
border: 1px solid rgba(96, 165, 250, 0.2);
display: flex;
flex-direction: column;
align-items: center;
}
.settings-icon:hover .settings-menu {
@ -229,15 +342,6 @@ button:hover {
text-align: center;
}
.difficulty-options, .mode-options {
display: flex;
gap: 10px;
justify-content: center;
flex-wrap: wrap;
margin-bottom: 20px;
width: 100%;
}
.difficulty-options button, .mode-options button {
min-width: 100px;
text-align: center;
@ -388,28 +492,6 @@ button:hover {
animation: pulse 1s infinite;
}
.difficulty-info, .mode-info {
margin-top: 10px;
font-size: 0.9rem;
color: #fff;
opacity: 0.8;
text-align: center;
}
.info-text {
display: none;
padding: 8px;
border-radius: 8px;
background: rgba(255, 255, 255, 0.1);
margin: 5px 0;
transition: all 0.3s ease;
}
.difficulty-btn.active + .difficulty-info .info-text,
.mode-btn.active + .mode-info .info-text {
display: block;
}
/* Death Screen */
.death-screen {
position: fixed;
@ -749,4 +831,142 @@ button:hover {
.difficulty-badge:hover {
background: linear-gradient(135deg, rgba(251, 191, 36, 0.3), rgba(251, 191, 36, 0.2));
}
.settings-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 20px;
margin-top: 20px;
}
.difficulty, .game-mode {
background: rgba(255, 255, 255, 0.05);
padding: 20px;
border-radius: 15px;
border: 1px solid rgba(255, 255, 255, 0.1);
}
.difficulty h3, .game-mode h3 {
color: #60a5fa;
font-size: 1.2rem;
margin-bottom: 15px;
text-align: center;
}
.difficulty-options, .mode-options {
display: flex;
flex-direction: column;
gap: 10px;
}
.difficulty-btn, .mode-btn {
width: 100%;
padding: 12px 20px 12px 18px;
border: 2px solid rgba(255, 255, 255, 0.1);
border-radius: 12px;
background: rgba(255, 255, 255, 0.05);
color: #fff;
font-weight: 500;
transition: all 0.3s ease;
display: flex;
align-items: center;
justify-content: flex-start;
gap: 12px;
font-size: 1.05rem;
}
.difficulty-btn i, .mode-btn i {
font-size: 1.15rem;
opacity: 0.85;
margin-right: 2px;
margin-left: 2px;
display: flex;
align-items: center;
}
.difficulty-btn[data-difficulty="easy"] i {
color: #4ecca3;
}
.difficulty-btn[data-difficulty="medium"] i {
color: #fbbf24;
}
.difficulty-btn[data-difficulty="hard"] i {
color: #f87171;
}
.mode-btn[data-mode="levels"] i {
color: #60a5fa;
}
.mode-btn[data-mode="endless"] i {
color: #60a5fa;
}
.difficulty-btn:hover, .mode-btn:hover {
transform: translateY(-2px);
border-color: rgba(96, 165, 250, 0.3);
background: rgba(255, 255, 255, 0.1);
}
.difficulty-btn.active, .mode-btn.active {
color: #fff;
border-color: transparent;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
transform: translateY(-2px);
}
.difficulty-btn[data-difficulty="easy"].active {
background: linear-gradient(135deg, #4ecca3, #34d399);
}
.difficulty-btn[data-difficulty="medium"].active {
background: linear-gradient(135deg, #fbbf24, #f59e0b);
}
.difficulty-btn[data-difficulty="hard"].active {
background: linear-gradient(135deg, #f87171, #ef4444);
}
.mode-btn[data-mode="levels"].active {
background: linear-gradient(135deg, #60a5fa, #3b82f6);
}
.mode-btn[data-mode="endless"].active {
background: linear-gradient(135deg, #60a5fa, #3b82f6);
}
.difficulty-btn.active i, .mode-btn.active i {
color: #fff;
opacity: 1;
}
.difficulty-info, .mode-info {
margin-top: 15px;
font-size: 0.9rem;
color: #94a3b8;
text-align: center;
padding: 12px;
border-radius: 12px;
background: rgba(255, 255, 255, 0.05);
border: 1px solid rgba(255, 255, 255, 0.1);
transition: all 0.3s ease;
}
.info-text {
display: none;
padding: 8px;
border-radius: 8px;
background: rgba(255, 255, 255, 0.05);
margin: 5px 0;
transition: all 0.3s ease;
line-height: 1.5;
}
.difficulty-btn.active + .difficulty-info .info-text,
.mode-btn.active + .mode-info .info-text {
display: block;
animation: fadeIn 0.3s ease forwards;
}