hacker theme added

This commit is contained in:
2025-07-24 14:49:54 -05:00
parent cb57ab1119
commit 53db1b34c9

View File

@@ -8,6 +8,13 @@
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
// ------------------
@@ -19,7 +26,7 @@ Component MakeAboutPage() {
"Focus areas: Secure systems, ML accuracy, and privacy.";
return Renderer([content]() -> Element {
return paragraph(content) | flex;
return paragraph(content) | hacker_text_style | flex;
});
}
@@ -35,15 +42,15 @@ Component MakeProjectsPage() {
for (const Project& project : projects) {
Component card = Renderer([project]() -> Element {
Element title = text(project.title);
Element title = text(project.title) | hacker_text_style;
Element link_line = project.link.empty()
? text("")
: text("🔗 " + project.link) | color(Color::Blue);
: text("🔗 " + project.link) | hacker_link_style;
return vbox({
title,
link_line
}) | border;
}) | hacker_border_style;
});
container->Add(card);
@@ -65,7 +72,7 @@ Component MakeEducationPage() {
for (const std::string& entry : entries) {
Component card = Renderer([entry]() -> Element {
return text(entry) | border;
return text(entry) | hacker_text_style | hacker_border_style;
});
container->Add(card);
}
@@ -86,7 +93,7 @@ Component MakeWorkPage() {
for (const std::string& job : jobs) {
Component card = Renderer([job]() -> Element {
return text(job) | border;
return text(job) | hacker_text_style | hacker_border_style;
});
container->Add(card);
}
@@ -104,7 +111,7 @@ Component MakeContactPage() {
"📍 Based in DFW Metroplex";
return Renderer([contact_info]() -> Element {
return paragraph(contact_info) | flex;
return paragraph(contact_info) | hacker_text_style | flex;
});
}
@@ -124,32 +131,33 @@ PortfolioApp::PortfolioApp() {
pages_.push_back(work_page_);
pages_.push_back(contact_page_);
// Create navigation sidebar
navigation_ = Container::Vertical({
Button("About", [&] { SwitchPage(0); }),
Button("Projects", [&] { SwitchPage(1); }),
Button("Education", [&] { SwitchPage(2); }),
Button("Work", [&] { SwitchPage(3); }),
Button("Contact", [&] { SwitchPage(4); })
});
// Create navigation sidebar with green styling
std::vector<std::string> labels = {"About", "Projects", "Education", "Work", "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);
// Initial layout
// Wrap separator element inside a Component
Component separator_component = Renderer([] { return separator(); });
Add(Container::Horizontal(Components{
navigation_,
separator_component,
pages_[current_page_]
}));
Component separator_component = Renderer([] { return separator(); });
Add(Container::Horizontal(Components{
navigation_,
separator_component,
pages_[current_page_]
}));
}
// SwitchPage method implementation
void PortfolioApp::SwitchPage(int index) {
current_page_ = index;
// Clear and rebuild layout
DetachAllChildren();
Component separator_component = Renderer([] { return separator(); });
@@ -164,9 +172,9 @@ void PortfolioApp::SwitchPage(int index) {
// Render method implementation
Element PortfolioApp::Render() {
return hbox({
navigation_->Render() | border,
navigation_->Render() | hacker_border_style,
separator(),
pages_[current_page_]->Render() | border | flex
pages_[current_page_]->Render() | hacker_border_style | flex
});
}