Files
leporello-js/index.html
2023-12-04 16:47:31 +08:00

476 lines
9.4 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Leporello.js</title>
<!--speedup loading-->
<link rel="modulepreload" href="/src/launch.js">
<script src='ace/ace.js'></script>
<script src='ace/keybinding-vim.js'></script>
<script src='ace/ext-language_tools.js'></script>
<style>
:root {
--shadow_color: rgb(171 200 214);
}
html, body, .app {
height: 100%;
}
body {
margin: 0px;
}
.app {
/* same as ace editor */
font-family: Monaco, Menlo, "Ubuntu Mono", Consolas, source-code-pro, monospace;
}
.app::backdrop {
background-color: white;
}
.root {
height: 100%;
display: grid;
grid-template-areas:
"code code"
"bottom files"
"statusbar statusbar";
grid-template-columns: 70% 30%;
grid-template-rows: auto 1fr 2.5em;
}
.editor_container, .bottom, .files_container, .statusbar {
box-shadow: 1px 1px 3px 0px var(--shadow_color);
}
.editor_container, .bottom, .statusbar, .files_container {
margin: 8px;
}
.editor_container:focus-within,
.bottom:focus-within,
.files_container:focus-within,
dialog {
outline: none;
box-shadow: 1px 1px 6px 3px var(--shadow_color);
}
.tab_content:focus-within, .problems_container:focus-within {
outline: none;
}
.editor_container {
height: 55vh;
resize: vertical;
position: relative;
grid-area: code;
font-size: 16px;
}
/* ace markers */
.selection {
position: absolute;
background-color: #ff00ff;
}
.evaluated_ok {
position: absolute;
background-color: rgb(225, 244, 253);
}
.evaluated_error {
position: absolute;
background-color: #ff000024;
}
.error-code {
/*
TODO: make underline like in all editors
*/
position: absolute;
border-bottom: 7px solid red;
}
/* end of ace markers */
.eval_error {
color: red;
}
/* Tabs */
.tabs {
display: flex;
padding-bottom: 0.5em;
}
.tabs > .tab {
margin-right: 1em;
padding: 0.3em 1em;
display: flex;
align-items: center;
}
.tabs > .tab.active {
background-color: rgb(225, 244, 253);
}
/* debugger */
.bottom {
grid-area: bottom;
overflow: auto;
display: grid;
}
.debugger {
display: flex;
flex-direction: column;
}
.debugger_wrapper {
display: flex;
flex: 1;
flex-direction: column;
overflow: auto;
}
.debugger, .problems_container {
padding: 5px;
overflow: auto;
}
.logs, .io_trace {
padding-left: 1em;
}
.logs .log {
cursor: pointer;
}
.logs .log.active {
background-color: rgb(225, 244, 253);
}
.tab_content {
flex: 1;
overflow: auto;
}
.callnode {
margin-left: 1em;
}
.callnode .active {
background-color: rgb(225, 244, 253);
}
.call_el {
cursor: pointer;
display: inline-block;
}
.call_header {
white-space: nowrap;
}
.call_header.error {
color: red;
}
.call_header.error.native {
color: red;
opacity: 0.5;
}
.call_header.native {
font-style: italic;
color: grey;
}
/* problems view */
.problem a {
color: red;
}
/* files */
.files_container {
overflow: auto;
grid-area: files;
display: flex;
flex-direction: column;
}
.allow_file_access {
display: flex;
flex-direction: column;
}
.allow_file_access .subtitle {
font-size: 0.8em;
}
.files {
overflow: auto;
padding: 5px;
}
.files .file {
margin-left: 1em;
}
.files > .file {
margin-left: 0em !important;
}
.files .file_title {
display: flex;
}
.files .file_title.active {
background-color: rgb(225, 244, 253);
}
.files .file_title .select_entrypoint {
margin-left: auto;
width: 40px;
text-align: center;
}
.files .file_title .icon {
display: inline-block;
margin-right: 5px;
width: 1em;
}
.file_actions {
position: relative;
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
padding: 5px;
background-color: rgb(225 244 253 / 80%);
}
.file_actions .file_action {
margin-right: 2em;
}
.file_actions .select_entrypoint_title {
width: 40px;
position: absolute;
right: 7px;
font-size: 0.8em;
text-align: center;
}
/* value_explorer */
.embed_value_explorer_container.is_not_dom_el {
height: 0px;
}
.embed_value_explorer_container.is_dom_el {
padding: 1em;
}
.embed_value_explorer_wrapper {
/* preserve wrapper from getting clicks for code line left to it */
pointer-events: none;
}
.embed_value_explorer_container.is_not_dom_el .embed_value_explorer_wrapper {
margin-left: 1em;
}
.embed_value_explorer_content {
pointer-events: initial;
white-space: pre;
max-width: fit-content;
background-color: white;
box-shadow: 1px 2px 3px -1px var(--shadow_color);
}
.embed_value_explorer_content:focus {
outline: none;
box-shadow: 1px 2px 11px 1px var(--shadow_color);
}
.embed_value_explorer_content > .value_explorer_node {
margin-left: 0 !important;
}
.embed_value_explorer_control {
display: block;
margin-bottom: 1em;
font-size: 0.9em;
}
.value_explorer_node {
margin-left: 1em;
}
.value_explorer_header.active {
background-color: rgb(148, 227, 191);
}
.value_explorer_key {
color: rgb(150, 0, 128);
font-weight: bold;
}
/* status */
.statusbar {
margin-bottom: 0px;
grid-area: statusbar;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
}
.status, .current_file {
font-size: 1.5em;
}
.status {
color: red;
}
.statusbar_action {
margin-right: 2em;
}
.statusbar_action.first {
margin-left: auto;
}
.open_app_window_button {
position: relative;
}
.open_app_window_tooltip {
padding: 1em;
position: absolute;
margin-bottom: 20px;
bottom: 100%;
border: none;
font-size: 1.7em;
background-color: rgb(120 206 247);
border-radius: 21px;
transform: scale(0);
transition: transform 0.3s;
}
.open_app_window_tooltip.on {
transform: scale(1);
}
.open_app_window_tooltip:after {
content: '';
width: 0;
height: 0;
border-left: 20px solid transparent;
border-right: 20px solid transparent;
border-top: 20px solid rgb(120 206 247);
position: absolute;
bottom: -20px;
left: 50%;
transform: translate(-50%);
}
.options {
padding: 5px;
}
.options > * {
margin: 5px;
}
.show_help, .github {
margin: 0em 0.5em;
}
.share_button, .upload_button {
border: none;
color: white;
background: rgb(23 166 236);
}
.share_button {
font-size: 1.2em;
margin-left: 1em;
margin-right: 0.5em;
}
.share_button[disabled] {
background: grey;
}
.share_dialog input, .share_dialog button {
font-size: 1.2em;
}
.share_dialog button {
padding: 5px;
height: 2em;
}
dialog {
border: none;
}
dialog::backdrop {
background-color: rgb(225 244 253 / 80%);
}
.help_dialog[open] {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding: 0;
min-width: 70%;
min-height: 70%;
background-color: white;
}
.help {
padding: 2em;
border-spacing: 5px;
}
.help th {
padding: 0.5em;
}
.help th.key {
width: 5em;
}
.help td.key {
background-color: rgb(225, 244, 253, 0.5);
border-radius: 10px;
text-align: center;
}
.help_dialog form {
margin-bottom: 1em;
}
</style>
<script type='module'>
// Shortcut for log(...) instead of console.log(...)
window.log = console.log
if(new URLSearchParams(window.location.search).get('leporello') == null) {
await import('./src/launch.js');
}
</script>
</head>
<body>
<div id='app' class='app'>
</div>
</body>
</html>