improvements

This commit is contained in:
λmolinae 2025-08-11 23:35:56 -06:00
parent c7165ec051
commit 5cb7412575
12 changed files with 105 additions and 32 deletions

14
js/script.js Normal file
View file

@ -0,0 +1,14 @@
// This sucks but works.
function getRandomLine(file) {
return fetch(file)
.then(res => res.text())
.then(text => {
const lines = text.trim().split('\n');
const randomIndex = Math.floor(Math.random() * lines.length);
return lines[randomIndex];
});
}
getRandomLine("/assets/messages.txt").then(line => {
document.getElementById("qotd").innerHTML = line;
});