File size: 2,314 Bytes
1954f97
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
// Update time every second
function updateTime() {
    const now = new Date();
    const timeElement = document.getElementById('time');
    timeElement.textContent = now.toLocaleTimeString();
}

setInterval(updateTime, 1000);
updateTime();

// Admin modal handling
const adminBtn = document.getElementById('admin-btn');
const adminModal = document.getElementById('admin-modal');
const cancelBtn = document.getElementById('cancel-btn');
const submitBtn = document.getElementById('submit-btn');

adminBtn.addEventListener('click', () => {
    adminModal.classList.remove('hidden');
    adminModal.classList.add('flex');
});

cancelBtn.addEventListener('click', () => {
    adminModal.classList.add('hidden');
    adminModal.classList.remove('flex');
});

submitBtn.addEventListener('click', () => {
    // Here you would validate the password
    const password = document.getElementById('password-input').value;
    console.log('Password entered:', password); // In a real app, validate this
    
    // For demo, just close the modal
    adminModal.classList.add('hidden');
    adminModal.classList.remove('flex');
});

// Create app icons
const appGrid = document.querySelector('.grid');
const appIconTemplate = document.getElementById('app-icon-template');

const apps = [
    { name: "Браузер", icon: "globe" },
    { name: "Текстовый редактор", icon: "edit" },
    { name: "Калькулятор", icon: "divide" },
    { name: "Календарь", icon: "calendar" },
    { name: "Почта", icon: "mail" },
    { name: "Музыка", icon: "music" },
    { name: "Настройки", icon: "settings" },
    { name: "Камера", icon: "camera" },
    { name: "Галерея", icon: "image" },
    { name: "Контакты", icon: "users" },
    { name: "Заметки", icon: "file-text" },
    { name: "Карты", icon: "map" }
];

apps.forEach(app => {
    const icon = appIconTemplate.content.cloneNode(true);
    const iconElement = icon.querySelector('i');
    iconElement.setAttribute('data-feather', app.icon);
    icon.querySelector('span').textContent = app.name;
    icon.querySelector('div').addEventListener('click', () => {
        console.log(`Launching ${app.name}`); // In a real app, this would launch the exe
    });
    appGrid.appendChild(icon);
});