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

stop music button added #26

Merged
merged 1 commit into from
Jan 11, 2024
Merged
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
1 change: 1 addition & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ <h1>Check If you are a Thala ?
<div id="resultContainer">
<p id="resultText"></p>
</div>
<button type="button" id="stop-music" onclick="Stopmusic()">Stop Music</button>
<div class="thala">
<p class="tfr">#ThalaForReason</p>
</div>
Expand Down
6 changes: 5 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ document.addEventListener("DOMContentLoaded", function () {
});
// index.js
const button = document.getElementsByClassName("checkButton");

// function to stop music
function Stopmusic(){
audio.pause();
audio.currentTime = 0; // Set playback position to the beginning
}
async function generateContent() {
if (button.disabled === true) {
return;
Expand Down
3 changes: 3 additions & 0 deletions src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -204,4 +204,7 @@ button:hover {
background: #333;
border-radius: 50%;
transform: translate(-50%,-50%);
}
#stop-music{
margin-left: 7.7rem;
}
Loading