diff --git a/package.json b/package.json index 3be5554..3ccd4b4 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "devDependencies": { "src": "latest", "svelte": "^5.0.0", + "tmux": "latest", "@sveltejs/adapter-auto": "^6.0.0", "@sveltejs/vite-plugin-svelte": "^5.0.0", "@tailwindcss/vite": "^4.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8b1dfa7..a92b1e8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -41,6 +41,9 @@ importers: tailwindcss: specifier: ^4.0.0 version: 4.0.0 + tmux: + specifier: latest + version: 1.0.0 typescript: specifier: 5.9.3 version: 5.9.3 @@ -853,6 +856,10 @@ packages: resolution: {integrity: sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==} engines: {node: '>=6'} + tmux@1.0.0: + resolution: {integrity: sha512-56dqTkuDc7jtYKDnY5aoLk4G1NRQUEFsEAyW5rXatU8/mj7ixBYFErHlubMzotEmBF/FTSmLpOvTF5/imEUkqA==} + deprecated: Package no longer supported. Contact support@npmjs.com for more info. + to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} @@ -1543,6 +1550,8 @@ snapshots: tapable@2.3.0: {} + tmux@1.0.0: {} + to-regex-range@5.0.1: dependencies: is-number: 7.0.0 diff --git a/src/lib/components/terminal-visualizer.svelte b/src/lib/components/terminal-visualizer.svelte index b034c27..db59f1a 100644 --- a/src/lib/components/terminal-visualizer.svelte +++ b/src/lib/components/terminal-visualizer.svelte @@ -1,7 +1,6 @@
@@ -166,6 +160,6 @@
- RENDERER: CANVAS_2D // {$containerWidth}x{$containerHeight} + RENDERER: CANVAS_2D // {containerWidth}x{containerHeight}
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 06a5995..c342303 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -15,9 +15,9 @@
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index ea34547..26a4369 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -8,35 +8,62 @@ let activePaneId = $state(0); let generatedConfig = $state(''); - function splitPane(direction: 'h' | 'v') { + const asciiArt = ` + _________________________________________ + / \\ + | root@mytmux:~ $ tmux new -s dev | + | [0] nvim ---------------- [1] server -- | + | | | | | + | | import { life } | npm run | | + | | from 'tmux'; | dev | | + | | | | | + | | // TODO: Sleep | | | + | |________________________|____________| | + | [2] logs ------------------------------ | + | | > ready in 200ms | | + | | > watching files... | | + | |_____________________________________| | + \\_________________________________________/ +`; + + // Refactored nested function to be a standalone helper to avoid potential parser issues + function findAndSplitNode(node, activeId, direction, nextIdVal) { + if (node.type === 'pane') { + if (node.id === activeId) { + const oldId = node.id; + const newId = nextIdVal; + + // Create new split node + node.type = direction === 'h' ? 'split-h' : 'split-v'; + node.ratio = 0.5; + delete node.id; + node.children = [ + { type: 'pane', id: oldId }, + { type: 'pane', id: newId } + ]; + return { found: true, nextId: nextIdVal + 1 }; + } + return { found: false, nextId: nextIdVal }; + } else { + // Recursively check children + let result = findAndSplitNode(node.children[0], activeId, direction, nextIdVal); + if (result.found) return result; + + return findAndSplitNode(node.children[1], activeId, direction, nextIdVal); + } + } + + function splitPane(direction) { // Find the active pane in the tree and replace it with a split const newLayout = JSON.parse(JSON.stringify(layout)); - function findAndSplit(node: any) { - if (node.type === 'pane') { - if (node.id === activePaneId) { - const oldId = node.id; - const newId = nextId++; - - // Create new split node - node.type = direction === 'h' ? 'split-h' : 'split-v'; - node.ratio = 0.5; - delete node.id; - node.children = [ - { type: 'pane', id: oldId }, - { type: 'pane', id: newId } - ]; - return true; - } - return false; - } else { - return findAndSplit(node.children[0]) || findAndSplit(node.children[1]); - } + const result = findAndSplitNode(newLayout, activePaneId, direction, nextId); + + if (result.found) { + nextId = result.nextId; + layout = newLayout; + generateTmuxConfig(); } - - findAndSplit(newLayout); - layout = newLayout; - generateTmuxConfig(); } function resetLayout() { @@ -46,7 +73,7 @@ generateTmuxConfig(); } - function selectPane(id: number) { + function selectPane(id) { activePaneId = id; } @@ -56,7 +83,7 @@ config += `# Generated by mytmux.life\n\n`; config += `new-session -s development -n editor\n`; - function traverse(node: any) { + function traverse(node) { if (node.type === 'split-h') { config += `split-window -h\n`; traverse(node.children[1]); // Right child @@ -113,23 +140,8 @@
diff --git a/src/routes/about/+page.svelte b/src/routes/about/+page.svelte new file mode 100644 index 0000000..3b39299 --- /dev/null +++ b/src/routes/about/+page.svelte @@ -0,0 +1,65 @@ + + +
+
+ + +
+
+
+ Shawn Anderson +
+

CEO @ LONG_TAIL_FINANCIAL

+
+
+
+ + +
+
+

+ Shawn Anderson +

+

+ Data Shaman, Educator, and Technologist. +

+
+ +
+

+ As the Founder of Long Tail Financial, Shawn operates at the intersection of data science, artificial intelligence, and decentralized finance. His work focuses on developing systems that enable exposure to the singularity—building the infrastructure for the next generation of financial technology. +

+ +

+ Beyond the code, Shawn is deeply passionate about teaching and self-empowerment. He believes that mastering your tools—like the terminal and tmux—is the first step towards mastering your craft. By understanding the systems we work with, we unlock the potential to build things that were previously impossible. +

+ +
+

+ "Coding is not just about writing syntax; it's about structuring your thoughts and empowering yourself to create change in the digital world." +

+
+ +

+ Whether he's leading workshops on AI in cryptocurrency markets or architecting complex tokenomics systems, Shawn's mission remains the same: to empower others through knowledge and technology. +

+
+ + + +
+
+