igorvkarpov commited on
Commit
cdf0905
·
verified ·
1 Parent(s): 7bf94f0

Upload 24 files

Browse files
.gitattributes CHANGED
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ src/images/windows-icon.png filter=lfs diff=lfs merge=lfs -text
37
+ src/images/windows10-bg.jpg filter=lfs diff=lfs merge=lfs -text
index.html CHANGED
@@ -1,19 +1,70 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  </html>
 
1
+ <!DOCTYPE html>
2
+ <html lang="ru">
3
+
4
+ <head>
5
+ <meta charset="UTF-8" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Windows 10 Simulator</title>
8
+ <link rel="stylesheet" href="/styles/main.css">
9
+ </head>
10
+
11
+ <body>
12
+ <div id="windows-container"></div>
13
+
14
+ <!-- Меню "Пуск" -->
15
+ <div id="start-menu">
16
+ <div id="start-menu-header">
17
+ <img src="src/images/user-icon.png" alt="Пользователь">
18
+ <span>Пользователь</span>
19
+ </div>
20
+ <div id="start-menu-apps">
21
+
22
+
23
+
24
+ <!--div class="start-menu-app" data-app-id="explorer">
25
+ <img src="src/images/explorer-icon.png" alt="Проводник">
26
+ <span>Проводник</span>
27
+ </div>
28
+ <div class="start-menu-app" data-app-id="browser">
29
+ <img src="src/images/browser-icon.png" alt="Браузер">
30
+ <span>Браузер</span>
31
+ </div>
32
+ <div class="start-menu-app" data-app-id="calculator">
33
+ <img src="src/images/calculator-icon.png" alt="Калькулятор">
34
+ <span>Калькулятор</span>
35
+ </div>
36
+ <div class="start-menu-app" data-app-id="notepad">
37
+ <img src="src/images/notepad-icon.png" alt="Заметки">
38
+ <span>Заметки</span>
39
+ </div>
40
+ <div class="start-menu-app" data-app-id="photos">
41
+ <img src="src/images/photos-icon.png" alt="Фотографии">
42
+ <span>Фотографии</span>
43
+ </div>
44
+ <div class="start-menu-app" data-app-id="settings">
45
+ <img src="src/images/settings-icon.png" alt="Настройки">
46
+ <span>Настройки</span>
47
+ </div-->
48
+
49
+
50
+ </div>
51
+ </div>
52
+
53
+ <!-- Панель задач -->
54
+ <div id="taskbar">
55
+ <div id="start-button">
56
+ <img src="src/images/windows-icon.png" alt="Пуск">
57
+ </div>
58
+ <div id="taskbar-programs"></div>
59
+ </div>
60
+
61
+ <script src="/js/appManager.js"></script>
62
+ <script src="/js/windows.js"></script>
63
+ <script src="/js/taskbar.js"></script>
64
+ <script src="/js/desktop.js"></script>
65
+ <script src="/js/startMenu.js"></script>
66
+ <script src="/js/main.js"></script>
67
+
68
+ </body>
69
+
70
  </html>
