dat.gui/index.html

86 lines
2.1 KiB
HTML
Raw Normal View History

2014-08-14 21:50:51 +00:00
<!doctype html>
<html>
<head>
<title></title>
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<script src="components/platform/platform.js"></script>
2014-08-15 02:21:38 +00:00
2014-08-15 16:32:49 +00:00
<link href="http://fonts.googleapis.com/css?family=Roboto" rel="stylesheet" type="text/css">
2014-08-15 02:21:38 +00:00
<link rel="import" href="elements/number-controller.html">
<link rel="import" href="elements/gui-panel.html">
<link rel="import" href="elements/gui-row.html">
2014-08-14 21:50:51 +00:00
</head>
2014-08-15 02:21:38 +00:00
<body touch-action="auto">
2014-08-14 21:50:51 +00:00
<!-- Added via DOM -->
2014-08-15 02:21:38 +00:00
<gui-panel>
<gui-row name="Number">
2014-08-15 16:32:49 +00:00
<number-controller id="test"></number-controller>
2014-08-15 02:21:38 +00:00
</gui-row>
2014-08-15 16:32:49 +00:00
<gui-row name="variableWithSeriousRange">
<number-controller value="5000" min="0" max="10000"></number-controller>
2014-08-15 02:21:38 +00:00
</gui-row>
<gui-row name="Straddle Zero">
2014-08-15 16:32:49 +00:00
<number-controller min="-1" max="1" value="0"></number-controller>
2014-08-15 02:21:38 +00:00
</gui-row>
<gui-row name="Weird Range">
2014-08-15 16:32:49 +00:00
<number-controller min="-1" max="2" value="0"></number-controller>
2014-08-15 02:21:38 +00:00
</gui-row>
<gui-row name="Negative">
2014-08-15 16:32:49 +00:00
<number-controller min="-1" max="0" value="0"></number-controller>
2014-08-15 02:21:38 +00:00
</gui-row>
</gui-panel>
2014-08-14 21:50:51 +00:00
<script>
2014-08-15 16:32:49 +00:00
var object = { "x": 25 };
2014-08-14 21:50:51 +00:00
2014-08-15 16:32:49 +00:00
document.addEventListener("polymer-ready", function() {
2014-08-14 21:50:51 +00:00
// Added via JavaScript
2014-08-15 16:32:49 +00:00
// var test1 = new NumberController();
// test1.min = 0;
// test1.max = 60;
// test1.value = 50;
2014-08-14 21:50:51 +00:00
2014-08-15 02:21:38 +00:00
// document.body.appendChild( test1 );
2014-08-15 16:32:49 +00:00
// var test2 = new NumberController();
var test2 = document.getElementById( 'test' );
2014-08-15 02:21:38 +00:00
test2.object = object
test2.property = "x";
2014-08-14 21:50:51 +00:00
2014-08-15 16:32:49 +00:00
window.test2 = test2;
console.log( test2 );
// Object.observe( object, function(changes) {
// changes.forEach( function( c ) {
// if ( c.name == "x" ) {
// console.log( "object.x was changed to " + c.object.x, typeof c.object.x );
// }
// } );
// } );
2014-08-14 21:50:51 +00:00
2014-08-15 02:21:38 +00:00
// document.body.appendChild( test2 );
// window.test2 = test2;
2014-08-14 21:50:51 +00:00
});
</script>
</body>
</html>