add more code, fix pre width

This commit is contained in:
PeterTheOne 2016-12-28 22:19:55 +01:00
parent a25cae0e76
commit 42f1e93c29
3 changed files with 9 additions and 6 deletions

View File

@ -17,6 +17,7 @@ code {
}
pre {
min-width: 42em;
color: #5cb85c;
text-align: left;
line-height: 1.2em;

View File

@ -10,8 +10,8 @@
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<h1>telnet 10.r3.at</h1>
<div>
<pre><code>$ telnet 10.r3.at</code></pre>
<pre><code class="output">...loading...</code></pre>
<pre><code class="output2"></code></pre>
<pre><code class="output3"></code></pre>

View File

@ -21,7 +21,7 @@ function overwriteLine(element, text, delay) {
function() {
element.text(text + '\n');
//console.log(text);
window.scrollTo(0,document.body.scrollHeight);
//window.scrollTo(0,document.body.scrollHeight);
},
globalDelay
)
@ -72,6 +72,9 @@ $(function () {
var $output = $('.output');
$output.text('');
printLine($output, 'Trying 2a02:3e0:4000:1::56...');
printLine($output, 'Connected to entrance.realraum.at.');
printLine($output, 'Escape character is \'^]\'.');
printLine($output, '');
printLine($output, '');
@ -114,7 +117,8 @@ $(function () {
setTimeout(
function() {
$body.on('keypress', function (event) {
console.log(event.which);
globalDelay = 0;
//console.log(event.which);
if (event.which === 121 && input === '') {
input += 'y';
}
@ -130,11 +134,9 @@ $(function () {
if (event.which === 111 && input === 'n') {
input += 'o';
}
$output.text(' are you coming? ' + input + '_\n');
window.scrollTo(0,document.body.scrollHeight);
overwriteLine($output, ' are you coming? ' + input + '_');
if (event.which === 13 && (input === 'y' || input === 'yes')) {
$body.off('keypress');
globalDelay = 0;
$output = $('.output4');
printLine($output, ' Great! We\'ll see you at the party then.');