Created
March 19, 2026 18:57
-
-
Save dell-optiplex-790/6437588e5c14c3b72b5fabf3080280d8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <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