File size: 13,606 Bytes
4a59d71
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Windows 3.1 Recreation</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <style>
        @font-face {
            font-family: 'MS Sans Serif';
            src: url('https://www.cufonfonts.com/download/font/ms-sans-serif-2');
        }
        
        body {
            font-family: 'MS Sans Serif', sans-serif;
            background-color: #008080;
            user-select: none;
            overflow: hidden;
        }
        
        .window {
            box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #dfdfdf, inset -2px -2px #808080, inset 2px 2px #ffffff;
        }
        
        .title-bar {
            background: linear-gradient(90deg, #000080, #1084d0);
            color: white;
        }
        
        .button {
            box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #dfdfdf, inset -2px -2px #808080, inset 2px 2px #ffffff;
        }
        
        .button:active {
            box-shadow: inset -1px -1px #ffffff, inset 1px 1px #0a0a0a, inset -2px -2px #dfdfdf, inset 2px 2px #808080;
        }
        
        .icon {
            text-shadow: 1px 1px 0px white;
        }
        
        .taskbar {
            box-shadow: inset -1px -1px #ffffff, inset 1px 1px #0a0a0a, inset -2px -2px #dfdfdf, inset 2px 2px #808080;
        }
        
        .start-button {
            box-shadow: inset -1px -1px #ffffff, inset 1px 1px #0a0a0a, inset -2px -2px #dfdfdf, inset 2px 2px #808080;
        }
        
        .start-button:active {
            box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #dfdfdf, inset -2px -2px #808080, inset 2px 2px #ffffff;
        }
        
        .menu {
            box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #dfdfdf, inset -2px -2px #808080, inset 2px 2px #ffffff;
        }
        
        .menu-item:hover {
            background-color: #000080;
            color: white;
        }
        
        .draggable {
            cursor: move;
        }
        
        .resizable {
            resize: both;
            overflow: hidden;
        }
    </style>
</head>
<body class="h-screen w-screen overflow-hidden">
    <!-- Desktop Icons -->
    <div class="absolute left-0 top-0 p-2 flex flex-col space-y-4">
        <div class="icon w-16 flex flex-col items-center text-center cursor-pointer" onclick="openProgram('my-computer')">
            <img src="https://win98icons.alexmeub.com/icons/png/computer_explorer-4.png" width="32" height="32">
            <span class="text-xs mt-1">My Computer</span>
        </div>
        <div class="icon w-16 flex flex-col items-center text-center cursor-pointer" onclick="openProgram('recycle-bin')">
            <img src="https://win98icons.alexmeub.com/icons/png/recycle_bin_empty-4.png" width="32" height="32">
            <span class="text-xs mt-1">Recycle Bin</span>
        </div>
        <div class="icon w-16 flex flex-col items-center text-center cursor-pointer" onclick="openProgram('notepad')">
            <img src="https://win98icons.alexmeub.com/icons/png/notepad-4.png" width="32" height="32">
            <span class="text-xs mt-1">Notepad</span>
        </div>
    </div>

    <!-- Windows -->
    <div id="my-computer-window" class="window absolute left-20 top-20 w-64 h-64 bg-gray-200 flex flex-col hidden">
        <div class="title-bar h-6 flex items-center justify-between px-1 draggable">
            <div class="flex items-center">
                <img src="https://win98icons.alexmeub.com/icons/png/computer_explorer-0.png" width="16" height="16" class="mr-1">
                <span class="text-sm">My Computer</span>
            </div>
            <div class="flex">
                <div class="button w-4 h-4 flex items-center justify-center mx-px">_</div>
                <div class="button w-4 h-4 flex items-center justify-center mx-px"></div>
                <div class="button w-4 h-4 flex items-center justify-center mx-px" onclick="closeWindow('my-computer')">×</div>
            </div>
        </div>
        <div class="flex-1 p-2 overflow-auto resizable">
            <div class="grid grid-cols-3 gap-4">
                <div class="icon w-16 flex flex-col items-center text-center cursor-pointer">
                    <img src="https://win98icons.alexmeub.com/icons/png/drive-4.png" width="32" height="32">
                    <span class="text-xs mt-1">Drive C:</span>
                </div>
                <div class="icon w-16 flex flex-col items-center text-center cursor-pointer">
                    <img src="https://win98icons.alexmeub.com/icons/png/drive-4.png" width="32" height="32">
                    <span class="text-xs mt-1">Drive A:</span>
                </div>
                <div class="icon w-16 flex flex-col items-center text-center cursor-pointer">
                    <img src="https://win98icons.alexmeub.com/icons/png/control_panel_users-4.png" width="32" height="32">
                    <span class="text-xs mt-1">Control Panel</span>
                </div>
            </div>
        </div>
        <div class="h-6 bg-gray-300 flex items-center px-2 text-xs">
            <span>2 object(s)</span>
        </div>
    </div>

    <div id="notepad-window" class="window absolute left-40 top-40 w-80 h-64 bg-white flex flex-col hidden">
        <div class="title-bar h-6 flex items-center justify-between px-1 draggable">
            <div class="flex items-center">
                <img src="https://win98icons.alexmeub.com/icons/png/notepad-0.png" width="16" height="16" class="mr-1">
                <span class="text-sm">Untitled - Notepad</span>
            </div>
            <div class="flex">
                <div class="button w-4 h-4 flex items-center justify-center mx-px">_</div>
                <div class="button w-4 h-4 flex items-center justify-center mx-px"></div>
                <div class="button w-4 h-4 flex items-center justify-center mx-px" onclick="closeWindow('notepad')">×</div>
            </div>
        </div>
        <div class="flex-1 p-1 overflow-auto resizable">
            <textarea class="w-full h-full p-1 font-mono text-sm resize-none" style="background-color: white;">Welcome to Windows 3.1!

This is a recreation of the classic operating system in your browser.

You can:
- Open programs from the desktop
- Use the Start menu
- Move windows around
- Resize windows
- Close windows

Have fun!</textarea>
        </div>
    </div>

    <!-- Taskbar -->
    <div class="taskbar absolute bottom-0 left-0 right-0 h-8 bg-gray-300 flex items-center px-1">
        <button id="start-button" class="start-button h-6 px-2 flex items-center" onclick="toggleStartMenu()">
            <img src="https://win98icons.alexmeub.com/icons/png/windows-0.png" width="16" height="16" class="mr-1">
            <span class="text-sm font-bold">Start</span>
        </button>
        <div id="start-menu" class="menu absolute bottom-8 left-0 w-48 bg-gray-300 hidden">
            <div class="menu-item p-1 flex items-center cursor-pointer">
                <img src="https://win98icons.alexmeub.com/icons/png/programs-0.png" width="16" height="16" class="mr-2">
                <span class="text-sm">Programs</span>
            </div>
            <div class="menu-item p-1 flex items-center cursor-pointer">
                <img src="https://win98icons.alexmeub.com/icons/png/documents-0.png" width="16" height="16" class="mr-2">
                <span class="text-sm">Documents</span>
            </div>
            <div class="menu-item p-1 flex items-center cursor-pointer">
                <img src="https://win98icons.alexmeub.com/icons/png/settings-0.png" width="16" height="16" class="mr-2">
                <span class="text-sm">Settings</span>
            </div>
            <div class="menu-item p-1 flex items-center cursor-pointer">
                <img src="https://win98icons.alexmeub.com/icons/png/find-0.png" width="16" height="16" class="mr-2">
                <span class="text-sm">Find</span>
            </div>
            <div class="menu-item p-1 flex items-center cursor-pointer">
                <img src="https://win98icons.alexmeub.com/icons/png/help_book-0.png" width="16" height="16" class="mr-2">
                <span class="text-sm">Help</span>
            </div>
            <div class="menu-item p-1 flex items-center cursor-pointer">
                <img src="https://win98icons.alexmeub.com/icons/png/run-0.png" width="16" height="16" class="mr-2">
                <span class="text-sm">Run...</span>
            </div>
            <div class="menu-item p-1 flex items-center cursor-pointer" onclick="shutdown()">
                <img src="https://win98icons.alexmeub.com/icons/png/shut_down_normal-0.png" width="16" height="16" class="mr-2">
                <span class="text-sm">Shut Down...</span>
            </div>
        </div>
        <div class="flex-1"></div>
        <div class="h-6 px-2 flex items-center text-xs">
            <span>4:20 PM</span>
        </div>
    </div>

    <!-- Shutdown Dialog -->
    <div id="shutdown-dialog" class="window absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-64 bg-gray-200 flex flex-col hidden">
        <div class="title-bar h-6 flex items-center justify-between px-1">
            <div class="flex items-center">
                <img src="https://win98icons.alexmeub.com/icons/png/shut_down_normal-0.png" width="16" height="16" class="mr-1">
                <span class="text-sm">Shut Down Windows</span>
            </div>
            <div class="flex">
                <div class="button w-4 h-4 flex items-center justify-center mx-px" onclick="closeWindow('shutdown')">×</div>
            </div>
        </div>
        <div class="p-4">
            <p class="text-sm mb-4">Are you sure you want to shut down your computer?</p>
            <div class="flex justify-end space-x-2">
                <button class="button px-4 py-1 text-sm" onclick="closeWindow('shutdown')">Cancel</button>
                <button class="button px-4 py-1 text-sm bg-gray-300" onclick="alert('Goodbye! This is just a simulation.'); closeWindow('shutdown')">OK</button>
            </div>
        </div>
    </div>

    <script>
        // Make windows draggable
        document.querySelectorAll('.draggable').forEach(draggable => {
            draggable.addEventListener('mousedown', function(e) {
                const window = this.closest('.window');
                let pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;
                
                e = e || window.event;
                e.preventDefault();
                // get the mouse cursor position at startup:
                pos3 = e.clientX;
                pos4 = e.clientY;
                
                document.onmouseup = closeDragElement;
                document.onmousemove = elementDrag;

                function elementDrag(e) {
                    e = e || window.event;
                    e.preventDefault();
                    // calculate the new cursor position:
                    pos1 = pos3 - e.clientX;
                    pos2 = pos4 - e.clientY;
                    pos3 = e.clientX;
                    pos4 = e.clientY;
                    // set the element's new position:
                    window.style.top = (window.offsetTop - pos2) + "px";
                    window.style.left = (window.offsetLeft - pos1) + "px";
                }

                function closeDragElement() {
                    // stop moving when mouse button is released:
                    document.onmouseup = null;
                    document.onmousemove = null;
                }
            });
        });

        // Window management
        function openProgram(program) {
            document.getElementById(`${program}-window`).classList.remove('hidden');
        }

        function closeWindow(program) {
            document.getElementById(`${program}-window`).classList.add('hidden');
        }

        function toggleStartMenu() {
            const menu = document.getElementById('start-menu');
            menu.classList.toggle('hidden');
        }

        function shutdown() {
            document.getElementById('start-menu').classList.add('hidden');
            document.getElementById('shutdown-dialog').classList.remove('hidden');
        }

        // Close start menu when clicking elsewhere
        document.addEventListener('click', function(e) {
            if (!e.target.closest('#start-button') && !e.target.closest('#start-menu')) {
                document.getElementById('start-menu').classList.add('hidden');
            }
        });

        // Simulate loading
        setTimeout(() => {
            document.getElementById('my-computer-window').classList.remove('hidden');
        }, 1000);
    </script>
<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=junho85/junho85" style="color: #fff;text-decoration: underline;" target="_blank" >🧬 Remix</a></p></body>
</html>