Changes
This commit is contained in:
88
.gitignore
vendored
Normal file
88
.gitignore
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
# ------------------------------------------------------
|
||||
# Build folders (your own build directories)
|
||||
# ------------------------------------------------------
|
||||
linuxbuild/
|
||||
macbuild/
|
||||
winbuild/
|
||||
|
||||
# External
|
||||
|
||||
|
||||
ftxui/
|
||||
|
||||
# If you ever add a generic build folder:
|
||||
build/
|
||||
build-*/
|
||||
|
||||
# ------------------------------------------------------
|
||||
# CMake generated files
|
||||
# ------------------------------------------------------
|
||||
CMakeFiles/
|
||||
CMakeCache.txt
|
||||
cmake_install.cmake
|
||||
Makefile
|
||||
install_manifest.txt
|
||||
|
||||
# ninja build
|
||||
.ninja_log
|
||||
.ninja_deps
|
||||
rules.ninja
|
||||
|
||||
# ------------------------------------------------------
|
||||
# Compiled object files / binaries
|
||||
# ------------------------------------------------------
|
||||
*.o
|
||||
*.obj
|
||||
*.lo
|
||||
*.la
|
||||
*.a
|
||||
*.lib
|
||||
*.so
|
||||
*.dll
|
||||
*.dylib
|
||||
*.exe
|
||||
*.out
|
||||
*.app
|
||||
*.pch
|
||||
|
||||
# ------------------------------------------------------
|
||||
# Logs + temporary files
|
||||
# ------------------------------------------------------
|
||||
*.log
|
||||
*.tmp
|
||||
*.temp
|
||||
|
||||
# ------------------------------------------------------
|
||||
# OS-generated crap
|
||||
# ------------------------------------------------------
|
||||
# macOS
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
|
||||
# Windows
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
Desktop.ini
|
||||
|
||||
# Linux
|
||||
*~
|
||||
|
||||
# ------------------------------------------------------
|
||||
# Editor / IDE files
|
||||
# ------------------------------------------------------
|
||||
.vscode/
|
||||
.idea/
|
||||
*.code-workspace
|
||||
|
||||
# ------------------------------------------------------
|
||||
# Shell script caches
|
||||
# ------------------------------------------------------
|
||||
*.swp
|
||||
*.swo
|
||||
|
||||
# ------------------------------------------------------
|
||||
# Keep these files (GitHub Pages)
|
||||
# ------------------------------------------------------
|
||||
!index.html
|
||||
!CNAME
|
||||
24
CMakeLists.txt
Normal file
24
CMakeLists.txt
Normal file
@@ -0,0 +1,24 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
project(PortfolioApp LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
# Add local FTXUI directory
|
||||
add_subdirectory(ftxui)
|
||||
|
||||
# Add your source files (adjust paths if needed)
|
||||
add_executable(portfolio
|
||||
main.cpp
|
||||
content.cpp
|
||||
)
|
||||
|
||||
# Link with FTXUI
|
||||
target_link_libraries(portfolio
|
||||
PRIVATE
|
||||
ftxui::screen
|
||||
ftxui::dom
|
||||
ftxui::component
|
||||
)
|
||||
|
||||
65
commands.sh
Normal file
65
commands.sh
Normal file
@@ -0,0 +1,65 @@
|
||||
#!/bin/bash
|
||||
|
||||
#macos
|
||||
|
||||
cd ~/Downloads/Code/Terminal
|
||||
rm -rf macbuild
|
||||
mkdir macbuild
|
||||
cd macbuild
|
||||
cmake -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" ..
|
||||
make
|
||||
|
||||
|
||||
|
||||
#Linux
|
||||
|
||||
cd ~/Downloads/Code/Terminal
|
||||
rm -rf linuxbuild
|
||||
mkdir linuxbuild
|
||||
cd linuxbuild
|
||||
|
||||
docker run --rm -v "$(pwd)/..":/src -w /src gcc:latest bash -c "
|
||||
apt-get update && apt-get install -y cmake make
|
||||
mkdir -p build && cd build
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS='-static' ..
|
||||
make
|
||||
cd ..
|
||||
mv build linuxbuild/
|
||||
"
|
||||
|
||||
#Linux Test
|
||||
|
||||
cd ~/Downloads/Code/Terminal
|
||||
|
||||
docker run --rm -v "$(pwd)/linuxbuild":/build -w /build --platform linux/amd64 ubuntu:22.04 bash -c "
|
||||
apt-get update && apt-get install -y libstdc++6
|
||||
./build/portfolio
|
||||
"
|
||||
|
||||
#Windows:
|
||||
|
||||
cd ~/Downloads/Code/Terminal
|
||||
rm -rf winbuild
|
||||
mkdir winbuild
|
||||
|
||||
# Download Dockcross helper
|
||||
docker run --rm dockcross/windows-static-x64 > ./winbuild/dockcross-windows
|
||||
chmod +x ./winbuild/dockcross-windows
|
||||
|
||||
# Build Windows binary inside winbuild
|
||||
# Note: we mount the repo root (current folder) as /work
|
||||
./winbuild/dockcross-windows bash -c "
|
||||
mkdir -p /work/winbuild/build
|
||||
cd /work/winbuild/build
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -S /work -B .
|
||||
make
|
||||
cp portfolio.exe /work/winbuild/
|
||||
"
|
||||
|
||||
#Windows Test (requires Wine)
|
||||
|
||||
cd ~/Downloads/Code/Terminal
|
||||
|
||||
docker run --rm -v "$(pwd)/winbuild":/winbuild -w /winbuild --platform linux/amd64 \
|
||||
scottyhardy/docker-wine:latest wine64 build/portfolio.exe
|
||||
|
||||
223
content.cpp
Normal file
223
content.cpp
Normal file
@@ -0,0 +1,223 @@
|
||||
#include <ftxui/component/component.hpp>
|
||||
#include <ftxui/component/component_base.hpp>
|
||||
#include <ftxui/component/screen_interactive.hpp>
|
||||
#include <ftxui/dom/elements.hpp>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "content.hpp"
|
||||
|
||||
using namespace ftxui;
|
||||
|
||||
// Hacker-style reusable styles
|
||||
const auto hacker_text_style = color(Color::Green) | bold | dim;
|
||||
const auto hacker_border_style = border | color(Color::Green);
|
||||
const auto hacker_link_style = color(Color::LightGreen) | underlined;
|
||||
const auto hacker_button_style = color(Color::Green) | bold;
|
||||
const auto hacker_button_active_style = color(Color::LightGreen) | bold;
|
||||
|
||||
// ------------------
|
||||
// Pages
|
||||
// ------------------
|
||||
|
||||
Component MakeAboutPage() {
|
||||
return Renderer([]() -> Element {
|
||||
return vbox({
|
||||
vbox({
|
||||
text("Keshav Anand") | color(Color::LightGreen) | bold | center,
|
||||
text("Student Researcher | ML + Robotics Developer | CS + Math Enthusiast") | hacker_text_style | center,
|
||||
}) | hacker_border_style,
|
||||
|
||||
}) | flex;
|
||||
});
|
||||
}
|
||||
|
||||
Component MakeProjectsPage() {
|
||||
const std::vector<std::pair<std::string, std::string>> projects = {
|
||||
{"🧠 GaitGuardian: IMU Processing for Parkinson’s Disease (2024–Present)",
|
||||
"• Hybrid biLSTM + CNN model for Freezing of Gait prediction\n"
|
||||
"• Signal segmentation reduces subject dependence\n"
|
||||
"• State-of-the-art accuracy, end-to-end functionality"},
|
||||
{"🔥 TEG-Powered Self-Stirring Device (2023–2024)",
|
||||
"• Built thermal energy harvesting prototype for self-stirring cookware\n"
|
||||
"• Developed mechanical + electrical integration\n"
|
||||
"• Won 1st at Dallas Fair, ISEF Finalist"},
|
||||
{"🤖 FTC Technical Turbulence (23344) — Lead Software Developer (2023–Present)",
|
||||
"• Custom inverse kinematics, pathing, and Computer Vision autonomy\n"
|
||||
"• Top-30 globally for software performance, FTC State Finalist"},
|
||||
};
|
||||
|
||||
Component container = Container::Vertical({});
|
||||
for (auto& p : projects) {
|
||||
Component card = Renderer([p]() -> Element {
|
||||
return vbox({
|
||||
text(p.first) | color(Color::LightGreen) | bold,
|
||||
paragraph(p.second) | hacker_text_style | dim,
|
||||
}) | hacker_border_style;
|
||||
});
|
||||
container->Add(card);
|
||||
}
|
||||
|
||||
return Renderer(container, [container]() -> Element {
|
||||
return vbox(container->Render()) | vscroll_indicator | yframe | flex;
|
||||
});
|
||||
}
|
||||
|
||||
Component MakeEducationPage() {
|
||||
return Renderer([]() -> Element {
|
||||
return vbox({
|
||||
vbox({
|
||||
text("🏫 Plano East Senior High School (2023–2027)") | color(Color::LightGreen) | bold,
|
||||
text("STEM & Multidisciplinary Endorsement") | hacker_text_style,
|
||||
text("GPA: 4.73 | Rank: 1/1273 | SAT: 1550") | hacker_text_style,
|
||||
}) | hacker_border_style,
|
||||
|
||||
separator(),
|
||||
|
||||
vbox({
|
||||
text("📚 Current Coursework:") | color(Color::LightGreen) | bold,
|
||||
text("• AP Chemistry") | hacker_text_style,
|
||||
text("• AP Physics I") | hacker_text_style,
|
||||
text("• Digital Electronics") | hacker_text_style,
|
||||
text("• American Studies (AP US History + AP English Language)") | hacker_text_style,
|
||||
text("• Calculus III (via Collin College)") | hacker_text_style,
|
||||
}) | hacker_border_style,
|
||||
}) | flex;
|
||||
});
|
||||
}
|
||||
|
||||
Component MakeWorkPage() {
|
||||
const std::vector<std::pair<std::string, std::string>> activities = {
|
||||
{"🧪 Vice President, LASER (Science Fair Organization)",
|
||||
"Guiding and mentoring 120+ students in research and experimentation"},
|
||||
{"💻 Technology Officer, National Honor Society",
|
||||
"Developed and maintained React-based management portal for 1000+ members"},
|
||||
{"🏏 Founder & Captain, Plano East Cricket Club",
|
||||
"Established first school tapeball cricket team; coached and led events"},
|
||||
{"🎶 Indian Film Music Performer",
|
||||
"Bass guitar & keyboard player in charity concerts; arrangement and production"},
|
||||
};
|
||||
|
||||
Component container = Container::Vertical({});
|
||||
for (auto& a : activities) {
|
||||
Component card = Renderer([a]() -> Element {
|
||||
return vbox({
|
||||
text(a.first) | color(Color::LightGreen) | bold,
|
||||
text(a.second) | hacker_text_style | dim,
|
||||
}) | hacker_border_style;
|
||||
});
|
||||
container->Add(card);
|
||||
}
|
||||
|
||||
return Renderer(container, [container]() -> Element {
|
||||
return vbox(container->Render()) | vscroll_indicator | yframe | flex;
|
||||
});
|
||||
}
|
||||
|
||||
Component MakeAwardsPage() {
|
||||
const std::vector<std::pair<std::string, std::string>> awards = {
|
||||
{"🥇 Thermoelectric Generator Research Project (2024)",
|
||||
"Dallas Fair: 1st in Engineering | USAF Recognition | USMA Best SI Units\nISEF Finalist"},
|
||||
{"🥈 GaitGuardian ML Research (2025)",
|
||||
"Dallas Fair: 1st in Systems Software, Grand Prize Runner-Up\nISEF Finalist | 3rd in Robotics & Intelligent Systems"},
|
||||
{"🏅 National Speech & Debate (2025)",
|
||||
"Impromptu Quarterfinalist at District and State Level"},
|
||||
};
|
||||
|
||||
Component container = Container::Vertical({});
|
||||
for (auto& a : awards) {
|
||||
Component card = Renderer([a]() -> Element {
|
||||
return vbox({
|
||||
text(a.first) | color(Color::LightGreen) | bold,
|
||||
paragraph(a.second) | hacker_text_style | dim,
|
||||
}) | hacker_border_style;
|
||||
});
|
||||
container->Add(card);
|
||||
}
|
||||
|
||||
return Renderer(container, [container]() -> Element {
|
||||
return vbox(container->Render()) | vscroll_indicator | yframe | flex;
|
||||
});
|
||||
}
|
||||
|
||||
Component MakeSkillsPage() {
|
||||
const std::string skills =
|
||||
"💻 Programming Languages:\n"
|
||||
" Java, Python, Bash, C++ (Arduino), Kotlin (FTC), limited HTML/CSS/JS\n\n"
|
||||
"🧠 Applications:\n"
|
||||
" Machine Learning, Signal Processing, TensorFlow, Computer Vision\n\n"
|
||||
"⚙️ Miscellaneous:\n"
|
||||
" Public Speaking, CAD, PCB Design, Electrical Systems, Competition Math";
|
||||
|
||||
return Renderer([skills]() -> Element {
|
||||
return paragraph(skills) | hacker_text_style | flex;
|
||||
});
|
||||
}
|
||||
|
||||
Component MakeContactPage() {
|
||||
const std::string contact_info =
|
||||
"📫 Email: keshavanandofficial@gmail.com\n"
|
||||
"🔗 LinkedIn: linkedin.com/in/keshavganand\n"
|
||||
"💻 GitHub: github.com/keshavanandcode\n"
|
||||
"🌐 Resume: resume.keshavanand.net\n"
|
||||
"📍 DFW Metroplex, Texas\n\n"
|
||||
"Updated: November 2025";
|
||||
|
||||
return Renderer([contact_info]() -> Element {
|
||||
return paragraph(contact_info) | hacker_text_style | flex;
|
||||
});
|
||||
}
|
||||
|
||||
// Constructor implementation
|
||||
PortfolioApp::PortfolioApp() {
|
||||
about_page_ = MakeAboutPage();
|
||||
projects_page_ = MakeProjectsPage();
|
||||
education_page_ = MakeEducationPage();
|
||||
work_page_ = MakeWorkPage();
|
||||
awards_page_ = MakeAwardsPage();
|
||||
skills_page_ = MakeSkillsPage();
|
||||
contact_page_ = MakeContactPage();
|
||||
|
||||
pages_ = {about_page_, projects_page_, education_page_,
|
||||
work_page_, awards_page_, skills_page_, contact_page_};
|
||||
|
||||
std::vector<std::string> labels = {"About", "Projects", "Education", "Activities", "Awards", "Skills", "Contact"};
|
||||
|
||||
std::vector<Component> buttons;
|
||||
for (int i = 0; i < (int)labels.size(); ++i) {
|
||||
Component button = Button(labels[i], [&, i] { SwitchPage(i); })
|
||||
| (i == current_page_ ? hacker_button_active_style : hacker_button_style);
|
||||
buttons.push_back(button);
|
||||
}
|
||||
|
||||
navigation_ = Container::Vertical(buttons);
|
||||
Component separator_component = Renderer([] { return separator(); });
|
||||
|
||||
Add(Container::Horizontal(Components{navigation_, separator_component, pages_[current_page_]}));
|
||||
}
|
||||
|
||||
void PortfolioApp::SwitchPage(int index) {
|
||||
current_page_ = index;
|
||||
DetachAllChildren();
|
||||
Component separator_component = Renderer([] { return separator(); });
|
||||
Add(Container::Horizontal(Components{navigation_, separator_component, pages_[current_page_]}));
|
||||
}
|
||||
|
||||
Element PortfolioApp::Render() {
|
||||
return hbox({
|
||||
navigation_->Render() | hacker_border_style,
|
||||
separator(),
|
||||
pages_[current_page_]->Render() | hacker_border_style | flex
|
||||
});
|
||||
}
|
||||
|
||||
bool PortfolioApp::OnEvent(Event event) {
|
||||
if (event == Event::ArrowRight) {
|
||||
SwitchPage((current_page_ + 1) % pages_.size());
|
||||
return true;
|
||||
}
|
||||
if (event == Event::ArrowLeft) {
|
||||
SwitchPage((current_page_ - 1 + pages_.size()) % pages_.size());
|
||||
return true;
|
||||
}
|
||||
return ComponentBase::OnEvent(event);
|
||||
}
|
||||
111
content.hpp
Normal file
111
content.hpp
Normal file
@@ -0,0 +1,111 @@
|
||||
#pragma once
|
||||
#include <ftxui/component/component.hpp>
|
||||
#include <ftxui/component/component_base.hpp>
|
||||
#include <ftxui/component/screen_interactive.hpp>
|
||||
#include <ftxui/dom/elements.hpp>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
// ------------------
|
||||
// Structs
|
||||
// ------------------
|
||||
struct Project {
|
||||
std::string title;
|
||||
std::string link; // Leave empty if no link
|
||||
};
|
||||
|
||||
// ------------------
|
||||
// PageFactory Functions
|
||||
//
|
||||
|
||||
// ------------------
|
||||
/**
|
||||
* Creates the About page component
|
||||
* @return Component containing personal introduction and focus areas
|
||||
*/
|
||||
ftxui::Component MakeAboutPage();
|
||||
|
||||
/**
|
||||
* Creates the Projects page component
|
||||
* @return Component displaying list of projects with links
|
||||
*/
|
||||
ftxui::Component MakeProjectsPage();
|
||||
|
||||
/**
|
||||
* Creates the Education page component
|
||||
* @return Component showing educational background and achievements
|
||||
*/
|
||||
ftxui::Component MakeEducationPage();
|
||||
|
||||
/**
|
||||
* Creates the Work page component
|
||||
* @return Component displaying work experience and competitions
|
||||
*/
|
||||
ftxui::Component MakeWorkPage();
|
||||
|
||||
/**
|
||||
* Creates the Awards page component
|
||||
* @return Component displaying awards, competitions, and achievements
|
||||
*/
|
||||
ftxui::Component MakeAwardsPage();
|
||||
|
||||
/**
|
||||
* Creates the Skills page component
|
||||
* @return Component showing technical skills and expertise
|
||||
*/
|
||||
ftxui::Component MakeSkillsPage();
|
||||
|
||||
/**
|
||||
* Creates the Contact page component
|
||||
* @return Component with contact information
|
||||
*/
|
||||
ftxui::Component MakeContactPage();
|
||||
|
||||
// ------------------
|
||||
// Main Application Class
|
||||
// ------------------
|
||||
/**
|
||||
* Main portfolio application class that manages navigation and page switching
|
||||
* Inherits from ftxui::ComponentBase to provide custom rendering and event handling
|
||||
*/
|
||||
class PortfolioApp : public ftxui::ComponentBase {
|
||||
public:
|
||||
/**
|
||||
* Constructor - initializes all pages and navigation
|
||||
*/
|
||||
PortfolioApp();
|
||||
|
||||
/**
|
||||
* Switch to a specific page by index
|
||||
* @param index The page index to switch to (0-6)
|
||||
*/
|
||||
void SwitchPage(int index);
|
||||
|
||||
/**
|
||||
* Render the current application state
|
||||
* @return Element representing the full UI layout
|
||||
*/
|
||||
ftxui::Element Render();
|
||||
|
||||
/**
|
||||
* Handle keyboard events for navigation
|
||||
* @param event The keyboard event to process
|
||||
* @return true if event was handled, false otherwise
|
||||
*/
|
||||
bool OnEvent(ftxui::Event event) override;
|
||||
|
||||
private:
|
||||
int current_page_ = 0; // Currently active page index
|
||||
|
||||
// UI Components
|
||||
ftxui::Component navigation_; // Navigation sidebar
|
||||
ftxui::Component about_page_; // About page component
|
||||
ftxui::Component projects_page_; // Projects page component
|
||||
ftxui::Component education_page_; // Education page component
|
||||
ftxui::Component work_page_; // Work page component
|
||||
ftxui::Component awards_page_; // Awards page component
|
||||
ftxui::Component skills_page_; // Skills page component
|
||||
ftxui::Component contact_page_; // Contact page component
|
||||
|
||||
std::vector<ftxui::Component> pages_; // Vector of all page components
|
||||
};
|
||||
518
index.html
Normal file
518
index.html
Normal file
@@ -0,0 +1,518 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||
<title>Terminal Portfolio</title>
|
||||
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap" rel="stylesheet">
|
||||
|
||||
|
||||
<style>
|
||||
/* --- General Reset & Base --- */
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
html, body {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
font-family: 'JetBrains Mono', monospace;
|
||||
background-color: #1e1e2e; /* Catppuccin Mocha */
|
||||
color: #b5f59b;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
max-width: 1200px;
|
||||
gap: 14px;
|
||||
padding-bottom: 24px;
|
||||
}
|
||||
|
||||
|
||||
/* --- Terminal Box --- */
|
||||
.terminal-wrapper {
|
||||
background-color: #0b0f0b;
|
||||
border: 2px solid #a6e3a1; /* soft green border */
|
||||
border-radius: 12px;
|
||||
padding: 16px;
|
||||
overflow-x: auto;
|
||||
max-width: 100%;
|
||||
font-size: 1rem;
|
||||
box-shadow: 0 0 12px rgba(166,227,161,0.3);
|
||||
}
|
||||
|
||||
pre.shell {
|
||||
margin: 0;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
pre.shell code {
|
||||
display: block;
|
||||
font-size: 1rem;
|
||||
line-height: 1.5;
|
||||
color: #b5f59b;
|
||||
}
|
||||
|
||||
.prompt {
|
||||
color: #a6e3a1;
|
||||
margin-right: 6px;
|
||||
}
|
||||
|
||||
.controls {
|
||||
display: flex;
|
||||
flex-wrap: wrap; /* allow wrapping on small screens */
|
||||
gap: 10px;
|
||||
align-items: flex-end; /* align bottom of elements */
|
||||
width: 100%;
|
||||
justify-content: flex-start; /* avoid pushing button offscreen */
|
||||
}
|
||||
|
||||
.left-controls {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1 1 60%; /* allow it to shrink */
|
||||
min-width: 120px; /* small enough for narrow devices */
|
||||
}
|
||||
|
||||
.right-controls {
|
||||
flex: 0 1 auto; /* shrink if needed */
|
||||
display: flex;
|
||||
justify-content: flex-start; /* aligns button nicely next to select or below if wrapped */
|
||||
margin-top: 4px; /* gives small spacing if wrapped */
|
||||
}
|
||||
|
||||
/* Small devices: stack copy button below select to avoid horizontal scroll */
|
||||
@media (max-width: 480px) {
|
||||
.controls {
|
||||
flex-direction: column; /* stack elements vertically */
|
||||
align-items: stretch; /* full width for both */
|
||||
gap: 6px;
|
||||
}
|
||||
.right-controls {
|
||||
justify-content: center; /* center button below select */
|
||||
margin-top: 4px;
|
||||
}
|
||||
.left-controls {
|
||||
flex: 1 1 100%; /* take full width */
|
||||
}
|
||||
}
|
||||
|
||||
.left-controls label.select-label {
|
||||
margin-bottom: 4px; /* small margin so button is closer to select */
|
||||
}
|
||||
|
||||
label.select-label {
|
||||
display: block;
|
||||
color: #a6e3a1;
|
||||
margin-bottom: 4px;
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
|
||||
select {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
padding: 8px;
|
||||
border-radius: 8px;
|
||||
background: #2a2a38;
|
||||
color: #b5f59b;
|
||||
border: 1px solid rgba(166,227,161,0.3);
|
||||
font-size: 0.95rem;
|
||||
cursor: pointer;
|
||||
transition: border 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
select:hover, select:focus {
|
||||
border-color: #b5f59b;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.copy-btn {
|
||||
background: #2a2a38;
|
||||
color: #b5f59b;
|
||||
padding: 8px 14px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid rgba(166,227,161,0.4);
|
||||
cursor: pointer;
|
||||
font-family: 'JetBrains Mono', monospace;
|
||||
font-size: 0.95rem;
|
||||
transition: all 0.2s ease-in-out;
|
||||
box-shadow: 0 0 6px rgba(166,227,161,0.2);
|
||||
}
|
||||
|
||||
.copy-btn:hover {
|
||||
background: #3c3c50;
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 0 12px rgba(166,227,161,0.35);
|
||||
}
|
||||
|
||||
/* --- Instructions --- */
|
||||
.instructions {
|
||||
background: #2a2a38;
|
||||
border: 2px solid rgba(166,227,161,0.3);
|
||||
border-radius: 10px;
|
||||
padding: 14px;
|
||||
color: #b5f59b;
|
||||
font-size: 0.9rem;
|
||||
line-height: 1.6;
|
||||
text-align: left;
|
||||
box-shadow: 0 0 8px rgba(166,227,161,0.15);
|
||||
}
|
||||
|
||||
.instructions strong {
|
||||
color: #a6e3a1;
|
||||
}
|
||||
|
||||
/* --- Run at Your Own Risk --- */
|
||||
.warning {
|
||||
margin-top: 8px;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 0.95rem;
|
||||
color: #ff4c4c;
|
||||
text-shadow: 0 0 6px #ff4c4c;
|
||||
animation: flash 2s infinite;
|
||||
}
|
||||
|
||||
@keyframes flash {
|
||||
0%, 60%, 100% { opacity: 1; }
|
||||
30%, 90% { opacity: 0.5; }
|
||||
}
|
||||
|
||||
/* --- How it works section (Catppuccin Mocha vibes) --- */
|
||||
.how-toggle button {
|
||||
text-align: left;
|
||||
background: #2a2a38;
|
||||
color: #a6e3a1;
|
||||
border: 1px solid rgba(166,227,161,0.3);
|
||||
padding: 12px 16px;
|
||||
border-radius: 10px;
|
||||
cursor: pointer;
|
||||
font-family: 'JetBrains Mono', monospace;
|
||||
font-size: 1rem;
|
||||
transition: all 0.25s ease-in-out;
|
||||
box-shadow: 0 0 6px rgba(166,227,161,0.2);
|
||||
}
|
||||
|
||||
.how-toggle button:hover {
|
||||
background: #3c3c50;
|
||||
box-shadow: 0 0 12px rgba(166,227,161,0.35);
|
||||
}
|
||||
|
||||
.how-content {
|
||||
display: none;
|
||||
background: #1e1e2e;
|
||||
color: #b5f59b;
|
||||
padding: 18px;
|
||||
border-radius: 10px;
|
||||
border: 1px solid rgba(166,227,161,0.2);
|
||||
box-shadow: 0 0 8px rgba(166,227,161,0.15);
|
||||
max-height: 60vh;
|
||||
overflow-y: auto;
|
||||
font-size: 0.95rem;
|
||||
line-height: 1.6;
|
||||
width: 100%;
|
||||
transition: all 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
.how-content div {
|
||||
background: #2a2a38;
|
||||
border-radius: 10px;
|
||||
padding: 16px;
|
||||
box-shadow: 0 0 10px rgba(166,227,161,0.15);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.how-content ol, .how-content ul {
|
||||
margin-left: 20px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.how-content a {
|
||||
display:inline-block;
|
||||
text-decoration:none;
|
||||
padding:6px 12px;
|
||||
border-radius:6px;
|
||||
background:#a6e3a1;
|
||||
color:#1e1e2e;
|
||||
font-weight:bold;
|
||||
font-family:'JetBrains Mono';
|
||||
transition: all 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
.how-content a:hover {
|
||||
background:#8bdc91;
|
||||
}
|
||||
|
||||
/* --- Small Devices --- */
|
||||
@media (max-width: 768px) {
|
||||
pre.shell code { font-size: 0.95rem; }
|
||||
select, .copy-btn, .instructions, .how-toggle button { font-size: 0.9rem; padding: 8px 12px; }
|
||||
.terminal-wrapper { padding: 12px; }
|
||||
.how-content { font-size: 0.9rem; padding: 14px; }
|
||||
.how-content div { padding: 14px; }
|
||||
}
|
||||
|
||||
|
||||
@media (max-width: 620px) {
|
||||
#copyBtn {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
|
||||
/* Remove ALL possible horizontal overflow sources */
|
||||
.controls,
|
||||
.left-controls,
|
||||
.right-controls,
|
||||
.terminal-wrapper,
|
||||
select {
|
||||
max-width: 100% !important;
|
||||
overflow-x: hidden !important;
|
||||
}
|
||||
|
||||
/* Remove leftover flex spacing from button zone */
|
||||
.right-controls {
|
||||
flex: 0 0 0 !important;
|
||||
padding: 0 !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
/* Remove the invisible width reservation for the old button */
|
||||
.controls {
|
||||
justify-content: center !important;
|
||||
}
|
||||
|
||||
/* Ensure dropdown never triggers overflow */
|
||||
select {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
/* Terminal text & spacing */
|
||||
pre.shell code {
|
||||
font-size: 0.85rem;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
select,
|
||||
.copy-btn,
|
||||
.instructions,
|
||||
.how-toggle button {
|
||||
font-size: 0.85rem;
|
||||
padding: 6px 10px;
|
||||
}
|
||||
|
||||
.terminal-wrapper {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
/* ✅ FORCE vertical stacking */
|
||||
.controls {
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* ✅ SELECT full width */
|
||||
.left-controls {
|
||||
width: 100%;
|
||||
justify-content: center;
|
||||
flex: 1 1 100%;
|
||||
min-width: 0; /* override your 120px minimum */
|
||||
}
|
||||
|
||||
/* ✅ COPY BUTTON always on its own line and centered */
|
||||
.right-controls {
|
||||
width: 100%;
|
||||
justify-content: center;
|
||||
flex: 1 1 100%;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
/* ✅ Never cause overflow — always fit in viewport */
|
||||
.copy-btn {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* Instructions */
|
||||
.instructions {
|
||||
font-size: 0.85rem;
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
/* How it works */
|
||||
.how-content {
|
||||
font-size: 0.85rem;
|
||||
padding: 12px;
|
||||
max-height: 50vh;
|
||||
}
|
||||
|
||||
.how-content div {
|
||||
padding: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="page">
|
||||
|
||||
<div class="terminal-wrapper">
|
||||
<pre class="shell">
|
||||
<code id="cmdline"><span class="prompt">$</span> <span class="command">Detecting your OS...</span></code>
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="controls">
|
||||
<div class="left-controls">
|
||||
<label class="select-label" for="osSelect">Choose OS command</label>
|
||||
<select id="osSelect">
|
||||
<option value="">Select OS</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="right-controls">
|
||||
<button id="copyBtn" class="copy-btn">Copy Command</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Instructions section -->
|
||||
<div class="instructions" id="instructions">
|
||||
<!-- JS injects instructions here -->
|
||||
</div>
|
||||
|
||||
<!-- Run at your own risk -->
|
||||
<div class="warning">Run at Your Own Risk</div>
|
||||
|
||||
<!-- How it works -->
|
||||
<!-- How It Works -->
|
||||
<div class="how-toggle">
|
||||
<button id="howToggle" aria-expanded="false">Show How It Works ▼</button>
|
||||
<div id="howContent" class="how-content" style="font-family:'JetBrains Mono';">
|
||||
<div style="background:#1e1e2e; border:1px solid #3fe07a; border-radius:8px; padding:14px; box-shadow:0 0 8px rgba(0,255,0,0.2); line-height:1.5;">
|
||||
|
||||
<ol style="margin-left:32px; color:#b5f59b;">
|
||||
<li>
|
||||
<strong>Terminal Command Execution:</strong>
|
||||
The command you copy downloads a platform-specific script:
|
||||
<ul style="margin-left:32px;">
|
||||
<li><code>.sh</code> for Mac/Linux</li>
|
||||
<li><code>.bat</code> for Windows</li>
|
||||
</ul>
|
||||
This script is hosted on my GitHub and automatically runs the corresponding binary.
|
||||
</li>
|
||||
|
||||
<li style="margin-top:6px;">
|
||||
<strong>Binary Execution:</strong>
|
||||
The binary is compiled in <strong>C++ separately for each OS</strong> and controls the standard input/output of your terminal to create a clean, interactive interface.
|
||||
</li>
|
||||
|
||||
<li style="margin-top:6px;">
|
||||
<strong>FTXUI Integration:</strong>
|
||||
It leverages the <code>FTXUI</code> library to render a web-like interactive menu directly inside your terminal, making navigation and presentation of my portfolio terminal-friendly but visually elegant.
|
||||
</li>
|
||||
|
||||
<li style="margin-top:6px;">
|
||||
<strong>Cross-Platform Support:</strong>
|
||||
Each OS has its own binary to ensure consistent behavior on Windows, Mac, and Linux.
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<p style="margin-top:12px;">
|
||||
<a href="https://github.com/KeshavAnandCode/TerminalPortfolio" target="_blank" style="
|
||||
display:inline-block;
|
||||
text-decoration:none;
|
||||
padding:6px 12px;
|
||||
border-radius:6px;
|
||||
background:#00ff00;
|
||||
color:#0b0f0b;
|
||||
font-weight:bold;
|
||||
font-family:'JetBrains Mono';
|
||||
transition: all 0.2s ease-in-out;
|
||||
" onmouseover="this.style.background='#3fff3f'" onmouseout="this.style.background='#00ff00'">
|
||||
View Source on GitHub
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const cmdEl = document.getElementById('cmdline');
|
||||
const commandSpan = cmdEl.querySelector('.command');
|
||||
const osSelect = document.getElementById('osSelect');
|
||||
const copyBtn = document.getElementById('copyBtn');
|
||||
const howToggle = document.getElementById('howToggle');
|
||||
const howContent = document.getElementById('howContent');
|
||||
const instructionsEl = document.getElementById('instructions');
|
||||
|
||||
const commands = {
|
||||
Windows: 'iwr https://terminalportfolio.keshavanand.net/run-windows.bat -OutFile $env:TEMP\\run-windows.bat; Start-Process $env:TEMP\\run-windows.bat -Wait',
|
||||
Mac: '/bin/bash -c "$(curl -fsSL https://terminalportfolio.keshavanand.net/run-mac.sh)"',
|
||||
Linux: '/bin/bash -c "$(curl -fsSL https://terminalportfolio.keshavanand.net/run-linux.sh)"'
|
||||
};
|
||||
|
||||
const platform = (navigator.platform || '').toLowerCase();
|
||||
let detectedOS = 'Linux';
|
||||
if(platform.includes('win')) detectedOS='Windows';
|
||||
else if(platform.includes('mac')) detectedOS='Mac';
|
||||
|
||||
// populate dropdown
|
||||
Object.keys(commands).forEach(os=>{
|
||||
const option=document.createElement('option');
|
||||
option.value=commands[os];
|
||||
option.textContent=os + (os===detectedOS ? ' (Detected)' : '');
|
||||
osSelect.appendChild(option);
|
||||
});
|
||||
|
||||
// set initial command
|
||||
osSelect.value=commands[detectedOS];
|
||||
commandSpan.textContent=commands[detectedOS];
|
||||
|
||||
// instructions per OS
|
||||
const instructions = {
|
||||
Windows: "💻 <strong>Windows:</strong> Copy the command, open PowerShell, and paste.",
|
||||
Mac: "💻 <strong>Mac:</strong> Copy the command, open Terminal, and paste.",
|
||||
Linux: "💻 <strong>Linux:</strong> Copy the command, open your terminal, and paste."
|
||||
};
|
||||
instructionsEl.innerHTML = instructions[detectedOS];
|
||||
|
||||
// update command when dropdown changes
|
||||
osSelect.addEventListener('change', e=>{
|
||||
if(!e.target.value) return;
|
||||
commandSpan.textContent = e.target.value;
|
||||
const selectedOS = osSelect.options[osSelect.selectedIndex].text.split(' ')[0];
|
||||
instructionsEl.innerHTML = instructions[selectedOS] || '';
|
||||
});
|
||||
|
||||
// copy button
|
||||
copyBtn.addEventListener('click', async ()=>{
|
||||
const text = commandSpan.textContent || '';
|
||||
try{
|
||||
await navigator.clipboard.writeText(text);
|
||||
copyBtn.textContent='Copied!';
|
||||
setTimeout(()=>copyBtn.textContent='Copy Command',1400);
|
||||
}catch(err){console.error('Copy failed',err);}
|
||||
});
|
||||
|
||||
// toggle How It Works
|
||||
howToggle.addEventListener('click', ()=>{
|
||||
const isOpen = howContent.style.display==='block';
|
||||
howContent.style.display = isOpen ? 'none' : 'block';
|
||||
howToggle.textContent = isOpen ? 'Show How It Works ▼' : 'Hide How It Works ▲';
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
13
main.cpp
Normal file
13
main.cpp
Normal file
@@ -0,0 +1,13 @@
|
||||
#include "content.hpp"
|
||||
#include <ftxui/component/screen_interactive.hpp>
|
||||
#include <ftxui/dom/elements.hpp>
|
||||
#include <ftxui/dom/node.hpp>
|
||||
#include <ftxui/screen/screen.hpp>
|
||||
#include <iostream>
|
||||
|
||||
int main() {
|
||||
ftxui::ScreenInteractive screen = ftxui::ScreenInteractive::Fullscreen();
|
||||
ftxui::Component app = std::make_shared<PortfolioApp>();
|
||||
screen.Loop(app);
|
||||
return 0;
|
||||
}
|
||||
13
run-linux.sh
Normal file
13
run-linux.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Download the Linux executable
|
||||
curl -L https://github.com/KeshavAnandCode/Terminal/releases/download/v2.0/portfolio-linux -o /tmp/portfolio
|
||||
|
||||
# Make it executable
|
||||
chmod +x /tmp/portfolio
|
||||
|
||||
# Run it
|
||||
/tmp/portfolio
|
||||
|
||||
# Clean up
|
||||
rm /tmp/portfolio
|
||||
13
run-mac.sh
Normal file
13
run-mac.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Download the macOS executable
|
||||
curl -L https://github.com/KeshavAnandCode/Terminal/releases/download/v2.0/portfolio-mac -o /tmp/portfolio
|
||||
|
||||
# Make it executable
|
||||
chmod +x /tmp/portfolio
|
||||
|
||||
# Run it
|
||||
/tmp/portfolio
|
||||
|
||||
# Clean up
|
||||
rm /tmp/portfolio
|
||||
13
run-windows.bat
Normal file
13
run-windows.bat
Normal file
@@ -0,0 +1,13 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
:: Download the Windows executable
|
||||
powershell -Command "Invoke-WebRequest -Uri 'https://github.com/KeshavAnandCode/Terminal/releases/download/v2.0/portfolio-windows' -OutFile '%TEMP%\\portfolio.exe'"
|
||||
|
||||
:: Run the executable
|
||||
"%TEMP%\portfolio.exe"
|
||||
|
||||
:: Clean up
|
||||
del "%TEMP%\portfolio.exe"
|
||||
|
||||
endlocal
|
||||
3
terminalOneLiners.txt
Normal file
3
terminalOneLiners.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
/bin/bash -c "$(curl -fsSL https://terminalportfolio.keshavanand.net/run-mac.sh)" for Mac
|
||||
/bin/bash -c "$(curl -fsSL https://terminalportfolio.keshavanand.net/run-linux.sh)" for linux
|
||||
iwr https://terminalportfolio.keshavanand.net/run-windows.bat -OutFile \$env:TEMP\run-windows.bat; Start-Process \$env:TEMP\run-windows.bat -Wait
|
||||
Reference in New Issue
Block a user