Skip to content

Instantly share code, notes, and snippets.

@bvancil
Created September 27, 2012 02:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bvancil/3791801 to your computer and use it in GitHub Desktop.
Save bvancil/3791801 to your computer and use it in GitHub Desktop.
Force naming template
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
$("#button").click(function() {
$("#output").append("<p><b>F⃑</b><sup>"+$('[name=type]').val()[0]+"</sup><sub>"+$('[name=dealer]').val()+" on "+$('[name=feeler]').val()+"</sub>≔the "+$('[name=cnc]').val()+" "+$('[name=type]').val()+" force of the "+$('[name=dealer]').val()+" on the "+$('[name=feeler]').val()+"</p>");
});
});
</script>
<style type="text/css">
button {
font-size: 100%;
}
</style>
<head>
<title>Force namer!</title>
</head>
<body>
<h1>Name a force!</h1>
<p>the&nbsp;<select name="cnc"><option value="contact">contact</option><option
value="non-contact">non-contact</option></select>&nbsp;<select name="type"><option value=""></option><option value="electric">electric</option><option value="frictional">frictional</option><option value="gravitational">gravitational</option><option value="magnetic">magnetic</option><option value="normal">normal</option><option
value="tension">tension</option></select> force of the&nbsp;<input name="dealer"/> on the&nbsp;<input name="feeler"/>
<button name="submit" value="Add" id="button">Add</button></p>
<h1>Named forces</h1>
<div id="output">
</div>
</body>
</html>
@bvancil
Copy link
Author

bvancil commented Nov 30, 2012

Added symbolic force notation and fixed button zooming behavior

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment