Fixed terminal
All checks were successful
Docker Deploy / build-and-push (push) Successful in 3m34s

This commit is contained in:
2025-06-09 12:44:53 -06:00
parent 4985310ec2
commit 6b6b571dd6
3 changed files with 314 additions and 299 deletions

View File

@ -12,20 +12,20 @@
"@astrojs/mdx": "^4.3.0", "@astrojs/mdx": "^4.3.0",
"@astrojs/node": "^9.2.2", "@astrojs/node": "^9.2.2",
"@astrojs/preact": "^4.1.0", "@astrojs/preact": "^4.1.0",
"@astrojs/rss": "^4.0.11", "@astrojs/rss": "^4.0.12",
"@preact/signals": "^2.2.0", "@preact/signals": "^2.2.0",
"@tailwindcss/typography": "^0.5.16", "@tailwindcss/typography": "^0.5.16",
"@tailwindcss/vite": "^4.1.8", "@tailwindcss/vite": "^4.1.8",
"astro": "^5.8.1", "astro": "^5.9.2",
"astro-icon": "^1.1.5", "astro-icon": "^1.1.5",
"lucide-preact": "^0.511.0", "lucide-preact": "^0.513.0",
"preact": "^10.26.8", "preact": "^10.26.8",
"sharp": "^0.34.2", "sharp": "^0.34.2",
"tailwindcss": "^4.1.8" "tailwindcss": "^4.1.8"
}, },
"devDependencies": { "devDependencies": {
"@iconify-json/mdi": "^1.2.3", "@iconify-json/mdi": "^1.2.3",
"@iconify-json/simple-icons": "^1.2.37", "@iconify-json/simple-icons": "^1.2.38",
"daisyui": "^5.0.43" "daisyui": "^5.0.43"
}, },
"pnpm": { "pnpm": {

546
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -28,6 +28,7 @@ interface Command {
input: string; input: string;
output: string; output: string;
timestamp: Date; timestamp: Date;
path: string;
} }
const Terminal = () => { const Terminal = () => {
@ -36,7 +37,8 @@ const Terminal = () => {
{ {
input: '', input: '',
output: 'Welcome to Atridad\'s Shell!\nType "help" to see available commands.\n', output: 'Welcome to Atridad\'s Shell!\nType "help" to see available commands.\n',
timestamp: new Date() timestamp: new Date(),
path: '/'
} }
]); ]);
const [currentInput, setCurrentInput] = useState(''); const [currentInput, setCurrentInput] = useState('');
@ -202,7 +204,7 @@ ${post.content}`;
'about.txt': { 'about.txt': {
type: 'file', type: 'file',
name: 'about.txt', name: 'about.txt',
content: `${resumeData.basics.name}\nResearcher, Full-Stack Developer, and IT Professional.\n\nA passionate technologist who loves building things and solving problems.\n\nVisit other sections to learn more about my work and experience.` content: `${resumeData.basics.name}\nResearcher, Full-Stack Developer, and IT Professional.\n\nVisit other sections to learn more about my work and experience.`
}, },
'resume': { 'resume': {
type: 'directory', type: 'directory',
@ -551,7 +553,8 @@ ${post.content}`;
const newCommand: Command = { const newCommand: Command = {
input: currentInput, input: currentInput,
output, output,
timestamp: new Date() timestamp: new Date(),
path: currentPath
}; };
// Save command to persistent history // Save command to persistent history
@ -620,7 +623,7 @@ ${post.content}`;
<div <div
ref={terminalRef} ref={terminalRef}
className="flex-1 p-4 overflow-hidden scrollbar-thin scrollbar-thumb-base-300 scrollbar-track-base-100 relative" className="flex-1 p-4 overflow-y-auto scrollbar-thin scrollbar-thumb-base-300 scrollbar-track-base-100 relative"
onClick={() => inputRef.current?.focus()} onClick={() => inputRef.current?.focus()}
> >
{isTrainRunning && ( {isTrainRunning && (
@ -645,15 +648,14 @@ __/ =| o |=-O=====O=====O=====O \\ ____Y___________|__|_________________________
</div> </div>
)} )}
{!isTrainRunning && ( <div className="min-h-full">
<div className="overflow-y-auto h-full">
{commandHistory.map((command: Command, index: number) => ( {commandHistory.map((command: Command, index: number) => (
<div key={index} className="mb-2"> <div key={index} className="mb-2">
{command.input && ( {command.input && (
<div className="flex items-center"> <div className="flex items-center">
<span className="text-primary font-semibold">guest@atri.dad</span> <span className="text-primary font-semibold">guest@atri.dad</span>
<span className="text-base-content">:</span> <span className="text-base-content">:</span>
<span className="text-secondary font-semibold">{currentPath}</span> <span className="text-secondary font-semibold">{command.path}</span>
<span className="text-base-content">$ </span> <span className="text-base-content">$ </span>
<span className="text-accent">{command.input}</span> <span className="text-accent">{command.input}</span>
</div> </div>
@ -667,6 +669,7 @@ __/ =| o |=-O=====O=====O=====O \\ ____Y___________|__|_________________________
</div> </div>
))} ))}
{!isTrainRunning && (
<form onSubmit={handleSubmit} className="flex items-center"> <form onSubmit={handleSubmit} className="flex items-center">
<span className="text-primary font-semibold">guest@atri.dad</span> <span className="text-primary font-semibold">guest@atri.dad</span>
<span className="text-base-content">:</span> <span className="text-base-content">:</span>
@ -683,10 +686,10 @@ __/ =| o |=-O=====O=====O=====O \\ ____Y___________|__|_________________________
spellcheck={false} spellcheck={false}
/> />
</form> </form>
</div>
)} )}
</div> </div>
</div> </div>
</div>
); );
}; };