From ae34e427cbdac09550a866545b41c73b85548dd3 Mon Sep 17 00:00:00 2001 From: ssyyhhrr <808648@student.derby-college.ac.uk> Date: Sat, 11 Mar 2023 18:14:30 +0000 Subject: [PATCH] Random Victory Phrases --- assets/js/main.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/assets/js/main.js b/assets/js/main.js index c3afd68..6ff7889 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -2,6 +2,19 @@ let canOpen = true let canClose = false let count = true +const victoryCalls = [ + "How About That?!", + "We Are The Champions!", + "******* Took It!", + "Si Ragazzi!", + "You Are The Best!", + "Yeahhaahh!", + "We Did It, We Did It!", + "Du Bist Weltmeister!", + "Aaahaaa Huh Huh Huh!", + "I Can't Believe It!" +] + function autocomplete(inp, arr) { /*the autocomplete function takes two arguments, the text field element and an array of possible autocompleted values:*/ @@ -258,7 +271,7 @@ async function submit(guess, real) { if (gg != null) { gg.classList.remove("input") gg.classList.add("gg") - let greeting = won ? "Grazie Ragazzi!" : "Bwoah." + let greeting = won ? victoryCalls[Math.floor(Math.random() * victoryCalls.length)] : "Bwoah." gg.innerHTML = `

${greeting}

The driver was

${winner.winner}!

Share

Next Stewardle

00:00:00:000

` document.getElementById("share-btn").onmousedown = () => { open(document.getElementById("shareScreen"))