Pure JS now makes a sound every time a website is found

This commit is contained in:
Taevas 2021-03-07 17:11:31 +01:00
parent 829c833f50
commit 38178829d7
2 changed files with 3 additions and 0 deletions

BIN
Javascript/found.mp3 Normal file

Binary file not shown.

View file

@ -14,6 +14,7 @@ function findWebsites() {
a.href = url
li.appendChild(a)
list.appendChild(li)
audio.play()
}
catch (e) {} // No server for this URL
}
@ -33,6 +34,8 @@ function findWebsites() {
return result
}
const audio = new Audio("found.mp3")
const times = document.getElementById("times").value ? Math.round(Number(document.getElementById("times").value)) : 3000
const domains = document.getElementById("domains").value ? document.getElementById("domains").value.split(", ") : ['.co', '.com', '.net', '.edu', '.gov', '.cn', '.org', '.cc', '.us', '.mil', '.ac', '.it', '.de']
const second = document.getElementById("second").value ? Math.round(Number(document.getElementById("second").value)) : 1