Files
kryon/docs/site/ide.html
T

110 lines
4.4 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Kryon Playground</title>
<meta name="description" content="Edit .kry files in the browser, compile with Kryon WASM tools, and preview the generated KRB cartridge from one place.">
<link rel="icon" type="image/png" sizes="16x16" href="icons/proj/kryon.png">
<link rel="stylesheet" href="styles.css">
<script src="theme.js"></script>
</head>
<body class="ide-page">
<header class="site-header">
<div class="site-header-inner">
<a class="brand" href="index.html">
<img src="icons/proj/kryon.png" alt="Kryon" width="22" height="22">
<span>KRYON</span>
</a>
<button class="menu-toggle" type="button" aria-label="Open site menu" aria-expanded="false" aria-controls="header-nav">Menu</button>
<nav class="header-nav" id="header-nav" aria-label="Primary">
<a href="/">Home</a>
<a href="docs.html">Docs</a>
<a href="language.html">Language</a>
<a href="renderers.html">Renderers</a>
<a href="showcase.html">Showcase</a>
<a href="api.html">API</a>
<a href="ide.html">Playground</a>
<a class="btn btn-primary" href="https://github.com/kryonlabs/kryon" target="_blank" rel="noopener">GitHub</a>
</nav>
</div>
</header>
<main class="web-ide" data-kryon-web-ide>
<section class="ide-shell">
<div class="ide-toolbar">
<div>
<p class="section-eyebrow">Kryon Playground</p>
<h1>Write, compile, and preview .kry</h1>
</div>
<div class="ide-actions">
<button class="btn" type="button" data-action="load-sample">Sample</button>
<button class="btn btn-primary" type="button" data-action="compile">Run</button>
</div>
</div>
<div class="live-grid">
<aside class="ide-pane example-browser">
<div class="pane-title">
<span>Examples</span>
<span data-count>loading</span>
</div>
<div class="example-list" data-example-list></div>
</aside>
<div class="ide-pane source-pane">
<div class="pane-title">
<span data-source-title>app.kry</span>
<span data-status>Loading compiler...</span>
</div>
<textarea spellcheck="false" data-source>#import "kryon.h"
app "Kryon Web IDE" {
size 800 520
}
App :: () #ui {
Screen root: {
Background((Color){249, 246, 235, 255})
Rect(48, 42, 704, 390, (Color){255, 254, 249, 255})
Text((TextProps){.bounds={76,86,0,0}, .text="Hello from .kry", .font=Text24, .color=(Color){31,83,102,255}, .wrap=TextWrapNone})
Text((TextProps){.bounds={76,134,0,0}, .text="This page runs k2kir and k2b as WebAssembly, then renders the KRB cartridge.", .font=Text16, .color=(Color){42,59,64,255}, .wrap=TextWrapNone})
Rect(76, 188, 292, 80, (Color){35, 101, 125, 255})
Text((TextProps){.bounds={104,219,0,0}, .text="Portable preview", .font=Text20, .color=WHITE, .wrap=TextWrapNone})
Button((ButtonProps){.bounds = {76, 308, 184, 44}, .label = "Get started"})
}
}</textarea>
</div>
<div class="ide-pane preview-pane">
<div class="pane-title">
<span>KRB Preview (supported nodes)</span>
<span data-preview-status>waiting</span>
</div>
<canvas width="800" height="520" data-preview></canvas>
</div>
<div class="ide-pane artifact-pane">
<div class="artifact-tabs" role="tablist" aria-label="Generated artifacts">
<button type="button" class="is-active" data-tab="kry">.kry</button>
<button type="button" data-tab="kir">KIR</button>
<button type="button" data-tab="c">C</button>
<button type="button" data-tab="go">Go</button>
<button type="button" data-tab="js">JS</button>
<button type="button" data-tab="krb">KRB</button>
</div>
<pre class="artifact-output"><code data-artifact></code></pre>
</div>
</div>
</section>
</main>
<script src="ide-tools/k2kir.js"></script>
<script src="ide-tools/k2b.js"></script>
<script src="ide-tools/k2c.js"></script>
<script src="ide-tools/k2go.js"></script>
<script src="ide-tools/k2js.js"></script>
<script src="ide.js"></script>
</body>
</html>