|
|
|
|
|
|
|
|
|
|
|
|
|
|
class AppManager { |
|
|
constructor(core) { |
|
|
this.core = core; |
|
|
this.projects = { |
|
|
'sneaky-cat-proxy': { |
|
|
title: 'Sneaky Cat Proxy', |
|
|
icon: 'π', |
|
|
description: 'A purr-fessional proxy that helps cats navigate the internet stealthily! π΅οΈββοΈ', |
|
|
technologies: ['Node.js', 'Express', 'Stealth'], |
|
|
features: [ |
|
|
'Stealth browsing capabilities', |
|
|
'Cat-safe internet filtering', |
|
|
'Automatic mouse toy detection', |
|
|
'Built-in treat dispenser API' |
|
|
], |
|
|
github: 'https://github.com/catcoder/sneaky-proxy', |
|
|
demo: 'https://sneaky-cat-proxy.vercel.app' |
|
|
}, |
|
|
'cat-photo-gallery': { |
|
|
title: 'Cat Photo Gallery', |
|
|
icon: 'πΈ', |
|
|
description: 'A claw-some gallery to showcase all your favorite cat pics with purr-fect filtering! π»', |
|
|
technologies: ['React', 'TypeScript', 'Tailwind'], |
|
|
features: [ |
|
|
'Advanced cat photo filtering', |
|
|
'Automatic whisker detection', |
|
|
'Paw print watermarking', |
|
|
'Social sharing for cat influencers' |
|
|
], |
|
|
github: 'https://github.com/catcoder/cat-gallery', |
|
|
demo: 'https://cat-gallery.vercel.app' |
|
|
}, |
|
|
'robo-cat-manager': { |
|
|
title: 'Robo-Cat Manager', |
|
|
icon: 'π€', |
|
|
description: 'Managing Discord bots like herding cats! Keep your digital kitties in line with style! π±βπ»', |
|
|
technologies: ['Discord.js', 'MongoDB', 'Docker'], |
|
|
features: [ |
|
|
'Multi-bot management dashboard', |
|
|
'Automatic yarn ball deployment', |
|
|
'Cat behavior analytics', |
|
|
'Emergency tuna button' |
|
|
], |
|
|
github: 'https://github.com/catcoder/robo-cat-manager', |
|
|
demo: 'https://discord-bot-manager.vercel.app' |
|
|
} |
|
|
}; |
|
|
} |
|
|
|
|
|
registerAllApps(core) { |
|
|
this.core = core; |
|
|
|
|
|
|
|
|
if (window.CatOSTerminal) { |
|
|
this.core.apps.set('terminal', { |
|
|
title: 'CatOS Terminal', |
|
|
icon: 'π»', |
|
|
create: this.createTerminalApp.bind(this) |
|
|
}); |
|
|
} |
|
|
|
|
|
this.core.apps.set('project-viewer', { |
|
|
title: 'Project Viewer', |
|
|
icon: 'π', |
|
|
create: this.createProjectViewer.bind(this) |
|
|
}); |
|
|
|
|
|
this.core.apps.set('about', { |
|
|
title: 'About CatOS', |
|
|
icon: 'π', |
|
|
create: this.createAboutApp.bind(this) |
|
|
}); |
|
|
|
|
|
this.core.apps.set('contact', { |
|
|
title: 'Contact', |
|
|
icon: 'π§', |
|
|
create: this.createContactApp.bind(this) |
|
|
}); |
|
|
|
|
|
this.core.apps.set('file-explorer', { |
|
|
title: 'File Explorer', |
|
|
icon: 'π', |
|
|
create: this.createFileExplorer.bind(this) |
|
|
}); |
|
|
} |
|
|
|
|
|
launchApp(appType, options = {}) { |
|
|
const app = this.core.apps.get(appType); |
|
|
|
|
|
if (!app) { |
|
|
this.core.showNotification('Error', `App "${appType}" not found! πΏ`); |
|
|
return; |
|
|
} |
|
|
|
|
|
|
|
|
if (appType === 'about' || appType === 'contact') { |
|
|
for (let [windowId, window] of this.core.windows) { |
|
|
if (window.appType === appType) { |
|
|
|
|
|
this.core.windowManager.focusWindow(windowId); |
|
|
return; |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
const content = app.create(options); |
|
|
const windowId = this.core.windowManager.createWindow({ |
|
|
title: app.title, |
|
|
icon: app.icon, |
|
|
content: content, |
|
|
appType: appType |
|
|
}); |
|
|
|
|
|
this.core.windowManager.addToTaskbar(windowId, app); |
|
|
return windowId; |
|
|
} |
|
|
|
|
|
createTerminalApp() { |
|
|
const terminalId = `terminal-${Date.now()}`; |
|
|
setTimeout(() => { |
|
|
if (window.CatOSTerminal) { |
|
|
window.CatOSTerminal.initialize(terminalId, this.core); |
|
|
} |
|
|
}, 100); |
|
|
|
|
|
return ` |
|
|
<div class="terminal-app" data-terminal-id="${terminalId}"> |
|
|
<div class="terminal-content" id="terminal-content-${terminalId}"> |
|
|
<div class="terminal-line"> |
|
|
<span class="terminal-prompt">cat@catos:~$</span> |
|
|
<span class="terminal-text">Welcome to CatOS Terminal! π±</span> |
|
|
</div> |
|
|
<div class="terminal-line"> |
|
|
<span class="terminal-prompt">cat@catos:~$</span> |
|
|
<span class="terminal-text">Type 'help' for available commands or 'meow' for cat wisdom</span> |
|
|
</div> |
|
|
</div> |
|
|
<div class="terminal-input-line"> |
|
|
<span class="terminal-prompt" id="prompt-${terminalId}">cat@catos:~$</span> |
|
|
<input type="text" class="terminal-input" id="terminal-input-${terminalId}" autofocus> |
|
|
</div> |
|
|
</div> |
|
|
`; |
|
|
} |
|
|
|
|
|
createProjectViewer(options) { |
|
|
const projectId = options.projectId; |
|
|
const project = this.projects[projectId]; |
|
|
|
|
|
if (!project) { |
|
|
return ` |
|
|
<div class="error-content"> |
|
|
<div class="error-icon">πΏ</div> |
|
|
<div class="error-title">Project Not Found</div> |
|
|
<div class="error-message">The requested project could not be found.</div> |
|
|
</div> |
|
|
`; |
|
|
} |
|
|
|
|
|
return ` |
|
|
<div class="project-viewer"> |
|
|
<div class="project-header"> |
|
|
<div class="project-icon">${project.icon}</div> |
|
|
<div class="project-info"> |
|
|
<h1 class="project-title">${project.title}</h1> |
|
|
<p class="project-description">${project.description}</p> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<div class="project-details"> |
|
|
<div class="detail-section"> |
|
|
<h3>π οΈ Technologies</h3> |
|
|
<div class="tech-stack"> |
|
|
${project.technologies.map(tech => `<span class="tech-badge">${tech}</span>`).join('')} |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<div class="detail-section"> |
|
|
<h3>β¨ Features</h3> |
|
|
<ul class="feature-list"> |
|
|
${project.features.map(feature => `<li>πΎ ${feature}</li>`).join('')} |
|
|
</ul> |
|
|
</div> |
|
|
|
|
|
<div class="detail-section"> |
|
|
<h3>π Links</h3> |
|
|
<div class="project-links"> |
|
|
<a href="${project.github}" target="_blank" rel="noopener noreferrer" class="project-link"> |
|
|
<span class="link-icon">π</span> |
|
|
<span class="link-text">View on GitHub</span> |
|
|
</a> |
|
|
<a href="${project.demo}" target="_blank" rel="noopener noreferrer" class="project-link"> |
|
|
<span class="link-icon">π</span> |
|
|
<span class="link-text">Live Demo</span> |
|
|
</a> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
`; |
|
|
} |
|
|
|
|
|
createAboutApp() { |
|
|
return ` |
|
|
<div class="about-content"> |
|
|
<div class="about-header"> |
|
|
<div class="about-avatar">π±βπ»</div> |
|
|
<div class="about-info"> |
|
|
<h1>Rafael - Cat Developer</h1> |
|
|
<p class="about-subtitle">Crafting purr-fessional software with whiskers and code</p> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<div class="about-sections"> |
|
|
<div class="about-section"> |
|
|
<h3>π― About Me</h3> |
|
|
<p>Welcome to my digital litter box! I'm a passionate developer who believes that the best code is written with cat-like curiosity and precision. When I'm not debugging, you'll find me contemplating the philosophical implications of yarn balls and infinite loops.</p> |
|
|
</div> |
|
|
|
|
|
<div class="about-section"> |
|
|
<h3>π οΈ Skills</h3> |
|
|
<div class="skills-grid"> |
|
|
<div class="skill-item">JavaScript</div> |
|
|
<div class="skill-item">TypeScript</div> |
|
|
<div class="skill-item">React</div> |
|
|
<div class="skill-item">Node.js</div> |
|
|
<div class="skill-item">Python</div> |
|
|
<div class="skill-item">Cat Psychology</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<div class="about-section"> |
|
|
<h3>πΎ Philosophy</h3> |
|
|
<blockquote class="cat-wisdom"> |
|
|
"In coding, as in cat life, the best solutions often come from patient observation, |
|
|
strategic planning, and the occasional strategic nap." |
|
|
<cite>- The Cat Developer's Manifesto</cite> |
|
|
</blockquote> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
`; |
|
|
} |
|
|
|
|
|
createContactApp() { |
|
|
return ` |
|
|
<div class="contact-content"> |
|
|
<div class="contact-header"> |
|
|
<div class="contact-icon">π§</div> |
|
|
<h1>Get in Touch</h1> |
|
|
<p>Let's discuss your next purr-fect project!</p> |
|
|
</div> |
|
|
|
|
|
<div class="contact-methods"> |
|
|
<div class="contact-method"> |
|
|
<div class="method-icon">π§</div> |
|
|
<div class="method-info"> |
|
|
<h3>Email</h3> |
|
|
<p>hello@catcoder.dev</p> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<div class="contact-method"> |
|
|
<div class="method-icon">πΌ</div> |
|
|
<div class="method-info"> |
|
|
<h3>LinkedIn</h3> |
|
|
<p>linkedin.com/in/catdeveloper</p> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<div class="contact-method"> |
|
|
<div class="method-icon">π±</div> |
|
|
<div class="method-info"> |
|
|
<h3>GitHub</h3> |
|
|
<p>github.com/catcoder</p> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<div class="contact-form"> |
|
|
<h3>Quick Message</h3> |
|
|
<form class="cat-form" onsubmit="return CatOSAppManager.handleContactForm(event)"> |
|
|
<div class="form-group"> |
|
|
<label for="contact-name">Name</label> |
|
|
<input type="text" id="contact-name" name="name" required> |
|
|
</div> |
|
|
<div class="form-group"> |
|
|
<label for="contact-email">Email</label> |
|
|
<input type="email" id="contact-email" name="email" required> |
|
|
</div> |
|
|
<div class="form-group"> |
|
|
<label for="contact-message">Message</label> |
|
|
<textarea id="contact-message" name="message" rows="4" required></textarea> |
|
|
</div> |
|
|
<button type="submit" class="submit-button">Send Message πΎ</button> |
|
|
</form> |
|
|
</div> |
|
|
</div> |
|
|
`; |
|
|
} |
|
|
|
|
|
createFileExplorer() { |
|
|
return ` |
|
|
<div class="file-explorer"> |
|
|
<div class="explorer-toolbar"> |
|
|
<div class="toolbar-section"> |
|
|
<button class="toolbar-btn" title="Back">β¬
οΈ</button> |
|
|
<button class="toolbar-btn" title="Forward">β‘οΈ</button> |
|
|
<button class="toolbar-btn" title="Up">β¬οΈ</button> |
|
|
</div> |
|
|
<div class="address-bar"> |
|
|
<span class="path-segment">π </span> |
|
|
<span class="path-separator">/</span> |
|
|
<span class="path-segment">Users</span> |
|
|
<span class="path-separator">/</span> |
|
|
<span class="path-segment">cat</span> |
|
|
</div> |
|
|
<div class="toolbar-section"> |
|
|
<button class="toolbar-btn" title="View">ποΈ</button> |
|
|
<button class="toolbar-btn" title="New Folder">π+</button> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<div class="explorer-content"> |
|
|
<div class="file-item directory"> |
|
|
<div class="file-icon">π</div> |
|
|
<div class="file-name">Projects</div> |
|
|
<div class="file-size">--</div> |
|
|
<div class="file-date">Today</div> |
|
|
</div> |
|
|
<div class="file-item directory"> |
|
|
<div class="file-icon">π</div> |
|
|
<div class="file-name">Documents</div> |
|
|
<div class="file-size">--</div> |
|
|
<div class="file-date">Yesterday</div> |
|
|
</div> |
|
|
<div class="file-item file"> |
|
|
<div class="file-icon">π</div> |
|
|
<div class="file-name">resume.pdf</div> |
|
|
<div class="file-size">2.1 MB</div> |
|
|
<div class="file-date">Mar 15</div> |
|
|
</div> |
|
|
<div class="file-item file"> |
|
|
<div class="file-icon">πΌοΈ</div> |
|
|
<div class="file-name">cat_memes.jpg</div> |
|
|
<div class="file-size">856 KB</div> |
|
|
<div class="file-date">Mar 14</div> |
|
|
</div> |
|
|
<div class="file-item file"> |
|
|
<div class="file-icon">π»</div> |
|
|
<div class="file-name">startup.sh</div> |
|
|
<div class="file-size">1.2 KB</div> |
|
|
<div class="file-date">Mar 13</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
`; |
|
|
} |
|
|
|
|
|
handleContactForm(event) { |
|
|
event.preventDefault(); |
|
|
const formData = new FormData(event.target); |
|
|
const data = Object.fromEntries(formData.entries()); |
|
|
|
|
|
|
|
|
this.core.showNotification( |
|
|
'β
Message Sent!', |
|
|
`Thanks ${data.name}! I'll get back to you faster than a cat chasing a laser pointer! π±` |
|
|
); |
|
|
|
|
|
event.target.reset(); |
|
|
return false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
window.CatOSAppManager = AppManager; |