summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatthewsotoudeh <matthewsot@outlook.com>2015-09-12 00:25:01 -0700
committermatthewsotoudeh <matthewsot@outlook.com>2015-09-12 00:25:01 -0700
commit49dd5c9980ccf1bfcf8aefe9f3914fbb6b1d1c7e (patch)
tree2318211c7e3879cfcec64a7b14cb01915ec78fea
parentd7437a29adbf05c0471167108a1180666b1277e1 (diff)
added a "next" button
-rw-r--r--index.html11
1 files changed, 9 insertions, 2 deletions
diff --git a/index.html b/index.html
index 0c806b9..598bea3 100644
--- a/index.html
+++ b/index.html
@@ -16,6 +16,7 @@
<input type="text" placeholder="Y steps" id="ysteps2" />
<br/><br/>
<button id="calc-btn">Calculate</button>
+ <button id="next-btn">Next</button>
<h3>Midset:</h3>
<p id="midset-x"></p>
@@ -27,6 +28,7 @@
<script type="text/javascript">
var calcBtn = document.getElementById("calc-btn");
+ var nextBtn = document.getElementById("next-btn");
var canvas = document.getElementById("triangle");
var ctx = canvas.getContext("2d");
@@ -37,8 +39,6 @@
var halfSet = Dot.average(firstSet, secondSet);
var prettyHalf = halfSet.prettify();
- alert(prettyHalf.x);
- alert(prettyHalf.y);
document.getElementById("midset-x").textContent = prettyHalf.x;
document.getElementById("midset-y").textContent = prettyHalf.y;
@@ -84,6 +84,13 @@
ctx.fillText(diff.x, 75, 15);
document.getElementById("hyp").textContent = Math.sqrt(Math.pow(diff.x, 2) + Math.pow(diff.y, 2));
};
+
+ nextBtn.onclick = function () {
+ document.getElementById("xsteps").value = document.getElementById("xsteps2").value;
+ document.getElementById("ysteps").value = document.getElementById("ysteps2").value;
+
+ document.getElementById("xsteps2").value = "";
+ document.getElementById("ysteps2").value = "";
};
</script>
</body>
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback