Skip to content

Commit

Permalink
Merge pull request #716 from Adityadhiman0/main
Browse files Browse the repository at this point in the history
[bug]: Fix issue #703 two theme switch toggle button
  • Loading branch information
YadavAkhileshh authored Nov 7, 2024
2 parents f0e3cd0 + c009486 commit 0d426f9
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
8 changes: 4 additions & 4 deletions Alien.css
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ body.dark-theme {
top: 0;
left: 0;
width: 100%;
height: 100px;
height: 80px;
z-index: 100;
/* padding-right: 20px; */
box-shadow: 0 4px 8px rgba(0, 255, 255, 0.1);
Expand Down Expand Up @@ -196,7 +196,7 @@ body.dark-theme #gameCanvas {
align-items: center;
padding: 20px;
border-radius: 8px;
margin-bottom: 20px;
margin-bottom: 1px;
margin-top: 130px;
transition: background-color var(--transition-speed),
border-color var(--transition-speed);
Expand Down Expand Up @@ -273,8 +273,8 @@ input:checked+.slider:before {
display: none;
/* Initially hidden until game over */
position: absolute;
top: 50%;
left: 50%;
top: 52%;
left: 38%;
transform: translate(-50%, -50%);
text-align: center;
background-color: rgba(0,
Expand Down
2 changes: 1 addition & 1 deletion Alien.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class Alien {
this.height = 40;
this.x = x;
this.y = y;
this.speed = 1 + level * 0.5;
this.speed = 1 + level * 0.2;
this.type = type; // Assign the type
this.points = points;
}
Expand Down
22 changes: 20 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,15 @@ <h2 class="primary-btn" id="logoutButton" style="display: none;">
<button class="primary-btn" id="signupButton" window.location.href="/Login and Signup/index.html">
Signup/Register
</button>
<div class="theme-switch-wrapper">
<label class="theme-switch" for="checkbox">
<input type="checkbox" id="checkbox">
<div class="slider"></div>
</label>

<span id="mode-label">Light Mode</span>
</div>



<div id="faqbtn">
Expand All @@ -572,15 +581,15 @@ <h2 class="primary-btn" id="logoutButton" style="display: none;">
</div>


<div class="theme-switch-wrapper">
<!-- <div class="theme-switch-wrapper">
<label class="theme-switch" for="checkbox">
<input type="checkbox" id="checkbox">
<div class="slider"></div>
</label>
<span id="mode-label">Light Mode</span>
</div>

-->
</nav>
<div class="gtranslate_wrapper"></div>
<div id="gameControls" class="header">
Expand All @@ -604,13 +613,22 @@ <h2 class="primary-btn" id="logoutButton" style="display: none;">
<button id="pauseButton" style="display: none"><i class="fas fa-play"></i> Game paused</button>
<button id="restartButton" style="display: none"><i class="fas fa-redo"></i> Play Again </button>
</div>

<div class="theme-switch-wrapper">
<label class="theme-switch" for="checkbox">
<input type="checkbox" id="checkbox">
<div class="slider"></div>
</label>

<span id="mode-label">Light Mode</span>
</div>
<!-- <div class="theme-switch-wrapper">
<label class="theme-switch" for="checkbox">
<input type="checkbox" id="checkbox">
<div class="slider"></div>
</label>
<span id="mode-label">Light Mode</span>
</div> -->

</div>
<div id="gameContainer">
Expand Down

0 comments on commit 0d426f9

Please sign in to comment.