Expand/Shrink

pwa/p2js

The program Phix\pwa\p2js.exw and the contents of the Phix\pwa directory represent the next big step for Phix:
running the exact same program source code both on the desktop and directly in a web browser.
The files pwa\p2js.js, pwa\pGUI.js and pGUI.css contain a basic JavaScript re-implementation of a subset of the standard builtins (especially any that use inline assembly in desktop/Phix) and pGUI.e, and the directory pwa\builtins contains auto-transpiled versions of other (more normal) builtins/autoincludes.

Example:

--
-- pwa\phix\hello_world.exw
-- ========================
--
include pGUI.e

IupOpen()
Ihandle lbl = IupFlatLabel("World","EXPAND=YES, ALIGNMENT=ACENTER")
Ihandln dlg = IupDialog(lbl,`TITLE="Hello", MINSIZE=225x75`)
--X IupSetAttribute(dlg,"HIDEHEADERS","YES")
--if SIZE <?? then
--IupSetInt(dlg,"HIDEHEADERS",true)
--end if

IupShow(dlg)
if platform()!=JS then
    IupMainLoop()
    dlg = IupDestroy(dlg)
    IupClose()
end if

Look familiar? Well it should:

Desktop

Browser


As you can see, the aim is "reasonably similar" rather than "pixel perfect".
You can move, resize, and maximise/restore the window just like the desktop.
In fact you should be able to run an online demo here.