-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
68 lines (59 loc) · 1.82 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
65
66
67
68
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>My own Detector</title>
<style>
.btn {
background: #3498db;
-webkit-border-radius: 28;
-moz-border-radius: 28;
border-radius: 28px;
color: #ffffff;
font-size: 20px;
padding: 10px 20px 10px 20px;
text-decoration: none;
}
.btn:hover {
background: #3cb0fd;
text-decoration: none;
}
.reset {
background: #ccc;
}
.reset:hover {
background: #eee;
}
#Actions, #Detector {
padding: 20px;
}
</style>
</head>
<body>
<div id="Actions">
<a class="btn reset" href="#" onclick="resetCanvas(); return false;">Reset</a>
<a class="btn" href="#" onclick="Tracks.drawRandomMuon(ctx, -1); return false;">µ<sup>-</sup></a>
<a class="btn" href="#" onclick="Tracks.drawRandomMuon(ctx, 1); return false;">µ<sup>+</sup></a>
<a class="btn" href="#" onclick="Tracks.drawRandomMuonPair(ctx); return false;">µ<sup>+</sup>µ<sup>-</sup></a>
</div>
<canvas id="Detector" width="600" height="600">
Your browser does not support HTML5 canvas. Where did you get such an old browser?
</canvas>
<script src="js/detector.js"></script>
<script src="js/tracks.js"></script>
<script>
var canvas = document.getElementById('Detector');
var ctx = canvas.getContext('2d');
var resetCanvas = function() {
canvas.width = canvas.width;
ctx.translate(canvas.width / 2, canvas.height / 2);
Detector.draw(ctx);
};
//canvas.addEventListener('click', function() {
// Tracks.drawRandomMuonTrack(ctx);
//}, false);
resetCanvas();
</script>
<noscript>Your browser does not support Javascript. If you have turned it off on purpose, please turn it on for this page or otherwise upgrade your browser.</noscript>
</body>
</html>