Немає опису редагування
Немає опису редагування
Рядок 922: Рядок 922:




 
// Тільки кнопка "Випадкова сторінка"
// Створення плаваючих кнопок для мобільної версії
function createRandomButtonOnly() {
function createMobileButtons() {
     if (document.getElementById('float-random-btn')) return;
    // Перевіряємо чи це мобільна версія
     if (!document.body.classList.contains('skin-minerva')) return;
      
      
     // Перевіряємо чи кнопки вже існують
     const btn = document.createElement('button');
     if (document.getElementById('mobile-random-btn')) return;
     btn.id = 'float-random-btn';
      
     btn.innerHTML = '🎲 Випадкова';
    // Створюємо контейнер для кнопок
     btn.title = 'Випадкова сторінка';
    const buttonContainer = document.createElement('div');
     btn.style.cssText = `
     buttonContainer.id = 'mobile-buttons-container';
     buttonContainer.style.cssText = `
         position: fixed;
         position: fixed;
         bottom: 80px;
         bottom: 100px;
         right: 15px;
         right: 15px;
         z-index: 10000;
         z-index: 10000;
        display: flex;
         background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
        flex-direction: column;
        gap: 10px;
    `;
   
    // Кнопка "Випадкова сторінка"
    const randomButton = document.createElement('button');
    randomButton.id = 'mobile-random-btn';
    randomButton.innerHTML = '🎲';
    randomButton.title = 'Випадкова сторінка';
    randomButton.style.cssText = `
        width: 60px;
        height: 60px;
        border-radius: 50%;
         background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border: none;
         color: white;
         color: white;
        font-size: 24px;
        cursor: pointer;
        box-shadow: 0 4px 15px rgba(0,0,0,0.3);
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
    `;
   
    // Кнопка "Головна сторінка"
    const homeButton = document.createElement('button');
    homeButton.id = 'mobile-home-btn';
    homeButton.innerHTML = '🏠';
    homeButton.title = 'Головна сторінка';
    homeButton.style.cssText = `
        width: 60px;
        height: 60px;
        border-radius: 50%;
        background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
         border: none;
         border: none;
         color: white;
         padding: 12px 18px;
         font-size: 24px;
        border-radius: 25px;
         font-size: 16px;
        font-weight: bold;
         cursor: pointer;
         cursor: pointer;
         box-shadow: 0 4px 15px rgba(0,0,0,0.3);
         box-shadow: 0 4px 15px rgba(0,0,0,0.3);
         display: flex;
         display: flex;
         align-items: center;
         align-items: center;
         justify-content: center;
         gap: 8px;
         transition: all 0.3s ease;
         transition: all 0.3s ease;
     `;
     `;
      
      
     // Додаємо обробники подій
     btn.addEventListener('click', function() {
    randomButton.addEventListener('click', function() {
         window.location.href = '/w/index.php/Спеціальна:Випадкова_сторінка';
         window.location.href = '/w/index.php/%D0%A1%D0%BF%D0%B5%D1%86%D1%96%D0%B0%D0%BB%D1%8C%D0%BD%D0%B0:%D0%92%D0%B8%D0%BF%D0%B0%D0%B4%D0%BA%D0%BE%D0%B2%D0%B0_%D1%81%D1%82%D0%BE%D1%80%D1%96%D0%BD%D0%BA%D0%B0';
    });
   
    homeButton.addEventListener('click', function() {
        window.location.href = '/w/index.php/%D0%93%D0%BE%D0%BB%D0%BE%D0%B2%D0%BD%D0%B0_%D1%81%D1%82%D0%BE%D1%80%D1%96%D0%BD%D0%BA%D0%B0';
    });
   
    // Ефекти при наведенні
    randomButton.addEventListener('mouseenter', function() {
        this.style.transform = 'scale(1.1)';
        this.style.boxShadow = '0 6px 20px rgba(0,0,0,0.4)';
    });
   
    randomButton.addEventListener('mouseleave', function() {
        this.style.transform = 'scale(1)';
        this.style.boxShadow = '0 4px 15px rgba(0,0,0,0.3)';
     });
     });
      
      
     homeButton.addEventListener('mouseenter', function() {
     btn.addEventListener('mouseenter', function() {
         this.style.transform = 'scale(1.1)';
         this.style.transform = 'scale(1.05)';
         this.style.boxShadow = '0 6px 20px rgba(0,0,0,0.4)';
         this.style.boxShadow = '0 6px 20px rgba(0,0,0,0.4)';
     });
     });
      
      
     homeButton.addEventListener('mouseleave', function() {
     btn.addEventListener('mouseleave', function() {
         this.style.transform = 'scale(1)';
         this.style.transform = 'scale(1)';
         this.style.boxShadow = '0 4px 15px rgba(0,0,0,0.3)';
         this.style.boxShadow = '0 4px 15px rgba(0,0,0,0.3)';
     });
     });
      
      
    // Додаємо кнопки в контейнер
     document.body.appendChild(btn);
    buttonContainer.appendChild(randomButton);
    buttonContainer.appendChild(homeButton);
   
    // Додаємо контейнер на сторінку
     document.body.appendChild(buttonContainer);
}
}


// Запускаємо при завантаженні
document.addEventListener('DOMContentLoaded', createRandomButtonOnly);
document.addEventListener('DOMContentLoaded', createMobileButtons);