-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
46 lines (41 loc) · 1.3 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
<html>
<head>
<link rel="stylesheet" type="text/css" href="styles.css">
<script>
function shuffleArray(array) {
for (var i = array.length - 1; i > 0; i--) {
var j = Math.floor(Math.random() * (i + 1));
var temp = array[i];
array[i] = array[j];
array[j] = temp;
}
return array;
}
function myFunction(image1, name1) {
image1.src = name1;
var rray = ['Matt.mp3','Andre.mp3','Alex.mp3','Easy Mike.m4a','Joseph.mp3','Kristen.mp3',
'MelanieMarie.mp3', 'speech-audio.mp3', 'Spencer.mp3','Nate.mp3','Amanda1.mp3','Amanda3.mp3'];
rray = shuffleArray(rray);
var musicToPlay = rray[1];
var audio = new Audio('audio/' + musicToPlay);
audio.play();
}
function myFunction2(image1, name1) {
image1.src = name1;
}
</script>
</head>
<body>
<div id="title">
<h1>The Easy Button</h1>
</div>
<div id="wrapper" style="width:100%; text-align:center">
<img src="easyBtn.png" alt="That was easy button" style="width:450px;height:300px;";
onmousedown="myFunction(this,'easyPressedBtn.png')" onmouseup="myFunction2(this,'easyBtn.png')"
onmouseout="myFunction2(this,'easyBtn.png')" >
</div>
<div id="volume">
<h3>(Turn on your sound)</h3>
</div>
</body>
</html>