securewin-shell / script.js
GamiDPC's picture
Создай интерфейс защищенной оболочки Windows на C# WinForms с темной темой.
1954f97 verified
Raw
History Blame Contribute Delete
2.31 kB
// 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);
});