2011-01-25 07:42:20 +00:00
<!doctype html>
< head >
< title > GUI-DAT< / title >
2011-01-25 08:14:24 +00:00
2011-01-25 22:16:30 +00:00
< link rel = "icon" type = "image/gif" href = "demo/assets/favicon.gif" >
2011-01-25 08:14:24 +00:00
2011-01-25 07:42:20 +00:00
< link href = "gui.css" media = "screen" rel = "stylesheet" type = "text/css" / >
2011-01-25 22:16:30 +00:00
< link href = "demo/demo.css" media = "screen" rel = "stylesheet" type = "text/css" / >
2011-01-25 07:42:20 +00:00
< script type = "text/javascript" src = "http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.js" > < / script >
2011-01-24 22:08:48 +00:00
2011-01-25 07:42:20 +00:00
< script type = "text/javascript" src = "gui.js" > < / script >
2011-01-25 08:28:18 +00:00
< script type = "text/javascript" src = "controllers/slider.js" > < / script >
2011-01-25 08:26:18 +00:00
< script type = "text/javascript" src = "controllers/controller.js" > < / script >
< script type = "text/javascript" src = "controllers/controller.string.js" > < / script >
< script type = "text/javascript" src = "controllers/controller.number.js" > < / script >
< script type = "text/javascript" src = "controllers/controller.boolean.js" > < / script >
< script type = "text/javascript" src = "controllers/controller.function.js" > < / script >
2011-01-26 00:58:52 +00:00
<!-- <script type="text/javascript" src="demo/demo.js"></script> -->
2011-01-26 00:07:51 +00:00
< script type = "text/javascript" >
2011-01-25 07:42:20 +00:00
var controllableObject =
{
numberProperty: 20,
constrainedNum: 0,
2011-01-25 09:35:45 +00:00
notchedNum: 240,
2011-01-26 00:07:51 +00:00
pageTitle: "gui-dat",
2011-01-25 07:42:20 +00:00
anotherTextProperty: "another string",
booleanProperty: false,
anotherBooleanProperty: false,
functionProperty: function() {
alert("I am a function!");
}
};
2011-01-23 22:35:19 +00:00
2011-01-25 07:42:20 +00:00
window.onload = function() {
2011-01-26 00:07:51 +00:00
2011-01-25 07:42:20 +00:00
prettyPrint();
2011-01-24 10:36:57 +00:00
2011-01-25 07:42:20 +00:00
GUI.start();
2011-01-26 00:58:52 +00:00
2011-01-25 07:42:20 +00:00
// Creates a number box
GUI.add(controllableObject, "numberProperty");
2011-01-26 00:07:51 +00:00
2011-01-25 07:42:20 +00:00
// Creates a slider (min, max)
2011-01-26 00:58:52 +00:00
GUI.add(controllableObject, "constrainedNum", 0, 16);
2011-01-26 00:07:51 +00:00
2011-01-25 09:35:45 +00:00
// Creates a slider with notches
2011-01-26 00:58:52 +00:00
GUI.add(controllableObject, "notchedNum", 0, 800, 100);
2011-01-26 00:07:51 +00:00
2011-01-25 07:42:20 +00:00
// Creates a text field
2011-01-26 00:58:52 +00:00
GUI.add(document.getElementById('helvetica-demo'), "innerHTML");
2011-01-26 00:07:51 +00:00
2011-01-25 07:42:20 +00:00
// Creates a checkbox
GUI.add(controllableObject, "booleanProperty");
2011-01-26 00:07:51 +00:00
2011-01-25 07:42:20 +00:00
// Creates a button
GUI.add(controllableObject, "functionProperty")
.setName("Fire a Function");
2011-01-26 00:07:51 +00:00
2011-01-26 00:58:52 +00:00
2011-01-25 07:42:20 +00:00
};
< / script >
< / head >
< body >
2011-01-26 00:58:52 +00:00
< h1 > < a href = "http://twitter.com/guidat" > < img src = "demo/assets/favicon.gif" border = "0" alt = "GUI-DAT flag" / > < / a > < span id = "helvetica-demo" > gui-dat< / span > < / h1 >
2011-01-25 09:05:49 +00:00
< p >
is a super-light javascript library for making GUI elements. It is inspired by < a href = "http://www.sojamo.de/libraries/controlP5/" > controlP5< / a > .
< / p >
2011-01-26 00:07:51 +00:00
2011-01-25 07:42:20 +00:00
< pre id = "demo-pre" class = "prettyprint" >
2011-01-24 10:36:57 +00:00
var controllableObject =
{
2011-01-26 00:58:52 +00:00
numberProperty: 20,
constrainedNum: 0,
notchedNum: 240,
pageTitle: "gui-dat",
anotherTextProperty: "another string",
booleanProperty: false,
anotherBooleanProperty: false,
functionProperty: function() {
alert("I am a function!");
}
2011-01-24 10:36:57 +00:00
};
window.onload = function() {
2011-01-26 00:58:52 +00:00
prettyPrint();
2011-01-24 10:36:57 +00:00
GUI.start();
2011-01-25 07:42:20 +00:00
2011-01-24 10:36:57 +00:00
// Creates a number box
GUI.add(controllableObject, "numberProperty");
2011-01-25 07:42:20 +00:00
2011-01-24 10:36:57 +00:00
// Creates a slider (min, max)
2011-01-25 09:35:45 +00:00
GUI.add(controllableObject, "constrainedNum", -100, 100)
2011-01-26 00:58:52 +00:00
2011-01-25 09:35:45 +00:00
// Creates a slider with notches
2011-01-25 22:10:40 +00:00
GUI.add(controllableObject, "notchedNum", 0, 800, 100)
2011-01-25 07:42:20 +00:00
2011-01-24 10:36:57 +00:00
// Creates a text field
2011-01-26 00:58:52 +00:00
GUI.add(controllableObject, "pageTitle");
2011-01-25 07:42:20 +00:00
2011-01-24 10:36:57 +00:00
// Creates a checkbox
GUI.add(controllableObject, "booleanProperty");
2011-01-25 07:42:20 +00:00
2011-01-24 10:36:57 +00:00
// Creates a button
2011-01-25 05:31:20 +00:00
GUI.add(controllableObject, "functionProperty")
.setName("Fire a Function");
2011-01-24 10:36:57 +00:00
};
2011-01-25 07:42:20 +00:00
< / pre >
< footer >
2011-01-25 09:05:49 +00:00
By < a href = "http://georgemichaelbrower.com/" > George Michael Brower< / a > , < a href = "http://jonobr1.com/" > Jono Brandel< / a > , and < a href = "http://github.com/jonobr1/GUI-DAT" > you< / a > .
2011-01-25 07:42:20 +00:00
< / footer >
2011-01-26 00:58:52 +00:00
< div id = "columns" > < / div >
2011-01-25 07:42:20 +00:00
< / body >
2011-01-23 21:23:53 +00:00
< / html >