Skip to content

Commit

Permalink
Minor examples improvements (#387)
Browse files Browse the repository at this point in the history
* Minor examples improvements

* Revert import map

* Revert import map

* Tweak numericinput example
  • Loading branch information
willeastcott authored Dec 27, 2024
1 parent f4a1429 commit ba8f909
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
18 changes: 10 additions & 8 deletions examples/elements/numericinput.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,24 @@
</head>
<body>
<script type="module">
import { LabelGroup, NumericInput } from '@playcanvas/pcui';
import { InfoBox, LabelGroup, NumericInput } from '@playcanvas/pcui';
import '@playcanvas/pcui/styles'

const numericInput = new NumericInput({
step: 0.1,
min: 0,
max: 1,
value: 0.5
});
const numericInput = new NumericInput();

const labelGroup = new LabelGroup({
field: numericInput,
text: 'NumericInput'
text: 'Enter a number:'
});
labelGroup.dom.querySelector('.pcui-label').style.width = '125px';

const infoBox = new InfoBox({
icon: 'E400',
text: 'NumericInput supports expressions and percentages. For example, you can enter "10 * (2 + 3)" to get a value of 50. You can also enter "50%" to calculate the percentage of the current value. You can even use percentages in expressions.'
});

document.body.appendChild(labelGroup.dom);
document.body.appendChild(infoBox.dom);
</script>
</body>
</html>
2 changes: 1 addition & 1 deletion examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
const treeView = new TreeView({
allowRenaming: false,
allowReordering: false,
allowDragging: false
allowDrag: false
});

const iframe = document.createElement('iframe');
Expand Down

0 comments on commit ba8f909

Please sign in to comment.