Skip to content

Instantly share code, notes, and snippets.

@dell-optiplex-790
Created March 19, 2026 18:57
Show Gist options
  • Select an option

  • Save dell-optiplex-790/6437588e5c14c3b72b5fabf3080280d8 to your computer and use it in GitHub Desktop.

Select an option

Save dell-optiplex-790/6437588e5c14c3b72b5fabf3080280d8 to your computer and use it in GitHub Desktop.
<script src="https://unpkg.com/hexagonal.js@1.3.6/dist/hexagonal.min.js"></script>
<script>
var app = hexagonal.App();
function alignmentTest(state) {
return function(_) {
var align = ['left', 'center', 'right'];
for(var i = 0; i < align.length; i++) {
_.push(
['p', {textAlign: align[i]}, [
(function(align, i) {
return function(_) { _.push(align[i].toUpperCase()); }
})(align, i)
], '/p']
);
}
}
}
hexagonal.defineComponent({
name: 'tests',
state: {name: 'untitled'},
render: function(name, state) {
return [
['h1', {}, ['Text alignment'], '/h1'],
['center', {}, [
alignmentTest(state)
], '/center'],
]
}
});
hexagonal.defineComponent({
name: 'root',
state: {},
render: function(name, state) {
return [
['div', { fontFamily: 'Comic Sans MS' }, [
['tests', {}, [], '/tests']
], '/div']
]
}
});
app.init('root');
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment