Skip to content

Commit

Permalink
dir command
Browse files Browse the repository at this point in the history
  • Loading branch information
nasan016 committed Nov 10, 2023
1 parent 82a9d17 commit bd0554c
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 39 deletions.
76 changes: 42 additions & 34 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,35 +1,43 @@
<!DOCTYPE html>
<html onclick="getFocus()" onload="getFocus()">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<meta name="description" content="Terminal Styled Website">
<meta name="author" content="Nathaniel Macapinlac">
<title>nasan | Terminal</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@200&family=Source+Code+Pro:wght@500&display=swap" rel="stylesheet">
<script src="https://kit.fontawesome.com/d5effce557.js" crossorigin="anonymous"></script>
<link rel="icon" href="./assets/terminal.png">
<link rel="stylesheet" href="./assets/style.css">
</head>
<body onload="writeLines(banner, '', 50)">
<div class="stuff">
<main id="main" class="inner fullheight">
<div id="terminal">
<p><span class="stark"><span class="lightpurple">guest</span>@<span class="jewel">nasan.dev</span>:$ ~ </span></p>
<a id="writingLines"></a>
</div>
<p id="passwordLine" class="hidden">[sudo] password for nasan: <input type='password' spellcheck='false' autocomplete='off' id='enterpassword' onkeypress='password(event)'></input><br><br></p>
<div id="commands">
<p><span class="stark"><span class="lightpurple">guest</span>@<span class="jewel">nasan.dev</span>:$ ~ </span>
<input spellcheck="false" autocomplete="off" id="user_cmd" onkeydown="historyScroll(event)" onkeypress="enterCommand(event)"></input>
</p>
</div>
</main>
</div>
<script src=".\js\variables.js"></script>
<script src=".\js\main.js"></script>
</body>
<!DOCTYPE html>
<html onclick="getFocus()" onload="getFocus()">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<meta name="description" content="Terminal Styled Website">
<meta name="author" content="Nathaniel Macapinlac">
<title>nasan | Terminal</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link
href="https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@200&family=Source+Code+Pro:wght@500&display=swap"
rel="stylesheet">
<script src="https://kit.fontawesome.com/d5effce557.js" crossorigin="anonymous"></script>
<link rel="icon" href="./assets/terminal.png">
<link rel="stylesheet" href="./assets/style.css">
</head>

<body onload="writeLines(banner, '', 50)">
<div class="stuff">
<main id="main" class="inner fullheight">
<div id="terminal">
<p><span class="stark"><span class="lightpurple">guest</span>@<span class="jewel">nasan.dev</span>:$ ~ </span>
</p>
<a id="writingLines"></a>
</div>
<p id="passwordLine" class="hidden">[sudo] password for nasan: <input type='password' spellcheck='false'
autocomplete='off' id='enterpassword' onkeypress='password(event)'></input><br><br></p>
<div id="commands">
<p><span class="stark"><span class="lightpurple">guest</span>@<span class="jewel">nasan.dev</span>:$ ~ </span>
<input spellcheck="false" autocomplete="off" id="user_cmd" onkeydown="historyScroll(event)"
onkeypress="enterCommand(event)"></input>
</p>
</div>
</main>
</div>
<script src=".\js\variables.js"></script>
<script src=".\js\main.js"></script>
</body>

</html>
5 changes: 4 additions & 1 deletion js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function tabCompletion(tab_cmd){
}

function historyScroll(event){
let tab_cmd = '';
let tab_cmd = ''
const key = event.key
if(key === "ArrowUp"){
if(history.length != 0 && historyTracker != history.length){
Expand Down Expand Up @@ -193,6 +193,9 @@ function switchCase(cmd){
displayText("loading GUI ... <br><br>", 1);
openNewTab(website, 500);
break;
case 'dir':
writeLines(dir, '', 50)
break;
default:
writeLines(defaultMessage, 50);
break;
Expand Down
21 changes: 17 additions & 4 deletions js/variables.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ const github = "https://github.com/nasan016";
const linkedin = "https://www.linkedin.com/in/nathanielmacapinlac/";
const email = 'nlm8841@nyu.edu'
const website = 'https://nasan016.github.io/nasan.me/'
const drdinosaur = "https://github.com/nasan016/dr-dinosaur"
const pomodoro = "https://github.com/nasan016/pomodoro-timer"

squid = 'https://www.youtube.com/watch?v=J2UyOTS3UCE'

Expand Down Expand Up @@ -30,12 +32,13 @@ commandList = [
'repo',
'banner',
'clear',
'gui'
'gui',
'dir'
];

whoami = [
'<br>',
"I don't know who you are, but I know who I am.",
"Who am I? A question worth exploring.",
'<br>',
' <i class="fa-solid fa-envelope"></i> Email <a href="mailto:' + email + '" target="_blank">nlm8841@nyu.edu</a>',
' <i class="fa-brands fa-github"></i> GitHub <a href="' + github + '" target="_blank">github/nasan016</a>',
Expand All @@ -47,6 +50,7 @@ help = [
"<br>",
'<span class="command"> \'about\'</span> Who made this website?',
'<span class="command"> \'whoami\'</span> What is a nasan?',
'<span class="command"> \'dir\'</span> What am I making?',
'<span class="command"> \'sudo\'</span> I forgot the password.',
'<span class="command"> \'repo\'</span> View the GitHub repository.',
'<span class="command"> \'banner\'</span> Display the header.',
Expand Down Expand Up @@ -81,7 +85,7 @@ banner = [
"<pre class='brightyellow'>&nbsp;&nbsp;&nbsp;&nbsp;\\|__| \\|__|\\|__|\\|__|\\_________\\|__|\\|__|\\|__| \\|__|</span>",
"<pre class='brightyellow'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\\|_________|</pre>",
"<br>",
"Welcome to NasanTerminal v1.0.0",
"Welcome to NasanTerminal v1.0.1",
"Type <span class=\"command\">'help'</span> for a list of available commands.",
"Type <span class=\"command\">'repo'</span> to view the GitHub repository or click <a href=\"" + sourceLink + "\" target=\"_blank\">here</a>.",
"Type <span class=\"command\">'gui'</span> for a simplified version of this website or click <a href=\"" + website + "\" target=\" _blank\">here</a>",
Expand All @@ -90,6 +94,15 @@ banner = [

defaultMessage = [
"COMMAND NOT FOUND.",
"Try 'help' to get started.",
"Try <span class='command'>'help'</span> to get started.",
"<br>"
];

dir = [
"<br>",
"<a href=\"" + drdinosaur + "\" target=\"_blank\">Dr. Dinosaur</a> JS",
"<a href=\"" + pomodoro + "\" target =\"_blank\">Pomodoro Timer</a> Go",
"<br>",
"2 File(s) 9,814,072,356 bytes",
"<br>"
]

0 comments on commit bd0554c

Please sign in to comment.