-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtraveltime.html
85 lines (79 loc) · 2.64 KB
/
traveltime.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
<!DOCTYPE html>
<html>
<link rel="stylesheet" type="text/css" href="style.css">
<body style="background-color:powderblue;">
<h1> Travel Time Calculator </h1>
<form onsubmit="return false;" method="post">
<div class="travelTimeBody">
<input placeholder="Distance from Start to Finish" type="text" id="totalDist" />
<input placeholder="Terminal Velocity" type="text" id="termVel" />
<input placeholder="Hover for more" title="INPUT: DISTANCE TRAVELED WHILE ACCELERATING; Distance Traveled While Accelerating is the distance traveled while accelerating to terminal velocity." type="text" id="distAccel" />
<input type="submit" onclick="calculate();" id="travelSubmit"/>
</div>
</form>
<a href="index.html">
<button>Back to Calculators</button>
</a>
<script>
//function getInput() {
/* var termVelCalc = document.getElementById("termVel").value;
var initVelCalc = document.getElementById("initVel").value;
var accelCalc = document.getElementById("accel").value;
alert(termVelCalc + " " + initVelCalc + " " + accelCalc);}*/
function calculate() {
var totalDistCalc= document.getElementById("totalDist").value;
var termVelCalc = document.getElementById("termVel").value;
var distAccelCalc = document.getElementById("distAccel").value;
var answer = totalDistCalc - distAccelCalc / termVelCalc;
alert("Answer: " + answer + " ft/s")
}
</script>
<style>
@import url('https://fonts.googleapis.com/css?family=Quicksand:300,500');
h1 {
font-family: 'Quicksand', sans-serif;
font-size: 30px;
text-align: center;
}
button {
appearance: button;
backface-visibility: hidden;
background-color: #405cf5;
border-radius: 6px;
border-width: 0;
box-shadow: rgba(50, 50, 93, .1) 0 0 0 1px inset, rgba(50, 50, 93, .1) 0 2px 5px 0, rgba(0, 0, 0, .07) 0 1px 1px 0;
box-sizing: border-box;
color: #fff;
cursor: pointer;
font-family: -apple-system, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Ubuntu, sans-serif;
font-size: 100%;
height: 44px;
line-height: 1.15;
margin: 12px 0 0;
outline: none;
overflow: hidden;
padding: 0 25px;
position: relative;
text-align: center;
text-transform: none;
transform: translateZ(0);
transition: all .2s, box-shadow .08s ease-in;
user-select: none;
-webkit-user-select: none;
touch-action: manipulation;
width: 100%;
}
button:disabled {
cursor: default;
}
button:focus {
box-shadow: rgba(50, 50, 93, .1) 0 0 0 1px inset, rgba(50, 50, 93, .2) 0 6px 15px 0, rgba(0, 0, 0, .1) 0 2px 2px 0, rgba(50, 151, 211, .3) 0 0 0 4px;
}
button:hover {
background-color: #E01E79;
border: 2px solid white;
font-weight: 500;
}
</style>
</body>
</html>