js/appManager.js ADDED
@@ -0,0 +1,226 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Определения приложений с их содержимым
2
+ const appDefinitions = {
3
+ 'explorer': {
4
+ name: 'Проводник',
5
+ icon: 'explorer-icon.png',
6
+ width: 800,
7
+ height: 500,
8
+ getContent: () => `
9
+ <div style="padding: 10px;">
10
+ <h3>Проводник</h3>
11
+ <div style="display: flex; margin-top: 10px;">
12
+ <div style="width: 200px; border-right: 1px solid #ddd; padding-right: 10px;">
13
+ <div style="margin-bottom: 5px;">Desktop</div>
14
+ <div style="margin-bottom: 5px;">Documents</div>
15
+ <div style="margin-bottom: 5px;">Downloads</div>
16
+ <div style="margin-bottom: 5px;">Music</div>
17
+ <div style="margin-bottom: 5px;">Pictures</div>
18
+ <div style="margin-bottom: 5px;">Videos</div>
19
+ </div>
20
+ <div style="flex: 1; padding-left: 10px;">
21
+ <div style="display: flex; flex-wrap: wrap;">
22
+ <div style="text-align: center; margin: 10px; width: 80px;">
23
+ <img src="src/images/folder-icon.png" style="width: 40px; height: 40px;">
24
+ <div>Folder 1</div>
25
+ </div>
26
+ <div style="text-align: center; margin: 10px; width: 80px;">
27
+ <img src="src/images/folder-icon.png" style="width: 40px; height: 40px;">
28
+ <div>Folder 2</div>
29
+ </div>
30
+ <div style="text-align: center; margin: 10px; width: 80px;">
31
+ <img src="src/images/text-file-icon.png" style="width: 40px; height: 40px;">
32
+ <div>Document.txt</div>
33
+ </div>
34
+ </div>
35
+ </div>
36
+ </div>
37
+ </div>
38
+ `
39
+ },
40
+ 'browser': {
41
+ name: 'Браузер',
42
+ icon: 'browser-icon.png',
43
+ width: 900,
44
+ height: 600,
45
+ getContent: () => `
46
+ <iframe
47
+ src="https://www.saucedemo.com/"
48
+ referrerpolicy="no-referrer"
49
+ sandbox="allow-scripts allow-same-origin"
50
+ style="width: 100%; height: 100%; border: none;"></iframe>
51
+ `
52
+ },
53
+ 'calculator': {
54
+ name: 'Калькулятор',
55
+ icon: 'calculator-icon.png',
56
+ width: 300,
57
+ height: 400,
58
+ getContent: () => `
59
+ <div style="display: flex; flex-direction: column; padding: 10px;">
60
+ <input type="text" value="0" style="text-align: right; padding: 10px; margin-bottom: 10px; font-size: 20px;">
61
+ <div style="display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px;">
62
+ <button style="padding: 10px;">7</button>
63
+ <button style="padding: 10px;">8</button>
64
+ <button style="padding: 10px;">9</button>
65
+ <button style="padding: 10px;">/</button>
66
+ <button style="padding: 10px;">4</button>
67
+ <button style="padding: 10px;">5</button>
68
+ <button style="padding: 10px;">6</button>
69
+ <button style="padding: 10px;">*</button>
70
+ <button style="padding: 10px;">1</button>
71
+ <button style="padding: 10px;">2</button>
72
+ <button style="padding: 10px;">3</button>
73
+ <button style="padding: 10px;">-</button>
74
+ <button style="padding: 10px;">0</button>
75
+ <button style="padding: 10px;">.</button>
76
+ <button style="padding: 10px;">=</button>
77
+ <button style="padding: 10px;">+</button>
78
+ </div>
79
+ </div>
80
+ `
81
+ },
82
+ 'notepad': {
83
+ name: 'Заметки',
84
+ icon: 'notepad-icon.png',
85
+ width: 500,
86
+ height: 400,
87
+ getContent: () => `
88
+ <div style="display: flex; flex-direction: column; height: 100%;">
89
+ <div style="padding: 5px; border-bottom: 1px solid #ddd;">
90
+ <span style="margin-right: 10px;">File</span>
91
+ <span style="margin-right: 10px;">Edit</span>
92
+ <span style="margin-right: 10px;">Format</span>
93
+ <span style="margin-right: 10px;">View</span>
94
+ <span style="margin-right: 10px;">Help</span>
95
+ </div>
96
+ <textarea style="flex: 1; padding: 10px; border: none; resize: none; font-family: 'Consolas', monospace;">Это текстовый редактор Windows...</textarea>
97
+ </div>
98
+ `
99
+ },
100
+ 'photos': {
101
+ name: 'Фотографии',
102
+ icon: 'photos-icon.png',
103
+ width: 700,
104
+ height: 500,
105
+ getContent: () => `
106
+ <div style="display: flex; flex-direction: column; height: 100%;">
107
+ <div style="padding: 5px; border-bottom: 1px solid #ddd;">
108
+ <span style="margin-right: 10px;">File</span>
109
+ <span style="margin-right: 10px;">Edit</span>
110
+ <span style="margin-right: 10px;">View</span>
111
+ <span style="margin-right: 10px;">Help</span>
112
+ </div>
113
+ <div style="flex: 1; display: flex; align-items: center; justify-content: center; background-color: #f0f0f0;">
114
+ <div style="text-align: center; color: #888;">
115
+ <div style="font-size: 48px;">🖼️</div>
116
+ <div>Нет доступных изображений</div>
117
+ </div>
118
+ </div>
119
+ </div>
120
+ `
121
+ },
122
+ 'settings': {
123
+ name: 'Настройки',
124
+ icon: 'settings-icon.png',
125
+ width: 800,
126
+ height: 600,
127
+ getContent: () => `
128
+ <div style="display: flex; height: 100%;">
129
+ <div style="width: 200px; border-right: 1px solid #ddd; padding: 10px;">
130
+ <div style="margin-bottom: 10px; font-weight: bold;">Система</div>
131
+ <div style="margin-bottom: 10px;">Дисплей</div>
132
+ <div style="margin-bottom: 10px;">Звук</div>
133
+ <div style="margin-bottom: 10px;">Уведомления</div>
134
+ <div style="margin-bottom: 10px; font-weight: bold;">Сеть и Интернет</div>
135
+ <div style="margin-bottom: 10px;">Wi-Fi</div>
136
+ <div style="margin-bottom: 10px;">Ethernet</div>
137
+ <div style="margin-bottom: 10px; font-weight: bold;">Персонализация</div>
138
+ <div style="margin-bottom: 10px;">Фон</div>
139
+ <div style="margin-bottom: 10px;">Цвета</div>
140
+ <div style="margin-bottom: 10px;">Темы</div>
141
+ </div>
142
+ <div style="flex: 1; padding: 20px;">
143
+ <h2>Настройки Windows</h2>
144
+ <p>Выберите категорию слева, чтобы изменить настройки.</p>
145
+ </div>
146
+ </div>
147
+ `
148
+ },
149
+ 'computer': {
150
+ name: 'Этот компьютер',
151
+ icon: 'computer-icon.png',
152
+ width: 700,
153
+ height: 500,
154
+ getContent: () => `
155
+ <div style="padding: 10px;">
156
+ <h3>Этот компьютер</h3>
157
+ <div style="display: flex; flex-wrap: wrap; margin-top: 20px;">
158
+ <div style="text-align: center; margin: 10px; width: 100px;">
159
+ <img src="src/images/disk-c-icon.png" style="width: 40px; height: 40px;">
160
+ <div>Локальный диск (C:)</div>
161
+ </div>
162
+ <div style="text-align: center; margin: 10px; width: 100px;">
163
+ <img src="src/images/disk-d-icon.png" style="width: 40px; height: 40px;">
164
+ <div>Локальный диск (D:)</div>
165
+ </div>
166
+ <div style="text-align: center; margin: 10px; width: 100px;">
167
+ <img src="src/images/folder-icon.png" style="width: 40px; height: 40px;">
168
+ <div>Desktop</div>
169
+ </div>
170
+ <div style="text-align: center; margin: 10px; width: 100px;">
171
+ <img src="src/images/folder-icon.png" style="width: 40px; height: 40px;">
172
+ <div>Documents</div>
173
+ </div>
174
+ <div style="text-align: center; margin: 10px; width: 100px;">
175
+ <img src="src/images/folder-icon.png" style="width: 40px; height: 40px;">
176
+ <div>Downloads</div>
177
+ </div>
178
+ </div>
179
+ </div>
180
+ `
181
+ },
182
+ 'recycle-bin': {
183
+ name: 'Корзина',
184
+ icon: 'recycle-bin-icon.png',
185
+ width: 600,
186
+ height: 400,
187
+ getContent: () => `
188
+ <div style="padding: 10px;">
189
+ <h3>Корзина</h3>
190
+ <div style="margin-top: 20px; text-align: center; color: #888;">
191
+ <p>Корзина пуста</p>
192
+ </div>
193
+ </div>
194
+ `
195
+ }
196
+ };
197
+
198
+ // Функция для получения информации о приложении по его ID
199
+ function getAppInfo(appId) {
200
+ return appDefinitions[appId] || null;
201
+ }
202
+
203
+ // Функция для запуска приложения
204
+ function launchApp(appId) {
205
+ const appInfo = getAppInfo(appId);
206
+ if (!appInfo) {
207
+ console.error(`Не найдено определение для приложения с ID: ${appId}`);
208
+ return;
209
+ }
210
+
211
+ console.log(`Запуск приложения: ${appInfo.name}`);
212
+
213
+
214
+ createWindow({
215
+ title: appInfo.name,
216
+ icon: appInfo.icon,
217
+ content: appInfo.getContent(),
218
+ width: appInfo.width,
219
+ height: appInfo.height,
220
+ x: Math.random() * (window.innerWidth - appInfo.width - 200) + 100,
221
+ y: Math.random() * (window.innerHeight - appInfo.height - 200) + 100,
222
+ isActive: true,
223
+ appId: appId
224
+ });
225
+
226
+ }
js/desktop.js ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Функция для инициализации рабочего стола
2
+ function initializeDesktop(container) {
3
+ // Список иконок на рабочем столе
4
+ const desktopIcons = [
5
+ { name: 'Этот компьютер', icon: 'computer-icon.png', appId: 'computer' },
6
+ { name: 'Корзина', icon: 'recycle-bin-icon.png', appId: 'recycle-bin' },
7
+ { name: 'Проводник', icon: 'explorer-icon.png', appId: 'explorer' },
8
+ { name: 'Браузер', icon: 'browser-icon.png', appId: 'browser' }
9
+ ];
10
+
11
+ console.log('Инициализация рабочего стола');
12
+
13
+ // Создаем иконки на рабочем столе
14
+ desktopIcons.forEach((icon, index) => {
15
+ const desktopIcon = document.createElement('div');
16
+ desktopIcon.className = 'desktop-icon';
17
+ desktopIcon.dataset.appId = icon.appId;
18
+
19
+ const iconImg = document.createElement('img');
20
+ iconImg.src = `src/images/${icon.icon}`;
21
+ iconImg.alt = icon.name;
22
+
23
+ const iconName = document.createElement('div');
24
+ iconName.textContent = icon.name;
25
+
26
+ desktopIcon.appendChild(iconImg);
27
+ desktopIcon.appendChild(iconName);
28
+
29
+ // Позиционируем иконку на рабочем столе
30
+ desktopIcon.style.position = 'absolute';
31
+ desktopIcon.style.left = '20px';
32
+ desktopIcon.style.top = `${20 + index * 100}px`;
33
+
34
+ container.appendChild(desktopIcon);
35
+
36
+ // Добавляем обработчик события для запуска приложения при клике на иконку
37
+ desktopIcon.addEventListener('click', (e) => {
38
+ console.log(`Клик по иконке: ${icon.name}`);
39
+ launchApp(icon.appId);
40
+ });
41
+ });
42
+ }
js/main.js ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ console.log('Загрузка main.js');
3
+
4
+ // Инициализация основных компонентов Windows 10
5
+ document.addEventListener('DOMContentLoaded', () => {
6
+ console.log('DOM полностью загружен');
7
+
8
+ // Создаем основной контейнер для Windows 10
9
+ const windowsContainer = document.getElementById('windows-container');
10
+ console.log('Контейнер окон:', windowsContainer);
11
+
12
+ // Инициализируем компоненты
13
+ initializeDesktop(windowsContainer);
14
+
15
+ // Важно: инициализируем startMenu до taskbar,
16
+ // чтобы избежать конфликтов при инициализации
17
+ initializeStartMenu();
18
+ initializeTaskbar();
19
+ initializeWindows();
20
+
21
+ console.log('Windows 10 simulator started');
22
+
23
+ // Добавляем тестовую функцию для проверки работы окон
24
+ window.testCreateWindow = () => {
25
+ console.log('Тестовое создание окна');
26
+ createWindow({
27
+ title: 'Тестовое окно',
28
+ icon: 'default-app-icon.png',
29
+ content: '<div style="padding: 20px;">Это тестовое окно для проверки работы системы</div>',
30
+ width: 500,
31
+ height: 300,
32
+ x: 100,
33
+ y: 100,
34
+ isActive: true
35
+ });
36
+ };
37
+
38
+ // Добавим подсветку для кнопки "Пуск"
39
+ const startButtonElement = document.getElementById('start-button');
40
+ if (startButtonElement) {
41
+ console.log('Кнопка "Пуск" найдена в DOM:', startButtonElement);
42
+
43
+ /*
44
+ startButtonElement.style.animation = 'pulse 1.5s infinite';
45
+ // Добавляем стиль для анимации
46
+ const style = document.createElement('style');
47
+ style.textContent = `
48
+ @keyframes pulse {
49
+ 0% { box-shadow: 0 0 0 0 rgba(0, 120, 215, 0.7); }
50
+ 70% { box-shadow: 0 0 0 10px rgba(0, 120, 215, 0); }
51
+ 100% { box-shadow: 0 0 0 0 rgba(0, 120, 215, 0); }
52
+ }
53
+ `;
54
+ document.head.appendChild(style);
55
+
56
+ */
57
+ }
58
+
59
+ // Создаем тестовое окно при загрузке для проверки
60
+ /*
61
+ setTimeout(() => {
62
+ createWindow({
63
+ title: 'Подсказка',
64
+ icon: 'default-app-icon.png',
65
+ content: '<div style="padding: 20px; text-align: center;"><h3>Добро пожаловать в Windows 10 Simulator!</h3><p>Нажмите на кнопку <strong>Пуск</strong> в левом нижнем углу, чтобы открыть меню "Пуск".</p><p>Вы также можете кликнуть по иконкам на рабочем столе, чтобы открыть программы.</p></div>',
66
+ width: 400,
67
+ height: 200,
68
+ x: 200,
69
+ y: 150,
70
+ isActive: true
71
+ });
72
+ }, 1000);
73
+ */
74
+
75
+ // Добавляем прямой обработчик кнопки "Пуск", заменяя все предыдущие
76
+ setTimeout(() => {
77
+ console.log('Настройка обработчика кнопки "Пуск"');
78
+ const startButton = document.getElementById('start-button');
79
+ const startMenu = document.getElementById('start-menu');
80
+
81
+ if (startButton && startMenu) {
82
+ // Удаляем предыдущие обработчики с кнопки "Пуск"
83
+ startButton.addEventListener('click', (event) => {
84
+ event.stopPropagation();
85
+ console.log('Клик по кнопке "Пуск" в main.js');
86
+
87
+ // Переключаем класс active для меню
88
+ const isActive = startMenu.classList.contains('active');
89
+ if (isActive) {
90
+ console.log('Скрываем меню "Пуск"');
91
+ startMenu.classList.remove('active');
92
+ startButton.classList.remove('active');
93
+ } else {
94
+ console.log('Показываем меню "Пуск"');
95
+ startMenu.classList.add('active');
96
+ startButton.classList.add('active');
97
+
98
+ // Проверка видимости меню после добавления класса active
99
+ setTimeout(() => {
100
+ const computedStyle = window.getComputedStyle(startMenu);
101
+ console.log(`Проверка стилей меню: opacity=${computedStyle.opacity}, transform=${computedStyle.transform}`);
102
+ }, 50);
103
+ }
104
+ });
105
+
106
+ // Добавляем обработчик для закрытия меню при клике вне его
107
+ document.addEventListener('click', (event) => {
108
+ // Проверяем, открыто ли меню и кликнули ли мы вне его
109
+ if (startMenu.classList.contains('active') &&
110
+ !startMenu.contains(event.target) &&
111
+ !startButton.contains(event.target)) {
112
+ console.log('Клик вне меню "Пуск", закрываем');
113
+ startMenu.classList.remove('active');
114
+ startButton.classList.remove('active');
115
+ }
116
+ });
117
+
118
+ console.log('Обработчик события для кнопки "Пуск" установлен');
119
+ } else {
120
+ console.error('Не найдена кнопка "Пуск" или меню "Пуск"');
121
+ }
122
+ }, 500);
123
+ });
js/startMenu.js ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ // Переменные для управления меню "Пуск"
3
+ let isStartMenuVisible = false;
4
+ let startMenu = null;
5
+
6
+ // Функция для создания меню "Пуск"
7
+ function initializeStartMenu() {
8
+ console.log('Инициализация меню "Пуск"');
9
+
10
+ // Проверяем, существует ли уже меню "Пуск"
11
+ if (document.getElementById('start-menu')) {
12
+ console.log('Меню "Пуск" уже существует');
13
+ startMenu = document.getElementById('start-menu');
14
+
15
+ // Добавляем обработчики событий для приложений в меню "Пуск"
16
+ const appElements = startMenu.querySelectorAll('.start-menu-app');
17
+ appElements.forEach(appElement => {
18
+ const appId = appElement.dataset.appId;
19
+ appElement.addEventListener('click', () => {
20
+ console.log(`Клик по приложению в меню Пуск: ${appId}`);
21
+ launchApp(appId);
22
+ toggleStartMenu(); // Закрываем меню "Пуск" после запуска приложения
23
+ });
24
+ });
25
+
26
+ return;
27
+ }
28
+
29
+ // Создаем меню "Пуск"
30
+ startMenu = document.createElement('div');
31
+ startMenu.id = 'start-menu';
32
+
33
+ // Создаем заголовок меню "Пуск"
34
+ const startMenuHeader = document.createElement('div');
35
+ startMenuHeader.id = 'start-menu-header';
36
+
37
+ const userIcon = document.createElement('img');
38
+ userIcon.src = 'src/images/user-icon.png';
39
+ userIcon.alt = 'Пользователь';
40
+
41
+ const userName = document.createElement('span');
42
+ userName.textContent = 'Пользователь';
43
+
44
+ startMenuHeader.appendChild(userIcon);
45
+ startMenuHeader.appendChild(userName);
46
+ startMenu.appendChild(startMenuHeader);
47
+
48
+ // Создаем контейнер для приложений в меню "Пуск"
49
+ const startMenuApps = document.createElement('div');
50
+ startMenuApps.id = 'start-menu-apps';
51
+ startMenu.appendChild(startMenuApps);
52
+
53
+ // Добавляем приложения в меню "Пуск"
54
+ const apps = [
55
+ { name: 'Браузер', icon: 'browser-icon.png', appId: 'browser' },
56
+ /*{ name: 'Проводник', icon: 'explorer-icon.png', appId: 'explorer' },
57
+ { name: 'Калькулятор', icon: 'calculator-icon.png', appId: 'calculator' },
58
+ { name: 'Заметки', icon: 'notepad-icon.png', appId: 'notepad' },
59
+ { name: 'Фотографии', icon: 'photos-icon.png', appId: 'photos' },*/
60
+ { name: 'Настройки', icon: 'settings-icon.png', appId: 'settings' }
61
+ ];
62
+
63
+ apps.forEach(app => {
64
+ const appElement = document.createElement('div');
65
+ appElement.className = 'start-menu-app';
66
+ appElement.dataset.appId = app.appId;
67
+
68
+ const appIcon = document.createElement('img');
69
+ appIcon.src = `src/images/${app.icon}`;
70
+ appIcon.alt = app.name;
71
+
72
+ const appName = document.createElement('span');
73
+ appName.textContent = app.name;
74
+
75
+ appElement.appendChild(appIcon);
76
+ appElement.appendChild(appName);
77
+ startMenuApps.appendChild(appElement);
78
+
79
+ // Добавляем обработчик клика
80
+ appElement.addEventListener('click', () => {
81
+ console.log(`Клик по приложению в меню Пуск: ${app.name}`);
82
+ launchApp(app.appId);
83
+ toggleStartMenu(); // Закрываем меню "Пуск" после запуска приложения
84
+ });
85
+ });
86
+
87
+ // Добавляем меню "Пуск" в DOM - сразу после body, чтобы избежать проблем с z-index
88
+ document.body.insertBefore(startMenu, document.body.firstChild);
89
+ console.log('Меню "Пуск" добавлено в DOM');
90
+
91
+ // Добавляем обработчик события для закрытия меню "Пуск" при клике вне его
92
+ document.addEventListener('mousedown', (e) => {
93
+ if (
94
+ isStartMenuVisible &&
95
+ startMenu &&
96
+ !startMenu.contains(e.target) &&
97
+ e.target.id !== 'start-button' &&
98
+ !e.target.closest('#start-button')
99
+ ) {
100
+ console.log('Клик вне меню "Пуск", закрываем меню');
101
+ toggleStartMenu();
102
+ }
103
+ });
104
+
105
+ // Принудительно обновляем меню "Пуск" для стилей
106
+ setTimeout(() => {
107
+ if (startMenu) {
108
+ startMenu.style.display = 'flex';
109
+ console.log('Стили меню "Пуск" обновлены');
110
+ }
111
+ }, 100);
112
+ }
113
+
114
+ // Функция для показа/скрытия меню "Пуск"
115
+ function toggleStartMenu() {
116
+ console.log('Вызов функции toggleStartMenu');
117
+
118
+ // Получаем меню и кнопку по необходимости
119
+ const startMenu = document.getElementById('start-menu');
120
+ const startButton = document.getElementById('start-button');
121
+
122
+ if (!startMenu) {
123
+ console.error('Меню "Пуск" не найдено в DOM');
124
+ return;
125
+ }
126
+
127
+ // Определяем текущее состояние
128
+ const isActive = startMenu.classList.contains('active');
129
+
130
+ console.log(`Переключение меню "Пуск": ${isActive ? 'скрыть' : 'показать'}`);
131
+
132
+ // Переключаем классы
133
+ if (isActive) {
134
+ startMenu.classList.remove('active');
135
+ if (startButton) startButton.classList.remove('active');
136
+ console.log('Меню "Пуск" скрыто');
137
+ } else {
138
+ startMenu.classList.add('active');
139
+ if (startButton) startButton.classList.add('active');
140
+ console.log('Меню "Пуск" активировано');
141
+
142
+ // Проверка видимости
143
+ setTimeout(() => {
144
+ const computedStyle = window.getComputedStyle(startMenu);
145
+ console.log(`Меню "Пуск" видимость: opacity=${computedStyle.opacity}, transform=${computedStyle.transform}`);
146
+ }, 50);
147
+ }
148
+ }
js/taskbar.js ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Инициализация панели задач
2
+ function initializeTaskbar() {
3
+ console.log('Инициализация панели задач');
4
+
5
+ // Получаем существующую панель задач
6
+ const taskbar = document.getElementById('taskbar');
7
+ if (!taskbar) {
8
+ console.error('Панель задач не найдена в DOM');
9
+ return;
10
+ }
11
+
12
+ // Получаем кнопку "Пуск"
13
+ const startButton = document.getElementById('start-button');
14
+ if (!startButton) {
15
+ console.error('Кнопка "Пуск" не найдена в DOM');
16
+ return;
17
+ }
18
+
19
+ console.log('Панель задач найдена в DOM');
20
+
21
+ // Не добавляем обработчик событий здесь, так как он будет добавлен в main.js
22
+ console.log('Обработчик события для кнопки "Пуск" будет добавлен в main.js');
23
+ }
js/windows.js ADDED
@@ -0,0 +1,704 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Глобальный массив для хранения всех окон
2
+ let windows = [];
3
+ let activeWindowId = null;
4
+ let zIndex = 100;
5
+
6
+ // Глобальное хранилище открытых приложений (appId -> windowId)
7
+ const openApps = {};
8
+
9
+ // Функция для создания нового окна
10
+ function createWindow(options = {}) {
11
+ console.log('Создание окна с параметрами:', options);
12
+
13
+ const {
14
+ title = 'Новое окно',
15
+ icon = 'default-app-icon.png',
16
+ content = '',
17
+ width = 600,
18
+ height = 400,
19
+ x = 100,
20
+ y = 100,
21
+ isActive = true,
22
+ appId
23
+ } = options;
24
+
25
+ // Проверяем, существует ли уже открытое окно с таким appId
26
+ if (appId && openApps[appId]) {
27
+ const existingWindowId = openApps[appId];
28
+ const existingWindow = windows.find(w => w.id === existingWindowId);
29
+
30
+ // Если окно существует, активируем его и возвращаем
31
+ if (existingWindow) {
32
+ console.log(`Приложение ${appId} уже открыто, активируем существующее окно:`, existingWindowId);
33
+
34
+ // Если окно свёрнуто, восстанавливаем его
35
+ if (existingWindow.isMinimized) {
36
+ restoreWindow(existingWindowId);
37
+ }
38
+
39
+ // Активируем окно
40
+ activateWindow(existingWindowId);
41
+
42
+ return existingWindow;
43
+ }
44
+ }
45
+
46
+ // Создаем уникальный ID для окна
47
+ const windowId = `window-${Date.now()}-${Math.floor(Math.random() * 1000)}`;
48
+
49
+ // Создаем DOM элемент окна
50
+ const windowElement = document.createElement('div');
51
+ windowElement.className = `window ${isActive ? 'active' : ''}`;
52
+ windowElement.id = windowId;
53
+ windowElement.dataset.appId = appId || '';
54
+ windowElement.style.width = `${width}px`;
55
+ windowElement.style.height = `${height}px`;
56
+ windowElement.style.left = `${x}px`;
57
+ windowElement.style.top = `${y}px`;
58
+ windowElement.style.zIndex = isActive ? ++zIndex : zIndex;
59
+
60
+ // Создаем заголовок окна
61
+ const windowHeader = document.createElement('div');
62
+ windowHeader.className = 'window-header';
63
+
64
+ const windowTitle = document.createElement('div');
65
+ windowTitle.className = 'window-title';
66
+
67
+ const iconImg = document.createElement('img');
68
+ iconImg.src = `src/images/${icon}`;
69
+ iconImg.alt = title;
70
+
71
+ const titleText = document.createElement('span');
72
+ titleText.textContent = title;
73
+
74
+ windowTitle.appendChild(iconImg);
75
+ windowTitle.appendChild(titleText);
76
+
77
+ // Создаем кнопки управления окном
78
+ const windowControls = document.createElement('div');
79
+ windowControls.className = 'window-controls';
80
+
81
+ const minimizeButton = document.createElement('div');
82
+ minimizeButton.className = 'window-control minimize';
83
+ minimizeButton.innerHTML = '&#8211;';
84
+ minimizeButton.title = 'Свернуть';
85
+
86
+ const maximizeButton = document.createElement('div');
87
+ maximizeButton.className = 'window-control maximize';
88
+ maximizeButton.innerHTML = '&#9744;';
89
+ maximizeButton.title = 'Развернуть';
90
+
91
+ const closeButton = document.createElement('div');
92
+ closeButton.className = 'window-control close';
93
+ closeButton.innerHTML = '&#10005;';
94
+ closeButton.title = 'Закрыть';
95
+
96
+ windowControls.appendChild(minimizeButton);
97
+ windowControls.appendChild(maximizeButton);
98
+ windowControls.appendChild(closeButton);
99
+
100
+ windowHeader.appendChild(windowTitle);
101
+ windowHeader.appendChild(windowControls);
102
+
103
+ // Создаем содержимое окна
104
+ const windowContent = document.createElement('div');
105
+ windowContent.className = 'window-content';
106
+ windowContent.innerHTML = content;
107
+
108
+ // Собираем окно вместе
109
+ windowElement.appendChild(windowHeader);
110
+ windowElement.appendChild(windowContent);
111
+
112
+ // Добавляем окно в DOM
113
+ const container = document.getElementById('windows-container');
114
+ console.log('Контейнер для окон:', container);
115
+
116
+ if (container) {
117
+ container.appendChild(windowElement);
118
+ console.log('Окно добавлено в DOM');
119
+ } else {
120
+ console.error('Не найден контейнер для окон с id="windows-container"');
121
+ return null;
122
+ }
123
+
124
+ // Добавляем окно в массив окон
125
+ const windowObject = {
126
+ id: windowId,
127
+ element: windowElement,
128
+ appId: appId || '',
129
+ title,
130
+ icon,
131
+ isMinimized: false,
132
+ isMaximized: false,
133
+ // Сохраняем оригинальные размеры и позицию для восстановления из полноэкранного режима
134
+ originalSize: {
135
+ width,
136
+ height,
137
+ x,
138
+ y
139
+ }
140
+ };
141
+
142
+ windows.push(windowObject);
143
+ console.log('Окно добавлено в массив, всего окон:', windows.length);
144
+
145
+ // Если окно активное, делаем его активным
146
+ if (isActive) {
147
+ activateWindow(windowId);
148
+ }
149
+
150
+ // Сохраняем ID окна для приложения, чтобы избежать дублирования
151
+ if (appId) {
152
+ openApps[appId] = windowId;
153
+ console.log(`Приложение ${appId} зарегистрировано с окном ${windowId}`);
154
+ }
155
+
156
+ // Добавляем кнопку в панель задач
157
+ addWindowToTaskbar(windowObject);
158
+
159
+ // Добавляем обработчики событий
160
+ setupWindowEvents(windowObject);
161
+
162
+ return windowObject;
163
+ }
164
+
165
+ // Функция для активации окна
166
+ function activateWindow(windowId) {
167
+ console.log('Активация окна:', windowId);
168
+
169
+ // Если активно другое окно, делаем его неактивным
170
+ if (activeWindowId && activeWindowId !== windowId) {
171
+ const activeWindow = document.getElementById(activeWindowId);
172
+ if (activeWindow) {
173
+ activeWindow.classList.remove('active');
174
+ }
175
+
176
+ // Обновляем стили в панели задач
177
+ const taskbarItem = document.querySelector(`.taskbar-program[data-window-id="${activeWindowId}"]`);
178
+ if (taskbarItem) {
179
+ taskbarItem.classList.remove('active');
180
+ }
181
+ }
182
+
183
+ // Активируем новое окно
184
+ const windowToActivate = document.getElementById(windowId);
185
+ if (windowToActivate) {
186
+ windowToActivate.classList.add('active');
187
+ windowToActivate.style.zIndex = ++zIndex;
188
+ activeWindowId = windowId;
189
+
190
+ // Обновляем стили в панели задач
191
+ const taskbarItem = document.querySelector(`.taskbar-program[data-window-id="${windowId}"]`);
192
+ if (taskbarItem) {
193
+ taskbarItem.classList.add('active');
194
+ }
195
+ } else {
196
+ console.error('Не найдено окно для активации с id', windowId);
197
+ }
198
+ }
199
+
200
+ // Функция для добавления окна в панель задач
201
+ function addWindowToTaskbar(windowObject) {
202
+ const taskbarPrograms = document.getElementById('taskbar-programs');
203
+
204
+ if (!taskbarPrograms) {
205
+ console.error('Не найден контейнер для программ в панели задач');
206
+ return;
207
+ }
208
+
209
+ // Проверяем, существует ли уже программа в панели задач
210
+ const existingTaskbarItem = document.querySelector(`.taskbar-program[data-app-id="${windowObject.appId}"]`);
211
+
212
+ if (existingTaskbarItem && windowObject.appId) {
213
+ // Если программа уже есть, добавляем к ней ссылку на новое окно
214
+ existingTaskbarItem.dataset.windowId = windowObject.id;
215
+ existingTaskbarItem.classList.add('active');
216
+ } else {
217
+ // Если программы нет, создаем новую иконку в панели задач
218
+ const taskbarItem = document.createElement('div');
219
+ taskbarItem.className = 'taskbar-program active';
220
+ taskbarItem.dataset.windowId = windowObject.id;
221
+ taskbarItem.dataset.appId = windowObject.appId || '';
222
+
223
+ const iconImg = document.createElement('img');
224
+ iconImg.src = `src/images/${windowObject.icon}`;
225
+ iconImg.alt = windowObject.title;
226
+
227
+ taskbarItem.appendChild(iconImg);
228
+ taskbarPrograms.appendChild(taskbarItem);
229
+
230
+ // Добавляем обработчик события для кнопки в панели задач
231
+ taskbarItem.addEventListener('click', () => {
232
+ console.log('Клик по кнопке в панели задач:', windowObject.id);
233
+
234
+ // Найдем окно по ID
235
+ const window = windows.find(w => w.id === windowObject.id);
236
+ if (!window) {
237
+ console.error('Не найдено окно с ID:', windowObject.id);
238
+ return;
239
+ }
240
+
241
+ console.log('Состояние окна:', window.isMinimized ? 'свернуто' : 'открыто', 'активно:', activeWindowId === window.id);
242
+
243
+ // Проверяем, свернуто ли окно
244
+ if (window.isMinimized) {
245
+ console.log('Восстанавливаем свернутое окно:', window.id);
246
+ restoreWindow(window.id);
247
+ }
248
+ // Если окно активно, сворачиваем его
249
+ else if (activeWindowId === window.id) {
250
+ console.log('Сворачиваем активное окно:', window.id);
251
+ minimizeWindow(window.id);
252
+ }
253
+ // Если окно не активно, делаем его активным
254
+ else {
255
+ console.log('Активируем неактивное окно:', window.id);
256
+ activateWindow(window.id);
257
+ }
258
+ });
259
+ }
260
+ }
261
+
262
+ // Функция для сворачивания окна
263
+ function minimizeWindow(windowId) {
264
+ const windowObj = windows.find(w => w.id === windowId);
265
+ if (windowObj) {
266
+ windowObj.isMinimized = true;
267
+ windowObj.element.classList.add('minimized');
268
+
269
+ // Если это активное окно, сбрасываем активное окно
270
+ if (activeWindowId === windowId) {
271
+ activeWindowId = null;
272
+ }
273
+
274
+ // Обновляем стили в панели задач
275
+ const taskbarItem = document.querySelector(`.taskbar-program[data-window-id="${windowId}"]`);
276
+ if (taskbarItem) {
277
+ taskbarItem.classList.remove('active');
278
+ }
279
+ }
280
+ }
281
+
282
+ // Функция для восстановления окна
283
+ function restoreWindow(windowId) {
284
+ const windowObj = windows.find(w => w.id === windowId);
285
+ if (windowObj) {
286
+ windowObj.isMinimized = false;
287
+ windowObj.element.classList.remove('minimized');
288
+ activateWindow(windowId);
289
+ }
290
+ }
291
+
292
+ // Функция для разворачивания окна на весь экран
293
+ function maximizeWindow(windowId) {
294
+ const windowObj = windows.find(w => w.id === windowId);
295
+ if (!windowObj) return;
296
+
297
+ const container = document.getElementById('windows-container');
298
+ if (!container) return;
299
+
300
+ const windowElement = windowObj.element;
301
+
302
+ // Если окно уже развернуто, восстанавливаем его оригинальный размер
303
+ if (windowObj.isMaximized) {
304
+ console.log('Восстановление окна из полноэкранного режима:', windowId);
305
+
306
+ // Восстанавливаем оригинальные размеры и позицию
307
+ windowElement.style.width = `${windowObj.originalSize.width}px`;
308
+ windowElement.style.height = `${windowObj.originalSize.height}px`;
309
+ windowElement.style.left = `${windowObj.originalSize.x}px`;
310
+ windowElement.style.top = `${windowObj.originalSize.y}px`;
311
+
312
+ // Обновляем иконку кнопки разворачивания
313
+ const maximizeButton = windowElement.querySelector('.window-control.maximize');
314
+ if (maximizeButton) {
315
+ maximizeButton.innerHTML = '&#9744;'; // Иконка "развернуть"
316
+ maximizeButton.title = 'Развернуть';
317
+ }
318
+
319
+ windowObj.isMaximized = false;
320
+ windowElement.classList.remove('maximized');
321
+ }
322
+ // Иначе разворачиваем окно на весь экран
323
+ else {
324
+ console.log('Разворачивание окна на весь экран:', windowId);
325
+
326
+ // Сохраняем текущие размеры и позицию перед разворачиванием
327
+ // (только если они еще не сохранены)
328
+ if (!windowObj.originalSize) {
329
+ windowObj.originalSize = {
330
+ width: parseInt(windowElement.style.width),
331
+ height: parseInt(windowElement.style.height),
332
+ x: parseInt(windowElement.style.left),
333
+ y: parseInt(windowElement.style.top)
334
+ };
335
+ }
336
+
337
+ // Получаем размеры контейнера (рабочего стола)
338
+ const containerRect = container.getBoundingClientRect();
339
+
340
+ // Устанавливаем размеры окна равными размерам контейнера
341
+ windowElement.style.width = `${containerRect.width}px`;
342
+ windowElement.style.height = `${containerRect.height}px`;
343
+ windowElement.style.left = '0px';
344
+ windowElement.style.top = '0px';
345
+
346
+ // Обновляем иконку кнопки разворачивания
347
+ const maximizeButton = windowElement.querySelector('.window-control.maximize');
348
+ if (maximizeButton) {
349
+ maximizeButton.innerHTML = '&#9744;&#9744;'; // Иконка "восстановить"
350
+ maximizeButton.title = 'Восстановить';
351
+ }
352
+
353
+ windowObj.isMaximized = true;
354
+ windowElement.classList.add('maximized');
355
+ }
356
+
357
+ // Активируем окно
358
+ activateWindow(windowId);
359
+ }
360
+
361
+ // Функция для закрытия окна
362
+ function closeWindow(windowId) {
363
+ const windowIndex = windows.findIndex(w => w.id === windowId);
364
+ if (windowIndex !== -1) {
365
+ const windowObj = windows[windowIndex];
366
+
367
+ // Удаляем окно из DOM
368
+ if (windowObj.element) {
369
+ windowObj.element.remove();
370
+ }
371
+
372
+ // Если это было активное окно, сбрасываем активное окно
373
+ if (activeWindowId === windowId) {
374
+ activeWindowId = null;
375
+ }
376
+
377
+ // Удаляем регистрацию открытого приложения
378
+ if (windowObj.appId && openApps[windowObj.appId] === windowId) {
379
+ delete openApps[windowObj.appId];
380
+ console.log(`Удалена регистрация приложения ${windowObj.appId}`);
381
+ }
382
+
383
+ // Удаляем из массива окон
384
+ windows.splice(windowIndex, 1);
385
+
386
+ // Проверяем, есть ли еще окна с таким же appId
387
+ const sameAppWindows = windows.filter(w => w.appId === windowObj.appId && w.appId !== '');
388
+
389
+ // Если других окон с таким же appId нет, удаляем кнопку из панели задач
390
+ if (sameAppWindows.length === 0) {
391
+ const taskbarItem = document.querySelector(`.taskbar-program[data-app-id="${windowObj.appId}"]`);
392
+ if (taskbarItem) {
393
+ taskbarItem.remove();
394
+ }
395
+ } else {
396
+ // Иначе обновляем ссылку на последнее окно этого приложения
397
+ const lastWindow = sameAppWindows[sameAppWindows.length - 1];
398
+ const taskbarItem = document.querySelector(`.taskbar-program[data-app-id="${windowObj.appId}"]`);
399
+ if (taskbarItem) {
400
+ taskbarItem.dataset.windowId = lastWindow.id;
401
+ }
402
+ }
403
+ }
404
+ }
405
+
406
+ // Функция для настройки событий окна
407
+ function setupWindowEvents(windowObj) {
408
+ const windowElement = windowObj.element;
409
+ const header = windowElement.querySelector('.window-header');
410
+ const minimizeButton = windowElement.querySelector('.window-control.minimize');
411
+ const maximizeButton = windowElement.querySelector('.window-control.maximize');
412
+ const closeButton = windowElement.querySelector('.window-control.close');
413
+
414
+ // Добавляем возможность перетаскивания окна
415
+ let isDragging = false;
416
+ let offsetX, offsetY;
417
+
418
+ // Функция для обработки начала перетаскивания (как для мыши, так и для сенсорного ввода)
419
+ const handleStartDrag = (clientX, clientY, target) => {
420
+ // Если окно развернуто на весь экран, не даем его перетаскивать
421
+ if (windowObj.isMaximized) return;
422
+
423
+ if (target === header || target.closest('.window-title')) {
424
+ isDragging = true;
425
+ offsetX = clientX - windowElement.getBoundingClientRect().left;
426
+ offsetY = clientY - windowElement.getBoundingClientRect().top;
427
+
428
+ // Активируем окно при начале перетаскивания
429
+ activateWindow(windowObj.id);
430
+ }
431
+ };
432
+
433
+ // Функция для обработки перемещения (как для мыши, так и для сенсорного ввода)
434
+ const handleDrag = (clientX, clientY) => {
435
+ if (!isDragging) return;
436
+
437
+ // Получаем размеры контейнера рабочего стола
438
+ const container = document.getElementById('windows-container');
439
+ const containerRect = container.getBoundingClientRect();
440
+
441
+ // Получаем размеры окна
442
+ const windowRect = windowElement.getBoundingClientRect();
443
+ const windowWidth = windowRect.width;
444
+ const windowHeight = windowRect.height;
445
+
446
+ // Вычисляем новые координаты с учетом ограничений
447
+ let newX = clientX - offsetX;
448
+ let newY = clientY - offsetY;
449
+
450
+ // Ограничиваем перемещение окна, чтобы оно не выходило за пределы рабочего стола
451
+ // Задаем минимальное значение заголовка, которое должно быть видимым (чтобы можно было перетащить окно обратно)
452
+ const minVisibleHeader = 30; // минимальная видимая часть заголовка окна
453
+
454
+ // Ограничение по X (горизонтали)
455
+ if (newX < -windowWidth + minVisibleHeader) {
456
+ newX = -windowWidth + minVisibleHeader;
457
+ } else if (newX > containerRect.width - minVisibleHeader) {
458
+ newX = containerRect.width - minVisibleHeader;
459
+ }
460
+
461
+ // Ограничение по Y (вертикали)
462
+ if (newY < 0) {
463
+ newY = 0;
464
+ } else if (newY > containerRect.height - minVisibleHeader) {
465
+ newY = containerRect.height - minVisibleHeader;
466
+ }
467
+
468
+ // Применяем новые координаты
469
+ windowElement.style.left = `${newX}px`;
470
+ windowElement.style.top = `${newY}px`;
471
+ };
472
+
473
+ // Функция для обработки окончания перетаскивания
474
+ const handleEndDrag = () => {
475
+ isDragging = false;
476
+ };
477
+
478
+ // Обработчики событий мыши
479
+ header.addEventListener('mousedown', (e) => {
480
+ handleStartDrag(e.clientX, e.clientY, e.target);
481
+ });
482
+
483
+ document.addEventListener('mousemove', (e) => {
484
+ handleDrag(e.clientX, e.clientY);
485
+ });
486
+
487
+ document.addEventListener('mouseup', handleEndDrag);
488
+
489
+ // Обработчики сенсорных событий
490
+ header.addEventListener('touchstart', (e) => {
491
+ const touch = e.touches[0];
492
+ handleStartDrag(touch.clientX, touch.clientY, e.target);
493
+ e.preventDefault(); // Предотвращаем скролл страницы
494
+ });
495
+
496
+ document.addEventListener('touchmove', (e) => {
497
+ if (isDragging) {
498
+ const touch = e.touches[0];
499
+ handleDrag(touch.clientX, touch.clientY);
500
+ e.preventDefault(); // Предотвращаем скролл страницы
501
+ }
502
+ });
503
+
504
+ document.addEventListener('touchend', handleEndDrag);
505
+ document.addEventListener('touchcancel', handleEndDrag);
506
+
507
+ // Добавляем двойной клик на заголовок для разворачивания/восстановления
508
+ header.addEventListener('dblclick', () => {
509
+ maximizeWindow(windowObj.id);
510
+ });
511
+
512
+ // Также добавляем обработчик двойного тапа для мобильных устройств
513
+ let lastTap = 0;
514
+ header.addEventListener('touchend', (e) => {
515
+ const currentTime = new Date().getTime();
516
+ const tapLength = currentTime - lastTap;
517
+ if (tapLength < 300 && tapLength > 0) {
518
+ // Двойной тап - разворачиваем/восстанавливаем окно
519
+ maximizeWindow(windowObj.id);
520
+ e.preventDefault();
521
+ }
522
+ lastTap = currentTime;
523
+ });
524
+
525
+ // Активируем окно при клике на него
526
+ windowElement.addEventListener('mousedown', () => {
527
+ activateWindow(windowObj.id);
528
+ });
529
+
530
+ windowElement.addEventListener('touchstart', () => {
531
+ activateWindow(windowObj.id);
532
+ });
533
+
534
+ // Обработчики для кнопок управления окном
535
+ if (minimizeButton) {
536
+ minimizeButton.addEventListener('click', () => {
537
+ minimizeWindow(windowObj.id);
538
+ });
539
+ minimizeButton.addEventListener('touchend', (e) => {
540
+ minimizeWindow(windowObj.id);
541
+ e.preventDefault();
542
+ });
543
+ }
544
+
545
+ if (maximizeButton) {
546
+ maximizeButton.addEventListener('click', () => {
547
+ maximizeWindow(windowObj.id);
548
+ });
549
+ maximizeButton.addEventListener('touchend', (e) => {
550
+ maximizeWindow(windowObj.id);
551
+ e.preventDefault();
552
+ });
553
+ }
554
+
555
+ if (closeButton) {
556
+ closeButton.addEventListener('click', () => {
557
+ closeWindow(windowObj.id);
558
+ });
559
+ closeButton.addEventListener('touchend', (e) => {
560
+ closeWindow(windowObj.id);
561
+ e.preventDefault();
562
+ });
563
+ }
564
+
565
+ // Добавляем поддержку изменения размера окна на мобильных устройствах
566
+ // с помощью жеста "pinch" (щипка)
567
+ let initialDistance = 0;
568
+ let initialWidth = 0;
569
+ let initialHeight = 0;
570
+
571
+ windowElement.addEventListener('touchstart', (e) => {
572
+ if (e.touches.length === 2) {
573
+ // Два пальца - жест изменения размера
574
+ const touch1 = e.touches[0];
575
+ const touch2 = e.touches[1];
576
+
577
+ // Вычисляем расстояние между пальцами
578
+ initialDistance = Math.hypot(
579
+ touch2.clientX - touch1.clientX,
580
+ touch2.clientY - touch1.clientY
581
+ );
582
+
583
+ // Запоминаем начальные размеры окна
584
+ initialWidth = windowElement.offsetWidth;
585
+ initialHeight = windowElement.offsetHeight;
586
+
587
+ e.preventDefault();
588
+ }
589
+ });
590
+
591
+ windowElement.addEventListener('touchmove', (e) => {
592
+ if (e.touches.length === 2 && initialDistance > 0) {
593
+ // Два пальца - жест изменения размера
594
+ const touch1 = e.touches[0];
595
+ const touch2 = e.touches[1];
596
+
597
+ // Вычисляем новое расстояние между пальцами
598
+ const newDistance = Math.hypot(
599
+ touch2.clientX - touch1.clientX,
600
+ touch2.clientY - touch1.clientY
601
+ );
602
+
603
+ // Вычисляем коэффициент масштабирования
604
+ const scale = newDistance / initialDistance;
605
+
606
+ // Применяем новые размеры с ограничениями
607
+ const newWidth = Math.max(300, Math.min(initialWidth * scale, window.innerWidth));
608
+ const newHeight = Math.max(200, Math.min(initialHeight * scale, window.innerHeight - 50));
609
+
610
+ windowElement.style.width = `${newWidth}px`;
611
+ windowElement.style.height = `${newHeight}px`;
612
+
613
+ e.preventDefault();
614
+ }
615
+ });
616
+
617
+ windowElement.addEventListener('touchend', () => {
618
+ initialDistance = 0;
619
+ });
620
+ }
621
+
622
+ // Инициализация системы окон
623
+ function initializeWindows() {
624
+ console.log('Инициализация системы окон');
625
+
626
+ // Обновляем обработчики для существующих кнопок в панели задач
627
+ setTimeout(() => {
628
+ updateTaskbarHandlers();
629
+ }, 500);
630
+
631
+ // Настраиваем глобальный обработчик клика для снятия активации со всех окон при клике на рабочий стол
632
+ const windowsContainer = document.getElementById('windows-container');
633
+ if (windowsContainer) {
634
+ windowsContainer.addEventListener('mousedown', (e) => {
635
+ if (e.target === document.getElementById('windows-container')) {
636
+ // Если клик был непосредственно на рабочем столе
637
+ if (activeWindowId) {
638
+ const activeWindow = document.getElementById(activeWindowId);
639
+ if (activeWindow) {
640
+ activeWindow.classList.remove('active');
641
+ }
642
+
643
+ // Обновляем стили в панели задач
644
+ const taskbarItem = document.querySelector(`.taskbar-program[data-window-id="${activeWindowId}"]`);
645
+ if (taskbarItem) {
646
+ taskbarItem.classList.remove('active');
647
+ }
648
+
649
+ activeWindowId = null;
650
+ }
651
+ }
652
+ });
653
+ } else {
654
+ console.error('Не найден контейнер для окон с id="windows-container"');
655
+ }
656
+ }
657
+
658
+ // Функция для обновления обработчиков событий для кнопок в панели задач
659
+ function updateTaskbarHandlers() {
660
+ const taskbarItems = document.querySelectorAll('.taskbar-program');
661
+ console.log('Найдено кнопок в панели задач:', taskbarItems.length);
662
+
663
+ taskbarItems.forEach(item => {
664
+ const windowId = item.dataset.windowId;
665
+ if (!windowId) return;
666
+
667
+ console.log('Добавление обработчика для кнопки в панели задач:', windowId);
668
+
669
+ // Удаляем старые обработчики, чтобы избежать дублирования
670
+ const newItem = item.cloneNode(true);
671
+ if (item.parentNode) {
672
+ item.parentNode.replaceChild(newItem, item);
673
+ }
674
+
675
+ newItem.addEventListener('click', () => {
676
+ console.log('Клик по кнопке в панели задач:', windowId);
677
+
678
+ // Проверим, есть ли такое окно
679
+ const windowObj = windows.find(w => w.id === windowId);
680
+ if (!windowObj) {
681
+ console.error('Не найдено окно с ID:', windowId);
682
+ return;
683
+ }
684
+
685
+ console.log('Состояние окна:', windowObj.isMinimized ? 'свернуто' : 'открыто', 'активно:', activeWindowId === windowObj.id);
686
+
687
+ // Проверяем, свернуто ли окно
688
+ if (windowObj.isMinimized) {
689
+ console.log('Восстанавливаем свернутое окно:', windowObj.id);
690
+ restoreWindow(windowObj.id);
691
+ }
692
+ // Если окно активно, сворачиваем его
693
+ else if (activeWindowId === windowObj.id) {
694
+ console.log('Сворачиваем активное окно:', windowObj.id);
695
+ minimizeWindow(windowObj.id);
696
+ }
697
+ // Если окно не активно, делаем его активным
698
+ else {
699
+ console.log('Активируем неактивное окно:', windowObj.id);
700
+ activateWindow(windowObj.id);
701
+ }
702
+ });
703
+ });
704
+ }
src/images/browser-icon.png ADDED
src/images/calculator-icon.png ADDED
src/images/computer-icon.png ADDED
src/images/default-app-icon.png ADDED
src/images/disk-c-icon.png ADDED
src/images/disk-d-icon.png ADDED
src/images/explorer-icon.png ADDED
src/images/folder-icon.png ADDED
src/images/notepad-icon.png ADDED
src/images/photos-icon.png ADDED
src/images/recycle-bin-icon.png ADDED
src/images/settings-icon.png ADDED
src/images/text-file-icon.png ADDED
src/images/user-icon.png ADDED
src/images/windows-icon.png ADDED

