winzik/engine/web/index.html
David Nurdin 4b66104ac3 JumPHP IDE: the visual editor of forms (graphic PHP apps without HTML), double click writes the event in the code behind; New Project: graphic app, mobile app
- ide/ui/js/form-designer.js: palette, canvas drawn like JumPHP\Gui (rows, columns, 12-column grid with spans per screen
  width, stack, panels, spacers), desktop / laptop / tablet / iPhone / Android sizes, a resizable desktop window, layers,
  inspector (widget, children, size and place, columns per breakpoint, hidden on, events), undo / redo, drag and drop;
  a double click wires the widget's first event: the method is added to the form's class and opened; @property lines
  kept in step with the ids. *.form.yaml open in Design view (Code / Split too)
- the form travels as a JSON string (Tauri's bridge sorts objects' keys)
- engine: a row too wide gives the room back from its supple children; touch: false honoured by phones and the web page;
  view: window in the browser (the canvas is the page, no start overlay, no double click fullscreen)
- docs/gui.md, AGENTS.md section 17

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01X3cUrsDZg7JngzTEgWW6Nj
2026-11-01 22:59:37 +01:00

56 lines
3.8 KiB
HTML

<!DOCTYPE html>
<html lang="{{LANG}}">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover" />
<!-- real size of php-web.wasm (progress bar: Content-Length is wrong when the server compresses) -->
<meta name="php-wasm-size" content="{{WASM_SIZE}}" />
<title>{{TITLE}}</title>
<meta name="description" content="{{DESCRIPTION}}" />
<meta name="generator" content="JumPHP {{ENGINE_VERSION}}" />
<meta name="theme-color" content="#000000" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta property="og:title" content="{{TITLE}}" />
<meta property="og:description" content="{{DESCRIPTION}}" />
<link rel="icon" href="{{ICON}}" />
{{PWA_HEAD}}
<style>
:root { --ratio: {{WIDTH}} / {{HEIGHT}}; --accent: #ffd23f; }
html, body { margin: 0; height: 100%; background: #000; color: #ddd; font: 14px/1.4 system-ui, sans-serif; overflow: hidden; }
#stage { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
/* SDL (emscripten) takes the CSS size of the canvas as the window size: an explicit size, never CSS zoom */
#canvas { display: block; width: min(100vw, calc(100vh * var(--ratio))); aspect-ratio: var(--ratio); background: #000; outline: none; }
#canvas:fullscreen { width: 100vw; height: 100vh; aspect-ratio: auto; }
/* an app of forms (game.yaml view: window): the canvas is the page, the forms lay themselves out in it */
.view-window #canvas { width: 100vw; height: 100vh; height: 100dvh; aspect-ratio: auto; }
.view-window #toolbar { display: none; }
#loader, #overlay { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
gap: 14px; background: #0b0b18; z-index: 10; text-align: center; padding: 16px; box-sizing: border-box; }
#loader h1, #overlay h1 { margin: 0; font: bold 28px monospace; letter-spacing: 2px; color: #fff; }
#bar { width: min(320px, 80vw); height: 10px; border: 2px solid #fff; }
#bar > div { height: 100%; width: 0; background: var(--accent); transition: width .15s; }
#status { font-family: monospace; min-height: 1.4em; }
#loader.error #status { color: #ff6b6b; white-space: pre-wrap; max-width: 90vw; }
#overlay { display: none; cursor: pointer; background: rgba(0, 0, 0, .75); }
#overlay p { font: bold 18px monospace; color: var(--accent); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
#toolbar { position: fixed; right: 8px; bottom: 8px; z-index: 5; display: flex; gap: 6px; opacity: .35; transition: opacity .2s; }
#toolbar:hover { opacity: 1; }
#toolbar button { background: #222; color: #fff; border: 1px solid #555; border-radius: 4px; font: 12px monospace; padding: 4px 8px; cursor: pointer; }
</style>
<script>window.JUMPHP_GAME = {{GAME_JSON}};</script>
</head>
<body>
<div id="stage"><canvas id="canvas" width="{{WIDTH}}" height="{{HEIGHT}}" tabindex="-1" oncontextmenu="event.preventDefault()"></canvas></div>
<div id="toolbar"><button id="btn-sound" title="Sound">SOUND</button><button id="btn-full" title="Fullscreen">FULLSCREEN</button></div>
<div id="loader"><h1>{{TITLE}}</h1><div id="bar"><div></div></div><div id="status">Loading...</div></div>
<div id="overlay"><h1>{{TITLE}}</h1><p>CLICK / TAP TO PLAY</p></div>
<!-- networking for PHP (php-wasm-network): loaded before the engine, its wasmnet extension calls it.
{{ENGINE}}: empty for a normal build; the shared engine folder for a remote game (docs/remote.md) -->
<script src="{{ENGINE}}php-wasm-network.js?v={{V_NET}}"></script>
<script src="{{ENGINE}}touch.js?v={{V_TOUCH}}"></script>
<script type="module" src="{{ENGINE}}jumphp.js?v={{V_JS}}"></script>
</body>
</html>