mirror of
https://github.com/ivabus/www
synced 2024-11-25 11:15:07 +03:00
Animation 1 modification
This commit is contained in:
parent
4e0944f401
commit
8e64b2c917
1 changed files with 22 additions and 13 deletions
|
@ -1,8 +1,8 @@
|
|||
<script>
|
||||
const commands2 = [
|
||||
{ input: '$ sh <(curl https://tea.xyz)<br>################################', output: '<br><br>k, we installed /Users/thomassmith/.tea/tea.xyz/v0.24.2/bin/tea' },
|
||||
{ input: `<br><br>$ tea redis-cli ping<br>################################`, output: `<br>installed: ~/.tea/redis.io/v7.0.8<br><div class="comment-success p-2" style="position:relative; top:5px;"><code class="small"><i class="icon-check-circle"></i>tea installs 'redis' automagically.</code></div>` },
|
||||
{ input: '', output: '<br>pong' },
|
||||
{ input: '$ sh <(curl https://tea.xyz)<br>##########################################', output: '<br>k, we installed /Users/thomassmith/.tea/tea.xyz/v0.24.2/bin/tea' },
|
||||
{ input: `<br>$ tea redis-cli ping<br>##########################################`, output: `<br>installed: ~/.tea/redis.io/v7.0.8<br><div class="comment-success p-2" style="position:relative; top:5px;"><code class="small"><i class="icon-check-circle"></i>tea installs 'redis' automagically.</code></div>` },
|
||||
{ input: '', output: 'pong' },
|
||||
];
|
||||
|
||||
let commandIndex2 = 0;
|
||||
|
@ -14,21 +14,30 @@
|
|||
return;
|
||||
}
|
||||
if (command2.input.length === 0) {
|
||||
commandOutput2 += '\n' + command2.output + '\n';
|
||||
setTimeout(() => {
|
||||
commandOutput2 += '<br>' + command2.output + '<br>';
|
||||
document.querySelector('#terminal-output-2').innerHTML = commandOutput2;
|
||||
commandIndex2++;
|
||||
command2 = commands2[commandIndex2];
|
||||
setTimeout(typeCommand2, 1000);
|
||||
}, 2000);
|
||||
return;
|
||||
}
|
||||
let char = command2.input[0];
|
||||
if (char === '$') {
|
||||
char = '<span class="purple">$</span>';
|
||||
let currentChar = command2.input[0];
|
||||
if (currentChar === '#') {
|
||||
currentChar = '#';
|
||||
const delay = 20;
|
||||
setTimeout(typeCommand2, delay);
|
||||
} else {
|
||||
const delay = Math.floor(Math.random() * 40) + 80;
|
||||
setTimeout(typeCommand2, delay);
|
||||
}
|
||||
commandOutput2 += char;
|
||||
if (currentChar === '$') {
|
||||
currentChar = '<span class="purple">$</span>';
|
||||
}
|
||||
commandOutput2 += currentChar;
|
||||
command2.input = command2.input.slice(1);
|
||||
document.querySelector('#terminal-output-2').innerHTML = commandOutput2;
|
||||
setTimeout(typeCommand2, 80);
|
||||
}
|
||||
|
||||
const observer2 = new IntersectionObserver((entries) => {
|
||||
|
|
Loading…
Reference in a new issue