From f34ac3210e4877e066afb3901dd37e8d7f6fb13c Mon Sep 17 00:00:00 2001 From: ducoterra Date: Thu, 28 May 2026 21:58:56 -0400 Subject: [PATCH] I like trains --- src/script.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/script.js b/src/script.js index 2b660e3..c66b9f7 100644 --- a/src/script.js +++ b/src/script.js @@ -461,7 +461,8 @@ function createServerRack() { 'ps aux': 'USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND\nreese 1242 2.1 12.4 4285632 3932160 ? Sl May15 42:18 /opt/llama.cpp/build/bin/llama-server --model /models/Qwen3-30B-A3B.Q4_K_M.gguf --port 8082\ndocker 2341 1.2 6.8 8562348 2156032 ? Sl May15 28:45 /usr/bin/dockerd -H fd://\nreese 3456 0.8 3.2 2845632 1015808 ? Sl May15 18:22 /opt/open-webui/server\nreese 4567 0.5 2.1 1562348 665600 ? Sl May15 12:34 /usr/bin/python3 /opt/borg/borgmatic\nroot 5678 0.3 1.4 945632 448000 ? Ssl May15 8:12 /usr/bin/docker-proxy -p tcp:0.0.0.0:80:80\nreese 6789 0.2 1.1 745632 348000 ? Ssl May15 5:45 /usr/bin/podman run --name homepage\nroot 7890 0.1 0.8 545632 256000 ? Ssl May15 3:22 /usr/bin/docker-proxy -p tcp:0.0.0.0:443:443', 'ps aux --sort=-%mem | head -10': 'USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND\nreese 1242 2.1 12.4 4285632 3932160 ? Sl May15 42:18 /opt/llama.cpp/build/bin/llama-server --model /models/Qwen3-30B-A3B.Q4_K_M.gguf --port 8082\ndocker 2341 1.2 6.8 8562348 2156032 ? Sl May15 28:45 /usr/bin/dockerd -H fd://\nreese 3456 0.8 3.2 2845632 1015808 ? Sl May15 18:22 /opt/open-webui/server\nreese 4567 0.5 2.1 1562348 665600 ? Sl May15 12:34 /usr/bin/python3 /opt/borg/borgmatic\nroot 5678 0.3 1.4 945632 448000 ? Ssl May15 8:12 /usr/bin/docker-proxy -p tcp:0.0.0.0:80:80\nreese 6789 0.2 1.1 745632 348000 ? Ssl May15 5:45 /usr/bin/podman run --name homepage\nroot 7890 0.1 0.8 545632 256000 ? Ssl May15 3:22 /usr/bin/docker-proxy -p tcp:0.0.0.0:443:443', 'neofetch': ` 'c. reese@homelab\n ,xNMM. ----------------------\n .OMMMMo OS: Fedora Linux 69 (Workstation Edition) x86_64\n OMMM0, Host: custom-build\n .;loddo:' loolloddol;. Kernel: 6.8.0\n cKMMMMMMMMMMNWMMMMMMMMMM0: Uptime: 42 days, 3 hours\n .KMMMMMMMMMMMMMMMMMMMMMMMWd. Packages: 2847 (dnf)\n XMMMMMMMMMMMMMMMMMMMMMMMX. Shell: bash 5.2.26\n;MMMMMMMMMMMMMMMMMMMMMMMM: Resolution: 2560x1440\n:MMMMMMMMMMMMMMMMMMMMMMMM: DE: GNOME 46.1\n.MMMMMMMMMMMMMMMMMMMMMMMMX. WM: Mutter\n kMMMMMMMMMMMMMMMMMMMMMMMMWd. Terminal: /dev/pts/0\n .XMMMMMMMMMMMMMMMMMMMMMMMMMMk CPU: AMD Ryzen 9 7900X (24) @ 5.6GHz\n .XMMMMMMMMMMMMMMMMMMMMMMK. GPU: NVIDIA GeForce RTX 4090\n kMMMMMMMMMMMMMMMMMMMMd GPU: AMD Ryzen Built-in\n ;KMMMMMMMWXXWMMMMMMMk. Memory: 8.2Gi / 31Gi\n .cooc,. .,coo:.\n\n█████████████████████████████████████████████`, - 'help': 'Available commands:\n ls List directory contents\n pwd Print working directory\n whoami Print current user\n hostname Print hostname\n date Print current date/time\n uname Print system information\n uptime Print system uptime\n id Print user identity\n cat Print file contents (try: cat /etc/os-release)\n docker List running containers\n podman List running pods\n systemctl List running systemd services\n ss Show listening ports\n ip Show network interfaces\n df Show disk usage\n free Show memory usage\n ps Show running processes\n neofetch System info display\n help Show this help message', + 'sl': '____\n|DD|____T_\n|_ |_____|<\n @-@-@-oo\\', + 'help': 'Available commands:\n ls List directory contents\n pwd Print working directory\n whoami Print current user\n hostname Print hostname\n date Print current date/time\n uname Print system information\n uptime Print system uptime\n id Print user identity\n cat Print file contents (try: cat /etc/os-release)\n docker List running containers\n podman List running pods\n systemctl List running systemd services\n ss Show listening ports\n ip Show network interfaces\n df Show disk usage\n free Show memory usage\n ps Show running processes\n neofetch System info display\n sl Steam locomotive\n help Show this help message', }; if (cmdText.startsWith('echo ')) { @@ -751,6 +752,7 @@ function createServerRack() { let ticking = false; + // Update the parallax scroll position of the rack container function updateParallax() { const scrolled = window.pageYOffset; const parallaxSpeed = 0.3; @@ -769,15 +771,18 @@ function createServerRack() { }); } +// Reference to the first rack unit's terminal display (the interactive easter egg) let activeTerminal = null; createServerRack(); const heroEl = document.getElementById('hero'); let heroMouseDown = false; +// Track mouse state to prevent state collapse during hero click heroEl.addEventListener('mousedown', () => { heroMouseDown = true; }); heroEl.addEventListener('mouseup', () => { heroMouseDown = false; }); +// Toggle terminal expansion when clicking the hero section heroEl.addEventListener('click', (e) => { if (e.target.closest('.btn')) return; if (activeTerminal && activeTerminal._mobileInput) { @@ -840,8 +845,11 @@ const ACHIEVEMENTS = { aesthetic_mode: { name: 'Aesthetic Mode', desc: 'Display system info with style', icon: '✨', cmd: 'neofetch' }, help_seeker: { name: 'Help Seeker', desc: 'Look up available commands', icon: '📖', cmd: 'help' }, clean_slate: { name: 'Clean Slate', desc: 'Clear the terminal', icon: '🧹', cmd: 'clear' }, + train_spotter: { name: 'Train Spotter', desc: 'Run the steam locomotive', icon: '🚂', cmd: 'sl' }, + tain: { name: 'I like trains', desc: 'Choo chooooooo', icon: '🧹', cmd: 'sl' }, }; +// Load unlocked achievement keys from localStorage function loadAchievements() { try { const saved = localStorage.getItem(ACHIEVEMENTS_STORAGE_KEY); @@ -851,10 +859,12 @@ function loadAchievements() { } } +// Persist unlocked achievement keys to localStorage function saveAchievements(achieved) { localStorage.setItem(ACHIEVEMENTS_STORAGE_KEY, JSON.stringify(achieved)); } +// Check if the given command triggers any new achievements; returns unlocked achievement objects function checkAchievements(cmdText, isRoot) { const achieved = loadAchievements(); const newAchievements = []; @@ -899,6 +909,7 @@ function checkAchievements(cmdText, isRoot) { return newAchievements; } +// Display a toast notification for a newly unlocked achievement function showToast(achievement) { const container = document.getElementById('toast-container') || createToastContainer(); const toast = document.createElement('div'); @@ -918,6 +929,7 @@ function showToast(achievement) { }, 4000); } +// Create the toast notification container element if it doesn't exist function createToastContainer() { const container = document.createElement('div'); container.id = 'toast-container'; @@ -926,6 +938,7 @@ function createToastContainer() { return container; } +// Reveal the hidden achievements section and add it to the nav if needed function revealAchievements() { const section = document.getElementById('achievements'); if (section.style.display === 'none' || !section.style.display) { @@ -937,6 +950,7 @@ function revealAchievements() { renderAchievements(); } +// Render all achievement cards (unlocked and locked) into the achievements grid function renderAchievements() { const achieved = loadAchievements(); const total = Object.keys(ACHIEVEMENTS).length; @@ -963,6 +977,7 @@ function renderAchievements() { } } +// Add an "Achievements" link to the main navigation if achievements have been unlocked function addAchievementsNav() { const navLinks = document.getElementById('navLinks'); const existing = document.getElementById('nav-achievements'); @@ -974,7 +989,7 @@ function addAchievementsNav() { } } -// Initialize +// Restore previously unlocked achievements on page load (function initAchievements() { const achieved = loadAchievements(); if (achieved.length > 0) {