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

#Issue 119 #120

Open
wants to merge 3 commits 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
216 changes: 211 additions & 5 deletions paras/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
grid-template-columns: repeat(3, 1fr);
grid-gap: 10px;
max-width: 300px;
margin: 20px auto;
margin: 0px auto;
padding: 20px;
border-radius: 15px;
background: linear-gradient(120deg, #0e2e4e, #1f4679);
Expand Down Expand Up @@ -116,11 +116,10 @@
}

.toggle {
margin-left: auto;
position: relative;
display: inline-block;
width: 60px;
height: 34px;
position: relative;
}

.toggle input {
Expand Down Expand Up @@ -161,6 +160,89 @@ input:checked + .slider:before {
transform: translateX(26px);
}

.icon {
position: absolute;
top: 50%;
transform: translateY(-50%);
font-size: 18px;
transition: opacity 0.3s ease;
}

.sun {
left: 7px;
top: 19px;
font-size: 18px;
font-weight: bold;
opacity: 1;
color: #f1c40f; /* Sunny yellow color */
}

.moon {
right: 5px;
top: 19px;
font-size: 18px;
font-weight: bold;
opacity: 0;
color: #f1c40f; /* Same color as sun for consistency */
}

input:checked + .slider .sun {
opacity: 0;
}

input:checked + .slider .moon {
opacity: 1;
}

/* Ensure contrast in both light and dark modes */
.dark .toggle .moon,
.dark .toggle .sun {
color: #f1c40f; /* Maintain yellow color in dark mode */
}

.restart-button{
background-color: #f44336;
color: white;
border: none;
border-radius: 5px;
padding: 10px 20px;
font-size: 16px;
font-weight: bold;
cursor: pointer;
transition: background-color 0.3s ease, transform 0.2s ease;
}

.restart-button:hover {
background-color: #2f8cd3;
transform: scale(1.1);
}

.winner-message{
font-size: 24px;
font-weight: bold;
margin-top: 20px;
}

.slider:before {
position: absolute;
content: "";
height: 26px;
width: 26px;
left: 4px;
bottom: 4px;
background-color: white;
transition: .4s;
border-radius: 50%;
}

input:checked + .slider {
background-color: #2196F3;
}

input:checked + .slider:before {
transform: translateX(26px);
}

.winning-cell {
animation: pulse 1s infinite;
}
Expand Down Expand Up @@ -224,7 +306,7 @@ input:checked + .slider:before {

.rules-card h2 {
text-align: center; /* Center align the title */
margin-bottom: 20px; /* Space below the title */
margin-bottom: 10px; /* Space below the title */
font-size: 28px; /* Title font size */
color: inherit; /* Use inherited color */
font-weight: bold; /* Bold title */
Expand All @@ -237,7 +319,7 @@ input:checked + .slider:before {
}

.rules-card li {
margin: 15px 0; /* Space between list items */
margin: 5px 0; /* Space between list items */
padding: 10px; /* Padding inside list items */
background-color: #e0e0e0; /* Light gray background for list items in light theme */
border-radius: 8px; /* Rounded corners for list items */
Expand Down Expand Up @@ -288,3 +370,127 @@ input:checked + .slider:before {
text-decoration: underline; /* Underline on hover */
}

.computer-toggle {
margin-left: 10px;
margin-bottom: 10px;
position: relative;
display: inline-block;
width: 60px;
height: 34px;
}

.game-mode{
display: flex;
align-items: center;
justify-content: center;
}

.game-mode-text{
font-size: 20px;
font-weight: bold;
margin-left: 10px;
}

.current-player{
font-size: 20px;
font-weight: 400;
margin-left: 10px;
}

.computer-toggle input {
opacity: 0;
width: 0;
height: 0;
}

.computer-toggle .slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
transition: .4s;
border-radius: 34px;
}

.computer-toggle .slider:before {
position: absolute;
content: "";
height: 26px;
width: 26px;
left: 4px;
bottom: 4px;
background-color: white;
transition: .4s;
border-radius: 50%;
}

.computer-toggle input:checked + .slider {
background-color: #2196F3;
}

.computer-toggle input:checked + .slider:before {
transform: translateX(26px);
}

.computer-toggle .icon {
position: absolute;
top: 50%;
transform: translateY(-50%);
font-size: 16px;
transition: opacity 0.3s ease;
}

.computer-toggle .human {
left: 7px;
opacity: 1;
color: #333;
}

.computer-toggle .computer {
right: 7px;
opacity: 0;
color: #fff;
}

.computer-toggle input:checked + .slider .human {
opacity: 0;
}

.computer-toggle input:checked + .slider .computer {
opacity: 1;
}

/* AI difficulty indicator */
.ai-difficulty {
display: inline-block;
margin-left: 10px;
font-size: 14px;
font-weight: bold;
color: #2196F3;
opacity: 0;
transition: opacity 0.3s ease;
}

.computer-toggle input:checked ~ .ai-difficulty {
opacity: 1;
}

/* Pulsating effect for AI mode */
@keyframes ai-pulse {
0% {
box-shadow: 0 0 0 0 rgba(33, 150, 243, 0.4);
}
70% {
box-shadow: 0 0 0 10px rgba(33, 150, 243, 0);
}
100% {
box-shadow: 0 0 0 0 rgba(33, 150, 243, 0);
}
}

.computer-toggle input:checked + .slider {
animation: ai-pulse 2s infinite;
}
Loading