Skip to content

Commit

Permalink
Merge pull request #75 from Harshil-Gupta21/main
Browse files Browse the repository at this point in the history
Background Music
  • Loading branch information
Akanchha112 authored Jan 27, 2024
2 parents 1d7048f + 9f8cfdb commit 71370ba
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 15 deletions.
2 changes: 0 additions & 2 deletions Dark/game.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ <h2 id="question"></h2>
<p class="choice-text" data-number="4"></p>
</div>


<h2 id="display">Correct option :</h2>

<label
Expand Down Expand Up @@ -82,7 +81,6 @@ <h2 id="display">Correct option :</h2>
/>
</label>


<footer>
<button class="next_btn">Next Ques</button>
</footer>
Expand Down
46 changes: 38 additions & 8 deletions Light/game.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css"
/>


</head>
<body>
<div class="container">
Expand All @@ -28,6 +27,18 @@
</div>
</div>

<div id="hud-item" class="time">
<div class="timer">
<div class="time_left_txt">Time Left</div>
<div class="timer_sec" id="timer">15</div>
</div>
<div class="time_line"></div>
</div>
<div id="hud-item">
<p class="hud-prefix">Score</p>
<h1 class="hud-main-text" id="score">0</h1>



<div id="hud-item">
<div id="hud-item" class="time">
Expand Down Expand Up @@ -112,6 +123,7 @@ <h2 id="question"></h2>
<h1 class="hud-main-text" id="score">
0
</h1>

</div>
</div>
<h2 id="question"></h2>
Expand All @@ -131,15 +143,33 @@ <h2 id="question"></h2>
<p class="choice-prefix">D</p>
<p class="choice-text" data-number="4"></p>
</div>
<label for="un-mute" class="unmute" onclick="playpause()" id="playpauseBTN">
<img src="http://upload.wikimedia.org/wikipedia/commons/3/3f/Mute_Icon.svg" alt="Mute_Icon.svg" title="Mute icon">
</label>
<label for="un-mute" class="mute" onclick="playpause()" id="playpauseBTN">
<img src="http://upload.wikimedia.org/wikipedia/commons/2/21/Speaker_Icon.svg" alt="Speaker_Icon.svg" title="Unmute/speaker icon">
</label>
<label
for="un-mute"
class="unmute"
onclick="playpause()"
id="playpauseBTN"
>
<img
src="http://upload.wikimedia.org/wikipedia/commons/3/3f/Mute_Icon.svg"
alt="Mute_Icon.svg"
title="Mute icon"
/>
</label>
<label
for="un-mute"
class="mute"
onclick="playpause()"
id="playpauseBTN"
>
<img
src="http://upload.wikimedia.org/wikipedia/commons/2/21/Speaker_Icon.svg"
alt="Speaker_Icon.svg"
title="Unmute/speaker icon"
/>
</label>
<footer>
<button class="next_btn">Next Ques</button>
</footer>
</footer>
</div>
</div>

Expand Down
14 changes: 9 additions & 5 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ let bgMusic = new Audio(`/assets/music_bg/${index}.mp3`);

function changeMusic() {
bgMusic.src = `/assets/music_bg${index}.mp3`;
if (index <= music.length) {
index += 1;
} else {
index = 1;
}

if (index <= 5) {

if (index <= music.length) {

index += 1;
} else {
index = 1;
}
}

window.addEventListener("load", () => {
Expand Down

0 comments on commit 71370ba

Please sign in to comment.