152 lines
4.6 KiB
HTML
152 lines
4.6 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
<title>Karlkoder Playground</title>
|
|
<link rel="stylesheet" href="./style.css">
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.43.2/ace.js"></script>
|
|
<script
|
|
src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.43.2/ext-language_tools.js"
|
|
></script>
|
|
<script src="./src/index.js" type="module"></script>
|
|
</head>
|
|
<body>
|
|
<main>
|
|
<div class="column" style="flex: 1">
|
|
<div id="buttons">
|
|
<a
|
|
href="docs/index.html"
|
|
target="_blank"
|
|
>
|
|
<button class="icon-button secondary">
|
|
<img
|
|
src="https://chatgpt.com/favicon.ico"
|
|
width="20"
|
|
height="20"
|
|
>
|
|
ChatGPT
|
|
</button>
|
|
</a>
|
|
|
|
<div>
|
|
<button id="run-button">🏃 Run</button>
|
|
</div>
|
|
</div>
|
|
|
|
<section>
|
|
<div class="section-header">Output</div>
|
|
|
|
<canvas id="canvas-area" width="480" height="360"></canvas>
|
|
</section>
|
|
|
|
<section id="console-section">
|
|
<div class="section-header">
|
|
Console
|
|
</div>
|
|
|
|
<div id="console">
|
|
<pre id="console-code"></pre>
|
|
<input
|
|
id="console-input"
|
|
type="text"
|
|
placeholder=">"
|
|
>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
|
|
<div class="column" style="flex: 3">
|
|
<div id="project-header">
|
|
<div id="project-header-left">
|
|
<input
|
|
id="project-name"
|
|
type="text"
|
|
placeholder="Project name"
|
|
aria-label="Project name"
|
|
>
|
|
|
|
<button id="save-button">
|
|
💾 Save
|
|
</button>
|
|
|
|
<button id="load-button" class="secondary">
|
|
📄 Load
|
|
</button>
|
|
</div>
|
|
|
|
<button id="export-button">
|
|
↗️ Export
|
|
</button>
|
|
</div>
|
|
|
|
<section>
|
|
<div class="section-header">
|
|
Code editor
|
|
</div>
|
|
|
|
<div id="editor-area">
|
|
<pre
|
|
id="editor"
|
|
>
|
|
export const lib = karlkoder.lib();
|
|
|
|
lib.clear("green");
|
|
|
|
lib.drawRect(100, 100, 100, 100, "blue");
|
|
|
|
lib.println("hello world!");
|
|
|
|
let playerX = 0;
|
|
|
|
function loop(deltaT) {
|
|
|
|
playerX += 100 * deltaT;
|
|
|
|
lib.drawRect(playerX, 200, 50, 50, "red");
|
|
}
|
|
|
|
lib.startGameLoop(loop);
|
|
|
|
</pre
|
|
>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
|
|
<div class="column" id="sprite-editor-container" style="flex-grow: 0">
|
|
<div id="toggle-sprite-editor-button">
|
|
‹
|
|
</div>
|
|
|
|
<section id="sprite-editor">
|
|
<div class="section-header">
|
|
Sprite editor
|
|
</div>
|
|
|
|
<div id="sprite-editor-preview">
|
|
<p id="sprite-editor-preview-title"></p>
|
|
<img id="sprite-editor-preview-image" src="">
|
|
<code id="sprite-editor-preview-snippet"></code>
|
|
</div>
|
|
|
|
<p id="sprite-editor-sprite-list-title">Uploaded sprites</p>
|
|
<ul id="sprite-editor-sprite-list"></ul>
|
|
<button id="sprite-editor-upload-button">Upload new sprite</button>
|
|
</section>
|
|
</div>
|
|
</main>
|
|
|
|
<footer>
|
|
Copyright © 2025 S. J. Fakobsen (do whatever idc)
|
|
</footer>
|
|
|
|
<!-- fix flash bug in furry browser -->
|
|
<script>
|
|
0;
|
|
</script>
|
|
</body>
|
|
</html>
|