// VS Code spoof — three-pane layout with file explorer and syntax-highlighted editor. const FILES = [ { path: 'src/index.ts', content: `import { Engine } from './engine'; const engine = new Engine({ title: 'Meridian OS', version: '0.1.0', antialias: true, vsync: true, }); // Entry point engine.start(); console.log('Meridian OS initialized'); export default engine;` }, { path: 'src/engine.ts', content: `export interface EngineConfig { title: string; version: string; antialias: boolean; vsync: boolean; } export class Engine { private config: EngineConfig; private running: boolean = false; constructor(config: EngineConfig) { this.config = config; this.running = false; } start(): void { if (this.running) return; this.running = true; console.log(\`Starting \${this.config.title} v\${this.config.version}\`); this.renderLoop(); } private renderLoop(): void { while (this.running) { this.update(); this.draw(); } } private update(): void { // Game loop update } private draw(): void { // Game loop render } stop(): void { this.running = false; } }` }, { path: 'README.md', content: `# Meridian OS ## Overview A browser-based desktop environment for a video game. Elegant, restrained, gamer-literate without being loud. ## Features - Window manager with drag, focus, minimize, close - Multiple apps: Notepad, Music, Terminal - Spoof apps: Steam, VS Code, Postman, Chrome - Achievement system - localStorage persistence ## Tech Stack - Vanilla JS - CSS custom properties - No frameworks. No excuses.` }, ]; function highlightTS(code) { // Very basic "syntax highlighting" — just colour types, strings, keywords return code .replace(/(import|export|from|const|let|var|function|class|private|public|return|if|while|interface|type|new|void|false|true|this|typeof|instanceof|extends)/g, '$1') .replace(/(\/\/.*)/g, '$1') .replace(/('.*?'|".*?"|`.*?`)/g, '$1') .replace(/\b(\d+)\b/g, '$1') .replace(/(\w+)(?=\s*\()/g, '$1') .replace(/(:\s*)(\w+)/g, '$1$2'); } export default { id: 'vscode', title: 'VS Code', render(container, api) { let activeFile = 0; const root = document.createElement('div'); root.style.cssText = 'height:100%;display:flex;flex-direction:column;background:#1e1e1e;font-family:var(--font-mono,monospace);font-size:13px;color:#d4d4d4;'; // Activity bar (leftmost, 40px wide) const actBar = document.createElement('div'); actBar.style.cssText = 'width:40px;background:#333333;display:flex;flex-direction:column;align-items:center;padding-top:8px;border-right:1px solid #444444;flex-shrink:0;'; // 5 geometric icons as divs const icons = [ { shape: 'square', id: 'explorer' }, { shape: 'hline', id: 'search' }, { shape: 'dots', id: 'git' }, { shape: 'circle', id: 'debug' }, { shape: 'grid', id: 'extensions' }, ]; const iconStyle = 'width:24px;height:24px;margin-bottom:16px;cursor:pointer;opacity:0.5;transition:opacity 150ms;'; icons.forEach((icon) => { const el = document.createElement('div'); el.style.cssText = iconStyle; el.id = `vscode-icon-${icon.id}`; if (icon.shape === 'square') { el.innerHTML = '
'; } else if (icon.shape === 'hline') { el.innerHTML = ''; } else if (icon.shape === 'dots') { el.innerHTML = '