-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
173 lines (158 loc) · 4.1 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>joRdan Interpreter</title>
<style>
html {
font-family: monospace;
white-space: pre-wrap;
background: #556271;
color: white;
}
body {
display: flex;
justify-content: center;
}
textarea {
padding: 10px;
border-radius: 10px;
outline: none;
resize: none;
width: 100%;
box-sizing: border-box;
}
.err {
color: red;
}
.return {
color: chocolate;
}
.input {
color: white;
}
.warn {
color:rgb(255, 0, 200);
}
#app {
display: flex;
flex-direction: row;
justify-content: center;
}
.title {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
margin-top: 0;
margin-bottom: 0;
}
.subtitle {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
font-weight: 100;
margin: 0;
}
.interpreter {
width: 50vw;
}
.repl-entry {
padding: 5px;
}
.repl {
margin: 5px;
padding: 10px;
border-radius: 10px;
border: 1px #757575;
font-family: monospace;
height: 50vh;
overflow-y: auto;
background: #282E35;
}
::-webkit-scrollbar {
width: 6px;
}
::-webkit-scrollbar-track {
margin-top: 10px;
margin-bottom: 10px;
}
/* Handle */
::-webkit-scrollbar-thumb {
background: #888;
border-right: 4px rgba(0, 0, 0, 0) solid;
background-clip: padding-box;
/* border-radius: 3px;
border: 4px solid rgba(0,0,0,0);
background-clip: padding-box; */
}
.environment {
background-color: rgba(1,1,1,0.2);
width: 25vw;
border-radius: 10px;
margin: 5px;
padding: 10px;
}
table {
border-collapse: collapse;
table-layout: fixed;
width: 100%;
}
td, th {
border: 1px solid #dddddd;
overflow: hidden;
text-align: left;
}
tr:nth-child(odd) {
background-color: #666666;
}
</style>
</head>
<body>
<div id="app">
<div class="interpreter">
<div style="padding-bottom: 8px;">
<h1 class="title">joRdan interpreter!</h1>
<h4 class="subtitle">by Daniel Hoe and Joash Chin</h4>
</div>
<div id="container" ref="container" class="repl">
<div v-for="entry in history" :class="outputType(entry.type)">
{{ entry.printOutput }}
</div>
</div>
<div class="repl-entry">
<textarea rows="5"
v-model="program"
@keyup.up.exact='getPreviousInput()'
@keyup.shift.enter=''
@keyup.enter.exact='repl(program)'
@keyup.down.exact='getNextInput()'
spellcheck="false"
type="text">
</textarea>
</div>
</div>
<div class="environment">
<h2 class="subtitle">Options</h2>
<label><input type="checkbox" v-model="options.warnPartialArgs" v-on:change="updateOptions">Warn Partial Args</label><br>
<label><input type="checkbox" v-model="options.warn" v-on:change="updateOptions">Show Warnings</label>
<h2 class="subtitle">Environment</h2>
<table>
<colgroup>
<col width="50%"/>
<col width="30%"/>
<col width="20%"/>
</colgroup>
<tr>
<th>Variable</th>
<th>Type</th>
<th>Length</th>
</tr>
<tr v-for="entry in env">
<td>{{ entry[0].pname }}</td>
<td>{{ entry[1].tag }}</td>
<td>{{ varlen(entry[1]) }}</td>
</tr>
</table>
</div>
</div>
<script src='./src/main.ts'></script>
</body>
</html>