| 1 |
<!DOCTYPE html> |
| 2 |
<html lang="en"> |
| 3 |
|
| 4 |
<head> |
| 5 |
<meta charset="UTF-8"> |
| 6 |
<title>Fiat Cryptography Web Interface</title> |
| 7 |
<style> |
| 8 |
.error { |
| 9 |
color: red; |
| 10 |
white-space: pre-wrap; |
| 11 |
} |
| 12 |
|
| 13 |
.code-container { |
| 14 |
position: relative; |
| 15 |
} |
| 16 |
|
| 17 |
.code { |
| 18 |
display: block; |
| 19 |
white-space: pre-wrap; |
| 20 |
border: 1px solid #ddd; |
| 21 |
padding: 10px; |
| 22 |
position: relative; |
| 23 |
} |
| 24 |
|
| 25 |
.copy-button { |
| 26 |
position: absolute; |
| 27 |
top: 5px; |
| 28 |
right: 5px; |
| 29 |
background: #f8f8f8; |
| 30 |
padding: 5px; |
| 31 |
border: 1px solid #ddd; |
| 32 |
cursor: pointer; |
| 33 |
z-index: 1; |
| 34 |
} |
| 35 |
|
| 36 |
/*.output-filename { |
| 37 |
position: absolute; |
| 38 |
top: 5px; |
| 39 |
left: 5px; |
| 40 |
padding: 5px; |
| 41 |
border: 1px solid #ddd; |
| 42 |
z-index: 1; |
| 43 |
}*/ |
| 44 |
|
| 45 |
.hidden { |
| 46 |
display: none; |
| 47 |
} |
| 48 |
|
| 49 |
#inputArgs { |
| 50 |
width: 100%; |
| 51 |
box-sizing: border-box; |
| 52 |
} |
| 53 |
|
| 54 |
.form-row { |
| 55 |
display: flex; |
| 56 |
flex-wrap: wrap; |
| 57 |
align-items: center; |
| 58 |
/* margin-bottom: 10px; */ |
| 59 |
} |
| 60 |
|
| 61 |
.form-row label, |
| 62 |
.form-row button, |
| 63 |
.status-span, |
| 64 |
.permalink-span { |
| 65 |
margin-right: 10px; |
| 66 |
} |
| 67 |
|
| 68 |
.status-span, |
| 69 |
.permalink-span { |
| 70 |
flex-grow: 1; |
| 71 |
text-align: right; |
| 72 |
} |
| 73 |
|
| 74 |
.version { |
| 75 |
color: #333; |
| 76 |
} |
| 77 |
|
| 78 |
/*#io-container { |
| 79 |
display: flex; |
| 80 |
flex-wrap: wrap; |
| 81 |
gap: 10px; |
| 82 |
margin-top: 10px; |
| 83 |
} |
| 84 |
|
| 85 |
#io-container>div { |
| 86 |
flex: 1 1 50%; |
| 87 |
min-width: 300px; |
| 88 |
border: 1px solid #ddd; |
| 89 |
padding: 10px; |
| 90 |
box-sizing: border-box; |
| 91 |
} |
| 92 |
|
| 93 |
#io-container h3 { |
| 94 |
margin-top: 0; |
| 95 |
} |
| 96 |
|
| 97 |
.stdin-line, |
| 98 |
.file-entry { |
| 99 |
display: flex; |
| 100 |
align-items: center; |
| 101 |
margin-bottom: 5px; |
| 102 |
} |
| 103 |
|
| 104 |
.stdin-line textarea, |
| 105 |
.file-entry textarea { |
| 106 |
flex: 1; |
| 107 |
margin-left: 5px; |
| 108 |
} |
| 109 |
|
| 110 |
.file-entry input { |
| 111 |
margin-right: 5px; |
| 112 |
}*/ |
| 113 |
.input-columns { |
| 114 |
display: flex; |
| 115 |
flex-direction: row; |
| 116 |
gap: 20px; |
| 117 |
width: 100%; |
| 118 |
} |
| 119 |
|
| 120 |
.stdin-column, |
| 121 |
.files-column { |
| 122 |
flex: 1; |
| 123 |
min-width: 0; |
| 124 |
} |
| 125 |
|
| 126 |
.stdin-entry, |
| 127 |
.file-entry { |
| 128 |
display: flex; |
| 129 |
margin-bottom: 10px; |
| 130 |
position: relative; |
| 131 |
} |
| 132 |
|
| 133 |
.stdin-textarea, |
| 134 |
.file-content { |
| 135 |
flex-grow: 1; |
| 136 |
min-height: 60px; |
| 137 |
resize: vertical; |
| 138 |
padding: 8px; |
| 139 |
margin-right: 5px; |
| 140 |
} |
| 141 |
|
| 142 |
.file-name { |
| 143 |
margin-bottom: 5px; |
| 144 |
width: calc(100% - 60px); |
| 145 |
padding: 5px; |
| 146 |
} |
| 147 |
|
| 148 |
.file-entry { |
| 149 |
flex-direction: column; |
| 150 |
} |
| 151 |
|
| 152 |
.file-entry .remove-btn { |
| 153 |
position: absolute; |
| 154 |
right: 0; |
| 155 |
top: 0; |
| 156 |
} |
| 157 |
|
| 158 |
.remove-btn, |
| 159 |
.add-btn { |
| 160 |
background: #f0f0f0; |
| 161 |
border: 1px solid #ccc; |
| 162 |
border-radius: 3px; |
| 163 |
cursor: pointer; |
| 164 |
padding: 2px 8px; |
| 165 |
font-weight: bold; |
| 166 |
} |
| 167 |
|
| 168 |
.add-btn { |
| 169 |
margin-top: 5px; |
| 170 |
} |
| 171 |
|
| 172 |
@media (max-width: 768px) { |
| 173 |
.input-columns { |
| 174 |
flex-direction: column; |
| 175 |
} |
| 176 |
|
| 177 |
.stdin-column, |
| 178 |
.files-column { |
| 179 |
width: 100%; |
| 180 |
margin-bottom: 20px; |
| 181 |
} |
| 182 |
} |
| 183 |
</style> |
| 184 |
</head> |
| 185 |
|
| 186 |
<body> |
| 187 |
<div id="versionContainer"> |
| 188 |
<span class="version"> |
| 189 |
Fiat Cryptography <span id="version"></span> (<a href="https://github.com/mit-plv/fiat-crypto">GitHub |
| 190 |
Source</a>) |
| 191 |
</span> |
| 192 |
</div> |
| 193 |
<form id="inputForm" class="hidden"> |
| 194 |
<div class="form-row"> |
| 195 |
<input type="text" id="inputArgs" placeholder="Enter arguments"> |
| 196 |
</div> |
| 197 |
<div class="form-row"> |
| 198 |
<label> |
| 199 |
<input type="radio" name="inputType" value="json"> Input JSON Array |
| 200 |
</label> |
| 201 |
<label> |
| 202 |
<input type="radio" name="inputType" value="string" checked> Input String |
| 203 |
</label> |
| 204 |
<label> |
| 205 |
<input type="checkbox" id="wasm" name="codeKind" value="wasm"> Use WASM <span |
| 206 |
id="extraWasmLabel"></span> |
| 207 |
</label> |
| 208 |
</div> |
| 209 |
<div class="form-row"> |
| 210 |
<div class="input-columns"> |
| 211 |
<div class="stdin-column hidden"> |
| 212 |
<h3>Standard Input</h3> |
| 213 |
<div class="stdin-entries" id="stdinEntries"></div> |
| 214 |
<button type="button" id="addStdinButton" class="add-btn">+</button> |
| 215 |
<textarea id="stdinTextArea" class="hidden" placeholder="Enter stdin" readonly></textarea> |
| 216 |
</div> |
| 217 |
<div class="files-column"> |
| 218 |
<h3>Input Files <button type="button" id="addFileButton" class="add-btn">+</button></h3> |
| 219 |
<div class="file-entries" id="fileEntries"> |
| 220 |
<div class="file-entry"> |
| 221 |
<input type="text" class="file-name" placeholder="Filename"> |
| 222 |
<textarea class="file-content" placeholder="File content"></textarea> |
| 223 |
<button type="button" class="remove-btn">-</button> |
| 224 |
</div> |
| 225 |
</div> |
| 226 |
<textarea id="filesTextArea" class="hidden" placeholder="Enter files" readonly></textarea> |
| 227 |
</div> |
| 228 |
</div> |
| 229 |
</div> |
| 230 |
<div class="form-row"> |
| 231 |
<button type="button" id="synthesizeButton">Synthesize</button> |
| 232 |
<button type="button" id="cancelButton" disabled>Cancel</button> |
| 233 |
<span id="status" class="status-span hidden"></span> |
| 234 |
<a id="permalink" class="permalink-span hidden" href="#">Pseudopermalink</a> |
| 235 |
<button type="button" id="clearCacheButton">Clear Cache</button> |
| 236 |
</div> |
| 237 |
</form> |
| 238 |
<div id="error" class="error hidden"></div> |
| 239 |
<div id="output" class="hidden"> |
| 240 |
<div id="stdoutContainer" class="code-container"> |
| 241 |
<code id="stdout" class="code"></code> |
| 242 |
<button class="copy-button" data-target="stdout">Copy</button> |
| 243 |
</div> |
| 244 |
<div id="stderrContainer" class="code-container hidden"> |
| 245 |
<code id="stderr" class="code"></code> |
| 246 |
<button class="copy-button" data-target="stderr">Copy</button> |
| 247 |
</div> |
| 248 |
<div id="outputFilesContainer" class="code-container-container hidden"></div> |
| 249 |
</div> |
| 250 |
<script src="version.js"></script> |
| 251 |
<script src="https://unpkg.com/wasm-feature-detect/dist/umd/index.js"></script> |
| 252 |
<script src="file-input.js"></script> |
| 253 |
<script src="main.js"></script> |
| 254 |
|
| 255 |
<script src="disable-wasm-option.js"></script> |
| 256 |
<script src="copy-button.js"></script> |
| 257 |
|
| 258 |
|
| 259 |
|
| 260 |
|
| 261 |
|
| 262 |
|
| 263 |
|
| 264 |
|
| 265 |
|
| 266 |
|
| 267 |
|
| 268 |
|
| 269 |
|
| 270 |
|
| 271 |
|
| 272 |
|
| 273 |
|
| 274 |
|
| 275 |
|
| 276 |
|
| 277 |
|
| 278 |
|
| 279 |
|
| 280 |
|
| 281 |
|
| 282 |
|
| 283 |
|
| 284 |
|
| 285 |
|
| 286 |
|
| 287 |
</body> |
| 288 |
|
| 289 |
</html> |