File size: 16,160 Bytes
06163ac
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
/**
 * CatOS Application Manager Module
 * Handles app registration, launching, and management
 */
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;
        
        // Register core apps (only if Terminal module is available)
        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;
        }

        // Check if app is already running (for singleton apps)
        if (appType === 'about' || appType === 'contact') {
            for (let [windowId, window] of this.core.windows) {
                if (window.appType === appType) {
                    // Focus existing window instead of creating new one
                    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());
        
        // Simulate form submission
        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;
    }
}

// Export for use in main system
window.CatOSAppManager = AppManager;