Randomize the thinking words

This commit is contained in:
Max Wofford 2024-05-07 22:20:21 -04:00
parent ea455cfa81
commit 67f363a2d1

View file

@ -143,7 +143,7 @@ window.addEventListener("load", (e) => {
});
document.querySelector("#generate-project-idea").addEventListener("click", async (e) => {
document.querySelector('#project-idea').innerText = "Thinking..."
document.querySelector('#project-idea').innerText = thinkingWords() + "..."
const res = await fetch('/api/bin/openai/', {
method: 'POST',
headers: {
@ -154,4 +154,14 @@ window.addEventListener("load", (e) => {
const json = await res.json()
document.querySelector('#project-idea').innerText = json.recommendation
})
})
})
function thinkingWords() {
const arr = [
"thinking",
"single neuron activated",
"quantum computing",
"thinking about trash",
"wishing you a garbage day"]
return arr[Math.floor(Math.random() * arr.length)]
}