-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
64 lines (52 loc) · 1.4 KB
/
index.html
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<html xmlns= "http://www.w3.org/1999/xhml" xml:lang= "en" lang= "en">
<link rel = "icon" href =https://www.clifton.co.uk/sites/default/files/checkout-icon-returns.png type = "image/x-icon">
<div id="cookiesection">
<button>Ask a<img id="cookie" src="https://cdn.afterdawn.fi/v3/news/original/github-logo.png"/>question and click on me</button>
</div>
<title>Github 8 ball</title>
<script>var responses = [
"No",
"Yes",
"Yeah, Duh!",
"YES!",
"Ask again later",//3
"Maybe",//4
"I do not know",//5
"Tomorrow",//6
"Go away!",//7
"Your input is random, so the output is going to be random.", //8
"You ask someone else!",//9
"No way",//10
"Arr me hearty! Me scurvy do not know!"//11
];
window.onload = function() {
let clickme = document.getElementById("cookiesection");
clickme.onclick = giveResponse;
}
function giveResponse() {
let id = Math.floor(Math.random() * responses.length)
alert(responses[id])
}
function changeColor() {
let colorChange = document.getElementById("eye");
let colorNow = colorChange.style.backgroundColor;
if (colorNow == "lightgreen") {
colorChange.style.background = "Navy"
} else {
colorChange.style.backgroundColor = "darkred";
}
}</script>
<style>#cookiesection{
width: 40px;
height: 20px;
margin:auto;
}
#cookie{
height:40px;
font-size: 10%;
}
button:hover {
color: white;
background-color:silver;
}
</style>