Skip to content
This repository was archived by the owner on Nov 12, 2025. It is now read-only.

Commit e8e2af4

Browse files
authored
Modernise webpage (#9)
1 parent 5c546ce commit e8e2af4

File tree

2 files changed

+118
-43
lines changed

2 files changed

+118
-43
lines changed

static/index.html

Lines changed: 26 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,39 @@
11
<!DOCTYPE html>
22

3+
<html lang="en">
34
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
8+
49
<title>ExpressionScript Playground</title>
10+
<link rel="stylesheet" href="style.css">
511
</head>
6-
7-
<div class="header">
8-
Basic ExpressionScript Playground
9-
</div>
10-
1112
<body>
12-
<textarea id="input" onkeydown="if(event.keyCode===9){var v=this.value,s=this.selectionStart,e=this.selectionEnd;this.value=v.substring(0, s)+' '+v.substring(e);this.selectionStart=this.selectionEnd=s+4;return false;}" rows=50>
13-
@name Example Code
13+
<div class="header">Basic ExpressionScript Playground</div>
14+
<div class="editors">
15+
<textarea id="input" onkeydown="onEditInput(this, event)" rows=50>@name Example Code
1416
print("Hello world!")
1517

1618
for(I = 1, 5) {
1719
if(I == 4) { continue }
1820
print(I)
19-
}
20-
21-
</textarea>
22-
23-
<textarea readonly id="output" rows=50> </textarea>
24-
25-
<center>
26-
<button id="transpile">Transpile!</button>
27-
</center>
28-
21+
}</textarea>
22+
23+
<textarea readonly id="output" rows=50></textarea>
24+
</div>
25+
<div class="footer"><button id="transpile">Transpile</button></div>
26+
27+
<script>
28+
function onEditInput(element, event) {
29+
if (event.keyCode === 9) {
30+
const v = element.value, s = element.selectionStart, e = element.selectionEnd;
31+
element.value = v.substring(0, s) + ' ' + v.substring(e);
32+
element.selectionStart = element.selectionEnd = s + 4;
33+
return false;
34+
}
35+
}
36+
</script>
2937
<script src="out.js"></script>
3038
</body>
31-
32-
<style>
33-
textarea {
34-
width: 40%;
35-
margin-left: 50px;
36-
background-color: #39464e;
37-
border: none;
38-
outline: none;
39-
color: lightslategray;
40-
}
41-
body {
42-
margin: 0;
43-
background-color:#1f2227;
44-
display: block;
45-
color: lightslategray;
46-
}
47-
48-
div.header {
49-
text-align: center;
50-
background-color: #1f1f7a;
51-
color: #ebebfa;
52-
padding: 0;
53-
height: 50px;
54-
margin: 0;
55-
}
56-
</style>
39+
</html>

static/style.css

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
:root {
2+
--primary: #2e3031;
3+
--primary-font: rgb(118, 78, 134);
4+
5+
--editor: #262727;
6+
--editor-font: rgb(216, 220, 224);
7+
8+
--button: rgb(118, 78, 134);
9+
--button-font: rgb(216, 220, 224);
10+
11+
font-size: 20px;
12+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
13+
}
14+
15+
html,body {
16+
margin: 0;
17+
padding: 0;
18+
width: 100vw;
19+
height: 100vh;
20+
}
21+
22+
body {
23+
display: flex;
24+
flex-direction: column;
25+
26+
background-color: var(--primary);
27+
color: var(--primary-font);
28+
29+
overflow: hidden;
30+
}
31+
32+
.header {
33+
text-align: center;
34+
margin-top: 5px;
35+
36+
font-size: 2em;
37+
font-weight: 300;
38+
letter-spacing: 0.1em;
39+
}
40+
41+
.editors {
42+
flex: 1;
43+
min-height: 5em;
44+
45+
display: flex;
46+
flex-direction: row;
47+
}
48+
textarea {
49+
flex: 1;
50+
51+
margin: 10px;
52+
padding: 5px;
53+
54+
background-color: var(--editor);
55+
color: var(--editor-font);
56+
57+
resize: none;
58+
59+
border: none;
60+
outline: none;
61+
62+
-webkit-box-shadow: none;
63+
-moz-box-shadow: none;
64+
box-shadow: none;
65+
}
66+
67+
.footer {
68+
display: grid;
69+
justify-content: center;
70+
align-items: center;
71+
72+
padding-bottom: 10px;
73+
74+
flex-shrink: 0;
75+
}
76+
77+
button {
78+
border: 0;
79+
border-radius: 5px;
80+
padding: 3px;
81+
82+
background-color: var(--button);
83+
color: var(--button-font);
84+
85+
font-size: 1.5em;
86+
}
87+
button:hover {
88+
filter: brightness(110%);
89+
}
90+
button:active {
91+
filter: brightness(90%);
92+
}

0 commit comments

Comments
 (0)