mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
55 lines
1.2 KiB
HTML
55 lines
1.2 KiB
HTML
|
<!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>
|
||
|
<link rel="import" href="number.html">
|
||
|
|
||
|
</head>
|
||
|
<body touch-action="auto" style="background: #e74400">
|
||
|
|
||
|
<!-- Added via DOM -->
|
||
|
<gui-number></gui-number>
|
||
|
<gui-number min="-1" max="1" value="0"></gui-number>
|
||
|
<gui-number min="-1" max="2" value="0"></gui-number>
|
||
|
|
||
|
|
||
|
<script>
|
||
|
|
||
|
var object = { 'x': 0 };
|
||
|
|
||
|
document.addEventListener('polymer-ready',function() {
|
||
|
|
||
|
// Added via JavaScript
|
||
|
|
||
|
var test1 = new NumberController();
|
||
|
test1.min = 0;
|
||
|
test1.max = 60;
|
||
|
test1.value = 50;
|
||
|
|
||
|
document.body.appendChild( test1 );
|
||
|
|
||
|
Object.observe( object, function(changes) {
|
||
|
changes.forEach( function( c ) {
|
||
|
if ( c.name == 'x' ) {
|
||
|
console.log( 'object.x was changed to ' + c.object.x );
|
||
|
}
|
||
|
} );
|
||
|
} );
|
||
|
|
||
|
var test2 = new NumberController();
|
||
|
test2.object = object
|
||
|
test2.property = 'x';
|
||
|
|
||
|
document.body.appendChild( test2 );
|
||
|
|
||
|
window.test2 = test2;
|
||
|
|
||
|
});
|
||
|
|
||
|
</script>
|
||
|
|
||
|
</body>
|
||
|
</html>
|