Hello friends,
I've been following pas2js development for some time now, but just recently began playing around with it. One thing that I thought I could develop to help the community (as well as learn more

) was a UI framework to build web apps.
Also in the spirit of write once compile everywhere, I wanted to be able to use the same framework to build desktop applications using the same code (or as much of it as possible).
I also wanted a way to fluently build interfaces via code, since this plays well with both compilers and has the perk of being very readable when reviewing diffs on commits and having full code completion at your disposal.
nyx is my stab at this,
https://github.com/mr-highball/nyx Under the hood, it will use the dom for browser elements and lcl for native apps.
In terms of maturity, nyx is an infant, and currently only supports a single element (control), and only minimal testing properties at that (but hey... I've only been working on it for a week). But now that I know things work, I plan to add quite a bit more in the coming days/weeks.
Below is a "hello world" with a single button and a click handler
procedure TBrowserTest.BuildUI;
var
I : Integer;
LID: String;
begin
//init the UI
UI := NewNyxUI;
//setup the ui with the demo ui components
UI
.AddContainer(NewNyxContainer, I) //add a container (holds elements)
.ContainerByIndex(I) //get the container we just added
.Add( //add a button to it
NewNyxButton
.UpdateText('Hello World') //sets our text for the display
.Observe(boClick, @HelloWorldClick, LID), //attaches a handler to the click event
I //optional recording of the index the button was added to in the container
)
.UI //scope to the UI property in order to call render
.Render(); //renders all containers and elements to the screen
end;
(See attached screenshot for this running in the browser)
Like I said, this is very early stages (and much earlier than I normally would post any demo) but if this interests anyone out there, perhaps you could check it out and provide some feedback.