Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added images on mode selection and a haptic feedback while hovering o… #381

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 30 additions & 8 deletions paras/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -548,33 +548,55 @@ body {
}
}


.mode-selection {
display: flex;
flex-direction: column;
align-items: center;
margin-top: 50px;
text-align: center;
}

.mode-selection h2 {
margin-bottom: 20px;
font-size: 28px;
color: #ffffff;
}

.mode-selection button {
margin: 10px;
padding: 10px 20px;
font-size: 18px;
cursor: pointer;
.button-container {
display: flex;
gap: 20px;
justify-content: center;
}

.mode-button {
display: flex;
flex-direction: column;
align-items: center;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 5px;
transition: background-color 0.3s;
border-radius: 10px;
padding: 15px 30px;
font-size: 20px;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
}

.mode-selection button:hover {
.mode-button:hover {
background-color: #45a049;
box-shadow: 0px 6px 8px rgba(0, 0, 0, 0.2);
transform: translateY(-3px);
}

.mode-button img {
width: 70px;
height: 70px;
margin-bottom: 10px;
border-radius: 5px;
object-fit: cover;
}
.back-button {
position: absolute;
top: 20px;
Expand Down
16 changes: 12 additions & 4 deletions paras/src/Game.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,18 @@ const App = () => {
</div>
</div>
<div className="mode-selection">
<h2>Choose Game Mode</h2>
<button onClick={() => setGameMode('multiplayer')}>Multiplayer</button>
<button onClick={() => setGameMode('ai')}>Play against AI</button>
</div>
<h2>Choose Your Game Mode</h2>
<div className="button-container">
<button className="mode-button" onClick={() => setGameMode("multiplayer")}>
<img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSBph70qYzF6IPJqI7zOXp-xF9HLGn3FqvxZQ&s" alt="Multiplayer Icon" />
Multiplayer
</button>
<button className="mode-button" onClick={() => setGameMode("ai")}>
<img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTWnLeRr1MHSN67acn-0GshKonoEUEl29_bng&s" alt="AI Icon" />
Play against AI
</button>
</div>
</div>
</div>
);
}
Expand Down