1
Fork 0
hare-playground/frontend/code.html

72 lines
1.9 KiB
HTML
Raw Normal View History

2024-05-24 21:53:23 +00:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>code</title>
<link rel="stylesheet" href="" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="codapi.js"></script>
<script src="codapi-settings.js"></script>
<link rel="stylesheet" href="codapi.css" />
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}
pre {
margin-bottom: 0;
background: #f5f5f5;
line-height: 1.2;
}
code {
display: block;
padding: 1.5em;
}
codapi-snippet {
display: block;
margin-bottom: 0.8em;
background: #f5f5f5;
}
codapi-toolbar button {
padding: 0;
border: none;
background: none;
line-height: 1.35;
color: #008bf5;
font-size: 16px;
}
codapi-toolbar button::after {
content: " ▶";
}
codapi-toolbar a {
color: #008bf5;
border-bottom: 1px solid rgba(0, 139, 245, 0.2);
text-decoration: none;
font-size: 16px;
}
</style>
</head>
<body>
2024-05-24 23:16:44 +00:00
<codapi-settings url="https://hare-exec.fly.dev/v1"></codapi-settings>
2024-05-24 21:53:23 +00:00
<div id="playground">
2024-05-24 23:16:44 +00:00
<pre class="code"><code contenteditable="true">use fmt;
2024-05-24 22:07:10 +00:00
export fn main() void = {
const greetings = [
"Hello, world!",
"¡Hola Mundo!",
"Γειά σου Κόσμε!",
"Привіт, світ!",
"こんにちは世界!",
];
for (let i = 0z; i < len(greetings); i+= 1) {
fmt::println(greetings[i])!;
};
};
</code></pre>
2024-05-24 21:53:23 +00:00
</div>
2024-05-24 22:07:10 +00:00
<codapi-snippet sandbox="hare" editor="basic" selector="#playground .code">
2024-05-24 21:53:23 +00:00
</codapi-snippet>
</body>
</html>