mirror of
https://github.com/roc-lang/roc.git
synced 2024-11-10 10:02:38 +03:00
fc991baf6a
The previous implemenation was adding a fake input and output
to the history and then removing just the input from the DOM.
We also removed the entry from the `inputHistory` array, to
prevent it appearing in the panel when you hit the UP arrow
enough times.
However this introduces a mismatch between the number of items
in `inputHistory` array and the number of `.history-item` divs
in the DOM.
This caused each REPL output to appear *above* the user input
that caused it! 🙃
The fix is to just make all of this separate from history!
We just make a separate call into Rust to get the initial :help.
The original idea was to share code between the initial :help
and the normal REPL operation, but they turn out to be only
similar, not the same.
104 lines
1.3 KiB
CSS
104 lines
1.3 KiB
CSS
html {
|
|
height: 100%;
|
|
}
|
|
body {
|
|
height: 92%;
|
|
background-color: #222;
|
|
color: #ccc;
|
|
font-family: sans-serif;
|
|
font-size: 12px;
|
|
}
|
|
.body-wrapper {
|
|
display: flex;
|
|
flex-direction: column;
|
|
max-width: 900px;
|
|
height: 100%;
|
|
margin: 0 auto;
|
|
padding: 0 24px;
|
|
}
|
|
h1 {
|
|
margin: 32px auto;
|
|
color: #eee;
|
|
text-align: center;
|
|
}
|
|
li {
|
|
margin: 8px;
|
|
}
|
|
section.history {
|
|
flex: 1;
|
|
position: relative;
|
|
height: 100%;
|
|
}
|
|
.scroll {
|
|
position: absolute;
|
|
top: 0;
|
|
bottom: 0;
|
|
left: 0;
|
|
right: 0;
|
|
overflow: auto;
|
|
}
|
|
#history-text {
|
|
margin: 16px 0;
|
|
padding: 8px;
|
|
}
|
|
#loading-message {
|
|
margin: 40% 10%;
|
|
}
|
|
.history-item {
|
|
margin-bottom: 24px;
|
|
}
|
|
.history-item .input {
|
|
margin: 0;
|
|
margin-bottom: 8px;
|
|
}
|
|
.history-item .output {
|
|
margin: 0;
|
|
}
|
|
.panic {
|
|
color: red;
|
|
}
|
|
.input-line-prefix {
|
|
color: cyan;
|
|
}
|
|
.code {
|
|
font-family: "Courier New", Courier, monospace;
|
|
background-color: #111;
|
|
color: #fff;
|
|
}
|
|
section.source {
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
section.source textarea {
|
|
padding: 8px;
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.color-red {
|
|
color: red;
|
|
}
|
|
.color-green {
|
|
color: green;
|
|
}
|
|
.color-yellow {
|
|
color: yellow;
|
|
}
|
|
.color-blue {
|
|
color: blue;
|
|
}
|
|
.color-magenta {
|
|
color: magenta;
|
|
}
|
|
.color-cyan {
|
|
color: cyan;
|
|
}
|
|
.color-white {
|
|
color: white;
|
|
}
|
|
.bold {
|
|
font-weight: bold;
|
|
}
|
|
.underline {
|
|
text-decoration: underline;
|
|
}
|