-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathabout.html
59 lines (57 loc) · 1.43 KB
/
about.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
<!DOCTYPE html>
<html>
<head>
<title>Keep it Clean</title>
<style type="text/css">
#myCanvas {
border: 1px solid #222222;
margin-top: 20px;
}
body{
background-color: black;
text-align: center;
}
</style>
<link rel="icon" href="logo.png" type="image/x-icon" />
</head>
<body>
<canvas id = "myCanvas" width = "800" height = "600"></canvas>
<script type="text/javascript">
var canvas = document.getElementById('myCanvas');
var context = canvas.getContext('2d');
msx=0;
msy=0;
var click = new Audio("click2.mp3");
clickplayed=false;
var bg = new Image();
bg.src="bgAbout.png";
bg.onload=function(){
context.drawImage(bg,0,0);
}
window.addEventListener("mousemove",function(e){
var rect = canvas.getBoundingClientRect();
msx = e.pageX - rect.left;
msy = e.pageY - rect.top;
if(msx>64&&msx<152&&msy>37&&msy<81){
canvas.style.cursor="pointer";
if(!clickplayed){
click.play();
console.log("hey");
clickplayed=true;
}
}else{
canvas.style.cursor="default";
clickplayed=false;
}
});
window.addEventListener("mousedown",function(e){
var rect = canvas.getBoundingClientRect();
msx = e.pageX - rect.left;
msy = e.pageY - rect.top;
if(msx>64&&msx<152&&msy>37&&msy<81){
window.location.href="index.html";
}
});
</script>
</body>
</html>