MediaWiki:Common.js: відмінності між версіями
Wiki (обговорення | внесок) Немає опису редагування |
Wiki (обговорення | внесок) Немає опису редагування |
||
| Рядок 922: | Рядок 922: | ||
// Тільки кнопка "Випадкова сторінка" | |||
// | function createRandomButtonOnly() { | ||
function | if (document.getElementById('float-random-btn')) return; | ||
if ( | |||
const btn = document.createElement('button'); | |||
btn.id = 'float-random-btn'; | |||
btn.innerHTML = '🎲 Випадкова'; | |||
btn.title = 'Випадкова сторінка'; | |||
btn.style.cssText = ` | |||
position: fixed; | position: fixed; | ||
bottom: | bottom: 100px; | ||
right: 15px; | right: 15px; | ||
z-index: 10000; | z-index: 10000; | ||
background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%); | |||
background: linear-gradient(135deg, # | |||
color: white; | color: white; | ||
border: none; | border: none; | ||
padding: 12px 18px; | |||
font-size: | 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; | ||
gap: 8px; | |||
transition: all 0.3s ease; | transition: all 0.3s ease; | ||
`; | `; | ||
btn.addEventListener('click', function() { | |||
window.location.href = '/w/index.php/Спеціальна:Випадкова_сторінка'; | |||
window.location.href = '/w/index.php/ | |||
}); | }); | ||
btn.addEventListener('mouseenter', function() { | |||
this.style.transform = 'scale(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)'; | ||
}); | }); | ||
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); | |||
document.body.appendChild( | |||
} | } | ||
document.addEventListener('DOMContentLoaded', createRandomButtonOnly); | |||
document.addEventListener('DOMContentLoaded', | |||