Add 3 files
Browse files- README.md +7 -5
- index.html +998 -19
- prompts.txt +2 -0
README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: static
|
7 |
pinned: false
|
|
|
|
|
8 |
---
|
9 |
|
10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
+
title: myspace
|
3 |
+
emoji: 🐳
|
4 |
+
colorFrom: blue
|
5 |
+
colorTo: gray
|
6 |
sdk: static
|
7 |
pinned: false
|
8 |
+
tags:
|
9 |
+
- deepsite
|
10 |
---
|
11 |
|
12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
@@ -1,19 +1,998 @@
|
|
1 |
-
<!
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Mini Linux OS</title>
|
7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
9 |
+
<style>
|
10 |
+
@keyframes blink {
|
11 |
+
0%, 100% { opacity: 1; }
|
12 |
+
50% { opacity: 0; }
|
13 |
+
}
|
14 |
+
.cursor-blink {
|
15 |
+
animation: blink 1s infinite;
|
16 |
+
}
|
17 |
+
.window {
|
18 |
+
box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
|
19 |
+
}
|
20 |
+
.file-icon:hover {
|
21 |
+
transform: scale(1.05);
|
22 |
+
}
|
23 |
+
.terminal-line::before {
|
24 |
+
content: "> ";
|
25 |
+
color: #4ade80;
|
26 |
+
font-weight: bold;
|
27 |
+
}
|
28 |
+
.resize-handle {
|
29 |
+
width: 100%;
|
30 |
+
height: 5px;
|
31 |
+
background-color: rgba(0, 0, 0, 0.1);
|
32 |
+
cursor: ns-resize;
|
33 |
+
}
|
34 |
+
.process-bar {
|
35 |
+
transition: width 0.5s ease;
|
36 |
+
}
|
37 |
+
.directory-item:hover {
|
38 |
+
background-color: rgba(74, 222, 128, 0.1);
|
39 |
+
}
|
40 |
+
.file-item:hover {
|
41 |
+
background-color: rgba(96, 165, 250, 0.1);
|
42 |
+
}
|
43 |
+
</style>
|
44 |
+
</head>
|
45 |
+
<body class="bg-gray-900 text-gray-200 h-screen overflow-hidden font-mono">
|
46 |
+
<!-- Desktop -->
|
47 |
+
<div class="h-full flex flex-col">
|
48 |
+
<!-- Top Bar -->
|
49 |
+
<div class="bg-gray-800 px-4 py-2 flex justify-between items-center border-b border-gray-700">
|
50 |
+
<div class="flex items-center space-x-4">
|
51 |
+
<span class="font-bold text-green-400">MiniLinux</span>
|
52 |
+
<div class="hidden md:flex space-x-2">
|
53 |
+
<button class="px-3 py-1 hover:bg-gray-700 rounded">File</button>
|
54 |
+
<button class="px-3 py-1 hover:bg-gray-700 rounded">Edit</button>
|
55 |
+
<button class="px-3 py-1 hover:bg-gray-700 rounded">View</button>
|
56 |
+
<button class="px-3 py-1 hover:bg-gray-700 rounded">Help</button>
|
57 |
+
</div>
|
58 |
+
</div>
|
59 |
+
<div class="flex items-center space-x-2">
|
60 |
+
<span id="clock" class="px-3 py-1 bg-gray-700 rounded">00:00:00</span>
|
61 |
+
<button class="w-8 h-8 flex items-center justify-center hover:bg-gray-700 rounded-full">
|
62 |
+
<i class="fas fa-power-off"></i>
|
63 |
+
</button>
|
64 |
+
</div>
|
65 |
+
</div>
|
66 |
+
|
67 |
+
<!-- Desktop Icons -->
|
68 |
+
<div class="flex-grow relative p-4">
|
69 |
+
<div class="absolute top-4 left-4 flex flex-col items-center w-20 text-center cursor-pointer file-icon">
|
70 |
+
<div class="w-12 h-12 bg-blue-500 rounded flex items-center justify-center mb-1">
|
71 |
+
<i class="fas fa-folder text-white text-2xl"></i>
|
72 |
+
</div>
|
73 |
+
<span class="text-xs">Home</span>
|
74 |
+
</div>
|
75 |
+
<div class="absolute top-4 left-28 flex flex-col items-center w-20 text-center cursor-pointer file-icon">
|
76 |
+
<div class="w-12 h-12 bg-green-500 rounded flex items-center justify-center mb-1">
|
77 |
+
<i class="fas fa-terminal text-white text-2xl"></i>
|
78 |
+
</div>
|
79 |
+
<span class="text-xs">Terminal</span>
|
80 |
+
</div>
|
81 |
+
<div class="absolute top-28 left-4 flex flex-col items-center w-20 text-center cursor-pointer file-icon">
|
82 |
+
<div class="w-12 h-12 bg-purple-500 rounded flex items-center justify-center mb-1">
|
83 |
+
<i class="fas fa-file-alt text-white text-2xl"></i>
|
84 |
+
</div>
|
85 |
+
<span class="text-xs">Documents</span>
|
86 |
+
</div>
|
87 |
+
<div class="absolute top-28 left-28 flex flex-col items-center w-20 text-center cursor-pointer file-icon">
|
88 |
+
<div class="w-12 h-12 bg-yellow-500 rounded flex items-center justify-center mb-1">
|
89 |
+
<i class="fas fa-chart-bar text-white text-2xl"></i>
|
90 |
+
</div>
|
91 |
+
<span class="text-xs">System</span>
|
92 |
+
</div>
|
93 |
+
|
94 |
+
<!-- Windows -->
|
95 |
+
<div id="terminal-window" class="window absolute top-20 left-20 w-3/4 md:w-1/2 bg-gray-800 rounded-lg overflow-hidden z-10">
|
96 |
+
<div class="bg-gray-700 px-3 py-2 flex justify-between items-center">
|
97 |
+
<div class="flex items-center space-x-2">
|
98 |
+
<i class="fas fa-terminal text-green-400"></i>
|
99 |
+
<span>Terminal</span>
|
100 |
+
</div>
|
101 |
+
<div class="flex space-x-2">
|
102 |
+
<button class="w-5 h-5 flex items-center justify-center hover:bg-gray-600 rounded">
|
103 |
+
<i class="fas fa-minus text-xs"></i>
|
104 |
+
</button>
|
105 |
+
<button class="w-5 h-5 flex items-center justify-center hover:bg-gray-600 rounded">
|
106 |
+
<i class="fas fa-square text-xs"></i>
|
107 |
+
</button>
|
108 |
+
<button class="w-5 h-5 flex items-center justify-center hover:bg-red-500 rounded">
|
109 |
+
<i class="fas fa-times text-xs"></i>
|
110 |
+
</button>
|
111 |
+
</div>
|
112 |
+
</div>
|
113 |
+
<div class="resize-handle"></div>
|
114 |
+
<div id="terminal-content" class="p-3 h-64 overflow-y-auto">
|
115 |
+
<div class="text-green-400 mb-2">Welcome to MiniLinux Terminal</div>
|
116 |
+
<div class="text-gray-400 mb-4">Type 'help' to see available commands</div>
|
117 |
+
<div id="terminal-history"></div>
|
118 |
+
<div class="flex items-center">
|
119 |
+
<span id="terminal-prompt" class="text-green-400 mr-2">user@minilinux:~$</span>
|
120 |
+
<input id="terminal-input" type="text" class="bg-transparent border-none outline-none flex-grow" autofocus>
|
121 |
+
<span class="cursor-blink">|</span>
|
122 |
+
</div>
|
123 |
+
</div>
|
124 |
+
</div>
|
125 |
+
|
126 |
+
<div id="files-window" class="window absolute top-40 left-40 w-3/4 md:w-1/2 bg-gray-800 rounded-lg overflow-hidden hidden">
|
127 |
+
<div class="bg-gray-700 px-3 py-2 flex justify-between items-center">
|
128 |
+
<div class="flex items-center space-x-2">
|
129 |
+
<i class="fas fa-folder text-blue-400"></i>
|
130 |
+
<span id="files-window-title">File Explorer</span>
|
131 |
+
</div>
|
132 |
+
<div class="flex space-x-2">
|
133 |
+
<button class="w-5 h-5 flex items-center justify-center hover:bg-gray-600 rounded">
|
134 |
+
<i class="fas fa-minus text-xs"></i>
|
135 |
+
</button>
|
136 |
+
<button class="w-5 h-5 flex items-center justify-center hover:bg-gray-600 rounded">
|
137 |
+
<i class="fas fa-square text-xs"></i>
|
138 |
+
</button>
|
139 |
+
<button class="w-5 h-5 flex items-center justify-center hover:bg-red-500 rounded">
|
140 |
+
<i class="fas fa-times text-xs"></i>
|
141 |
+
</button>
|
142 |
+
</div>
|
143 |
+
</div>
|
144 |
+
<div class="resize-handle"></div>
|
145 |
+
<div class="p-3 h-64 overflow-y-auto">
|
146 |
+
<div class="flex items-center mb-2">
|
147 |
+
<button id="files-back" class="mr-3 text-gray-400 hover:text-white cursor-pointer disabled:opacity-50" disabled>
|
148 |
+
<i class="fas fa-arrow-left"></i>
|
149 |
+
</button>
|
150 |
+
<button id="files-forward" class="mr-3 text-gray-400 hover:text-white cursor-pointer disabled:opacity-50" disabled>
|
151 |
+
<i class="fas fa-arrow-right"></i>
|
152 |
+
</button>
|
153 |
+
<button id="files-home" class="mr-3 text-gray-400 hover:text-white cursor-pointer">
|
154 |
+
<i class="fas fa-home"></i>
|
155 |
+
</button>
|
156 |
+
<div id="files-path" class="bg-gray-700 px-2 py-1 rounded text-sm flex-grow">/home/user</div>
|
157 |
+
</div>
|
158 |
+
<div id="files-content" class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-4">
|
159 |
+
<!-- Content will be generated by JavaScript -->
|
160 |
+
</div>
|
161 |
+
</div>
|
162 |
+
</div>
|
163 |
+
|
164 |
+
<div id="system-window" class="window absolute top-60 left-60 w-3/4 md:w-1/2 bg-gray-800 rounded-lg overflow-hidden hidden">
|
165 |
+
<div class="bg-gray-700 px-3 py-2 flex justify-between items-center">
|
166 |
+
<div class="flex items-center space-x-2">
|
167 |
+
<i class="fas fa-chart-bar text-yellow-400"></i>
|
168 |
+
<span>System Monitor</span>
|
169 |
+
</div>
|
170 |
+
<div class="flex space-x-2">
|
171 |
+
<button class="w-5 h-5 flex items-center justify-center hover:bg-gray-600 rounded">
|
172 |
+
<i class="fas fa-minus text-xs"></i>
|
173 |
+
</button>
|
174 |
+
<button class="w-5 h-5 flex items-center justify-center hover:bg-gray-600 rounded">
|
175 |
+
<i class="fas fa-square text-xs"></i>
|
176 |
+
</button>
|
177 |
+
<button class="w-5 h-5 flex items-center justify-center hover:bg-red-500 rounded">
|
178 |
+
<i class="fas fa-times text-xs"></i>
|
179 |
+
</button>
|
180 |
+
</div>
|
181 |
+
</div>
|
182 |
+
<div class="resize-handle"></div>
|
183 |
+
<div class="p-3 h-64 overflow-y-auto">
|
184 |
+
<div class="mb-4">
|
185 |
+
<div class="flex justify-between mb-1">
|
186 |
+
<span>CPU Usage</span>
|
187 |
+
<span id="cpu-usage">0%</span>
|
188 |
+
</div>
|
189 |
+
<div class="w-full bg-gray-700 rounded-full h-2.5">
|
190 |
+
<div id="cpu-bar" class="bg-blue-500 h-2.5 rounded-full process-bar" style="width: 0%"></div>
|
191 |
+
</div>
|
192 |
+
</div>
|
193 |
+
<div class="mb-4">
|
194 |
+
<div class="flex justify-between mb-1">
|
195 |
+
<span>Memory Usage</span>
|
196 |
+
<span id="mem-usage">0%</span>
|
197 |
+
</div>
|
198 |
+
<div class="w-full bg-gray-700 rounded-full h-2.5">
|
199 |
+
<div id="mem-bar" class="bg-purple-500 h-2.5 rounded-full process-bar" style="width: 0%"></div>
|
200 |
+
</div>
|
201 |
+
</div>
|
202 |
+
<div class="mb-4">
|
203 |
+
<div class="flex justify-between mb-1">
|
204 |
+
<span>Disk Usage</span>
|
205 |
+
<span id="disk-usage">0%</span>
|
206 |
+
</div>
|
207 |
+
<div class="w-full bg-gray-700 rounded-full h-2.5">
|
208 |
+
<div id="disk-bar" class="bg-green-500 h-2.5 rounded-full process-bar" style="width: 0%"></div>
|
209 |
+
</div>
|
210 |
+
</div>
|
211 |
+
<div>
|
212 |
+
<h3 class="font-bold mb-2">Running Processes</h3>
|
213 |
+
<div class="bg-gray-700 rounded p-2">
|
214 |
+
<div class="grid grid-cols-4 gap-2 text-sm mb-1 font-bold border-b border-gray-600 pb-1">
|
215 |
+
<span>PID</span>
|
216 |
+
<span>Name</span>
|
217 |
+
<span>CPU</span>
|
218 |
+
<span>Memory</span>
|
219 |
+
</div>
|
220 |
+
<div id="process-list" class="text-sm">
|
221 |
+
<!-- Processes will be added here -->
|
222 |
+
</div>
|
223 |
+
</div>
|
224 |
+
</div>
|
225 |
+
</div>
|
226 |
+
</div>
|
227 |
+
</div>
|
228 |
+
|
229 |
+
<!-- Taskbar -->
|
230 |
+
<div class="bg-gray-800 px-3 py-2 flex items-center space-x-3 border-t border-gray-700">
|
231 |
+
<button id="terminal-launcher" class="w-10 h-10 flex items-center justify-center hover:bg-gray-700 rounded">
|
232 |
+
<i class="fas fa-terminal text-green-400"></i>
|
233 |
+
</button>
|
234 |
+
<button id="files-launcher" class="w-10 h-10 flex items-center justify-center hover:bg-gray-700 rounded">
|
235 |
+
<i class="fas fa-folder text-blue-400"></i>
|
236 |
+
</button>
|
237 |
+
<button id="system-launcher" class="w-10 h-10 flex items-center justify-center hover:bg-gray-700 rounded">
|
238 |
+
<i class="fas fa-chart-bar text-yellow-400"></i>
|
239 |
+
</button>
|
240 |
+
<div class="flex-grow"></div>
|
241 |
+
<div class="flex items-center space-x-2">
|
242 |
+
<span id="network-status" class="px-2 py-1 bg-gray-700 rounded text-xs flex items-center">
|
243 |
+
<i class="fas fa-wifi mr-1"></i>
|
244 |
+
<span>Connected</span>
|
245 |
+
</span>
|
246 |
+
<span id="battery-status" class="px-2 py-1 bg-gray-700 rounded text-xs flex items-center">
|
247 |
+
<i class="fas fa-battery-full mr-1"></i>
|
248 |
+
<span>100%</span>
|
249 |
+
</span>
|
250 |
+
</div>
|
251 |
+
</div>
|
252 |
+
</div>
|
253 |
+
|
254 |
+
<script>
|
255 |
+
// File system structure
|
256 |
+
const fileSystem = {
|
257 |
+
name: '/',
|
258 |
+
type: 'directory',
|
259 |
+
children: [
|
260 |
+
{
|
261 |
+
name: 'bin',
|
262 |
+
type: 'directory',
|
263 |
+
children: [
|
264 |
+
{ name: 'bash', type: 'executable', size: '1.2MB' },
|
265 |
+
{ name: 'ls', type: 'executable', size: '56KB' },
|
266 |
+
{ name: 'cat', type: 'executable', size: '48KB' }
|
267 |
+
]
|
268 |
+
},
|
269 |
+
{
|
270 |
+
name: 'etc',
|
271 |
+
type: 'directory',
|
272 |
+
children: [
|
273 |
+
{ name: 'passwd', type: 'file', size: '2KB' },
|
274 |
+
{ name: 'hosts', type: 'file', size: '1KB' },
|
275 |
+
{
|
276 |
+
name: 'network',
|
277 |
+
type: 'directory',
|
278 |
+
children: [
|
279 |
+
{ name: 'interfaces', type: 'file', size: '3KB' }
|
280 |
+
]
|
281 |
+
}
|
282 |
+
]
|
283 |
+
},
|
284 |
+
{
|
285 |
+
name: 'home',
|
286 |
+
type: 'directory',
|
287 |
+
children: [
|
288 |
+
{
|
289 |
+
name: 'user',
|
290 |
+
type: 'directory',
|
291 |
+
children: [
|
292 |
+
{
|
293 |
+
name: 'Documents',
|
294 |
+
type: 'directory',
|
295 |
+
children: [
|
296 |
+
{ name: 'notes.txt', type: 'file', size: '4KB', content: 'These are my personal notes.\n\nTodo:\n- Learn JavaScript\n- Build a Linux simulator\n- Have fun!' },
|
297 |
+
{ name: 'report.pdf', type: 'file', size: '2.4MB' }
|
298 |
+
]
|
299 |
+
},
|
300 |
+
{
|
301 |
+
name: 'Downloads',
|
302 |
+
type: 'directory',
|
303 |
+
children: [
|
304 |
+
{ name: 'linux_handbook.pdf', type: 'file', size: '5.2MB' }
|
305 |
+
]
|
306 |
+
},
|
307 |
+
{
|
308 |
+
name: 'Pictures',
|
309 |
+
type: 'directory',
|
310 |
+
children: [
|
311 |
+
{ name: 'vacation.jpg', type: 'file', size: '3.8MB' }
|
312 |
+
]
|
313 |
+
},
|
314 |
+
{ name: '.bashrc', type: 'file', size: '2KB', content: '# User specific aliases and functions\nalias ll=\'ls -la\'\nalias ..=\'cd ..\'' },
|
315 |
+
{ name: 'todo.txt', type: 'file', size: '1KB', content: '- Buy groceries\n- Call mom\n- Finish project' }
|
316 |
+
]
|
317 |
+
}
|
318 |
+
]
|
319 |
+
},
|
320 |
+
{
|
321 |
+
name: 'usr',
|
322 |
+
type: 'directory',
|
323 |
+
children: [
|
324 |
+
{
|
325 |
+
name: 'bin',
|
326 |
+
type: 'directory',
|
327 |
+
children: [
|
328 |
+
{ name: 'python', type: 'executable', size: '4.8MB' },
|
329 |
+
{ name: 'gcc', type: 'executable', size: '3.2MB' }
|
330 |
+
]
|
331 |
+
},
|
332 |
+
{
|
333 |
+
name: 'lib',
|
334 |
+
type: 'directory',
|
335 |
+
children: [
|
336 |
+
{ name: 'libc.so.6', type: 'library', size: '2.1MB' }
|
337 |
+
]
|
338 |
+
}
|
339 |
+
]
|
340 |
+
},
|
341 |
+
{
|
342 |
+
name: 'var',
|
343 |
+
type: 'directory',
|
344 |
+
children: [
|
345 |
+
{
|
346 |
+
name: 'log',
|
347 |
+
type: 'directory',
|
348 |
+
children: [
|
349 |
+
{ name: 'syslog', type: 'file', size: '12KB' }
|
350 |
+
]
|
351 |
+
}
|
352 |
+
]
|
353 |
+
},
|
354 |
+
{ name: 'README.md', type: 'file', size: '1KB', content: '# MiniLinux\n\nThis is a simulated Linux environment running in your browser.' }
|
355 |
+
]
|
356 |
+
};
|
357 |
+
|
358 |
+
// Current directory state
|
359 |
+
let currentDir = ['home', 'user'];
|
360 |
+
let dirHistory = [];
|
361 |
+
let dirHistoryIndex = -1;
|
362 |
+
|
363 |
+
// Update clock
|
364 |
+
function updateClock() {
|
365 |
+
const now = new Date();
|
366 |
+
const timeString = now.toLocaleTimeString();
|
367 |
+
document.getElementById('clock').textContent = timeString;
|
368 |
+
}
|
369 |
+
setInterval(updateClock, 1000);
|
370 |
+
updateClock();
|
371 |
+
|
372 |
+
// Terminal functionality
|
373 |
+
const terminalInput = document.getElementById('terminal-input');
|
374 |
+
const terminalHistory = document.getElementById('terminal-history');
|
375 |
+
const terminalPrompt = document.getElementById('terminal-prompt');
|
376 |
+
|
377 |
+
// Update terminal prompt based on current directory
|
378 |
+
function updateTerminalPrompt() {
|
379 |
+
const path = currentDir.length > 0 ? currentDir.join('/') : '~';
|
380 |
+
terminalPrompt.textContent = `user@minilinux:${path}$`;
|
381 |
+
}
|
382 |
+
|
383 |
+
// Get current directory from file system
|
384 |
+
function getCurrentDirectory() {
|
385 |
+
let dir = fileSystem;
|
386 |
+
for (const part of currentDir) {
|
387 |
+
const found = dir.children.find(child => child.name === part && child.type === 'directory');
|
388 |
+
if (!found) return null;
|
389 |
+
dir = found;
|
390 |
+
}
|
391 |
+
return dir;
|
392 |
+
}
|
393 |
+
|
394 |
+
// Available commands
|
395 |
+
const commands = {
|
396 |
+
help: () => {
|
397 |
+
return `Available commands:<br>
|
398 |
+
- help: Show this help message<br>
|
399 |
+
- ls: List directory contents<br>
|
400 |
+
- clear: Clear the terminal<br>
|
401 |
+
- date: Show current date and time<br>
|
402 |
+
- echo [text]: Print text to terminal<br>
|
403 |
+
- neofetch: Show system information<br>
|
404 |
+
- cpu: Show CPU usage<br>
|
405 |
+
- mem: Show memory usage<br>
|
406 |
+
- pwd: Print working directory<br>
|
407 |
+
- cd [dir]: Change directory<br>
|
408 |
+
- cat [file]: Display file contents<br>
|
409 |
+
- mkdir [dir]: Create new directory<br>
|
410 |
+
- touch [file]: Create new file<br>
|
411 |
+
- rm [file]: Remove file<br>
|
412 |
+
- rmdir [dir]: Remove directory<br>
|
413 |
+
- shutdown: Power off the system`;
|
414 |
+
},
|
415 |
+
ls: (args) => {
|
416 |
+
const dir = getCurrentDirectory();
|
417 |
+
if (!dir) return `ls: cannot access '${currentDir.join('/')}': No such file or directory`;
|
418 |
+
|
419 |
+
let output = '';
|
420 |
+
const showHidden = args.includes('-a');
|
421 |
+
const longFormat = args.includes('-l');
|
422 |
+
|
423 |
+
dir.children.forEach(child => {
|
424 |
+
if (!showHidden && child.name.startsWith('.')) return;
|
425 |
+
|
426 |
+
if (longFormat) {
|
427 |
+
const typeChar = child.type === 'directory' ? 'd' : '-';
|
428 |
+
const size = child.size || '0';
|
429 |
+
output += `${typeChar}rw-r--r-- 1 user user ${size.padEnd(8)} ${child.name}<br>`;
|
430 |
+
} else {
|
431 |
+
output += child.name + ' ';
|
432 |
+
}
|
433 |
+
});
|
434 |
+
|
435 |
+
return output || (longFormat ? '' : '(empty directory)');
|
436 |
+
},
|
437 |
+
clear: () => {
|
438 |
+
terminalHistory.innerHTML = '';
|
439 |
+
return '';
|
440 |
+
},
|
441 |
+
date: () => {
|
442 |
+
return new Date().toString();
|
443 |
+
},
|
444 |
+
echo: (args) => {
|
445 |
+
return args.join(' ');
|
446 |
+
},
|
447 |
+
neofetch: () => {
|
448 |
+
return `user@minilinux<br>
|
449 |
+
-----------------<br>
|
450 |
+
OS: MiniLinux 1.0<br>
|
451 |
+
Host: Web Browser<br>
|
452 |
+
Kernel: 5.15.0-76-generic<br>
|
453 |
+
Uptime: 2 hours, 15 minutes<br>
|
454 |
+
Shell: bash 5.1.16<br>
|
455 |
+
CPU: Virtual CPU @ 2.5GHz<br>
|
456 |
+
Memory: 1024MB / 2048MB (50%)<br>
|
457 |
+
Disk: 15GB / 50GB (30%)`;
|
458 |
+
},
|
459 |
+
cpu: () => {
|
460 |
+
const usage = Math.floor(Math.random() * 100);
|
461 |
+
return `CPU usage: ${usage}%`;
|
462 |
+
},
|
463 |
+
mem: () => {
|
464 |
+
const usage = Math.floor(Math.random() * 100);
|
465 |
+
const total = 2048;
|
466 |
+
const used = Math.floor(total * usage / 100);
|
467 |
+
return `Memory: ${used}MB / ${total}MB (${usage}%)`;
|
468 |
+
},
|
469 |
+
pwd: () => {
|
470 |
+
return currentDir.length > 0 ? '/' + currentDir.join('/') : '/';
|
471 |
+
},
|
472 |
+
cd: (args) => {
|
473 |
+
if (args.length === 0) {
|
474 |
+
// Go to home directory
|
475 |
+
currentDir = ['home', 'user'];
|
476 |
+
updateTerminalPrompt();
|
477 |
+
updateFilesWindow();
|
478 |
+
return '';
|
479 |
+
}
|
480 |
+
|
481 |
+
const target = args[0];
|
482 |
+
let newDir;
|
483 |
+
|
484 |
+
if (target === '..') {
|
485 |
+
// Go up one directory
|
486 |
+
if (currentDir.length > 0) {
|
487 |
+
currentDir.pop();
|
488 |
+
}
|
489 |
+
} else if (target === '/') {
|
490 |
+
// Go to root
|
491 |
+
currentDir = [];
|
492 |
+
} else if (target.startsWith('/')) {
|
493 |
+
// Absolute path
|
494 |
+
const parts = target.split('/').filter(p => p);
|
495 |
+
currentDir = parts;
|
496 |
+
} else {
|
497 |
+
// Relative path
|
498 |
+
newDir = [...currentDir, ...target.split('/')];
|
499 |
+
}
|
500 |
+
|
501 |
+
// Validate the new directory exists
|
502 |
+
if (newDir) {
|
503 |
+
let dir = fileSystem;
|
504 |
+
for (const part of newDir) {
|
505 |
+
const found = dir.children.find(child => child.name === part && child.type === 'directory');
|
506 |
+
if (!found) {
|
507 |
+
return `cd: no such file or directory: ${target}`;
|
508 |
+
}
|
509 |
+
dir = found;
|
510 |
+
}
|
511 |
+
currentDir = newDir;
|
512 |
+
}
|
513 |
+
|
514 |
+
updateTerminalPrompt();
|
515 |
+
updateFilesWindow();
|
516 |
+
return '';
|
517 |
+
},
|
518 |
+
cat: (args) => {
|
519 |
+
if (args.length === 0) {
|
520 |
+
return 'cat: missing file operand';
|
521 |
+
}
|
522 |
+
|
523 |
+
const filename = args[0];
|
524 |
+
const dir = getCurrentDirectory();
|
525 |
+
if (!dir) return `cat: ${currentDir.join('/')}: No such file or directory`;
|
526 |
+
|
527 |
+
const file = dir.children.find(child => child.name === filename && child.type === 'file');
|
528 |
+
if (!file) {
|
529 |
+
return `cat: ${filename}: No such file or directory`;
|
530 |
+
}
|
531 |
+
|
532 |
+
return file.content || '(empty file)';
|
533 |
+
},
|
534 |
+
mkdir: (args) => {
|
535 |
+
if (args.length === 0) {
|
536 |
+
return 'mkdir: missing operand';
|
537 |
+
}
|
538 |
+
|
539 |
+
const dirname = args[0];
|
540 |
+
const dir = getCurrentDirectory();
|
541 |
+
if (!dir) return `mkdir: cannot create directory '${dirname}': No such file or directory`;
|
542 |
+
|
543 |
+
if (dir.children.some(child => child.name === dirname)) {
|
544 |
+
return `mkdir: cannot create directory '${dirname}': File exists`;
|
545 |
+
}
|
546 |
+
|
547 |
+
dir.children.push({
|
548 |
+
name: dirname,
|
549 |
+
type: 'directory',
|
550 |
+
children: []
|
551 |
+
});
|
552 |
+
|
553 |
+
updateFilesWindow();
|
554 |
+
return '';
|
555 |
+
},
|
556 |
+
touch: (args) => {
|
557 |
+
if (args.length === 0) {
|
558 |
+
return 'touch: missing file operand';
|
559 |
+
}
|
560 |
+
|
561 |
+
const filename = args[0];
|
562 |
+
const dir = getCurrentDirectory();
|
563 |
+
if (!dir) return `touch: cannot touch '${filename}': No such file or directory`;
|
564 |
+
|
565 |
+
if (dir.children.some(child => child.name === filename)) {
|
566 |
+
return '';
|
567 |
+
}
|
568 |
+
|
569 |
+
dir.children.push({
|
570 |
+
name: filename,
|
571 |
+
type: 'file',
|
572 |
+
size: '0KB'
|
573 |
+
});
|
574 |
+
|
575 |
+
updateFilesWindow();
|
576 |
+
return '';
|
577 |
+
},
|
578 |
+
rm: (args) => {
|
579 |
+
if (args.length === 0) {
|
580 |
+
return 'rm: missing operand';
|
581 |
+
}
|
582 |
+
|
583 |
+
const filename = args[0];
|
584 |
+
const dir = getCurrentDirectory();
|
585 |
+
if (!dir) return `rm: cannot remove '${filename}': No such file or directory`;
|
586 |
+
|
587 |
+
const index = dir.children.findIndex(child => child.name === filename && child.type === 'file');
|
588 |
+
if (index === -1) {
|
589 |
+
return `rm: cannot remove '${filename}': No such file or directory`;
|
590 |
+
}
|
591 |
+
|
592 |
+
dir.children.splice(index, 1);
|
593 |
+
updateFilesWindow();
|
594 |
+
return '';
|
595 |
+
},
|
596 |
+
rmdir: (args) => {
|
597 |
+
if (args.length === 0) {
|
598 |
+
return 'rmdir: missing operand';
|
599 |
+
}
|
600 |
+
|
601 |
+
const dirname = args[0];
|
602 |
+
const dir = getCurrentDirectory();
|
603 |
+
if (!dir) return `rmdir: failed to remove '${dirname}': No such file or directory`;
|
604 |
+
|
605 |
+
const target = dir.children.find(child => child.name === dirname && child.type === 'directory');
|
606 |
+
if (!target) {
|
607 |
+
return `rmdir: failed to remove '${dirname}': No such file or directory`;
|
608 |
+
}
|
609 |
+
|
610 |
+
if (target.children.length > 0) {
|
611 |
+
return `rmdir: failed to remove '${dirname}': Directory not empty`;
|
612 |
+
}
|
613 |
+
|
614 |
+
dir.children = dir.children.filter(child => child !== target);
|
615 |
+
updateFilesWindow();
|
616 |
+
return '';
|
617 |
+
},
|
618 |
+
shutdown: () => {
|
619 |
+
setTimeout(() => {
|
620 |
+
alert('System is shutting down...');
|
621 |
+
document.body.innerHTML = '<div class="h-screen w-screen bg-black flex items-center justify-center"><div class="text-white text-2xl">System halted. It\'s now safe to close this window.</div></div>';
|
622 |
+
}, 1000);
|
623 |
+
return 'Shutting down system...';
|
624 |
+
}
|
625 |
+
};
|
626 |
+
|
627 |
+
terminalInput.addEventListener('keydown', (e) => {
|
628 |
+
if (e.key === 'Enter') {
|
629 |
+
const input = terminalInput.value.trim();
|
630 |
+
terminalInput.value = '';
|
631 |
+
|
632 |
+
// Add the command to history
|
633 |
+
const commandLine = document.createElement('div');
|
634 |
+
commandLine.className = 'mb-2';
|
635 |
+
commandLine.innerHTML = `<span class="text-green-400">${terminalPrompt.textContent}</span> ${input}`;
|
636 |
+
terminalHistory.appendChild(commandLine);
|
637 |
+
|
638 |
+
// Process command
|
639 |
+
const parts = input.split(' ');
|
640 |
+
const cmd = parts[0].toLowerCase();
|
641 |
+
const args = parts.slice(1);
|
642 |
+
|
643 |
+
let output = '';
|
644 |
+
if (commands[cmd]) {
|
645 |
+
output = commands[cmd](args);
|
646 |
+
} else if (cmd) {
|
647 |
+
output = `Command not found: ${cmd}. Type 'help' for available commands.`;
|
648 |
+
}
|
649 |
+
|
650 |
+
if (output) {
|
651 |
+
const outputElement = document.createElement('div');
|
652 |
+
outputElement.className = 'mb-2 terminal-line';
|
653 |
+
outputElement.innerHTML = output;
|
654 |
+
terminalHistory.appendChild(outputElement);
|
655 |
+
}
|
656 |
+
|
657 |
+
// Scroll to bottom
|
658 |
+
terminalHistory.scrollTop = terminalHistory.scrollHeight;
|
659 |
+
}
|
660 |
+
});
|
661 |
+
|
662 |
+
// File explorer functionality
|
663 |
+
function updateFilesWindow() {
|
664 |
+
const dir = getCurrentDirectory();
|
665 |
+
const filesContent = document.getElementById('files-content');
|
666 |
+
const filesPath = document.getElementById('files-path');
|
667 |
+
const filesWindowTitle = document.getElementById('files-window-title');
|
668 |
+
|
669 |
+
// Update path display
|
670 |
+
const path = currentDir.length > 0 ? '/' + currentDir.join('/') : '/';
|
671 |
+
filesPath.textContent = path;
|
672 |
+
filesWindowTitle.textContent = `File Explorer - ${path}`;
|
673 |
+
|
674 |
+
// Update back/forward buttons
|
675 |
+
document.getElementById('files-back').disabled = dirHistoryIndex <= 0;
|
676 |
+
document.getElementById('files-forward').disabled = dirHistoryIndex >= dirHistory.length - 1;
|
677 |
+
|
678 |
+
// Clear current content
|
679 |
+
filesContent.innerHTML = '';
|
680 |
+
|
681 |
+
if (!dir) {
|
682 |
+
filesContent.innerHTML = '<div class="text-red-400">Error: Directory not found</div>';
|
683 |
+
return;
|
684 |
+
}
|
685 |
+
|
686 |
+
// Add parent directory link (except for root)
|
687 |
+
if (currentDir.length > 0) {
|
688 |
+
const parentItem = document.createElement('div');
|
689 |
+
parentItem.className = 'file-icon flex flex-col items-center p-2 hover:bg-gray-700 rounded cursor-pointer';
|
690 |
+
parentItem.innerHTML = `
|
691 |
+
<i class="fas fa-level-up-alt text-gray-400 text-3xl mb-1"></i>
|
692 |
+
<span class="text-xs text-center">..</span>
|
693 |
+
`;
|
694 |
+
parentItem.addEventListener('dblclick', () => {
|
695 |
+
navigateToParentDirectory();
|
696 |
+
});
|
697 |
+
filesContent.appendChild(parentItem);
|
698 |
+
}
|
699 |
+
|
700 |
+
// Add directory contents
|
701 |
+
dir.children.forEach(child => {
|
702 |
+
const item = document.createElement('div');
|
703 |
+
item.className = 'file-icon flex flex-col items-center p-2 hover:bg-gray-700 rounded cursor-pointer';
|
704 |
+
|
705 |
+
let icon, color;
|
706 |
+
if (child.type === 'directory') {
|
707 |
+
icon = 'fa-folder';
|
708 |
+
color = 'text-blue-400';
|
709 |
+
} else if (child.type === 'executable') {
|
710 |
+
icon = 'fa-file-code';
|
711 |
+
color = 'text-green-400';
|
712 |
+
} else {
|
713 |
+
icon = 'fa-file';
|
714 |
+
color = 'text-gray-300';
|
715 |
+
}
|
716 |
+
|
717 |
+
item.innerHTML = `
|
718 |
+
<i class="fas ${icon} ${color} text-3xl mb-1"></i>
|
719 |
+
<span class="text-xs text-center">${child.name}</span>
|
720 |
+
`;
|
721 |
+
|
722 |
+
if (child.type === 'directory') {
|
723 |
+
item.addEventListener('dblclick', () => {
|
724 |
+
navigateToDirectory(child.name);
|
725 |
+
});
|
726 |
+
} else {
|
727 |
+
item.addEventListener('dblclick', () => {
|
728 |
+
// For files, we could open them in a text editor or show content
|
729 |
+
const content = child.content || `This is a ${child.type} file named ${child.name}`;
|
730 |
+
alert(`File: ${child.name}\n\n${content}`);
|
731 |
+
});
|
732 |
+
}
|
733 |
+
|
734 |
+
filesContent.appendChild(item);
|
735 |
+
});
|
736 |
+
}
|
737 |
+
|
738 |
+
function navigateToDirectory(dirName) {
|
739 |
+
dirHistory = dirHistory.slice(0, dirHistoryIndex + 1);
|
740 |
+
dirHistory.push([...currentDir]);
|
741 |
+
dirHistoryIndex++;
|
742 |
+
|
743 |
+
currentDir.push(dirName);
|
744 |
+
updateTerminalPrompt();
|
745 |
+
updateFilesWindow();
|
746 |
+
}
|
747 |
+
|
748 |
+
function navigateToParentDirectory() {
|
749 |
+
dirHistory = dirHistory.slice(0, dirHistoryIndex + 1);
|
750 |
+
dirHistory.push([...currentDir]);
|
751 |
+
dirHistoryIndex++;
|
752 |
+
|
753 |
+
if (currentDir.length > 0) {
|
754 |
+
currentDir.pop();
|
755 |
+
}
|
756 |
+
updateTerminalPrompt();
|
757 |
+
updateFilesWindow();
|
758 |
+
}
|
759 |
+
|
760 |
+
// Initialize file explorer
|
761 |
+
document.getElementById('files-back').addEventListener('click', () => {
|
762 |
+
if (dirHistoryIndex > 0) {
|
763 |
+
dirHistoryIndex--;
|
764 |
+
currentDir = [...dirHistory[dirHistoryIndex]];
|
765 |
+
updateTerminalPrompt();
|
766 |
+
updateFilesWindow();
|
767 |
+
}
|
768 |
+
});
|
769 |
+
|
770 |
+
document.getElementById('files-forward').addEventListener('click', () => {
|
771 |
+
if (dirHistoryIndex < dirHistory.length - 1) {
|
772 |
+
dirHistoryIndex++;
|
773 |
+
currentDir = [...dirHistory[dirHistoryIndex]];
|
774 |
+
updateTerminalPrompt();
|
775 |
+
updateFilesWindow();
|
776 |
+
}
|
777 |
+
});
|
778 |
+
|
779 |
+
document.getElementById('files-home').addEventListener('click', () => {
|
780 |
+
dirHistory = dirHistory.slice(0, dirHistoryIndex + 1);
|
781 |
+
dirHistory.push([...currentDir]);
|
782 |
+
dirHistoryIndex++;
|
783 |
+
|
784 |
+
currentDir = ['home', 'user'];
|
785 |
+
updateTerminalPrompt();
|
786 |
+
updateFilesWindow();
|
787 |
+
});
|
788 |
+
|
789 |
+
// Window management
|
790 |
+
function toggleWindow(windowId) {
|
791 |
+
const window = document.getElementById(windowId);
|
792 |
+
window.classList.toggle('hidden');
|
793 |
+
if (!window.classList.contains('hidden')) {
|
794 |
+
// Bring to front
|
795 |
+
document.querySelectorAll('.window').forEach(w => {
|
796 |
+
w.style.zIndex = '10';
|
797 |
+
});
|
798 |
+
window.style.zIndex = '20';
|
799 |
+
|
800 |
+
// Update content if needed
|
801 |
+
if (windowId === 'files-window') {
|
802 |
+
updateFilesWindow();
|
803 |
+
} else if (windowId === 'system-window') {
|
804 |
+
updateSystemStats();
|
805 |
+
}
|
806 |
+
}
|
807 |
+
}
|
808 |
+
|
809 |
+
document.getElementById('terminal-launcher').addEventListener('click', () => {
|
810 |
+
toggleWindow('terminal-window');
|
811 |
+
document.getElementById('terminal-input').focus();
|
812 |
+
});
|
813 |
+
|
814 |
+
document.getElementById('files-launcher').addEventListener('click', () => {
|
815 |
+
toggleWindow('files-window');
|
816 |
+
});
|
817 |
+
|
818 |
+
document.getElementById('system-launcher').addEventListener('click', () => {
|
819 |
+
toggleWindow('system-window');
|
820 |
+
updateSystemStats();
|
821 |
+
});
|
822 |
+
|
823 |
+
// Desktop icon double click handlers
|
824 |
+
document.querySelectorAll('.file-icon').forEach((icon, index) => {
|
825 |
+
icon.addEventListener('dblclick', () => {
|
826 |
+
if (index === 0) {
|
827 |
+
// Home directory
|
828 |
+
dirHistory = dirHistory.slice(0, dirHistoryIndex + 1);
|
829 |
+
dirHistory.push([...currentDir]);
|
830 |
+
dirHistoryIndex++;
|
831 |
+
|
832 |
+
currentDir = ['home', 'user'];
|
833 |
+
updateTerminalPrompt();
|
834 |
+
toggleWindow('files-window');
|
835 |
+
}
|
836 |
+
if (index === 1) {
|
837 |
+
toggleWindow('terminal-window');
|
838 |
+
document.getElementById('terminal-input').focus();
|
839 |
+
}
|
840 |
+
if (index === 3) toggleWindow('system-window');
|
841 |
+
});
|
842 |
+
});
|
843 |
+
|
844 |
+
// System monitor updates
|
845 |
+
function updateSystemStats() {
|
846 |
+
// CPU
|
847 |
+
const cpuUsage = Math.floor(Math.random() * 100);
|
848 |
+
document.getElementById('cpu-usage').textContent = `${cpuUsage}%`;
|
849 |
+
document.getElementById('cpu-bar').style.width = `${cpuUsage}%`;
|
850 |
+
|
851 |
+
// Memory
|
852 |
+
const memUsage = 30 + Math.floor(Math.random() * 50);
|
853 |
+
document.getElementById('mem-usage').textContent = `${memUsage}%`;
|
854 |
+
document.getElementById('mem-bar').style.width = `${memUsage}%`;
|
855 |
+
|
856 |
+
// Disk
|
857 |
+
const diskUsage = 10 + Math.floor(Math.random() * 40);
|
858 |
+
document.getElementById('disk-usage').textContent = `${diskUsage}%`;
|
859 |
+
document.getElementById('disk-bar').style.width = `${diskUsage}%`;
|
860 |
+
|
861 |
+
// Processes
|
862 |
+
const processes = [
|
863 |
+
{ pid: 1234, name: 'bash', cpu: Math.floor(Math.random() * 5), mem: Math.floor(Math.random() * 3) },
|
864 |
+
{ pid: 2345, name: 'systemd', cpu: Math.floor(Math.random() * 3), mem: 5 + Math.floor(Math.random() * 5) },
|
865 |
+
{ pid: 3456, name: 'Xorg', cpu: 10 + Math.floor(Math.random() * 15), mem: 50 + Math.floor(Math.random() * 30) },
|
866 |
+
{ pid: 4567, name: 'chrome', cpu: 20 + Math.floor(Math.random() * 30), mem: 100 + Math.floor(Math.random() * 150) },
|
867 |
+
{ pid: 5678, name: 'node', cpu: 5 + Math.floor(Math.random() * 10), mem: 30 + Math.floor(Math.random() * 20) }
|
868 |
+
];
|
869 |
+
|
870 |
+
const processList = document.getElementById('process-list');
|
871 |
+
processList.innerHTML = '';
|
872 |
+
|
873 |
+
processes.forEach(proc => {
|
874 |
+
const procElement = document.createElement('div');
|
875 |
+
procElement.className = 'grid grid-cols-4 gap-2 text-sm mb-1';
|
876 |
+
procElement.innerHTML = `
|
877 |
+
<span>${proc.pid}</span>
|
878 |
+
<span>${proc.name}</span>
|
879 |
+
<span>${proc.cpu}%</span>
|
880 |
+
<span>${proc.mem}MB</span>
|
881 |
+
`;
|
882 |
+
processList.appendChild(procElement);
|
883 |
+
});
|
884 |
+
}
|
885 |
+
|
886 |
+
// Update system stats periodically when system window is open
|
887 |
+
setInterval(() => {
|
888 |
+
if (!document.getElementById('system-window').classList.contains('hidden')) {
|
889 |
+
updateSystemStats();
|
890 |
+
}
|
891 |
+
}, 3000);
|
892 |
+
|
893 |
+
// Battery simulation
|
894 |
+
let batteryLevel = 100;
|
895 |
+
setInterval(() => {
|
896 |
+
batteryLevel = Math.max(0, batteryLevel - 0.1);
|
897 |
+
const batteryIcon = batteryLevel > 80 ? 'fa-battery-full' :
|
898 |
+
batteryLevel > 60 ? 'fa-battery-three-quarters' :
|
899 |
+
batteryLevel > 40 ? 'fa-battery-half' :
|
900 |
+
batteryLevel > 20 ? 'fa-battery-quarter' : 'fa-battery-empty';
|
901 |
+
|
902 |
+
document.getElementById('battery-status').innerHTML = `
|
903 |
+
<i class="fas ${batteryIcon} mr-1"></i>
|
904 |
+
<span>${Math.floor(batteryLevel)}%</span>
|
905 |
+
`;
|
906 |
+
}, 10000);
|
907 |
+
|
908 |
+
// Make windows draggable
|
909 |
+
document.querySelectorAll('.window').forEach(window => {
|
910 |
+
const header = window.querySelector('.bg-gray-700');
|
911 |
+
|
912 |
+
header.addEventListener('mousedown', (e) => {
|
913 |
+
if (e.target.tagName === 'BUTTON' || e.target.tagName === 'I') return;
|
914 |
+
|
915 |
+
const startX = e.clientX;
|
916 |
+
const startY = e.clientY;
|
917 |
+
const startLeft = parseInt(window.style.left || '0');
|
918 |
+
const startTop = parseInt(window.style.top || '0');
|
919 |
+
|
920 |
+
function moveWindow(e) {
|
921 |
+
const dx = e.clientX - startX;
|
922 |
+
const dy = e.clientY - startY;
|
923 |
+
window.style.left = (startLeft + dx) + 'px';
|
924 |
+
window.style.top = (startTop + dy) + 'px';
|
925 |
+
}
|
926 |
+
|
927 |
+
function stopMoving() {
|
928 |
+
document.removeEventListener('mousemove', moveWindow);
|
929 |
+
document.removeEventListener('mouseup', stopMoving);
|
930 |
+
}
|
931 |
+
|
932 |
+
document.addEventListener('mousemove', moveWindow);
|
933 |
+
document.addEventListener('mouseup', stopMoving);
|
934 |
+
});
|
935 |
+
});
|
936 |
+
|
937 |
+
// Window controls
|
938 |
+
document.querySelectorAll('.window').forEach(window => {
|
939 |
+
const closeBtn = window.querySelectorAll('button')[2];
|
940 |
+
const minimizeBtn = window.querySelectorAll('button')[0];
|
941 |
+
const maximizeBtn = window.querySelectorAll('button')[1];
|
942 |
+
|
943 |
+
closeBtn.addEventListener('click', () => {
|
944 |
+
window.classList.add('hidden');
|
945 |
+
});
|
946 |
+
|
947 |
+
minimizeBtn.addEventListener('click', () => {
|
948 |
+
const content = window.querySelector('.h-64');
|
949 |
+
if (content.style.display === 'none') {
|
950 |
+
content.style.display = '';
|
951 |
+
} else {
|
952 |
+
content.style.display = 'none';
|
953 |
+
}
|
954 |
+
});
|
955 |
+
|
956 |
+
maximizeBtn.addEventListener('click', () => {
|
957 |
+
if (window.style.width === '90%') {
|
958 |
+
window.style.width = '';
|
959 |
+
window.style.height = '';
|
960 |
+
window.style.left = '';
|
961 |
+
window.style.top = '';
|
962 |
+
} else {
|
963 |
+
window.style.width = '90%';
|
964 |
+
window.style.height = '80%';
|
965 |
+
window.style.left = '5%';
|
966 |
+
window.style.top = '10%';
|
967 |
+
}
|
968 |
+
});
|
969 |
+
});
|
970 |
+
|
971 |
+
// Resize handles
|
972 |
+
document.querySelectorAll('.resize-handle').forEach(handle => {
|
973 |
+
handle.addEventListener('mousedown', (e) => {
|
974 |
+
const window = handle.parentElement;
|
975 |
+
const startY = e.clientY;
|
976 |
+
const startHeight = parseInt(window.style.height || window.offsetHeight);
|
977 |
+
|
978 |
+
function resizeWindow(e) {
|
979 |
+
const dy = e.clientY - startY;
|
980 |
+
const newHeight = startHeight + dy;
|
981 |
+
window.style.height = Math.max(200, newHeight) + 'px';
|
982 |
+
}
|
983 |
+
|
984 |
+
function stopResizing() {
|
985 |
+
document.removeEventListener('mousemove', resizeWindow);
|
986 |
+
document.removeEventListener('mouseup', stopResizing);
|
987 |
+
}
|
988 |
+
|
989 |
+
document.addEventListener('mousemove', resizeWindow);
|
990 |
+
document.addEventListener('mouseup', stopResizing);
|
991 |
+
});
|
992 |
+
});
|
993 |
+
|
994 |
+
// Initialize terminal prompt
|
995 |
+
updateTerminalPrompt();
|
996 |
+
</script>
|
997 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=ayokings/myspace" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
998 |
+
</html>
|
prompts.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
Create a mini linux base OS that can perform some functions
|
2 |
+
add more functionalities to it, create base directories
|