diff options
| author | 8cy <[email protected]> | 2020-04-23 01:42:13 -0700 |
|---|---|---|
| committer | 8cy <[email protected]> | 2020-04-23 01:42:13 -0700 |
| commit | 9edf1fa9431016cdd4e08c8afaff52cf0909f22b (patch) | |
| tree | 2d35a76b5103f43af419400b4c5492eae84b146b /connection | |
| parent | change verify upload button (diff) | |
| download | acantha.ga-admin-9edf1fa9431016cdd4e08c8afaff52cf0909f22b.tar.xz acantha.ga-admin-9edf1fa9431016cdd4e08c8afaff52cf0909f22b.zip | |
stage 2legacy-2
Diffstat (limited to 'connection')
| -rw-r--r-- | connection/private/index.html | 58 | ||||
| -rw-r--r-- | connection/private/main.css | 106 | ||||
| -rw-r--r-- | connection/private/other.js | 177 |
3 files changed, 341 insertions, 0 deletions
diff --git a/connection/private/index.html b/connection/private/index.html new file mode 100644 index 0000000..a858dee --- /dev/null +++ b/connection/private/index.html @@ -0,0 +1,58 @@ +<html> + <head> + <meta charset="utf-8" /> + <meta http-equiv="X-UA-Compatible" content="chrome=1" /> + <title>198.168.0.1</title> + <!--<script src="http://www.codehelper.io/api/ips/?js"></script>--> + <script src="https://code.jquery.com/jquery-2.1.1.min.js"></script> + <link href="https://fonts.googleapis.com/css?family=Inconsolata" + rel="stylesheet" type="text/css" /> + <link rel="stylesheet" href="main.css"> + <script src="other.js"></script> + <script> + $(function() { + + // Set the command-line prompt to include the user's IP Address + //$('.prompt').html('[' + codehelper_ip["IP"] + '@HTML5] # '); + var ip = (Math.floor(Math.random() * 255) + 1) + "." + (Math.floor(Math.random() * 255)) + "." + (Math.floor(Math.random() * 255)) + "." + (Math.floor(Math.random() * 255)); + //$('.prompt').html('[[email protected]] # '); + $('.prompt').html('[user@' + ip + '] # '); + + // Initialize a new terminal object + var term = new Terminal('#input-line .cmdline', '#container output'); + term.init(); + + // Update the clock every second + setInterval(function() { + function r(cls, deg) { + $('.' + cls).attr('transform', 'rotate('+ deg +' 50 50)') + } + var d = new Date() + r("sec", 6*d.getSeconds()) + r("min", 6*d.getMinutes()) + r("hour", 30*(d.getHours()%12) + d.getMinutes()/2) + }, 1000); + }); + </script> + </head> + <body> + <div id="container"> + <output></output> + <div id="input-line" class="input-line"> + <div class="prompt"></div><div><input class="cmdline" autofocus /></div> + </div> + </div> + + <div class="clock-container"> + <svg viewBox="0 0 100 100"> + <circle cx="50" cy="50" r="45"/> + <g> + <rect class="hour" x="47.5" y="12.5" width="5" height="40" rx="2.5" ry="2.55" /> + <rect class="min" x="48.5" y="12.5" width="3" height="40" rx="2" ry="2"/> + <line class="sec" x1="50" y1="50" x2="50" y2="16" /> + </g> + </svg> + </div> + + </body> +</html>
\ No newline at end of file diff --git a/connection/private/main.css b/connection/private/main.css new file mode 100644 index 0000000..f01abce --- /dev/null +++ b/connection/private/main.css @@ -0,0 +1,106 @@ +::selection { + background: #FF5E99; +} +html, body { + width: 100%; + height: 100%; + margin: 0; +} +body { + font-size: 11pt; + font-family: Inconsolata, monospace; + color: white; + background-color: black; +} +#container { + padding: .1em 1.5em 1em 1em; +} +#container output { + clear: both; + width: 100%; +} +#container output h3 { + margin: 0; +} +#container output pre { + margin: 0; +} +.input-line { + display: -webkit-box; + -webkit-box-orient: horizontal; + -webkit-box-align: stretch; + display: -moz-box; + -moz-box-orient: horizontal; + -moz-box-align: stretch; + display: box; + box-orient: horizontal; + box-align: stretch; + clear: both; +} +.input-line > div:nth-child(2) { + -webkit-box-flex: 1; + -moz-box-flex: 1; + box-flex: 1; +} +.prompt { + white-space: nowrap; + color: #96b38a; + margin-right: 7px; + display: -webkit-box; + -webkit-box-pack: center; + -webkit-box-orient: vertical; + display: -moz-box; + -moz-box-pack: center; + -moz-box-orient: vertical; + display: box; + box-pack: center; + box-orient: vertical; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; +} +.cmdline { + outline: none; + background-color: transparent; + margin: 0; + width: 100%; + font: inherit; + border: none; + color: inherit; +} +.ls-files { + height: 45px; + -webkit-column-width: 100px; + -moz-column-width: 100px; + -o-column-width: 100px; + column-width: 100px; +} + + +/************************************************************/ +/* SVG Clock */ +/************************************************************/ + +.clock-container { + display: none /*inline-block*/; + position: relative; + width: 200px; + vertical-align: middle; + overflow: hidden; +} + +.clock-container > svg > circle { + stroke-width: 2px; + stroke: #fff; +} + +.hour, .min, .sec { + stroke-width: 1px; + fill: #333; + stroke: #555; +} + +.sec { + stroke: #f55; +} + diff --git a/connection/private/other.js b/connection/private/other.js new file mode 100644 index 0000000..d27ae50 --- /dev/null +++ b/connection/private/other.js @@ -0,0 +1,177 @@ +var util = util || {}; +util.toArray = function(list) { + return Array.prototype.slice.call(list || [], 0); +}; + +var Terminal = Terminal || function(cmdLineContainer, outputContainer) { + window.URL = window.URL || window.webkitURL; + window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem; + + var cmdLine_ = document.querySelector(cmdLineContainer); + var output_ = document.querySelector(outputContainer); + + /*const CMDS_ = [ + 'clear', 'date', 'echo', 'help', 'uname', 'whoami' + ];*/ + + var fs_ = null; + var cwd_ = null; + var history_ = []; + var histpos_ = 0; + var histtemp_ = 0; + + window.addEventListener('click', function(e) { + cmdLine_.focus(); + }, false); + + cmdLine_.addEventListener('click', inputTextClick_, false); + cmdLine_.addEventListener('keydown', historyHandler_, false); + cmdLine_.addEventListener('keydown', processNewCommand_, false); + + // + function inputTextClick_(e) { + this.value = this.value; + } + + // + function historyHandler_(e) { + if (history_.length) { + if (e.keyCode == 38 || e.keyCode == 40) { + if (history_[histpos_]) { + history_[histpos_] = this.value; + } else { + histtemp_ = this.value; + } + } + + if (e.keyCode == 38) { // up + histpos_--; + if (histpos_ < 0) { + histpos_ = 0; + } + } else if (e.keyCode == 40) { // down + histpos_++; + if (histpos_ > history_.length) { + histpos_ = history_.length; + } + } + + if (e.keyCode == 38 || e.keyCode == 40) { + this.value = history_[histpos_] ? history_[histpos_] : histtemp_; + this.value = this.value; // Sets cursor to end of input. + } + } + } + + // + function processNewCommand_(e) { + + if (e.keyCode == 9) { // tab + e.preventDefault(); + // Implement tab suggest. + } else if (e.keyCode == 13) { // enter + // Save shell history. + if (this.value) { + history_[history_.length] = this.value; + histpos_ = history_.length; + } + + // Duplicate current input and append to output section. + var line = this.parentNode.parentNode.cloneNode(true); + line.removeAttribute('id') + line.classList.add('line'); + var input = line.querySelector('input.cmdline'); + input.autofocus = false; + input.readOnly = true; + output_.appendChild(line); + + if (this.value && this.value.trim()) { + var args = this.value.split(' ').filter(function(val, i) { + return val; + }); + var cmd = args[0].toLowerCase(); + args = args.splice(1); // Remove cmd from arg list. + } + + switch (cmd) { + case 'clear': + output_.innerHTML = ''; + this.value = ''; + return; + case 'date': + output( new Date() ); + break; + case 'echo': + output( args.join(' ') ); + break; + /*case 'help': + output('<div class="ls-files">' + CMDS_.join('<br>') + '</div>'); + break;*/ + case 'uname': + output(navigator.appVersion); + break; + case 'login': + output('Already logged in.'); + break; + case 'logout': + location.href = '/'; + break; + case 'exit': + location.href = '/'; + break; + case 'download': + output('Authentication process has started. An email will be sent once completed.'); + break; + default: + if (cmd) { + output(cmd + ': command not found'); + } + }; + + window.scrollTo(0, getDocHeight_()); + this.value = ''; // Clear/setup line for next input. + } + } + + // + function formatColumns_(entries) { + var maxName = entries[0].name; + util.toArray(entries).forEach(function(entry, i) { + if (entry.name.length > maxName.length) { + maxName = entry.name; + } + }); + + var height = entries.length <= 3 ? + 'height: ' + (entries.length * 15) + 'px;' : ''; + + // 12px monospace font yields ~7px screen width. + var colWidth = maxName.length * 7; + + return ['<div class="ls-files" style="-webkit-column-width:', + colWidth, 'px;', height, '">']; + } + + // + function output(html) { + output_.insertAdjacentHTML('beforeEnd', '<p>' + html + '</p>'); + } + + // Cross-browser impl to get document's height. + function getDocHeight_() { + var d = document; + return Math.max( + Math.max(d.body.scrollHeight, d.documentElement.scrollHeight), + Math.max(d.body.offsetHeight, d.documentElement.offsetHeight), + Math.max(d.body.clientHeight, d.documentElement.clientHeight) + ); + } + + // + return { + init: function() { + output(new Date() /*+ '</p><p>Enter "help" for more information.</p>'*/ ); + }, + output: output + } +};
\ No newline at end of file |