forked from Ltlynch/GW-calculator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathworking_particle_energy.html
92 lines (85 loc) · 2.18 KB
/
working_particle_energy.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<!DOCTYPE html>
<html>
<head>
<title> Pulsar Timing Calculator </title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width", initial-scale=1">
<style>
body {background-color: rgba(128,0,0,1);}
p {colr:black;}
.box1 {
background-color: rgba(255,255,255,.3);
width: 300px;
//height: 100px;
margin: 15px;
padding: 15px;
border: 15px;
}
.box2 {
background-color: rgba(255,255,255,1);
width: 300px;
height: 100px;
margin: 25px;
padding: 25px;
border: 25px;
}
.boxwrapper {
width: 800px;
margin: 25px;
padding: 25px;
border: 25px;
}
header {
background-color: rgba(250,230,140,1);
padding: 10px;
text-align: center;
font-size: 35px;
color:white;
}
</style>
<script language="javascript" type="text/javascript">
function Calculate() {
var Mass=parseFloat(document.getElementById("Input_Mass").value);
var Velocity=parseFloat(document.getElementById("Input_Velocity").value);
var result= .5 * Mass * Math.pow(Velocity, 2);
document.getElementById("Answer").innerHTML="The energy of your particle is "+result;
}
</script>
<script language="javascript" type="text/javascript">
var input = document.getElementById("TestValue");
input.addEventListener("keyup", function(event) {
event.preventDefault();
if (event.keyCode === 13) {
document.getElementById("Calc1").click();
}
});
</script>
</head>
<body>
<nav class="w3-bar w3-black">
<a href="#home" class="w3-button w3-bar-item">Home</a>
</nav>
<header>
<h2>Pulsar Timing Calculator</h2>
</header>
<p> This is some html/css/js to get started on Drew and Liam's thesis project. Woooooo </p>
<div class="box1">
<h2>Input the mass of your particle!</h2>
<tr>
<td><input type="text" name"Input_Mass" size="40", id="Input_Mass"></td>
</tr>
</div>
<div class="box1">
<h2>Input the velocity of your particle!</h2>
<tr>
<td><input type="text" name"Input_Velocity" size="40", id="Input_Velocity"></td>
</tr>
</div>
<div class="box1">
<h2 id="Answer"></h2>
<tr>
<td><button id= "Calcall" onclick="Calculate()">Calculate Energy</button></td>
</tr>
</div>
</body>
</html>