/
MM_Designer
/
MySlavesTEST
Обзор
Документация
Войти
/
MM_Designer
/
MySlavesTEST
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
prochee-script.js
265 строк
9 KB
MM_Designer
upload files
26 сен 2025, 21:43
26 сен 2025, 21:43
cda51ee
Код
Авторство
О чём код?
// Theme management let currentTheme = 'light'; // Initialize the page document.addEventListener('DOMContentLoaded', function() { initializeThemeTabs(); initializeNavigation(); // Add animation to elements on load setTimeout(() => { const elements = document.querySelectorAll('.link-item, .option-button'); elements.forEach((element, index) => { element.style.opacity = '0'; element.style.transform = 'translateY(10px)'; element.style.transition = 'all 0.3s ease'; setTimeout(() => { element.style.opacity = '1'; element.style.transform = 'translateY(0)'; }, index * 50); }); }, 100); }); // Initialize theme tabs function initializeThemeTabs() { const tabs = document.querySelectorAll('.tab'); tabs.forEach(tab => { tab.addEventListener('click', function() { const theme = this.getAttribute('data-theme'); switchTheme(theme); }); }); } // Switch theme function switchTheme(theme) { currentTheme = theme; // Update active tab const tabs = document.querySelectorAll('.tab'); tabs.forEach(tab => { tab.classList.remove('active'); if (tab.getAttribute('data-theme') === theme) { tab.classList.add('active'); } }); // Apply theme (in a real app, this would change CSS variables or classes) switch(theme) { case 'dark': showNotification('Тёмная тема активирована'); break; case 'light': showNotification('Светлая тема активирована'); break; case 'system': showNotification('Использование системной темы'); break; } } // Handle link clicks function handleLinkClick(action) { switch(action) { case 'community': showNotification('Подписка на сообщество игроков оформлена!'); break; case 'chat': showNotification('Вы присоединились к беседе игроков!'); break; case 'version': showNotification('Переход в Telegram версию...'); break; default: showNotification('Функция в разработке'); } } // Handle option button clicks function handleOptionClick(option) { switch(option) { case 'rules': showNotification('Здесь будут отображены правила игры The РАБЫ.'); break; case 'howto': showNotification('Инструкция по игре The РАБЫ будет здесь.'); break; case 'company': showNotification('Информация о кампании TheTechStudio.'); break; case 'social': showNotification('Управление подключенными социальными сетями.'); break; case 'favorite': showNotification('Игра добавлена в избранное!'); break; case 'rate': showNotification('Оцените The РАБЫ в магазине приложений.'); break; case 'ideas': showNotification('Поделитесь своими идеями для улучшения игры.'); break; case 'chats': window.open("index.html"); break; case 'emoji': showNotification('Выберите новый смайлик для вашего профиля.'); break; case 'status': showNotification('Установите новый статус профиля.'); break; case 'jobs': showNotification('Настройте работы для ваших рабов.'); break; case 'reset-price': if (showConfirmation('Вы уверены, что хотите обнулить свою цену?')) { showNotification('Цена обнулена!'); } break; case 'increase-limit': showNotification('Расширьте свои возможности в игре.'); break; case 'delete': if (showConfirmation('Вы уверены, что хотите удалить профиль? Это действие нельзя отменить.')) { showNotification('Профиль будет удален...'); } break; case 'edit': showNotification('Измените информацию в вашем профиле.'); break; default: showNotification('Функция в разработке'); } } // Show notification function showNotification(message) { const notification = document.createElement('div'); notification.style.cssText = ` position: fixed; top: 20px; right: 20px; background-color: #0f172a; color: white; padding: 12px 16px; border-radius: 8px; font-size: 14px; font-weight: 600; font-family: 'Inter', sans-serif; z-index: 1000; transform: translateX(100%); transition: transform 0.3s ease; max-width: 250px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); `; notification.textContent = message; document.body.appendChild(notification); setTimeout(() => { notification.style.transform = 'translateX(0)'; }, 100); setTimeout(() => { notification.style.transform = 'translateX(100%)'; setTimeout(() => { notification.remove(); }, 300); }, 3000); } // Show confirmation dialog function showConfirmation(message) { return confirm(message); } // Initialize navigation function initializeNavigation() { const navItems = document.querySelectorAll('.nav-item'); navItems.forEach(item => { item.addEventListener('click', function(e) { const href = this.getAttribute('href'); // Handle current page if (href === 'prochee.html') { e.preventDefault(); navItems.forEach(nav => nav.classList.remove('active')); this.classList.add('active'); } }); }); } // Update time display function updateTime() { const now = new Date(); const hours = now.getHours().toString().padStart(2, '0'); const minutes = now.getMinutes().toString().padStart(2, '0'); const timeDisplay = document.querySelector('.time-display'); if (timeDisplay) { timeDisplay.textContent = `${hours}:${minutes}`; } } // Update time every minute setInterval(updateTime, 60000); updateTime(); // Initial call // Add hover effects for better UX document.addEventListener('DOMContentLoaded', function() { // Add ripple effect to buttons const buttons = document.querySelectorAll('.option-button, .link-item, .tab'); buttons.forEach(button => { button.addEventListener('mousedown', function(e) { const ripple = document.createElement('span'); const rect = this.getBoundingClientRect(); const size = Math.max(rect.width, rect.height); const x = e.clientX - rect.left - size / 2; const y = e.clientY - rect.top - size / 2; ripple.style.cssText = ` position: absolute; width: ${size}px; height: ${size}px; left: ${x}px; top: ${y}px; background: rgba(255, 255, 255, 0.3); border-radius: 50%; transform: scale(0); animation: ripple 0.6s linear; pointer-events: none; z-index: 1; `; this.style.position = 'relative'; this.style.overflow = 'hidden'; this.appendChild(ripple); setTimeout(() => { ripple.remove(); }, 600); }); }); // Add CSS for ripple animation const style = document.createElement('style'); style.textContent = ` @keyframes ripple { to { transform: scale(4); opacity: 0; } } `; document.head.appendChild(style); }); // Global functions for HTML onclick handlers window.handleLinkClick = handleLinkClick; window.handleOptionClick = handleOptionClick;