forked from vihdzp/offbuilder-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
232 lines (193 loc) · 5.81 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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>OFFBuilder</title>
<link rel="icon" href="public/offbuilder.ico">
<style>
/* Logical sizing, common font for the application. */
* {
box-sizing:border-box;
font-family:sans-serif;
}
/* Uses a monospace font for the code editor. */
.ace_editor * {
font-family: monospace;
}
/* The main div contains the entire application, except the buttons
* on the bottom. */
#main-div {
width:calc(100vw - 10px);
height:calc(100vh - 55px);
margin:0;
}
/* Centers and configures the "Coordinates:" label. */
#coord-lbl {
text-align:center;
display:block;
font-size:16px;
font-weight:bold;
}
/* Centers and configures the "Output" and "Code" label. */
.secondary-lbl {
height:20px;
text-align:center;
display:block;
font-size:14px;
font-weight:bold;
}
/* Aligns every new div on the main div to the left. */
#main-div>div {
float:left;
}
/* Configures the div to input coordinates. */
#input-div {
width:100%;
height:60px;
padding:5px 15px 0 10px;
}
/* Configures the "Coordinates:" textbox. */
#in-txt {
width:100%;
height:20px;
text-align:center;
}
/* Configure the div with the permutations and sign changes. */
#options-div {
width:30%;
height:calc(100% - 60px);
overflow-y:scroll;
overflow-x:hidden;
padding:0;
}
/* Adds spaces between radio buttons and checkboxes. */
input[type="radio"], input[type="checkbox"] {
margin: 7px 0 7px 0;
}
.checkboxDiv {
overflow-x:auto;
width:calc(30vw - 80px);
white-space:nowrap;
border:1px solid gray;
padding:2px 5px 2px 5px;
}
/* Configures the + and × buttons. */
.squareBtn {
height:23px;
width:23px;
font-size:14px;
padding:0;
}
/* Configures the "Output" and "Code" div. */
#textarea-div {
width:70%;
height:calc(100% - 55px);
padding:10px;
}
/* Configures the "Output" and "Code" divs. */
#output-div, #code-div {
width:100%;
height:50%;
}
textarea {
position:relative;
width:100%;
height:calc(100% - 30px);
resize:none
}
#code-txt {
position:relative;
width:100%;
height:calc(100% - 30px);
border:1px solid gray;
}
.change {
border:1px solid gray;
padding:10px;
margin:5px 0px 5px 0px;
}
#buttons-div>input {
font-size:16px;
width:80px;
margin:10px 5px 0 5px;
}
</style>
</head>
<body>
<a id="dl-a" href=""></a>
<!-- Main div, contains everything but the buttons. -->
<div id="main-div">
<!-- Input div, contains the coordinate textbox. -->
<div id="input-div">
<label for="in-txt" id="coord-lbl">Coordinates:</label>
<input type="text" id="in-txt" />
</div>
<!-- Options div, the entire left panel. -->
<div id="options-div">
<!-- Dimensions fieldset. -->
<fieldset>
<legend>Dimensions</legend>
<input type="number" min="1" max="100" value="4" id="dimensions-nud" />
<input type="button" style="float:right;" id="project-btn" />
</fieldset>
<!-- Scale fieldset. -->
<fieldset>
<legend>Scale</legend>
<input type="text" id="scale-txt" placeholder="1" />
<input type="button" value="Apply" style="float:right;" id="scale-btn" />
</fieldset>
<!-- Formatting fieldset. -->
<fieldset>
<legend>Formatting</legend>
<form name="formatting">
<input name="radio" type="radio" id="spaces-rad" checked /><label for="spaces-rad"> Separate by spaces</label><br />
<input name="radio" type="radio" id="commas-rad" /><label for="commas-rad"> Separate by commas</label><br />
<input type="checkbox" id="paren-chk" /><label for="paren-chk"> Enclosing parentheses</label><br />
<input type="checkbox" id="newline-chk" /><label for="newline-chk"> Use Windows line ending</label><br />
</form>
</fieldset>
<fieldset id = "sign-fst">
<legend><span style="width:100px;display:inline-block;">Sign changes</span>
<input type="button" class="squareBtn" value="+" id="plussigns-btn" />
<input type="button" class="squareBtn" value="×" id="minussigns-btn" disabled />
</legend>
</fieldset>
<fieldset id = "perm-fst">
<legend><span style="width:100px;display:inline-block;">Permutations</span>
<input type="button" class="squareBtn" value="+" id="plusperms-btn" />
<input type="button" class="squareBtn" value="×" id="minusperms-btn" disabled />
</legend>
</fieldset>
</div>
<div id="textarea-div">
<div id="output-div">
<label for="out-txt" class="secondary-lbl">Output</label>
<textarea id="out-txt" readonly></textarea>
</div>
<div id="code-div">
<label for="code-txt" class="secondary-lbl">Code</label>
<div id="code-txt"></div>
</div>
</div>
</div>
<div id="buttons-div">
<input type="button" id="clear-btn" value="Clear" />
<input type="button" id="undo-btn" value="Undo" />
<input type="button" id="insert-btn" style="float:right" value="Insert"/>
<input type="button" id="copy-btn" style="float:right" value="Copy"/>
<input type="button" id="import-btn" style="float:right" value="Import"/>
<input type="button" id="export-btn" style="float:right" value="Export"/>
</div>
<input id="input-ofd" type="file" style="position: fixed; top: -100em"/>
<!-- Loads ace. -->
<script src="src/ace/ace.js"></script>
<script src="src/ace/mode-javascript.js"></script>
<script src="src/ace/worker-javascript.js"></script>
<script>
const editor = ace.edit("code-txt");
const JavaScriptMode = ace.require("ace/mode/javascript").Mode;
editor.session.setMode(new JavaScriptMode());
</script>
<script type="module" src="src/main.js"></script>
</body>
</html>