Skip to content

Commit 896177e

Browse files
feat: #9 input and output editor areas side by side
1 parent a001308 commit 896177e

2 files changed

Lines changed: 27 additions & 9 deletions

File tree

src/index.html

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,23 @@
3030
<!-- <script type="module" src="./scripts/editor.ts"></script> -->
3131

3232
<style>
33+
#playground-container {
34+
display: flex;
35+
gap: 2%;
36+
width: 100%;
37+
height: 80vh;
38+
}
39+
3340
#input-container,
3441
#output-container {
35-
width: 48%;
42+
flex: 1;
43+
width: 100%;
44+
}
45+
46+
#input-content,
47+
#output-content {
48+
width: 100%;
3649
height: 100%;
37-
display: inline-block;
3850
}
3951
</style>
4052
</head>
@@ -43,11 +55,17 @@
4355

4456
<h1>WCC Playground</h1>
4557

46-
<h2>Input</h2>
47-
<div id="input-container"></div>
58+
<div id="playground-container">
59+
<div id="input-container">
60+
<h2>Input</h2>
61+
<div id="input-content"></div>
62+
</div>
4863

49-
<h2>Output</h2>
50-
<div id="output-container"></div>
64+
<div id="output-container">
65+
<h2>Output</h2>
66+
<div id="output-content"></div>
67+
</div>
68+
</div>
5169

5270
<wcc-footer></wcc-footer>
5371
</body>

src/scripts/repl-init.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as monaco from "monaco-editor/esm/vs/editor/editor.main.js";
22

3-
const inputContainer = document.getElementById("input-container") as HTMLDivElement;
4-
const outputContainer = document.getElementById("output-container") as HTMLDivElement;
3+
const inputContainer = document.getElementById("input-content") as HTMLDivElement;
4+
const outputContainer = document.getElementById("output-content") as HTMLDivElement;
55
const workerUrl = new URL("./repl.ts", import.meta.url);
66
const worker = new Worker(workerUrl, { type: "module" });
77

@@ -17,7 +17,7 @@ const inputContents = `
1717
</style>
1818
1919
<footer class="footer">
20-
<h4>My Blog &copy; ${new Date().getFullYear()}</h4>
20+
<h4>My Blog &copy; \${new Date().getFullYear()}</h4>
2121
</footer>
2222
\`;
2323

0 commit comments

Comments
 (0)