-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
48 lines (39 loc) · 1.57 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
const result = document.getElementById("result text");
const inputBar = document.getElementById("inputBar");
const submitBtn = document.getElementById("submitBtn");
let startArray = ["🎉","✨","𝓼𝔀𝓪𝓰","𝓪𝔀𝓮𝓼𝓸𝓶𝓮","𝓯𝓻𝓮𝓪𝓴𝔂", "𝓼𝓲𝓵𝓵𝔂", "★", "bread", "🌟", "🐈", "𝓮𝓿𝓲𝓵", "tally", "𝓼𝓴𝓲𝓫𝓲𝓭𝓲", "yoyle", "scrimblo", "criminal", "devious", "quirky"];
let endArray = [":3", "★", "😎", "💥", "🌟", "meow", "goober"];
let endRepeat = 3;
let startRepeat = 3;
function sillyfyText(str) {
let sillifiedText = "";
let toAdd = "";
let toAddEnd = " ";
for(let i = 0; i < startRepeat; i++) {
const silly = startArray[Math.floor(Math.random() * startArray.length)]
toAdd += silly + " ";
}
for(let i = 0; i < endRepeat; i++) {
const silly = endArray[Math.floor(Math.random() * endArray.length)]
toAddEnd += silly + " ";
}
sillifiedText = toAdd.trim() + " " + str + " " + toAddEnd.trim()
return sillifiedText
}
submitBtn.addEventListener('click', function() {
const yeah = document.getElementById("yeah");
yeah.load();
result.textContent = sillyfyText(inputBar.value);
yeah.play();
});
window.addEventListener('load', function() {
const hi = document.getElementById("hi");
hi.load()
hi.play()
})
window.addEventListener('beforeunload', function() {
const bye = document.getElementById("bye");
bye.load()
bye.play()
});
// edit this to test webhook