Git LFS Details

  • SHA256: 3e1cf9aa3f18afa49afc776fe8e6d573223bd264d3875ca95197edc2a76efb8f
  • Pointer size: 131 Bytes
  • Size of remote file: 211 kB
src/images/windows10-bg.jpg ADDED

Git LFS Details

  • SHA256: 46e96390f443294ff42bf6ca227c7976f5d7be97b003b743523bb8163dd847c5
  • Pointer size: 132 Bytes
  • Size of remote file: 9.24 MB
styles/main.css ADDED
@@ -0,0 +1,336 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Основные сбросы стилей */
2
+ * {
3
+ margin: 0;
4
+ padding: 0;
5
+ box-sizing: border-box;
6
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
7
+ }
8
+
9
+ :root {
10
+ --taskbar-height: 40px;
11
+ --taskbar-bg: #202020;
12
+ --start-menu-bg: #2d2d2d;
13
+ --window-header-bg: #1f1f1f;
14
+ --window-border: #0078d7;
15
+ --window-bg: #fff;
16
+ --hover-color: #333;
17
+ --active-program-bg: #3a3a3a;
18
+ --desktop-bg: #004275;
19
+ }
20
+
21
+ body {
22
+ width: 100%;
23
+ height: 100vh;
24
+ overflow: hidden;
25
+ background-color: var(--desktop-bg);
26
+ background-image: url('../images/windows10-bg.jpg');
27
+ background-size: cover;
28
+ background-position: center;
29
+ position: relative;
30
+ }
31
+
32
+ /* Стили для рабочего стола */
33
+ #windows-container {
34
+ width: 100%;
35
+ height: calc(100vh - var(--taskbar-height));
36
+ position: relative;
37
+ overflow: hidden;
38
+ }
39
+
40
+ /* Иконки на рабочем столе */
41
+ .desktop-icon {
42
+ width: 80px;
43
+ height: 90px;
44
+ display: flex;
45
+ flex-direction: column;
46
+ align-items: center;
47
+ justify-content: flex-start;
48
+ padding: 10px;
49
+ margin: 10px;
50
+ color: #fff;
51
+ text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
52
+ position: relative;
53
+ cursor: pointer;
54
+ text-align: center;
55
+ font-size: 12px;
56
+ }
57
+
58
+ .desktop-icon img {
59
+ width: 40px;
60
+ height: 40px;
61
+ margin-bottom: 5px;
62
+ }
63
+
64
+ .desktop-icon:hover {
65
+ background-color: rgba(255, 255, 255, 0.1);
66
+ }
67
+
68
+ /* Стили для панели задач */
69
+ #taskbar {
70
+ width: 100%;
71
+ height: var(--taskbar-height);
72
+ background-color: var(--taskbar-bg);
73
+ position: fixed;
74
+ bottom: 0;
75
+ display: flex;
76
+ align-items: center;
77
+ z-index: 1000;
78
+ }
79
+
80
+ #start-button {
81
+ height: 100%;
82
+ width: 48px;
83
+ display: flex;
84
+ align-items: center;
85
+ justify-content: center;
86
+ cursor: pointer;
87
+ background-color: rgba(0, 120, 215, 0.7);
88
+ transition: background-color 0.2s ease;
89
+ }
90
+
91
+ #start-button img {
92
+ width: 24px;
93
+ height: 24px;
94
+ }
95
+
96
+ #start-button:hover {
97
+ background-color: rgba(0, 120, 215, 1);
98
+ }
99
+
100
+ /* Добавляем активное состояние для кнопки Пуск */
101
+ #start-button.active {
102
+ background-color: rgba(0, 120, 215, 1);
103
+ }
104
+
105
+ #taskbar-programs {
106
+ display: flex;
107
+ height: 100%;
108
+ }
109
+
110
+ .taskbar-program {
111
+ height: 100%;
112
+ padding: 0 10px;
113
+ min-width: 40px;
114
+ display: flex;
115
+ align-items: center;
116
+ justify-content: center;
117
+ cursor: pointer;
118
+ border-bottom: 2px solid transparent;
119
+ }
120
+
121
+ .taskbar-program img {
122
+ width: 24px;
123
+ height: 24px;
124
+ }
125
+
126
+ .taskbar-program:hover {
127
+ background-color: var(--hover-color);
128
+ }
129
+
130
+ .taskbar-program.active {
131
+ background-color: var(--active-program-bg);
132
+ border-bottom: 2px solid #0078d7;
133
+ }
134
+
135
+ /* Стили для меню "Пуск" */
136
+ #start-menu {
137
+ position: absolute;
138
+ bottom: var(--taskbar-height);
139
+ left: 0;
140
+ width: 350px;
141
+ height: 500px;
142
+ background-color: var(--start-menu-bg);
143
+ box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
144
+ z-index: 9999;
145
+ color: #fff;
146
+ transform: translateY(100%);
147
+ opacity: 0;
148
+ pointer-events: none;
149
+ display: flex;
150
+ flex-direction: column;
151
+ transition: transform 0.3s ease, opacity 0.3s ease;
152
+ visibility: hidden;
153
+ }
154
+
155
+ #start-menu.active {
156
+ transform: translateY(0);
157
+ opacity: 1;
158
+ pointer-events: auto;
159
+ visibility: visible;
160
+ }
161
+
162
+ #start-menu-header {
163
+ padding: 15px;
164
+ display: flex;
165
+ align-items: center;
166
+ }
167
+
168
+ #start-menu-header img {
169
+ width: 30px;
170
+ height: 30px;
171
+ border-radius: 50%;
172
+ margin-right: 10px;
173
+ }
174
+
175
+ #start-menu-apps {
176
+ flex: 1;
177
+ overflow-y: auto;
178
+ padding: 10px;
179
+ display: flex;
180
+ flex-wrap: wrap;
181
+ align-content: flex-start;
182
+ }
183
+
184
+ .start-menu-app {
185
+ width: 90px;
186
+ height: 90px;
187
+ display: flex;
188
+ flex-direction: column;
189
+ align-items: center;
190
+ justify-content: center;
191
+ margin: 5px;
192
+ padding: 10px;
193
+ cursor: pointer;
194
+ text-align: center;
195
+ font-size: 12px;
196
+ }
197
+
198
+ .start-menu-app img {
199
+ width: 32px;
200
+ height: 32px;
201
+ margin-bottom: 5px;
202
+ }
203
+
204
+ .start-menu-app:hover {
205
+ background-color: var(--hover-color);
206
+ }
207
+
208
+ /* Стили для окон программ */
209
+ .window {
210
+ position: absolute;
211
+ min-width: 300px;
212
+ min-height: 200px;
213
+ background-color: var(--window-bg);
214
+ border: 1px solid var(--window-border);
215
+ box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
216
+ display: flex;
217
+ flex-direction: column;
218
+ z-index: 100;
219
+ resize: both;
220
+ overflow: hidden;
221
+ }
222
+
223
+ .window.minimized {
224
+ display: none;
225
+ }
226
+
227
+ .window.active {
228
+ z-index: 101;
229
+ box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
230
+ }
231
+
232
+ /* Стили для окна в полноэкранном режиме */
233
+ .window.maximized {
234
+ width: 100% !important;
235
+ height: calc(100vh - var(--taskbar-height)) !important;
236
+ top: 0 !important;
237
+ left: 0 !important;
238
+ border-radius: 0;
239
+ resize: none;
240
+ border: none;
241
+ }
242
+
243
+ .window-header {
244
+ background-color: var(--window-header-bg);
245
+ color: #fff;
246
+ padding: 5px 10px;
247
+ display: flex;
248
+ align-items: center;
249
+ justify-content: space-between;
250
+ cursor: move;
251
+ }
252
+
253
+ /* Изменение курсора при наведении на заголовок окна (указывает на возможность двойного клика) */
254
+ .window.maximized .window-header {
255
+ cursor: default;
256
+ }
257
+
258
+ .window-title {
259
+ display: flex;
260
+ align-items: center;
261
+ }
262
+
263
+ .window-title img {
264
+ width: 16px;
265
+ height: 16px;
266
+ margin-right: 5px;
267
+ }
268
+
269
+ .window-controls {
270
+ display: flex;
271
+ }
272
+
273
+ .window-control {
274
+ width: 14px;
275
+ height: 14px;
276
+ margin-left: 10px;
277
+ display: flex;
278
+ align-items: center;
279
+ justify-content: center;
280
+ font-size: 10px;
281
+ cursor: pointer;
282
+ }
283
+
284
+ .window-control:hover {
285
+ background-color: var(--hover-color);
286
+ }
287
+
288
+ .window-control.minimize:hover {
289
+ background-color: #0078d7;
290
+ }
291
+
292
+ .window-control.maximize:hover {
293
+ background-color: #00a65a;
294
+ }
295
+
296
+ .window-control.close:hover {
297
+ background-color: #d9534f;
298
+ }
299
+
300
+ .window-content {
301
+ flex: 1;
302
+ padding-bottom: 20px;
303
+ /*overflow: auto;*/
304
+ }
305
+
306
+ /* Адаптивные стили */
307
+ @media (max-width: 768px) {
308
+ :root {
309
+ --taskbar-height: 50px;
310
+ }
311
+
312
+ #start-menu {
313
+ width: 100%;
314
+ height: 70vh;
315
+ }
316
+
317
+ .desktop-icon {
318
+ width: 70px;
319
+ height: 80px;
320
+ }
321
+ }
322
+
323
+ @media (max-width: 480px) {
324
+ .desktop-icon {
325
+ width: 60px;
326
+ height: 70px;
327
+ font-size: 10px;
328
+ }
329
+
330
+ .window {
331
+ min-width: 90%;
332
+ min-height: 300px;
333
+ width: 90% !important;
334
+ left: 5% !important;
335
+ }
336
+ }