Files
kryon/docs/site/ide.html
T
2026-08-26 16:21:10 -03:00

102 lines
3.9 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Kryon Web IDE</title>
<meta name="description" content="Edit simple .kry files in the browser, compile with Kryon WASM tools, and preview the generated KRB cartridge.">
<link rel="icon" type="image/png" sizes="16x16" href="icons/proj/kryon.png">
<link rel="stylesheet" href="styles.css">
</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="showcase.html">Showcase</a>
<a href="language.html">Language</a>
<a href="matrices.html">Matrices</a>
<a href="renderers.html">Renderers</a>
<a href="api.html">API</a>
<a href="live-examples.html">Live Examples</a>
<a href="ide.html">Web IDE</a>
<a class="star-pill" href="https://github.com/kryonlabs/kryon" target="_blank" rel="noopener">★ <span class="count">GitHub</span></a>
<a class="btn btn-primary" href="/#start">Get started</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 Web IDE</p>
<h1>Compile .kry in the browser</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="ide-grid">
<div class="ide-pane source-pane">
<div class="pane-title">
<span>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("Hello from .kry", 76, 86, Text24, (Color){31, 83, 102, 255})
Text("This page runs k2ir and k2b as WebAssembly, then renders the KRB cartridge.", 76, 134, Text16, (Color){42, 59, 64, 255})
Rect(76, 188, 292, 80, (Color){35, 101, 125, 255})
Text("Portable preview", 104, 219, Text20, WHITE)
Button((ButtonProps){.bounds = {76, 308, 184, 44}, .label = "Get started"})
}
}</textarea>
</div>
<div class="ide-pane preview-pane">
<div class="pane-title">
<span>Live KRB Preview</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="krb">KRB</button>
</div>
<pre class="artifact-output"><code data-artifact></code></pre>
</div>
</div>
</section>
</main>
<script src="ide-tools/k2ir.js"></script>
<script src="ide-tools/k2b.js"></script>
<script src="ide-tools/k2c.js"></script>
<script src="ide-tools/k2g.js"></script>
<script src="ide-tools/krb-web.js"></script>
<script src="ide.js"></script>
</body>
</html>