Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/almostworked/shehacks
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniella committed Jan 12, 2025
2 parents aa557ba + 4ca60a7 commit 056338d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
1 change: 1 addition & 0 deletions home.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ <h5>⋆.˚⟡ ࣪ ˖ you have spent 8 days on the moon ✩₊˚.⋆☾⋆⁺₊
</ul>
</div>
</div>
<audio id="strikeSound" src="sounds/paper1sec.mp3" preload="auto"></audio>
<div id="progressBar">
<div id="progressBase"></div>
<div id="progressFill"></div>
Expand Down
23 changes: 22 additions & 1 deletion script.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ function addBlankTask() {
const taskItem = document.createElement('li');
const inputSpan = document.createElement('span');
inputSpan.className = 'task-text';
inputSpan.textContent = 'New task...'; // Default placeholder text
inputSpan.textContent = 'new task...'; // Default placeholder text
taskItem.appendChild(inputSpan);

const deleteButton = document.createElement('button');
Expand Down Expand Up @@ -279,3 +279,24 @@ const body = document.body;
toggleButton.addEventListener('click', () => {
body.classList.toggle('selection-mode');
});

document.addEventListener("DOMContentLoaded", function() {
// Select all delete-task buttons
const deleteButtons = document.querySelectorAll('.delete-task');

// Access the audio element
const strikeSound = document.getElementById('strikeSound');

// Add event listeners to each delete button
deleteButtons.forEach(button => {
button.addEventListener('click', function() {
// Play the sound
strikeSound.play();

// Remove the task
const task = button.closest('li');
task.remove();
});
});
});

Binary file added sounds/paper1sec.mp3
Binary file not shown.
Binary file added sounds/woosh.mp3
Binary file not shown.

0 comments on commit 056338d

Please sign in to comment.