Skip to content
This repository has been archived by the owner on May 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #80 from Abh1noob/master
Browse files Browse the repository at this point in the history
feat: some cmds
  • Loading branch information
Abh1noob authored Feb 29, 2024
2 parents 326fcdd + a17ffd7 commit 84a8f64
Showing 1 changed file with 92 additions and 43 deletions.
135 changes: 92 additions & 43 deletions devsoc24-landing/src/components/terminal/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,29 +36,37 @@ const Terminal = () => {
type CommandOutputs = Record<string, string[]>;

const commandOutputs: CommandOutputs = {
faqs: [
'<span class="command">whatisdevsoc</span>',
'<span class="command">whoisdevsoc</span>',
ls: [
'<span class="command">about</span>',
'<span class="command">timeline</span>',
'<span class="command">tracks</span>',
'<span class="command">prizepool</span>',
'<span class="command">sponsors</span>',
'<span class="command">portal</span>',
'<span class="command">faq</span>',
],
sponsors: [
'<span class="command">????????</span>',
'<span class="command">404 not found</span>',
about: [
'<span class="command">DEVSOC is CodeChef-VIT’s annual flagship event where participants create, hack, and innovate to solve problems while adhering to the spirit of creativity and teamwork. Rub shoulders with some of the brightest minds in tech and boost your tech journey!</span>',
],
timeline: [
'<span class="command">........</span>What is Devsoc?',
'<span class="command">.........</span>',
faqs: [
'<span class="command">hackathon cost</span>',
'<span class="command">application process</span>',
'<span class="command">inexperienced</span>',
'<span class="command">team size</span>',
],
sponsors: ['<span class="command">Coming Soon</span>'],
timeline: ['<span class="command">Coming Soon</span>'],
tracks: [
'<span class="command">tracks</span>',
'<span class="command">tracks</span>',
'<span class="command">1. AR/VR</span>',
'<span class="command">2. Blockchain</span>',
'<span class="command">3. Automation Tools</span>',
'<span class="command">4. Social Good</span>',
'<span class="command">5. Health and Wellness</span>',
'<span class="command">6. Open Innovation</span>',
],
prizepool: [
'<span class="command">25,000</span>',
'<span class="command">rupaiye</span>',
],
adityabhaiya: [
'<span class="command">mostest web dev</span>',
'<span class="command">to find out more use command <b>aditansh</b></span>',
'<span class="command">Printing the Moneyyy!!</span>',
'<span class="command">More details coming soon...</span>',
],
help: [
'<span class="command">faqs (frequently asked questions)</span>',
Expand Down Expand Up @@ -93,7 +101,7 @@ const Terminal = () => {
'<span class="" style="margin-bottom:10px">[complete]</span>',
'<span class="" style="margin-bottom:10px">User ip found and indexed:</span>',
'<span class="" font-weight: bold;>----------------------------------------</span>',

"<p class='block-text' style='font-size:6.5px;font-weight: bold;'>&nbsp;*******&nbsp;&nbsp;&nbsp;********&nbsp;**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;**&nbsp;&nbsp;********&nbsp;&nbsp;&nbsp;*******&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;******&nbsp;</p>",
"<p class='block-text' style='font-size:6.5px;font-weight: bold;'>/**////**&nbsp;/**/////&nbsp;/**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/**&nbsp;**//////&nbsp;&nbsp;&nbsp;**/////**&nbsp;&nbsp;&nbsp;**////**</p>",
"<p class='block-text' style='font-size:6.5px;font-weight: bold;'>/**&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;&nbsp;&nbsp;&nbsp;//**&nbsp;**&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;</p>",
Expand All @@ -102,7 +110,7 @@ const Terminal = () => {
"<p class='block-text' style='font-size:6.5px;font-weight: bold;'>/**&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;&nbsp;&nbsp;&nbsp;**&nbsp;//**&nbsp;&nbsp;&nbsp;&nbsp;**</p>",
"<p class='block-text' style='font-size:6.5px;font-weight: bold;'>/*******&nbsp;&nbsp;/********&nbsp;&nbsp;&nbsp;//**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;********&nbsp;&nbsp;//*******&nbsp;&nbsp;&nbsp;//******&nbsp;</p>",
"<p class='block-text' style='font-size:6.5px;font-weight: bold;'>///////&nbsp;&nbsp;&nbsp;////////&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;////////&nbsp;&nbsp;&nbsp;&nbsp;///////&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//////&nbsp;&nbsp;</p>",

'<span class="" font-weight: bold;>----------------------------------------</span>',
'<span class="" style="margin-bottom:10px">[found] == 1 online & accessible</span>',
'<span class="" style="margin-bottom:10px">[anomalies] == 3 detected</span>',
Expand All @@ -114,13 +122,6 @@ const Terminal = () => {
'<span class="" style="margin-bottom:10px">to start with, type <b>help</b> to get all commands</span>',
// "<br>",
],
aaditya: ['<span class="">Mostest frontend dev</span>'],
designTeam: [
'<span class="">Calculating.....</span>',
'<span class="">Calculating.....</span>',
'<span class="">Calculating.....</span>',
'<span class="">Calculating.....</span>',
],
};

const sleep = (ms: number) =>
Expand All @@ -131,22 +132,67 @@ const Terminal = () => {
event.preventDefault(); // Prevent the default behavior of the Enter key

const trimmedInput = inputValue.trim();
if (trimmedInput === "clear") {
setCommands([]);
} else if (trimmedInput === "rolls") {
setTimeout(() => {
window.open("https://www.youtube.com/watch?v=xvFZjo5PgG0", "_blank");
}, 500);
} else {
const output = commandOutputs[trimmedInput] ?? [
`Command not found: ${trimmedInput}`,
];
const displayOutput = output.map(() => "");
setCommands((prevCommands) => [
...prevCommands,
{ command: trimmedInput, output, displayOutput },
]);
switch (trimmedInput) {
case "clear":
setCommands([]);
break;
case "cd ..":
setSelectedComponent("DEVSOC 2024")
break;
case "cd about":
setSelectedComponent("About")
break;
case "cd timeline":
setSelectedComponent("Timeline")
break;
case "cd tracks":
setSelectedComponent("Tracks")
break;
case "cd prizepool":
setSelectedComponent("Prizepool")
break;
case "cd sponsors":
setSelectedComponent("Sponsors")
break;
case "cd portal":
setSelectedComponent("Portal")
break;
case "cd faq":
setSelectedComponent("FAQs")
break;
case "roles":
setTimeout(() => {
window.open(
"https://www.youtube.com/watch?v=xvFZjo5PgG0",
"_blank",
);
}, 500);
break;
default:
const output = commandOutputs[trimmedInput] ?? [
`Command not found: ${trimmedInput}`,
];
const displayOutput = output.map(() => "");
setCommands((prevCommands) => [
...prevCommands,
{ command: trimmedInput, output, displayOutput },
]);
break;
}
// if (trimmedInput === "clear") {

// } else if (trimmedInput === "rolls") {

// } else {
// const output = commandOutputs[trimmedInput] ?? [
// `Command not found: ${trimmedInput}`,
// ];
// const displayOutput = output.map(() => "");
// setCommands((prevCommands) => [
// ...prevCommands,
// { command: trimmedInput, output, displayOutput },
// ]);
// }

setInputValue("");
}
Expand Down Expand Up @@ -275,14 +321,17 @@ const Terminal = () => {
}, [commands]);

return (
<div className="relative h-[400px] w-screen overflow-auto bg-[#757575] font-diatype text-sm sm:w-full md:h-[100%] md:text-[13.3px] md:leading-[13.5px]">
<div className="relative h-[400px] w-screen overflow-y-auto bg-[#757575] font-diatype text-sm sm:w-full md:h-[100%] md:text-[13.3px] md:leading-[13.5px]">
<button
onClick={() => toggleTerminal()}
className="absolute right-[2px] z-50 flex h-[4vh] w-[4vh] items-center justify-center bg-[#666565] hover:cursor-pointer hover:bg-[#606060] sm:hidden"
>
<IoMdClose className="text-lg font-bold " />
</button>
<div id="terminal" className=" w-[20vw] bg-[#757575] pt-0 md:pt-2">
<div
id="terminal"
className=" w-[20vw] overflow-y-auto bg-[#757575] pt-0 md:pt-2"
>
<div className="ml-[10px] flex h-fit flex-col items-start gap-[5px] border-b-[1px] border-black pb-5 md:text-[13px] md:leading-[13.5px] ">
<div className="">
[Network&nbsp;&nbsp;&nbsp;] DotMid://19.22.10.14
Expand Down

0 comments on commit 84a8f64

Please sign in to comment.